diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index ade38f64d4..854db6b123 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -12402,7 +12402,7 @@ (set-top-plane-offset (shadow-control float) int 11) (set-bottom-plane-offset (shadow-control float) int 12) (shadow-control-method-13 (_type_ vector float float float) none 13) ;; (unused-13 (_type_) none 13) - (shadow-control-method-14 () none 14) ;; (update-direction-from-time-of-day (_type_) none 14) + (shadow-control-method-14 (_type_ vector vector float float float) none 14) ;; (update-direction-from-time-of-day (_type_) none 14) ) ) @@ -18095,6 +18095,7 @@ (declare-type gun-info basic) (declare-type darkjak-info basic) (declare-type mech-info basic) +(declare-type indax-info basic) (deftype target (process-focusable) ((self-override target :offset 32 :score 100) (control control-info :offset 128 :score 200) ;; guessed by decompiler @@ -18162,7 +18163,7 @@ (mech mech-info :offset-assert 2216) (turret basic :offset-assert 2220) (darkjak darkjak-info :offset-assert 2224) - (indax basic :offset-assert 2228) + (indax indax-info :offset-assert 2228) ) :method-count-assert 29 :size-assert #x8b8 @@ -20050,7 +20051,7 @@ (color rgbaf :inline :offset-assert 32) (fade-a float :offset-assert 48) (fade-b float :offset-assert 52) - (tex-id uint32 :offset-assert 56) + (tex-id texture-id :offset-assert 56) (dummy uint32 :offset-assert 60) ) :method-count-assert 10 @@ -20064,13 +20065,13 @@ (deftype simple-sprite-system (structure) ((count int16 :offset-assert 0) (max-count int16 :offset-assert 2) - (data uint32 :offset-assert 4) + (data sprite-glow-data :offset-assert 4) ) :method-count-assert 12 :size-assert #x8 :flag-assert #xc00000008 (:methods - (add! () none 9) + (add! (_type_ dma-buffer) none 9) (simple-sprite-system-method-10 (_type_ dma-buffer) none 10) (clear! (_type_) none 11) ) @@ -23653,7 +23654,7 @@ (define-extern sprite-glow-init-engine (function dma-buffer none)) (define-extern *sprite-glow-dma-packet-data* sprite-glow-dma-packet-data) (define-extern sprite-glow-add-sprite (function dma-buffer sprite-vec-data-2d float float float adgif-shader none)) -;; (define-extern sprite-glow-add-simple-sprite function) +(define-extern sprite-glow-add-simple-sprite (function dma-buffer sprite-glow-dma-packet-data sprite-glow-data pointer)) (define-extern sprite-glow-draw (function dma-buffer none)) (define-extern add-shader-to-dma (function dma-buffer pointer)) (define-extern *simple-sprite-system* simple-sprite-system) @@ -32300,8 +32301,8 @@ ) (deftype idle-control (structure) - ((anim (pointer uint32) :offset-assert 0) - (current (pointer uint32) :offset-assert 4) + ((anim (pointer idle-control-frame) :offset-assert 0) + (current (pointer idle-control-frame) :offset-assert 4) (counter int32 :offset-assert 8) (target int32 :offset-assert 12) ) @@ -32309,7 +32310,7 @@ :size-assert #x10 :flag-assert #xb00000010 (:methods - (idle-control-method-9 (_type_ (pointer uint32)) none 9) + (idle-control-method-9 (_type_ (pointer idle-control-frame)) none 9) (idle-control-method-10 (_type_ process-drawable) none :behavior process-drawable 10) ) ) @@ -32419,7 +32420,7 @@ (jump-debug-draw symbol :offset-assert 24) (move-to-ground symbol :offset-assert 28) (hover-if-no-ground symbol :offset-assert 32) - (idle-anim-script (pointer uint32) :offset-assert 36) ;; TODO very likely WRONG, possible `script-form`s? + (idle-anim-script (pointer idle-control-frame) :offset-assert 36) ;; TODO very likely WRONG, possible `script-form`s? (idle-anim int32 :offset-assert 40) (notice-anim int32 :offset-assert 44) (hostile-anim int32 :offset-assert 48) @@ -43624,50 +43625,48 @@ ;; target-indax ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype indax-info (basic) ((indax-start-time time-frame :offset-assert 8) (indax-time time-frame :offset-assert 16) - (art-group-backup basic :offset-assert 24) + (art-group-backup art-group :offset-assert 24) ) :method-count-assert 9 :size-assert #x1c :flag-assert #x90000001c ) -|# -;; (define-extern *indax-walk-mods* object) -;; (define-extern *indax-jump-mods* object) -;; (define-extern *indax-double-jump-mods* object) -;; (define-extern *indax-bounce-mods* object) -;; (define-extern target-indax-handler function) -;; (define-extern target-indax-dangerous-event-handler function) -;; (define-extern target-indax-jump-event-handler function) -;; (define-extern target-indax-init function) -;; (define-extern target-indax-exit function) -;; (define-extern target-indax-real-post function) -;; (define-extern target-indax-post function) -;; (define-extern target-indax-stance state) -;; (define-extern target-indax-walk state) -;; (define-extern target-indax-falling state) -;; (define-extern target-indax-jump state) -;; (define-extern target-indax-double-jump state) -;; (define-extern target-indax-hit-ground state) -;; (define-extern target-indax-trip state) -;; (define-extern target-indax-attack state) -;; (define-extern target-indax-attack-air state) -;; (define-extern target-indax-running-attack state) -;; (define-extern target-indax-hit-setup-anim function) -;; (define-extern target-indax-hit state) -;; (define-extern target-indax-death state) +(define-extern *indax-walk-mods* surface) +(define-extern *indax-jump-mods* surface) +(define-extern *indax-double-jump-mods* surface) +(define-extern *indax-bounce-mods* surface) +(define-extern target-indax-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-indax-dangerous-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-indax-jump-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-indax-init (function none :behavior target)) +(define-extern target-indax-exit (function none :behavior target)) +(define-extern target-indax-real-post (function none :behavior target)) +(define-extern target-indax-post (function none :behavior target)) +(define-extern target-indax-stance (state target)) +(define-extern target-indax-walk (state target)) +(define-extern target-indax-falling (state symbol target)) +(define-extern target-indax-jump (state float float surface target)) +(define-extern target-indax-double-jump (state float float target)) +(define-extern target-indax-hit-ground (state symbol target)) +(define-extern target-indax-trip (state target)) +(define-extern target-indax-attack (state target)) +(define-extern target-indax-attack-air (state symbol target)) +(define-extern target-indax-running-attack (state target)) +(define-extern target-indax-hit-setup-anim (function attack-info none :behavior target)) +(define-extern target-indax-hit (state symbol attack-info target)) +(define-extern target-indax-death (state symbol target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; tomb-boulder ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype tomb-spider (process-drawable) - () + ((root-override collide-shape-moving :offset 128 :score 1) + ) :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 @@ -43675,11 +43674,10 @@ (idle () _type_ :state 20) ) ) -|# -#| (deftype tomb-boulder-stop (process-drawable) - ((prefix basic :offset-assert 196) + ((root-override collide-shape-moving :offset 128 :score 1) + (prefix string :offset-assert 200) ) :method-count-assert 21 :size-assert #xcc @@ -43688,11 +43686,10 @@ (idle () _type_ :state 20) ) ) -|# -#| (deftype tomb-boulder-pillar (process-drawable) - ((prefix basic :offset-assert 196) + ((root-override collide-shape-moving :offset 128 :score 1) + (prefix string :offset-assert 200) ) :method-count-assert 21 :size-assert #xcc @@ -43701,40 +43698,63 @@ (idle () _type_ :state 20) ) ) -|# -#| +(declare-type tomb-wing-door com-airlock) + (deftype tomb-boulder (process-drawable) - () + ((root-override collide-shape-moving :offset 128 :score 1) + (art-name string :offset-assert 200) + (anim spool-anim :offset-assert 204) + (loop-id uint32 :offset-assert 208) + (spider (pointer tomb-spider) :offset-assert 212) + (explode (pointer process) :offset-assert 216) ;; guess + (stick basic :offset-assert 220) + (wing-door (pointer tomb-wing-door) :offset-assert 224) + (stop (pointer tomb-boulder-stop) 2 :offset-assert 228) + (pillar (pointer tomb-boulder-pillar) 4 :offset-assert 236) + (mode uint32 :offset-assert 252) + (sub-mode uint32 :offset-assert 256) + (gui-id uint32 :offset-assert 260) + (target-pause symbol :offset-assert 264) + (current-pause symbol :offset-assert 268) + (previous-y-vel float :offset-assert 272) + (previous-y float :offset-assert 276) + (target-speed float :offset-assert 280) + (current-speed float :offset-assert 284) + (distance meters :offset-assert 288) + (distance-target meters :offset-assert 292) + (distance-offset float :offset-assert 296) + (speed-time time-frame :offset-assert 304) + (trans vector 2 :inline :offset-assert 320) + (dir vector :inline :offset-assert 352) + (distance-adjust (array float) :offset-assert 368) ;; guess + ) :method-count-assert 22 :size-assert #x174 :flag-assert #x1601000174 - ;; Failed to read fields. (:methods - (chase () _type_ :state 20) + (chase (spool-anim) _type_ :state 20) (idle () _type_ :state 21) ) ) -|# -#| (deftype spider-eyes (process-drawable) - ((node-index uint32 :offset-assert 196) + ((root-override collide-shape-moving :offset 128 :score 1) + (node-index uint32 :offset-assert 200) ) :method-count-assert 22 :size-assert #xcc :flag-assert #x16005000cc (:methods (idle () _type_ :state 20) - (spider-eyes-method-21 () none 21) + (spider-eyes-method-21 (_type_) none 21) ) ) -|# -;; (define-extern tomb-spider-init function) -;; (define-extern tomb-boulder-stop-init function) -;; (define-extern tomb-boulder-pillar-init function) -;; (define-extern spider-eyes-init-by-other function) +(define-extern tomb-spider-init (function none :behavior tomb-spider)) +(define-extern tomb-boulder-stop-init (function string none :behavior tomb-boulder-stop)) +(define-extern tomb-boulder-pillar-init (function string none :behavior tomb-boulder-pillar)) +(define-extern spider-eyes-init-by-other (function entity-actor object uint none :behavior spider-eyes)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; squid-part ;; @@ -44327,11 +44347,10 @@ ;; grunt-mech ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype grunt-mech-hold (structure) ((reserve-mask uint8 :offset-assert 0) (lower-hold int8 :offset-assert 1) - (grunt-handle uint64 :offset-assert 8) + (grunt-handle handle :offset-assert 8) (timeout uint64 :offset-assert 16) (local-pos vector :inline :offset-assert 32) (local-rot vector :inline :offset-assert 48) @@ -44342,28 +44361,24 @@ :size-assert #xc0 :flag-assert #x9000000c0 ) -|# -#| (deftype grunt-mech-info (basic) - ((reserved-mask uint8 :offset-assert 4) - (last-update-time time-frame :offset-assert 8) - (holds UNKNOWN 6 :offset-assert 16) + ((reserved-mask uint8 :offset-assert 4) + (last-update-time time-frame :offset-assert 8) + (holds grunt-mech-hold 6 :inline :offset-assert 16) ) :method-count-assert 11 :size-assert #x490 :flag-assert #xb00000490 (:methods - (grunt-mech-info-method-9 () none 9) - (grunt-mech-info-method-10 () none 10) + (grunt-mech-info-method-9 (_type_ int process symbol) symbol 9) + (grunt-mech-info-method-10 (_type_) none 10) ) ) -|# -#| (deftype grunt-mech (grunt) - ((hold-id int8 :offset-assert 688) - (dismount-dest vector :inline :offset-assert 700) + ((hold-id int8 :offset-assert 692) + (dismount-dest vector :inline :offset-assert 704) ) :method-count-assert 196 :size-assert #x2d0 @@ -44374,17 +44389,16 @@ (mech-dismount () _type_ :state 188) (mech-post-circling () _type_ :state 189) (mech-pre-circling () _type_ :state 190) - (grunt-mech-method-191 () none 191) - (grunt-mech-method-192 () none 192) - (grunt-mech-method-193 () none 193) - (grunt-mech-method-194 () none 194) - (grunt-mech-method-195 () none 195) + (grunt-mech-method-191 (_type_) none 191) + (grunt-mech-method-192 (_type_) symbol 192) + (grunt-mech-method-193 (_type_) int 193) + (grunt-mech-method-194 (_type_) none 194) + (grunt-mech-method-195 (_type_ vector vector vector) symbol 195) ) ) -|# -;; (define-extern *grunt-mech-info* grunt-mech-info) -;; (define-extern grunt-mech-hold-post function) +(define-extern *grunt-mech-info* grunt-mech-info) +(define-extern grunt-mech-hold-post (function none :behavior grunt-mech)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; palcab-part ;; @@ -45280,10 +45294,9 @@ ;; tomb-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype tomb-plat-wall (plat) - ((position vector :inline :offset-assert 332) - (last-pos float :offset-assert 348) + ((position vector :inline :offset-assert 336) + (last-pos float :offset-assert 352) ) :method-count-assert 37 :size-assert #x164 @@ -45291,11 +45304,10 @@ (:methods ) ) -|# -#| (deftype tomb-stair-block-spikes (process-drawable) - () + ((root-override collide-shape-moving :offset 128 :score 1) + ) :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 @@ -45303,11 +45315,9 @@ (idle () _type_ :state 20) ) ) -|# -#| (deftype tomb-stair-block-spike-info (structure) - ((spike uint64 :offset-assert 0) + ((spike handle :offset-assert 0) (joint int32 :offset-assert 8) (y-offset float :offset-assert 12) (up basic :offset-assert 16) @@ -45317,15 +45327,14 @@ :size-assert #x18 :flag-assert #x900000018 ) -|# -#| (deftype tomb-stair-block (process-drawable) - ((initial-y float :offset-assert 196) - (spike-info UNKNOWN 4 :offset-assert 204) - (camera-state int32 :offset-assert 332) - (sink-sound uint32 :offset-assert 336) - (rise-sound uint32 :offset-assert 340) + ((root-override collide-shape-moving :offset 128 :score 1) + (initial-y float :offset-assert 200) + (spike-info tomb-stair-block-spike-info 4 :inline :offset 208) + (camera-state int32 :offset 336) + (sink-sound uint32 :offset 340) + (rise-sound uint32 :offset 344) ) :method-count-assert 25 :size-assert #x15c @@ -45338,9 +45347,7 @@ (sunk () _type_ :state 24) ) ) -|# -#| (deftype tomb-bounce-web (bouncer) () :method-count-assert 25 @@ -45349,9 +45356,7 @@ (:methods ) ) -|# -#| (deftype tomb-plat-pillar (plat) () :method-count-assert 37 @@ -45360,12 +45365,10 @@ (:methods ) ) -|# -#| (deftype tomb-elevator (elevator) - ((last-pos vector :inline :offset-assert 364) - (speed float :offset-assert 380) + ((last-pos vector :inline :offset-assert 368) + (speed float :offset-assert 384) ) :method-count-assert 49 :size-assert #x184 @@ -45373,9 +45376,7 @@ (:methods ) ) -|# -#| (deftype tomb-boss-door (com-airlock) () :method-count-assert 28 @@ -45384,9 +45385,7 @@ (:methods ) ) -|# -#| (deftype water-anim-tomb (water-anim) () :method-count-assert 29 @@ -45395,9 +45394,7 @@ (:methods ) ) -|# -#| (deftype tomb-wing-door (com-airlock) () :method-count-assert 28 @@ -45406,11 +45403,10 @@ (:methods ) ) -|# -#| (deftype tomb-boulder-door (process-drawable) - () + ((root-override collide-shape-moving :offset 128 :score 1) + ) :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 @@ -45419,17 +45415,15 @@ (close () _type_ :state 21) ) ) -|# -#| (deftype tomb-plat-return (base-plat) - ((intro-path basic :offset-assert 268) - (ride-timer uint64 :offset-assert 276) - (flags uint16 :offset-assert 284) - (path-pos float :offset-assert 288) - (dest-pos float :offset-assert 292) - (path-speed float :offset-assert 296) - (sound-id uint32 :offset-assert 300) + ((intro-path path-control :offset-assert 272) + (ride-timer time-frame :offset-assert 280) + (flags uint16 :offset-assert 288) + (path-pos float :offset-assert 292) + (dest-pos float :offset-assert 296) + (path-speed float :offset-assert 300) + (sound-id uint32 :offset-assert 304) ) :method-count-assert 39 :size-assert #x134 @@ -45442,13 +45436,12 @@ (waiting-for-no-player () _type_ :state 38) ) ) -|# -#| (deftype tomb-sphinx (process-drawable) - ((target-actor basic :offset-assert 196) - (sound-id uint32 :offset-assert 200) - (move-dir float :offset-assert 212) + ((root-override collide-shape-moving :offset 128 :score 1) + (target-actor entity-actor :offset-assert 200) + (sound-id uint32 :offset-assert 204) + (move-dir float :offset 216) ) :method-count-assert 23 :size-assert #xdc @@ -45459,50 +45452,49 @@ (doors-open () _type_ :state 22) ) ) -|# -;; (define-extern tomb-stair-block-collision function) -;; (define-extern tomb-stair-block-spikes-init-by-other function) -;; (define-extern lift-pool function) -;; (define-extern drop-pool function) -;; (define-extern position-spikes function) -;; (define-extern ripple-for-water-anim-tomb ripple-wave-set) -;; (define-extern tomb-sphinx-draw-beam function) +(define-extern tomb-stair-block-collision (function symbol object :behavior tomb-stair-block-spikes)) +(define-extern tomb-stair-block-spikes-init-by-other (function vector none :behavior tomb-stair-block-spikes)) +(define-extern lift-pool (function int object :behavior tomb-stair-block)) +(define-extern drop-pool (function int object :behavior tomb-stair-block)) +(define-extern position-spikes (function int symbol :behavior tomb-stair-block)) +(define-extern ripple-for-water-anim-tomb ripple-wave-set) +(define-extern tomb-sphinx-draw-beam (function vector vector none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; tomb-water ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype tomb-door (process-drawable) - ((notify-actor basic :offset-assert 196) - (round uint32 :offset-assert 200) + ((notify-actor entity :offset-assert 200) + (round uint32 :offset-assert 204) ) :method-count-assert 22 :size-assert #xd0 :flag-assert #x16005000d0 (:methods (idle () _type_ :state 20) - (open () _type_ :state 21) + (open (time-frame) _type_ :state 21) ) ) -|# -#| (deftype tomb-beetle-door (process-drawable) - () + ((offset vector 3 :inline :offset-assert 208) + (offset-index int32 :offset-assert 256) + (key-index int32 :offset-assert 260) + (beetle handle 3 :offset-assert 264) + (actor-group (pointer actor-group) :offset-assert 288) + (actor-group-count int32 :offset-assert 292) + ) :method-count-assert 22 :size-assert #x128 :flag-assert #x1600b00128 - ;; Failed to read fields. (:methods (idle () _type_ :state 20) (open () _type_ :state 21) ) ) -|# -#| (deftype tomb-button (basebutton) () :method-count-assert 39 @@ -45511,35 +45503,54 @@ (:methods ) ) -|# -#| (deftype tomb-beetle-button (tomb-button) - ((round uint32 :offset-assert 284) - (speech-mask uint32 :offset-assert 288) - (speech-timer uint64 :offset-assert 292) + ((round uint32 :offset-assert 288) + (speech-mask uint32 :offset-assert 292) + (speech-timer time-frame :offset-assert 296) ) :method-count-assert 40 :size-assert #x130 :flag-assert #x2800b00130 (:methods - (tomb-beetle-button-method-39 () none 39) + (tomb-beetle-button-method-39 (_type_) none 39) ) ) -|# -#| +;; +++tomb-water:simon-block-flags +(defenum simon-block-flags + :type uint16 + :bitfield #t + (sbf0) + (sbf1) + (sbf2) + (sbf3) + (sbf4) + (sbf5) + (sbf6) + (sbf7) + (sbf8) + (sbf9) + (sbf10) + (sbf11) + (sbf12) + (sbf13) + (sbf14) + (sbf15) + ) +;; ---tomb-water:simon-block-flags + (deftype tomb-simon-block (base-plat) - ((sound-show uint128 :offset-assert 268) - (color vector :inline :offset-assert 284) - (my-idx int32 :offset-assert 300) - (next-idx int32 :offset-assert 304) - (flags uint16 :offset-assert 308) - (blink-timer UNKNOWN 2 :offset-assert 316) - (ride-timer uint64 :offset-assert 332) - (order int32 :offset-assert 340) - (base-height float :offset-assert 344) - (move-rate float :offset-assert 348) + ((sound-show uint128 :offset-assert 272) + (color vector :inline :offset-assert 288) + (my-idx int32 :offset-assert 304) + (next-idx int32 :offset-assert 308) + (flags simon-block-flags :offset-assert 312) + (blink-timer time-frame 2 :offset-assert 320) + (ride-timer time-frame :offset-assert 336) + (order int32 :offset-assert 344) + (base-height float :offset-assert 348) + (move-rate float :offset-assert 352) ) :method-count-assert 42 :size-assert #x164 @@ -45552,21 +45563,19 @@ (dangerous () _type_ :state 38) (wobble-die () _type_ :state 39) (die () _type_ :state 40) - (tomb-simon-block-method-41 () none 41) + (set-blink-timers! (_type_) none 41) ) ) -|# -#| (deftype tomb-plat-simon (process-drawable) - ((plat basic :offset-assert 196) - (plat-seq uint32 :offset-assert 200) - (plat-count int32 :offset-assert 204) - (plat-seq-count int32 :offset-assert 208) - (plat-idx int32 :offset-assert 212) - (button-handle uint64 :offset-assert 220) - (notify-actor basic :offset-assert 228) - (flags uint16 :offset-assert 232) + ((plat (array handle) :offset-assert 200) + (plat-seq (pointer uint32) :offset-assert 204) + (plat-count int32 :offset-assert 208) + (plat-seq-count int32 :offset-assert 212) + (plat-idx int32 :offset-assert 216) + (button-handle handle :offset-assert 224) + (notify-actor entity :offset-assert 232) + (flags uint16 :offset-assert 236) ) :method-count-assert 25 :size-assert #xee @@ -45576,60 +45585,65 @@ (appear () _type_ :state 21) (show-sequence () _type_ :state 22) (idle () _type_ :state 23) - (tomb-plat-simon-method-24 () none 24) + (tomb-plat-simon-method-24 (_type_ int) none 24) ) ) -|# -#| (deftype tomb-simon-button (process-drawable) - ((notify-actor basic :offset-assert 196) - (on-notice basic :offset-assert 200) - (on-activate basic :offset-assert 204) + ((notify-actor entity :offset-assert 200) + (on-notice (function none) :offset-assert 204) + (on-activate (function none) :offset-assert 208) ) :method-count-assert 25 :size-assert #xd4 :flag-assert #x19006000d4 - ;; field on-notice uses ~A with a signed load field on-activate uses ~A with a signed load + ;; field on-notice uses ~A with a signed load + ;; field on-activate uses ~A with a signed load (:methods (idle () _type_ :state 20) - (open () _type_ :state 21) + (open (symbol) _type_ :state 21) (waiting () _type_ :state 22) - (pressed () _type_ :state 23) + (pressed (symbol) _type_ :state 23) (unpress () _type_ :state 24) ) ) -|# -#| (deftype tomb-vibe (process-drawable) - () + ((spawn-pos vector :inline :offset-assert 208) + (pat-tbl (array handle) :offset-assert 224) ;; pattern-table + (pat-count int32 :offset-assert 228) + (pat-index int32 :offset-assert 232) + (pat-entry-index int32 :offset-assert 236) + (pat-timer time-frame :offset-assert 240) + (pat-duration time-frame :offset-assert 248) + (actor-group (pointer actor-group) :offset-assert 256) + (actor-group-count int32 :offset-assert 260) + (flags uint16 :offset-assert 264) + (on-activate basic :offset-assert 268) + ) :method-count-assert 24 :size-assert #x110 :flag-assert #x1800900110 - ;; Failed to read fields. (:methods (get-pattern () _type_ :state 20) (idle () _type_ :state 21) (vibrate () _type_ :state 22) - (die () _type_ :state 23) + (die (symbol) _type_ :state 23) ) ) -|# -#| (deftype tomb-water-trap (process-drawable) - ((bbox bounding-box :inline :offset-assert 204) - (run-bbox bounding-box :inline :offset-assert 236) - (sync sync-linear :inline :offset-assert 268) - (on-duration uint64 :offset-assert 284) - (harmless-time time-frame :offset-assert 292) - (l-spec basic :offset-assert 300) - (l-count uint32 :offset-assert 304) - (l-index basic :offset-assert 308) - (attack-id uint32 :offset-assert 312) - (volume float :offset-assert 316) - (can-exit-running? basic :offset-assert 320) + ((bbox bounding-box :inline :offset-assert 208) + (run-bbox bounding-box :inline :offset-assert 240) + (sync sync-linear :inline :offset-assert 272) + (on-duration time-frame :offset-assert 288) + (harmless-time time-frame :offset-assert 296) + (l-spec lightning-spec :offset-assert 304) + (l-count uint32 :offset-assert 308) + (l-index (array uint32) :offset-assert 312) + (attack-id uint32 :offset-assert 316) + (volume float :offset-assert 320) + (can-exit-running? symbol :offset-assert 324) ) :method-count-assert 25 :size-assert #x148 @@ -45637,17 +45651,15 @@ (:methods (idle () _type_ :state 20) (running () _type_ :state 21) - (tomb-water-trap-method-22 () none 22) - (tomb-water-trap-method-23 () none 23) - (tomb-water-trap-method-24 () none 24) + (tomb-water-trap-method-22 (_type_) none 22) + (tomb-water-trap-method-23 (_type_ vector vector) none 23) + (tomb-water-trap-method-24 (_type_ vector vector int) none 24) ) ) -|# -#| (deftype tomb-smash-door (process-drawable) - ((timeout uint64 :offset-assert 196) - (button uint64 :offset-assert 204) + ((timeout time-frame :offset-assert 200) + (button handle :offset-assert 208) ) :method-count-assert 23 :size-assert #xd8 @@ -45658,22 +45670,20 @@ (close () _type_ :state 22) ) ) -|# -;; (define-extern tomb-beetle-door-offsets object) -;; (define-extern *tomb-simon-sound-tbl* object) -;; (define-extern *tomb-simon-color-tbl* object) -;; (define-extern tomb-plat-simon-handler function) -;; (define-extern simon-block-handler function) -;; (define-extern tomb-simon-block-post function) -;; (define-extern tomb-simon-block-trans function) -;; (define-extern tomb-simon-block-init-by-other function) +(define-extern tomb-beetle-door-offsets (inline-array vector)) +(define-extern *tomb-simon-sound-tbl* (pointer sound-name)) +(define-extern *tomb-simon-color-tbl* (inline-array vector)) +(define-extern tomb-plat-simon-handler (function process int symbol event-message-block object :behavior tomb-plat-simon)) +(define-extern simon-block-handler (function process int symbol event-message-block object :behavior tomb-simon-block)) +(define-extern tomb-simon-block-post (function none :behavior tomb-simon-block)) +(define-extern tomb-simon-block-trans (function none :behavior tomb-simon-block)) +(define-extern tomb-simon-block-init-by-other (function vector int int int int none :behavior tomb-simon-block)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; tomb-beetle ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype tomb-beetle-fly-info (structure) ((dst vector :inline :offset-assert 0) (dst-quat quaternion :inline :offset-assert 16) @@ -45684,41 +45694,38 @@ :size-assert #x28 :flag-assert #x900000028 ) -|# -#| (deftype tomb-beetle (nav-enemy) - ((src-quat quaternion :inline :offset-assert 604) - (fly-info UNKNOWN 2 :offset-assert 620) - (speed meters :offset-assert 716) - (init-height meters :offset-assert 720) - (flags uint16 :offset-assert 724) - (dest-index int32 :offset-assert 728) - (round uint32 :offset-assert 732) - (flying? basic :offset-assert 736) - (fly-away-radius float :offset-assert 740) - (fly-away-ry float :offset-assert 744) - (fly-away-ry-speed float :offset-assert 748) - (fly-away-acc float :offset-assert 752) - (fly-away-dir vector :inline :offset-assert 764) + ((src-quat quaternion :inline :offset-assert 608) + (fly-info tomb-beetle-fly-info 2 :inline :offset-assert 624) + (speed meters :offset-assert 720) + (init-height meters :offset-assert 724) + (flags uint16 :offset-assert 728) + (dest-index int32 :offset-assert 732) + (round uint32 :offset-assert 736) + (flying? symbol :offset-assert 740) + (fly-away-radius float :offset-assert 744) + (fly-away-ry float :offset-assert 748) + (fly-away-ry-speed float :offset-assert 752) + (fly-away-acc float :offset-assert 756) + (fly-away-dir vector :inline :offset-assert 768) ) :method-count-assert 186 :size-assert #x310 :flag-assert #xba02900310 (:methods - (tomb-beetle-method-178 () none 178) + (tomb-beetle-method-178 (_type_) none 178) (explode () _type_ :state 179) (fly-away () _type_ :state 180) (go-to-door () _type_ :state 181) (key () _type_ :state 182) (land () _type_ :state 183) (stand () _type_ :state 184) - (tomb-beetle-method-185 () none 185) + (tomb-beetle-method-185 (_type_) none 185) ) ) -|# -;; (define-extern *tomb-beetle-nav-enemy-info* nav-enemy-info) +(define-extern *tomb-beetle-nav-enemy-info* nav-enemy-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; widow-part ;; @@ -51450,14 +51457,14 @@ ;; target-pilot ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *pilot-mods* surface) +(define-extern *pilot-mods* surface) ;; (define-extern target-pilot-handler function) ;; (define-extern target-pilot-pidax-enter function) ;; (define-extern target-pilot-pidax-exit function) ;; (define-extern target-pilot-exit function) ;; (define-extern target-pilot-init function) -;; (define-extern pilot-on-ground? function) -;; (define-extern target-pilot-post function) +(define-extern pilot-on-ground? (function symbol :behavior target)) +(define-extern target-pilot-post (function none :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; pilot-states ;; @@ -51701,15 +51708,15 @@ ;; mechtest-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype mechblock (process-drawable) - ((origin vector :inline :offset-assert 204) - (drop-point vector :inline :offset-assert 252) - (allow-drag? basic :offset-assert 268) - (reset-on-land? basic :offset-assert 272) - (hit-something? basic :offset-assert 276) - (attack-id uint32 :offset-assert 280) - (next-entity basic :offset-assert 284) + ((root-override collide-shape-moving :offset 128 :score 1) + (origin vector :inline :offset-assert 208) + (drop-point vector :inline :offset 256) + (allow-drag? symbol :offset-assert 272) + (reset-on-land? symbol :offset-assert 276) + (hit-something? symbol :offset-assert 280) + (attack-id uint32 :offset-assert 284) + (next-entity entity :offset-assert 288) ) :method-count-assert 25 :size-assert #x124 @@ -51722,9 +51729,7 @@ (wait () _type_ :state 24) ) ) -|# -#| (deftype throwblock (mechblock) () :method-count-assert 25 @@ -51733,9 +51738,7 @@ (:methods ) ) -|# -#| (deftype pushblock (mechblock) () :method-count-assert 25 @@ -51744,7 +51747,6 @@ (:methods ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -51768,10 +51770,9 @@ ;; breakable-wall ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype rbw-side (basic) - ((break-anim basic :offset-assert 4) - (end-anim basic :offset-assert 8) + ((break-anim string :offset-assert 4) + (end-anim string :offset-assert 8) (break-prim-mask uint8 :offset-assert 12) (break-root-prim-joint int16 :offset-assert 14) (break-bounds-joint int16 :offset-assert 16) @@ -51782,25 +51783,21 @@ :size-assert #x40 :flag-assert #x900000040 ) -|# -#| (deftype rbw-info (basic) - ((skel-group basic :offset-assert 4) - (anim basic :offset-assert 8) - (sides basic :offset-assert 12) + ((skel-group string :offset-assert 4) + (anim spool-anim :offset-assert 8) + (sides (array rbw-side) :offset-assert 12) ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype ruins-breakable-wall (process-focusable) - ((info basic :offset-assert 200) - (side basic :offset-assert 204) - (nav-mesh basic :offset-assert 208) + ((info rbw-info :offset-assert 204) + (side rbw-side :offset-assert 208) + (nav-mesh nav-mesh :offset-assert 212) ) :method-count-assert 31 :size-assert #xd8 @@ -51809,27 +51806,26 @@ (unbroken () _type_ :state 27) (hit () _type_ :state 28) (broken () _type_ :state 29) - (ruins-breakable-wall-method-30 () none 30) + (ruins-breakable-wall-method-30 (_type_ symbol) none 30) ) ) -|# -;; (define-extern *rbw-infos* array) +(define-extern *rbw-infos* (array rbw-info)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; pillar-collapse ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype ruins-pillar-collapse (process-drawable) - ((player-attack-id int32 :offset-assert 196) - (fall-anim-index int32 :offset-assert 200) - (hit-points int8 :offset-assert 204) - (mesh-trans UNKNOWN 3 :offset-assert 205) - (mesh-joint UNKNOWN 2 :offset-assert 208) - (deadly? basic :offset-assert 212) - (art-name basic :offset-assert 216) - (anim basic :offset-assert 220) + ((root-override collide-shape-moving :offset 128 :score 1) + (player-attack-id int32 :offset-assert 200) + (fall-anim-index int32 :offset-assert 204) + (hit-points int8 :offset-assert 208) + (mesh-trans uint8 3 :offset-assert 209) + (mesh-joint joint 2 :offset-assert 212) + (deadly? symbol :offset 216) + (art-name string :offset 220) + (anim spool-anim :offset 224) ) :method-count-assert 24 :size-assert #xe4 @@ -51838,10 +51834,9 @@ (idle () _type_ :state 20) (bump () _type_ :state 21) (hit () _type_ :state 22) - (fall () _type_ :state 23) + (fall (symbol) _type_ :state 23) ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/decompiler/config/jak2/anonymous_function_types.jsonc b/decompiler/config/jak2/anonymous_function_types.jsonc index 29ecb2f767..fd9b2ad4f8 100644 --- a/decompiler/config/jak2/anonymous_function_types.jsonc +++ b/decompiler/config/jak2/anonymous_function_types.jsonc @@ -721,5 +721,15 @@ [36, "(function process-focusable traffic-object-type-info none)"], [45, "(function process-tree none)"], [61, "(function vector matrix matrix)"] // a guess + ], + "ruins-obs": [ + [0, "(function object :behavior task-manager)"], + [1, "(function symbol :behavior task-manager)"], + [2, "(function object :behavior task-manager)"], + [3, "(function symbol :behavior task-manager)"] + ], + "tomb-boulder": [ + [0, "(function process vector cspace object object (pointer process))"], + [4, "(function process-drawable vector)"] ] } diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index 0c15a9cfde..3fb4e64cce 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -443,7 +443,7 @@ "bones-mtx-calc-execute": [19, 7], "foreground-draw": [0, 1, 126], "dma-add-process-drawable": [0, 136], - "(anon-function 3 ruins-obs)": [14], + "(anon-function 3 ruins-obs)": [14, 22], "(anon-function 0 target-death)": [ 50, // goto 52 51, // goto L65 @@ -510,7 +510,16 @@ "(method 18 traffic-tracker)": [2, 3, 5, 6, 7, 8], "(method 181 gator)": [ 2, 3, 7, 10, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 25, 26, 30 - ] + ], + "(method 10 simple-sprite-system)": [0, 1, 3, 4, 5, 6, 9, 11], + "target-pilot-post": [0, 2, 4, 5, 13, 16, 22, 27, 41], + "(anon-function 0 ruins-obs)": [ + 0, 5, 7, 12, 13, 15, 17, 23, 24, 33, 42, 45, 46, 53, 58 + ], + "(anon-function 1 ruins-obs)": [ + 1, 2, 4, 6, 7, 14, 17, 19, 22, 24, 26, 27, 29, 31, 33, 35 + ], + "(anon-function 2 ruins-obs)": [7, 28, 37, 50, 51, 61, 62, 71] }, // Sometimes the game might use format strings that are fetched dynamically, diff --git a/decompiler/config/jak2/inputs.jsonc b/decompiler/config/jak2/inputs.jsonc index d640ae58b7..a9a2e19879 100644 --- a/decompiler/config/jak2/inputs.jsonc +++ b/decompiler/config/jak2/inputs.jsonc @@ -90,7 +90,7 @@ "DGO/CFA.DGO", // "DGO/TOMBEXT.DGO", // "DGO/LCGUARD.DGO", - // "DGO/TOE.DGO", + "DGO/TOE.DGO", // "DGO/PALBOSS.DGO", "DGO/FRB.DGO", "DGO/PAE.DGO", @@ -215,10 +215,28 @@ "LWIDEA.DGO", "LWIDEB.DGO", "LWIDEC.DGO", + "FEA.DGO", + "FEB.DGO", + "DRI.DGO", + "TOC.DGO", + "FOB.DGO", + "SAG.DGO", + "MTX.DGO", "MCN.DGO", "MTN.DGO", - "MTX.DGO", + "TOB.DGO", + "TOA.DGO", + "TOD.DGO", + "TOE.DGO", + "DRILLMTN.DGO", + "FOR.DGO", + "LDJAKBRN.DGO", + "HIDEOUT.DGO", + "KIOSK.DGO", + "DMI.DGO", + "LSACK.DGO", "ORACLE.DGO", + "MTN.DGO", "PRI.DGO", "RUI.DGO", "SAG.DGO", diff --git a/decompiler/config/jak2/label_types.jsonc b/decompiler/config/jak2/label_types.jsonc index b25cea737c..879af47797 100644 --- a/decompiler/config/jak2/label_types.jsonc +++ b/decompiler/config/jak2/label_types.jsonc @@ -64,7 +64,10 @@ "rigid-body-plat": [["L47", "rigid-body-platform-constants"]], "sprite": [["L51", "vu-function"]], "sprite-distort": [["L27", "vu-function"]], - "sprite-glow": [["L29", "vu-function"]], + "sprite-glow": [ + ["L29", "vu-function"], + ["L27", "vector"] + ], "debug": [ ["L250", "(inline-array vector)", 32], ["L254", "(inline-array vector)", 3], @@ -1016,5 +1019,34 @@ "traffic-engine": [ ["L803", "uint64", true], ["L733", "uint64", true] + ], + "mechtest-obs": [["L79", "attack-info"]], + "pillar-collapse": [["L193", "attack-info"]], + "tomb-boulder": [ + ["L364", "attack-info"], + ["L343", "attack-info"], + ["L323", "attack-info"], + ["L322", "attack-info"] + ], + "grunt-mech": [["L122", "attack-info"]], + "tomb-obs": [ + ["L225", "vector"], + ["L290", "vector"], + ["L286", "vector"], + ["L224", "vector"], + ["L301", "attack-info"] + ], + "tomb-water": [ + ["L552", "(inline-array vector)", 3], + ["L495", "attack-info"], + ["L524", "attack-info"], + ["L502", "(pointer handle)", 2], + ["L503", "(pointer int32)", 4], + ["L534", "(pointer sound-name)", 4], + ["L533", "(inline-array vector)", 4] + ], + "tomb-beetle": [ + ["L118", "attack-info"], + ["L126", "(pointer int64)", 2] ] } diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index b5d8a0476a..a207a50b4b 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -1559,5 +1559,49 @@ [16, "bounding-box"], [48, "vector4w"] ], - "(method 22 traffic-tracker)": [[16, ["inline-array", "vector", 10]]] + "(method 22 traffic-tracker)": [[16, ["inline-array", "vector", 10]]], + "(method 10 simple-sprite-system)": [[16, ["array", "texture-id", 4]]], + "(anon-function 3 ruins-obs)": [[16, "event-message-block"]], + "(event unbroken ruins-breakable-wall)": [[16, "attack-info"]], + "(method 21 spider-eyes)": [[32, "vector"]], + "(code mech-lunge grunt-mech)": [[16, "matrix"]], + "(method 193 grunt-mech)": [[32, "vector"]], + "(code mech-dismount grunt-mech)": [[16, "matrix"]], + "(post chase tomb-boulder)": [ + [16, "collide-query"], + [560, "vector"], + [576, "vector"], + [592, "event-message-block"] + ], + "(enter chase tomb-boulder)": [[32, "event-message-block"]], + "(code doors-open tomb-sphinx)": [ + [32, "vector"], + [48, "vector"], + [64, "vector"], + [80, "vector"] + ], + "(code active tomb-sphinx)": [[80, "vector"]], + "(trans wait-for-pools tomb-stair-block)": [[32, "event-message-block"]], + "drop-pool": [[32, "vector"]], + "(method 24 tomb-water-trap)": [ + [16, "vector"], + [32, "vector"], + [48, "vector"], + [64, "vector"], + [80, "matrix"], + [144, "matrix"] + ], + "(method 11 tomb-water-trap)": [ + [16, "sync-info-params"], + [64, "sphere"] + ], + "(method 23 tomb-water-trap)": [ + [592, "vector"], + [608, "event-message-block"], + [16, "collide-query"], + [560, "vector"] + ], + "(trans show-sequence tomb-plat-simon)": [[16, "event-message-block"]], + "(event dangerous tomb-simon-block)": [[16, "vector"]], + "(method 185 tomb-beetle)": [[16, "vector"]] } diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index 1c4da8f759..521241080f 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -5236,7 +5236,7 @@ "(event impact turret-shot)": [[11, "s4", "process-drawable"]], "(code impact turret-shot)": [[4, "v1", "collide-shape-prim-group"]], "(method 29 sinking-plat)": [ - [6, "v0", "(function rigid-body-platform float none)"] + [9, "t9", "(function rigid-body-platform float none)"] ], "(code collapse beam)": [[25, "v1", "art-joint-anim"]], "(code fall ruins-bridge)": [ @@ -6917,5 +6917,214 @@ "(method 72 traffic-engine)": [[25, "a3", "int"]], "(method 60 traffic-engine)": [[29, "v1", "collide-shape"]], "(method 26 traffic-tracker)": [[26, "a0", "process-focusable"]], - "(method 17 traffic-tracker)": [[23, "s1", "process-focusable"]] + "(method 17 traffic-tracker)": [[23, "s1", "process-focusable"]], + "target-pilot-post": [[96, "s5", "process-focusable"]], + "(anon-function 1 ruins-obs)": [ + [85, "v1", "process-drawable"], + [17, "v1", "process-drawable"] + ], + "(anon-function 0 ruins-obs)": [ + [173, "v1", "process-drawable"], + [36, "v1", "process-drawable"] + ], + "(event idle mechblock)": [ + [15, "a0", "carry-info"], + [29, "a0", "carry-info"], + [20, "a0", "carry-info"], + [32, "a0", "carry-info"] + ], + "(event drag mechblock)": [ + [49, "a0", "carry-info"], + [57, "a0", "vector"], + [79, "a0", "vector"], + [52, "a0", "carry-info"] + ], + "(enter fall mechblock)": [ + [43, "a0", "carry-info"], + [46, "a0", "carry-info"] + ], + "(event carry mechblock)": [[15, "a0", "vector"]], + "(method 30 ruins-breakable-wall)": [[55, "v1", "collide-shape-prim-group"]], + "(event unbroken ruins-breakable-wall)": [ + [10, "s4", "attack-info"], + [41, "s3", "attack-info"], + [20, "s4", "pointer"] + ], + "(method 11 ruins-pillar-collapse)": [ + [77, "s1", "pair"], + [96, "s1", "pair"], + [97, "v1", "pair"], + [110, "s1", "pair"], + [111, "v1", "pair"], + [112, "v1", "pair"], + [118, "s2", "pair"], + [117, "s2", "pair"] + ], + "(code fall ruins-pillar-collapse)": [ + [16, "v1", "collide-shape-prim-group"], + [20, "v1", "collide-shape-prim-group"] + ], + "(event fall ruins-pillar-collapse)": [ + [35, "a0", "process-focusable"], + [13, "a0", "process-focusable"], + [34, "gp", "process-focusable"] + ], + "(event idle ruins-pillar-collapse)": [ + [10, "gp", "attack-info"], + [27, "s3", "process-drawable"], + [45, "gp", "attack-info"] + ], + "target-indax-handler": [[88, "a0", "process"]], + "(code target-indax-stance)": [ + [23, "v1", "art-joint-anim"], + [240, "v1", "art-joint-anim"], + [94, "v1", "art-joint-anim"], + [182, "v1", "art-joint-anim"] + ], + "(code target-indax-walk)": [[89, "v1", "art-joint-anim"]], + "(code target-indax-hit-ground)": [[14, "v1", "art-joint-anim"]], + "(code target-indax-attack-air)": [[11, "gp", "art-joint-anim"]], + "(code target-indax-death)": [ + [134, "v1", "art-joint-anim"], + [251, "v1", "art-joint-anim"], + [341, "v1", "art-joint-anim"], + [394, "v1", "art-joint-anim"], + [478, "v1", "art-joint-anim"] + ], + "(code target-indax-double-jump)": [ + [50, "v1", "art-joint-anim"], + [104, "v1", "art-joint-anim"] + ], + "(code target-indax-trip)": [ + [17, "v1", "art-joint-anim"], + [90, "v1", "art-joint-anim"] + ], + "(code target-indax-attack)": [[18, "gp", "art-joint-anim"]], + "(code target-indax-running-attack)": [ + [42, "gp", "art-joint-anim"], + [141, "f26", "float"], + [224, "f26", "float"] + ], + "(code idle tomb-boulder-stop)": [[4, "a0", "process"]], + "tomb-spider-init": [[114, "gp", "process-drawable"]], + "(code idle tomb-boulder-pillar)": [[4, "a0", "process"]], + "(code mech-lunge grunt-mech)": [[25, "v1", "art-joint-anim"]], + "(trans mech-post-circling grunt-mech)": [ + [14, "a0", "process-focusable"], + [17, "a0", "process-focusable"] + ], + "(code mech-dismount grunt-mech)": [ + [41, "v1", "art-joint-anim"], + [149, "v1", "art-joint-anim"] + ], + "(code mech-hold grunt-mech)": [ + [10, "v1", "art-joint-anim"], + [531, "v1", "art-joint-anim"] + ], + "(code chase tomb-boulder)": [[141, "gp", "handle"]], + "(code idle tomb-boulder)": [[137, "gp", "handle"]], + "(exit chase tomb-boulder)": [[24, "v0", "sound-rpc-set-param"]], + "(post chase tomb-boulder)": [ + [606, "v0", "sound-rpc-set-param"], + [496, "a0", "int"], + [278, "v1", "vector"], + [463, "a0", "(array float)"], + [486, "v1", "(array float)"], + [452, "a0", "(array float)"], + [457, "a0", "(array float)"] + ], + "(code idle tomb-spider)": [[[1, 9], "v1", "(pointer process)"]], + "(method 10 tomb-sphinx)": [[10, "t9", "(function process-drawable none)"]], + "tomb-stair-block-spikes-init-by-other": [ + [53, "s2", "pair"], + [72, "s2", "pair"], + [73, "v1", "pair"], + [86, "s2", "pair"], + [87, "v1", "pair"], + [88, "v1", "pair"], + [94, "s3", "pair"], + [93, "s3", "pair"] + ], + "(enter sunk tomb-stair-block)": [[16, "v1", "art-joint-anim"]], + "(code sink tomb-stair-block)": [[109, "v1", "art-joint-anim"]], + "(event idle tomb-stair-block-spikes)": [[24, "v1", "vector"]], + "(code moving tomb-stair-block)": [[40, "v1", "art-joint-anim"]], + "(post running tomb-elevator)": [[8, "t9", "(function none)"]], + "(method 10 tomb-plat-return)": [ + [10, "t9", "(function process-drawable none)"] + ], + "lift-pool": [ + [12, "v0", "(pointer actor-group)"], + ["_stack_", 16, "res-tag"] + ], + "drop-pool": [ + [12, "v0", "(pointer actor-group)"], + ["_stack_", 16, "res-tag"] + ], + "(trans wait-for-pools tomb-stair-block)": [ + [12, "v0", "(pointer actor-group)"], + ["_stack_", 16, "res-tag"] + ], + "(enter idle tomb-stair-block)": [ + [40, "v0", "(pointer actor-group)"], + ["_stack_", 16, "res-tag"] + ], + "(code die tomb-vibe)": [ + [14, "v1", "art-joint-anim"], + [70, "v1", "art-joint-anim"] + ], + "(code open tomb-smash-door)": [[10, "v1", "art-joint-anim"]], + "(code close tomb-smash-door)": [[10, "v1", "art-joint-anim"]], + "(method 33 tomb-button)": [[35, "v1", "art-joint-anim"]], + "(code open tomb-beetle-door)": [[10, "v1", "art-joint-anim"]], + "(code open tomb-door)": [[19, "v1", "art-joint-anim"]], + "(trans up-idle tomb-beetle-button)": [[4, "v0", "(state basebutton)"]], + "(code wobble-die tomb-simon-block)": [[10, "v1", "art-joint-anim"]], + "(code open tomb-simon-button)": [ + [14, "v1", "art-joint-anim"], + [47, "v1", "art-joint-anim"] + ], + "(code unpress tomb-simon-button)": [[10, "v1", "art-joint-anim"]], + "(method 23 tomb-water-trap)": [[42, "s2", "collide-shape-prim-sphere"]], + "(code pressed tomb-simon-button)": [ + [19, "v1", "art-joint-anim"], + [55, "v1", "art-joint-anim"] + ], + "(enter waiting tomb-simon-button)": [[10, "v1", "art-joint-anim"]], + "(event idle tomb-vibe)": [[6, "a0", "attack-info"]], + "(method 11 tomb-beetle-door)": [["_stack_", 16, "res-tag"]], + "(method 11 tomb-vibe)": [ + ["_stack_", 16, "res-tag"], + ["_stack_", 32, "res-tag"] + ], + "(method 11 tomb-plat-simon)": [["_stack_", 16, "res-tag"]], + "(code ambush tomb-beetle)": [[14, "v1", "art-joint-anim"]], + "(code active tomb-beetle)": [ + [74, "v1", "art-joint-anim"], + [22, "v1", "art-joint-anim"] + ], + "(code land tomb-beetle)": [ + [10, "v1", "art-joint-anim"], + [111, "v1", "art-joint-anim"] + ], + "(code key tomb-beetle)": [[10, "v1", "art-joint-anim"]], + "(code go-to-door tomb-beetle)": [[85, "v1", "art-joint-anim"]], + "(code die tomb-beetle)": [[30, "v1", "art-joint-anim"]], + "(code fly-away tomb-beetle)": [ + [77, "v1", "art-joint-anim"], + [212, "v1", "art-joint-anim"] + ], + "(code stand tomb-beetle)": [[10, "v1", "art-joint-anim"]], + "(enter dormant tomb-beetle)": [[17, "v0", "(state enemy)"]], + "(enter go-to-door tomb-beetle)": [ + [[22, 153], "gp", "(inline-array tomb-beetle-fly-info)"], + [65, "v1", "vector"], + [35, "a0", "vector"], + [51, "v1", "vector"] + ], + "(trans go-to-door tomb-beetle)": [[23, "a0", "vector"]], + "(enter fly-away tomb-beetle)": [ + [6, "a0", "vector"], + [[1, 53], "gp", "(inline-array tomb-beetle-fly-info)"] + ] } diff --git a/decompiler/config/jak2_ntsc_v1.jsonc b/decompiler/config/jak2_ntsc_v1.jsonc index 879c5abf45..eed09f656f 100644 --- a/decompiler/config/jak2_ntsc_v1.jsonc +++ b/decompiler/config/jak2_ntsc_v1.jsonc @@ -8,7 +8,7 @@ // if you want to filter to only some object names. // it will make the decompiler much faster. "allowed_objects": [], - "banned_objects": ["texture-anim-tables"], + "banned_objects": ["tomb-beetle", "texture-anim-tables"], //////////////////////////// // CODE ANALYSIS OPTIONS diff --git a/decompiler/util/data_decompile.cpp b/decompiler/util/data_decompile.cpp index 895d75b5d9..ce4cb24c95 100644 --- a/decompiler/util/data_decompile.cpp +++ b/decompiler/util/data_decompile.cpp @@ -752,12 +752,12 @@ const std::unordered_map< ArrayFieldDecompMeta::Kind::REF_TO_INTEGER_ARR)}}}, {"enemy-info", {{"idle-anim-script", - ArrayFieldDecompMeta(TypeSpec("uint32"), + ArrayFieldDecompMeta(TypeSpec("idle-control-frame"), 4, ArrayFieldDecompMeta::Kind::REF_TO_INTEGER_ARR)}}}, {"nav-enemy-info", {{"idle-anim-script", - ArrayFieldDecompMeta(TypeSpec("uint32"), + ArrayFieldDecompMeta(TypeSpec("idle-control-frame"), 4, ArrayFieldDecompMeta::Kind::REF_TO_INTEGER_ARR)}}}, {"tpath-info", diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.cpp b/game/graphics/opengl_renderer/OpenGLRenderer.cpp index 92f2ccde18..e86e0584fc 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.cpp +++ b/game/graphics/opengl_renderer/OpenGLRenderer.cpp @@ -93,7 +93,8 @@ void OpenGLRenderer::init_bucket_renderers_jak2() { init_bucket_renderer("tex-lcom-sky-pre", BucketCategory::TEX, BucketId::TEX_LCOM_SKY_PRE); init_bucket_renderer("sky-draw", BucketCategory::OTHER, BucketId::SKY_DRAW, 1024); - init_bucket_renderer("bucket-6", BucketCategory::OCEAN, BucketId::OCEAN_MID_FAR); + init_bucket_renderer("ocean-mid-far", BucketCategory::OCEAN, + BucketId::OCEAN_MID_FAR); init_bucket_renderer("tex-l0-tfrag", BucketCategory::TEX, BucketId::TEX_L0_TFRAG); init_bucket_renderer("tfrag-l0-tfrag", BucketCategory::TFRAG, BucketId::TFRAG_L0_TFRAG, @@ -163,9 +164,11 @@ void OpenGLRenderer::init_bucket_renderers_jak2() { BucketId::TFRAG_T_L1_ALPHA, std::vector{tfrag3::TFragmentTreeKind::TRANS}, false, 1); // 140 - init_bucket_renderer("merc-l1-alpha", BucketCategory::MERC, - BucketId::MERC_L1_ALPHA); + init_bucket_renderer("merc-l1-alpha", BucketCategory::MERC, BucketId::MERC_L1_ALPHA); + init_bucket_renderer("tex-l2-alpha", BucketCategory::TEX, + BucketId::TEX_L2_ALPHA); // 150 + init_bucket_renderer("merc-l2-alpha", BucketCategory::MERC, BucketId::MERC_L2_ALPHA); // 160 // 170 // 180 diff --git a/game/graphics/opengl_renderer/buckets.h b/game/graphics/opengl_renderer/buckets.h index da658015c7..2f38f4eff6 100644 --- a/game/graphics/opengl_renderer/buckets.h +++ b/game/graphics/opengl_renderer/buckets.h @@ -120,6 +120,8 @@ enum class BucketId { TEX_L1_ALPHA = 137, MERC_L1_ALPHA = 141, TFRAG_T_L1_ALPHA = 138, + TEX_L2_ALPHA = 147, + MERC_L2_ALPHA = 151, TEX_LCOM_TFRAG = 187, MERC_LCOM_TFRAG = 188, TEX_LCOM_SHRUB = 191, diff --git a/goal_src/jak2/engine/ai/enemy-h.gc b/goal_src/jak2/engine/ai/enemy-h.gc index d9696ddbdf..8a18f85893 100644 --- a/goal_src/jak2/engine/ai/enemy-h.gc +++ b/goal_src/jak2/engine/ai/enemy-h.gc @@ -105,87 +105,87 @@ (deftype enemy-info (basic) - ((fact-defaults fact-info-enemy-defaults :offset-assert 4) - (use-die-falling symbol :offset-assert 8) - (use-victory symbol :offset-assert 12) - (use-jump-blocked symbol :offset-assert 16) - (debug-draw-neck symbol :offset-assert 20) - (jump-debug-draw symbol :offset-assert 24) - (move-to-ground symbol :offset-assert 28) - (hover-if-no-ground symbol :offset-assert 32) - (idle-anim-script (pointer uint32) :offset-assert 36) - (idle-anim int32 :offset-assert 40) - (notice-anim int32 :offset-assert 44) - (hostile-anim int32 :offset-assert 48) - (hit-anim int32 :offset-assert 52) - (knocked-anim int32 :offset-assert 56) - (knocked-land-anim int32 :offset-assert 60) - (die-anim int32 :offset-assert 64) - (die-falling-anim int32 :offset-assert 68) - (victory-anim int32 :offset-assert 72) - (jump-wind-up-anim int32 :offset-assert 76) - (jump-in-air-anim int32 :offset-assert 80) - (jump-land-anim int32 :offset-assert 84) - (neck-joint int32 :offset-assert 88) - (look-at-joint int32 :offset-assert 92) - (bullseye-joint int32 :offset-assert 96) - (sound-hit sound-name :offset-assert 112) - (sound-die sound-name :offset-assert 128) - (notice-distance meters :offset-assert 144) - (notice-distance-delta meters :offset-assert 148) - (proximity-notice-distance meters :offset-assert 152) - (default-hit-points int32 :offset-assert 156) - (gnd-collide-with collide-spec :offset-assert 160) - (overlaps-others-collide-with-filter collide-spec :offset-assert 164) - (penetrate-flinch uint64 :offset-assert 168) - (penetrate-knocked uint64 :offset-assert 176) - (movement-gravity meters :offset-assert 184) - (friction float :offset-assert 188) - (slip-factor float :offset-assert 192) - (attack-shove-back meters :offset-assert 196) - (attack-shove-up meters :offset-assert 200) - (attack-mode symbol :offset-assert 204) - (attack-damage int32 :offset-assert 208) - (recover-gnd-collide-with collide-spec :offset-assert 212) - (jump-height-min meters :offset-assert 216) - (jump-height-factor float :offset-assert 220) - (knocked-seek-ry-clamp float :offset-assert 224) - (knocked-soft-vxz-lo float :offset-assert 228) - (knocked-soft-vxz-hi float :offset-assert 232) - (knocked-soft-vy-lo float :offset-assert 236) - (knocked-soft-vy-hi float :offset-assert 240) - (knocked-medium-vxz-lo float :offset-assert 244) - (knocked-medium-vxz-hi float :offset-assert 248) - (knocked-medium-vy-lo float :offset-assert 252) - (knocked-medium-vy-hi float :offset-assert 256) - (knocked-hard-vxz-lo float :offset-assert 260) - (knocked-hard-vxz-hi float :offset-assert 264) - (knocked-hard-vy-lo float :offset-assert 268) - (knocked-hard-vy-hi float :offset-assert 272) - (knocked-huge-vxz-lo float :offset-assert 276) - (knocked-huge-vxz-hi float :offset-assert 280) - (knocked-huge-vy-lo float :offset-assert 284) - (knocked-huge-vy-hi float :offset-assert 288) - (knocked-yellow-vxz-lo float :offset-assert 292) - (knocked-yellow-vxz-hi float :offset-assert 296) - (knocked-yellow-vy-lo float :offset-assert 300) - (knocked-yellow-vy-hi float :offset-assert 304) - (knocked-red-vxz-lo float :offset-assert 308) - (knocked-red-vxz-hi float :offset-assert 312) - (knocked-red-vy-lo float :offset-assert 316) - (knocked-red-vy-hi float :offset-assert 320) - (knocked-blue-vxz-lo float :offset-assert 324) - (knocked-blue-vxz-hi float :offset-assert 328) - (knocked-blue-vy-lo float :offset-assert 332) - (knocked-blue-vy-hi float :offset-assert 336) - (shadow-size meters :offset-assert 340) - (shadow-max-y meters :offset-assert 344) - (shadow-min-y meters :offset-assert 348) - (shadow-locus-dist meters :offset-assert 352) - (gem-joint int32 :offset-assert 356) - (gem-seg uint32 :offset-assert 360) - (gem-no-seg uint32 :offset-assert 364) - (gem-offset sphere :inline :offset-assert 368) + ((fact-defaults fact-info-enemy-defaults :offset-assert 4) + (use-die-falling symbol :offset-assert 8) + (use-victory symbol :offset-assert 12) + (use-jump-blocked symbol :offset-assert 16) + (debug-draw-neck symbol :offset-assert 20) + (jump-debug-draw symbol :offset-assert 24) + (move-to-ground symbol :offset-assert 28) + (hover-if-no-ground symbol :offset-assert 32) + (idle-anim-script (pointer idle-control-frame) :offset-assert 36) + (idle-anim int32 :offset-assert 40) + (notice-anim int32 :offset-assert 44) + (hostile-anim int32 :offset-assert 48) + (hit-anim int32 :offset-assert 52) + (knocked-anim int32 :offset-assert 56) + (knocked-land-anim int32 :offset-assert 60) + (die-anim int32 :offset-assert 64) + (die-falling-anim int32 :offset-assert 68) + (victory-anim int32 :offset-assert 72) + (jump-wind-up-anim int32 :offset-assert 76) + (jump-in-air-anim int32 :offset-assert 80) + (jump-land-anim int32 :offset-assert 84) + (neck-joint int32 :offset-assert 88) + (look-at-joint int32 :offset-assert 92) + (bullseye-joint int32 :offset-assert 96) + (sound-hit sound-name :offset-assert 112) + (sound-die sound-name :offset-assert 128) + (notice-distance meters :offset-assert 144) + (notice-distance-delta meters :offset-assert 148) + (proximity-notice-distance meters :offset-assert 152) + (default-hit-points int32 :offset-assert 156) + (gnd-collide-with collide-spec :offset-assert 160) + (overlaps-others-collide-with-filter collide-spec :offset-assert 164) + (penetrate-flinch uint64 :offset-assert 168) + (penetrate-knocked uint64 :offset-assert 176) + (movement-gravity meters :offset-assert 184) + (friction float :offset-assert 188) + (slip-factor float :offset-assert 192) + (attack-shove-back meters :offset-assert 196) + (attack-shove-up meters :offset-assert 200) + (attack-mode symbol :offset-assert 204) + (attack-damage int32 :offset-assert 208) + (recover-gnd-collide-with collide-spec :offset-assert 212) + (jump-height-min meters :offset-assert 216) + (jump-height-factor float :offset-assert 220) + (knocked-seek-ry-clamp float :offset-assert 224) + (knocked-soft-vxz-lo float :offset-assert 228) + (knocked-soft-vxz-hi float :offset-assert 232) + (knocked-soft-vy-lo float :offset-assert 236) + (knocked-soft-vy-hi float :offset-assert 240) + (knocked-medium-vxz-lo float :offset-assert 244) + (knocked-medium-vxz-hi float :offset-assert 248) + (knocked-medium-vy-lo float :offset-assert 252) + (knocked-medium-vy-hi float :offset-assert 256) + (knocked-hard-vxz-lo float :offset-assert 260) + (knocked-hard-vxz-hi float :offset-assert 264) + (knocked-hard-vy-lo float :offset-assert 268) + (knocked-hard-vy-hi float :offset-assert 272) + (knocked-huge-vxz-lo float :offset-assert 276) + (knocked-huge-vxz-hi float :offset-assert 280) + (knocked-huge-vy-lo float :offset-assert 284) + (knocked-huge-vy-hi float :offset-assert 288) + (knocked-yellow-vxz-lo float :offset-assert 292) + (knocked-yellow-vxz-hi float :offset-assert 296) + (knocked-yellow-vy-lo float :offset-assert 300) + (knocked-yellow-vy-hi float :offset-assert 304) + (knocked-red-vxz-lo float :offset-assert 308) + (knocked-red-vxz-hi float :offset-assert 312) + (knocked-red-vy-lo float :offset-assert 316) + (knocked-red-vy-hi float :offset-assert 320) + (knocked-blue-vxz-lo float :offset-assert 324) + (knocked-blue-vxz-hi float :offset-assert 328) + (knocked-blue-vy-lo float :offset-assert 332) + (knocked-blue-vy-hi float :offset-assert 336) + (shadow-size meters :offset-assert 340) + (shadow-max-y meters :offset-assert 344) + (shadow-min-y meters :offset-assert 348) + (shadow-locus-dist meters :offset-assert 352) + (gem-joint int32 :offset-assert 356) + (gem-seg uint32 :offset-assert 360) + (gem-no-seg uint32 :offset-assert 364) + (gem-offset sphere :inline :offset-assert 368) ) :method-count-assert 10 :size-assert #x180 diff --git a/goal_src/jak2/engine/common_objs/generic-obs.gc b/goal_src/jak2/engine/common_objs/generic-obs.gc index f92d45f8fb..c0c6f2ffd4 100644 --- a/goal_src/jak2/engine/common_objs/generic-obs.gc +++ b/goal_src/jak2/engine/common_objs/generic-obs.gc @@ -490,33 +490,36 @@ (s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self draw shadow-joint-index))) ) + (f30-0 1638400.0) + (s3-0 (new 'stack-no-clear 'collide-query)) + (f28-0 122880.0) ) - 1638400.0 - (let ((s3-0 (new 'stack-no-clear 'collide-query)) - (f28-0 122880.0) - ) - (set! (-> s3-0 start-pos quad) (-> s4-1 quad)) - (vector-normalize-copy! (-> s3-0 move-dist) s5-2 f28-0) - (let ((v1-64 s3-0)) - (set! (-> v1-64 radius) 1638.4) - (set! (-> v1-64 collide-with) (collide-spec obstacle hit-by-others-list)) - (set! (-> v1-64 ignore-process0) self) - (set! (-> v1-64 ignore-process1) #f) - (set! (-> v1-64 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) - (set! (-> v1-64 action-mask) (collide-action solid)) - ) - (let* ((f0-13 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) - (f28-1 (if (< 0.0 f0-13) - (* f0-13 f28-0) - 122880.0 - ) - ) - (s2-0 (method-of-object (-> self draw shadow-ctrl) shadow-control-method-14)) - ) - (- f28-1 (command-get-float (-> event param 0) 0.0)) - (+ f28-1 (command-get-float (-> event param 1) 0.0)) - (the-as object (s2-0)) - ) + (set! (-> s3-0 start-pos quad) (-> s4-1 quad)) + (vector-normalize-copy! (-> s3-0 move-dist) s5-2 f28-0) + (let ((v1-64 s3-0)) + (set! (-> v1-64 radius) 1638.4) + (set! (-> v1-64 collide-with) (collide-spec obstacle hit-by-others-list)) + (set! (-> v1-64 ignore-process0) self) + (set! (-> v1-64 ignore-process1) #f) + (set! (-> v1-64 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-64 action-mask) (collide-action solid)) + ) + (let* ((f0-13 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) + (f28-1 (if (< 0.0 f0-13) + (* f0-13 f28-0) + 122880.0 + ) + ) + ) + (the-as object (shadow-control-method-14 + (-> self draw shadow-ctrl) + s4-1 + s5-2 + f30-0 + (- f28-1 (command-get-float (-> event param 0) 0.0)) + (+ f28-1 (command-get-float (-> event param 1) 0.0)) + ) + ) ) ) ) diff --git a/goal_src/jak2/engine/game/idle-control.gc b/goal_src/jak2/engine/game/idle-control.gc index 2c09dd2d80..dc4b67d675 100644 --- a/goal_src/jak2/engine/game/idle-control.gc +++ b/goal_src/jak2/engine/game/idle-control.gc @@ -20,23 +20,23 @@ (deftype idle-control (structure) - ((anim (pointer uint32) :offset-assert 0) - (current (pointer uint32) :offset-assert 4) - (counter int32 :offset-assert 8) - (target int32 :offset-assert 12) + ((anim (pointer idle-control-frame) :offset-assert 0) + (current (pointer idle-control-frame) :offset-assert 4) + (counter int32 :offset-assert 8) + (target int32 :offset-assert 12) ) :method-count-assert 11 :size-assert #x10 :flag-assert #xb00000010 (:methods - (idle-control-method-9 (_type_ (pointer uint32)) none 9) + (idle-control-method-9 (_type_ (pointer idle-control-frame)) none 9) (idle-control-method-10 (_type_ process-drawable) none :behavior process-drawable 10) ) ) ;; WARN: Return type mismatch idle-control vs none. -(defmethod idle-control-method-9 idle-control ((obj idle-control) (arg0 (pointer uint32))) +(defmethod idle-control-method-9 idle-control ((obj idle-control) (arg0 (pointer idle-control-frame))) (set! (-> obj anim) arg0) (set! (-> obj current) arg0) (set! (-> obj counter) 0) @@ -47,81 +47,79 @@ ;; TODO - method manually patched (maybe incorrectly) around `self` changing ;; WARN: Function (method 10 idle-control) has a return type of none, but the expression builder found a return statement. (defmethod idle-control-method-10 idle-control ((obj idle-control) (arg0 process-drawable)) - (with-pp arg0 - (local-vars (a1-1 int)) - (when (nonzero? (-> obj anim)) - (let ((s5-0 self)) - (loop - (let* ((s4-0 (-> obj current 0)) - (v1-4 (shr (shl s4-0 56) 56)) - ) - (cond - ((= v1-4 1) - (if (< (shr (shl s4-0 48) 56) 0) - (return #f) - ) - (when (zero? (-> obj target)) - (let ((t9-0 rand-vu-int-range) - (a0-3 (sar (shl s4-0 40) 56)) - ) - (shift-arith-right-32 a1-1 s4-0 24) - (set! (-> obj target) (t9-0 (the-as int a0-3) a1-1)) - ) - (ja :group! (-> (the-as process-drawable arg0) draw art-group data (shr (shl s4-0 48) 56)) :num! min) - (return #f) - ) - (ja :group! (-> (the-as process-drawable arg0) draw art-group data (shr (shl s4-0 48) 56)) - :num! (seek! - (the float - (+ (-> (the-as art-joint-anim (-> (the-as process-drawable arg0) draw art-group data (shr (shl s4-0 48) 56))) - frames - num-frames - ) - -1 - ) - ) + (local-vars (a1-1 int)) + (when (nonzero? (-> obj anim)) + (let ((s5-0 self)) + (loop + (let* ((s4-0 (-> obj current 0)) + (v1-4 (-> s4-0 command)) + ) + (cond + ((= v1-4 1) + (if (< (-> s4-0 anim) 0) + (return #f) + ) + (when (zero? (-> obj target)) + (let ((t9-0 rand-vu-int-range) + (a0-3 (-> s4-0 param0)) + ) + (shift-arith-right-32 a1-1 s4-0 24) + (set! (-> obj target) (t9-0 (the-as int a0-3) a1-1)) + ) + (ja :group! (-> (the-as process-drawable self) draw art-group data (-> s4-0 anim)) :num! min) + (return #f) + ) + (ja :group! (-> (the-as process-drawable self) draw art-group data (-> s4-0 anim)) + :num! (seek! + (the float + (+ (-> (the-as art-joint-anim (-> (the-as process-drawable self) draw art-group data (-> s4-0 anim))) + frames + num-frames + ) + -1 + ) + ) + ) + ) + (cond + ((ja-done? 0) + (+! (-> obj counter) 1) + (cond + ((>= (-> obj counter) (-> obj target)) + (set! (-> obj current) (&-> (-> obj current) 1)) + (set! (-> obj counter) 0) + (set! (-> obj target) 0) + 0 + ) + (else + (ja :num-func num-func-identity :frame-num 0.0) + (return #f) ) ) - (cond - ((ja-done? 0) - (+! (-> obj counter) 1) - (cond - ((>= (-> obj counter) (-> obj target)) - (set! (-> obj current) (&-> (-> obj current) 1)) - (set! (-> obj counter) 0) - (set! (-> obj target) 0) - 0 - ) - (else - (ja :num-func num-func-identity :frame-num 0.0) - (return #f) - ) - ) - ) - (else - (return #f) - ) ) - ) - ((= v1-4 2) - (ja-channel-push! 1 (the-as time-frame (sar (shl s4-0 40) 56))) - (set! (-> obj current) (&-> (-> obj current) 1)) - (set! (-> obj counter) 0) - (set! (-> obj target) 0) - 0 - ) - ((zero? v1-4) - (set! (-> obj current) (-> obj anim)) - (set! (-> obj counter) 0) - (set! (-> obj target) 0) - 0 - ) - ) + (else + (return #f) + ) + ) + ) + ((= v1-4 2) + (ja-channel-push! 1 (the-as time-frame (-> s4-0 param0))) + (set! (-> obj current) (&-> (-> obj current) 1)) + (set! (-> obj counter) 0) + (set! (-> obj target) 0) + 0 + ) + ((zero? v1-4) + (set! (-> obj current) (-> obj anim)) + (set! (-> obj counter) 0) + (set! (-> obj target) 0) + 0 + ) ) ) ) ) - 0 - (none) ) + 0 + (none) ) diff --git a/goal_src/jak2/engine/gfx/foreground/shadow-cpu-h.gc b/goal_src/jak2/engine/gfx/foreground/shadow-cpu-h.gc index a394846c06..42961bd2e7 100644 --- a/goal_src/jak2/engine/gfx/foreground/shadow-cpu-h.gc +++ b/goal_src/jak2/engine/gfx/foreground/shadow-cpu-h.gc @@ -22,17 +22,17 @@ ;; DECOMP BEGINS (deftype shadow-settings (structure) - ((flags shadow-flags :offset 12) ;; shadow-flags - (center vector :inline :offset 0 :score -1) - (shadow-dir vector :inline :offset-assert 16) - (dist-to-locus float :offset 28) - (bot-plane plane :inline :offset-assert 32) - (top-plane plane :inline :offset-assert 48) - (fade-dist float :offset-assert 64) - (fade-start float :offset-assert 68) - (dummy-2 int32 :offset-assert 72) - (shadow-type int32 :offset-assert 76) - (flag-vector vector :inline :offset 64) ;; added + ((flags shadow-flags :offset 12) + (center vector :inline :offset 0) + (shadow-dir vector :inline :offset-assert 16) + (dist-to-locus float :offset 28) + (bot-plane plane :inline :offset-assert 32) + (top-plane plane :inline :offset-assert 48) + (fade-dist float :offset-assert 64) + (fade-start float :offset-assert 68) + (dummy-2 int32 :offset-assert 72) + (shadow-type int32 :offset-assert 76) + (flag-vector vector :inline :offset 64) ) :method-count-assert 9 :size-assert #x50 @@ -53,7 +53,7 @@ (set-top-plane-offset (shadow-control float) int 11) (set-bottom-plane-offset (shadow-control float) int 12) (shadow-control-method-13 (_type_ vector float float float) none 13) - (shadow-control-method-14 () none 14) + (shadow-control-method-14 (_type_ vector vector float float float) none 14) ) ) @@ -152,17 +152,6 @@ :flag-assert #x900000002 ) -; (deftype shadow-edge (structure) -; ((ind-0 uint8 :offset-assert 0) -; (ind-1 uint8 :offset-assert 1) -; (tri-0 uint8 :offset-assert 2) -; (tri-1 uint8 :offset-assert 3) -; ) -; :method-count-assert 9 -; :size-assert #x4 -; :flag-assert #x900000004 -; ) - (deftype shadow-tri (structure) ((ind-0 uint8 :offset-assert 0) (ind-1 uint8 :offset-assert 1) diff --git a/goal_src/jak2/engine/gfx/foreground/shadow-cpu.gc b/goal_src/jak2/engine/gfx/foreground/shadow-cpu.gc index 597e6f9ef4..a10991f610 100644 --- a/goal_src/jak2/engine/gfx/foreground/shadow-cpu.gc +++ b/goal_src/jak2/engine/gfx/foreground/shadow-cpu.gc @@ -5,6 +5,8 @@ ;; name in dgo: shadow-cpu ;; dgos: ENGINE, GAME +;; temp + (defmethod shadow-control-method-13 shadow-control ((obj shadow-control) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (with-pp (let ((s4-0 (new 'stack-no-clear 'collide-query))) @@ -47,5 +49,29 @@ ) ) +(defmethod shadow-control-method-14 shadow-control ((obj shadow-control) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float) (arg4 float)) + (let ((gp-0 (-> obj settings))) + (let ((s4-0 (-> gp-0 shadow-dir))) + (vector-normalize-copy! s4-0 arg1 1.0) + (set! (-> gp-0 shadow-dir w) (- arg2)) + (when *shadow-debug* + (add-debug-x #t (bucket-id debug-no-zbuf1) arg0 *color-red*) + (add-debug-vector #t (bucket-id debug-no-zbuf1) arg0 s4-0 (meters 3) *color-red*) + ) + (let ((s1-2 (vector+float*! (new 'stack-no-clear 'vector) arg0 s4-0 arg3)) + (s5-2 (vector+float*! (new 'stack-no-clear 'vector) arg0 s4-0 arg4)) + ) + (vector-negate! (-> gp-0 top-plane) s4-0) + (vector-negate! (-> gp-0 bot-plane) s4-0) + (set! (-> gp-0 top-plane w) (- (vector-dot s1-2 (the-as vector (-> gp-0 top-plane))))) + (set! (-> gp-0 bot-plane w) (- (vector-dot s5-2 (the-as vector (-> gp-0 bot-plane))))) + ) + ) + (logior! (-> gp-0 flags) (shadow-flags shdf02 shdf03 shdf04 shdf07)) + ) + 0 + (none) + ) + ;; DECOMP BEGINS diff --git a/goal_src/jak2/engine/gfx/sprite/simple-sprite-h.gc b/goal_src/jak2/engine/gfx/sprite/simple-sprite-h.gc index 60b1ac09aa..e21080e6ac 100644 --- a/goal_src/jak2/engine/gfx/sprite/simple-sprite-h.gc +++ b/goal_src/jak2/engine/gfx/sprite/simple-sprite-h.gc @@ -8,17 +8,17 @@ ;; DECOMP BEGINS (deftype sprite-glow-data (structure) - ((position vector :inline :offset-assert 0) - (size-x float :offset 12) - (size-probe float :offset-assert 16) - (z-offset float :offset-assert 20) - (rot-angle float :offset-assert 24) - (size-y float :offset-assert 28) - (color rgbaf :inline :offset-assert 32) - (fade-a float :offset-assert 48) - (fade-b float :offset-assert 52) - (tex-id uint32 :offset-assert 56) - (dummy uint32 :offset-assert 60) + ((position vector :inline :offset-assert 0) + (size-x float :offset 12) + (size-probe float :offset-assert 16) + (z-offset float :offset-assert 20) + (rot-angle float :offset-assert 24) + (size-y float :offset-assert 28) + (color rgbaf :inline :offset-assert 32) + (fade-a float :offset-assert 48) + (fade-b float :offset-assert 52) + (tex-id texture-id :offset-assert 56) + (dummy uint32 :offset-assert 60) ) :method-count-assert 10 :size-assert #x40 @@ -28,6 +28,7 @@ ) ) + (defmethod set-trans sprite-glow-data ((obj sprite-glow-data) (arg0 vector)) (let ((f0-0 (-> obj position w))) (set! (-> obj position quad) (-> arg0 quad)) @@ -38,15 +39,15 @@ ) (deftype simple-sprite-system (structure) - ((count int16 :offset-assert 0) - (max-count int16 :offset-assert 2) - (data uint32 :offset-assert 4) + ((count int16 :offset-assert 0) + (max-count int16 :offset-assert 2) + (data sprite-glow-data :offset-assert 4) ) :method-count-assert 12 :size-assert #x8 :flag-assert #xc00000008 (:methods - (add! () none 9) + (add! (_type_ dma-buffer) none 9) (simple-sprite-system-method-10 (_type_ dma-buffer) none 10) (clear! (_type_) none 11) ) diff --git a/goal_src/jak2/engine/target/mech_suit/grunt-mech.gc b/goal_src/jak2/engine/target/mech_suit/grunt-mech.gc index be3ae823e6..f79a169beb 100644 --- a/goal_src/jak2/engine/target/mech_suit/grunt-mech.gc +++ b/goal_src/jak2/engine/target/mech_suit/grunt-mech.gc @@ -7,3 +7,877 @@ ;; DECOMP BEGINS +(deftype grunt-mech-hold (structure) + ((reserve-mask uint8 :offset-assert 0) + (lower-hold int8 :offset-assert 1) + (grunt-handle handle :offset-assert 8) + (timeout uint64 :offset-assert 16) + (local-pos vector :inline :offset-assert 32) + (local-rot vector :inline :offset-assert 48) + (local-mat matrix :inline :offset-assert 64) + (world-mat matrix :inline :offset-assert 128) + ) + :method-count-assert 9 + :size-assert #xc0 + :flag-assert #x9000000c0 + ) + + +(deftype grunt-mech-info (basic) + ((reserved-mask uint8 :offset-assert 4) + (last-update-time time-frame :offset-assert 8) + (holds grunt-mech-hold 6 :inline :offset-assert 16) + ) + :method-count-assert 11 + :size-assert #x490 + :flag-assert #xb00000490 + (:methods + (grunt-mech-info-method-9 (_type_ int process symbol) symbol 9) + (grunt-mech-info-method-10 (_type_) none 10) + ) + ) + + +(define *grunt-mech-info* + (new 'static 'grunt-mech-info :holds (new 'static 'inline-array grunt-mech-hold 6 + (new 'static 'grunt-mech-hold + :reserve-mask #x11 + :lower-hold 4 + :local-pos (new 'static 'vector :x 163.84 :y 4874.24 :z 3522.56 :w 1.0) + :local-rot (new 'static 'vector :y 32768.0 :w 1.0) + ) + (new 'static 'grunt-mech-hold + :reserve-mask #x22 + :lower-hold 5 + :local-pos (new 'static 'vector :x 958.464 :y 4874.24 :z -2678.784 :w 1.0) + :local-rot (new 'static 'vector :w 1.0) + ) + (new 'static 'grunt-mech-hold + :reserve-mask #x4 + :lower-hold -1 + :local-pos (new 'static 'vector :x 3223.552 :y 4874.24 :z 217.088 :w 1.0) + :local-rot (new 'static 'vector :y 49152.0 :w 1.0) + ) + (new 'static 'grunt-mech-hold + :reserve-mask #x8 + :lower-hold -1 + :local-pos (new 'static 'vector :x -3170.304 :y 4874.24 :z 520.192 :w 1.0) + :local-rot (new 'static 'vector :y 16384.0 :w 1.0) + ) + (new 'static 'grunt-mech-hold + :reserve-mask #x11 + :lower-hold -1 + :local-pos (new 'static 'vector :x 516.096 :y 1929.216 :z 2449.408 :w 1.0) + :local-rot (new 'static 'vector :x -9975.308 :y 34955.266 :z -205.34613 :w 1.0) + ) + (new 'static 'grunt-mech-hold + :reserve-mask #x22 + :lower-hold -1 + :local-pos (new 'static 'vector :x 413.696 :y 1929.216 :z -1785.856 :w 1.0) + :local-rot (new 'static 'vector :x -10709.129 :y 1107.0122 :z 54.795376 :w 1.0) + ) + ) + ) + ) + +(let ((gp-0 *grunt-mech-info*)) + (set! (-> gp-0 last-update-time) 0) + (set! (-> gp-0 reserved-mask) (the-as uint 0)) + (countdown (s5-0 6) + (let ((s4-0 (-> gp-0 holds s5-0))) + (set! (-> s4-0 grunt-handle) (the-as handle #f)) + (set! (-> s4-0 timeout) (the-as uint 0)) + (matrix-rotate-xyz! (-> s4-0 local-mat) (-> s4-0 local-rot)) + (set! (-> s4-0 local-mat trans quad) (-> s4-0 local-pos quad)) + ) + ) + ) + +(defmethod grunt-mech-info-method-10 grunt-mech-info ((obj grunt-mech-info)) + (with-pp + (let ((s5-0 (-> pp clock frame-counter))) + (when (!= (-> obj last-update-time) s5-0) + (when (< s5-0 (-> obj last-update-time)) + (countdown (v1-4 6) + (let ((a0-4 (-> obj holds v1-4))) + (set! (-> a0-4 grunt-handle) (the-as handle #f)) + (set! (-> a0-4 timeout) (the-as uint 0)) + ) + 0 + ) + (set! (-> obj reserved-mask) (the-as uint 0)) + 0 + ) + (set! (-> obj last-update-time) s5-0) + (let ((v1-8 *target*)) + (cond + ((and v1-8 (logtest? (focus-status mech) (-> v1-8 focus-status))) + (let ((s4-0 (-> v1-8 manipy 0 node-list data 3))) + (dotimes (s3-0 6) + (let ((s2-0 (-> obj holds s3-0))) + (matrix*! (-> s2-0 world-mat) (-> s2-0 local-mat) (-> s4-0 bone transform)) + (vector-float*! (-> s2-0 world-mat trans) (-> s2-0 world-mat trans) (/ 1.0 (-> s2-0 world-mat trans w))) + (when (and (!= (-> s2-0 grunt-handle) #f) (>= s5-0 (the-as time-frame (-> s2-0 timeout)))) + (set! (-> s2-0 grunt-handle) (the-as handle #f)) + (logclear! (-> obj reserved-mask) (-> s2-0 reserve-mask)) + ) + ) + ) + ) + ) + (else + (countdown (v1-25 6) + (let ((a0-16 (-> obj holds v1-25))) + (set! (-> a0-16 grunt-handle) (the-as handle #f)) + (set! (-> a0-16 timeout) (the-as uint 0)) + ) + 0 + ) + (set! (-> obj reserved-mask) (the-as uint 0)) + 0 + ) + ) + ) + ) + ) + (none) + ) + ) + +(defmethod grunt-mech-info-method-9 grunt-mech-info ((obj grunt-mech-info) (arg0 int) (arg1 process) (arg2 symbol)) + (with-pp + (grunt-mech-info-method-10 obj) + (let ((v1-2 *target*)) + (when (and v1-2 + (logtest? (focus-status mech) (-> v1-2 focus-status)) + (zero? (logand (-> v1-2 focus-status) (focus-status dead ignore))) + ) + (let ((v1-8 (-> obj holds arg0))) + (when (and (!= (-> v1-8 grunt-handle) #f) (= (handle->process (-> v1-8 grunt-handle)) arg1)) + (set! (-> v1-8 timeout) (the-as uint (+ (-> pp clock frame-counter) (seconds 0.5)))) + (return #t) + ) + (when (not (logtest? (-> obj reserved-mask) (-> v1-8 reserve-mask))) + (when (not arg2) + (logior! (-> obj reserved-mask) (-> v1-8 reserve-mask)) + (set! (-> v1-8 grunt-handle) (process->handle arg1)) + (set! (-> v1-8 timeout) (the-as uint (+ (-> pp clock frame-counter) (seconds 0.5)))) + ) + #t + ) + ) + ) + ) + ) + ) + +(deftype grunt-mech (grunt) + ((hold-id int8 :offset-assert 692) + (dismount-dest vector :inline :offset-assert 704) + ) + :heap-base #x250 + :method-count-assert 196 + :size-assert #x2d0 + :flag-assert #xc4025002d0 + (:methods + (mech-lunge () _type_ :state 186) + (mech-hold () _type_ :state 187) + (mech-dismount () _type_ :state 188) + (mech-post-circling () _type_ :state 189) + (mech-pre-circling () _type_ :state 190) + (grunt-mech-method-191 (_type_) none 191) + (grunt-mech-method-192 (_type_) symbol 192) + (grunt-mech-method-193 (_type_) int 193) + (grunt-mech-method-194 (_type_) none 194) + (grunt-mech-method-195 (_type_ vector vector vector) symbol 195) + ) + ) + + +(defmethod enemy-method-55 grunt-mech ((obj grunt-mech)) + ((method-of-type grunt enemy-method-55) obj) + 0 + (none) + ) + +;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] +;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] +;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] +(defmethod grunt-mech-method-193 grunt-mech ((obj grunt-mech)) + (local-vars (f0-3 float) (sv-592 vector)) + (let ((s4-0 *grunt-mech-info*)) + (grunt-mech-info-method-10 s4-0) + (let ((gp-0 -1)) + (let ((f30-0 0.0) + (s3-0 (-> obj root-override2 trans)) + ) + (countdown (s2-0 4) + (let ((s1-0 (-> s4-0 holds s2-0))) + (when (grunt-mech-info-method-9 s4-0 s2-0 obj #t) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (set! sv-592 (new 'stack-no-clear 'vector)) + (set! (-> s0-0 quad) (-> s1-0 world-mat vector 2 quad)) + (set! (-> s0-0 y) 0.0) + (vector-normalize! s0-0 1.0) + (vector-! sv-592 (-> s1-0 world-mat trans) (-> obj root-override2 trans)) + (set! (-> sv-592 y) 0.0) + (vector-normalize! sv-592 1.0) + (let ((f0-2 (-> sv-592 x)) + (f1-0 (-> sv-592 y)) + (f2-0 (-> sv-592 z)) + (f3-0 (-> s0-0 x)) + (f4-0 (-> s0-0 y)) + (f5-0 (-> s0-0 z)) + ) + ;; (.mula.s f0-2 f3-0) + ;; (.madda.s f1-0 f4-0) + ;; (.madd.s f0-3 f2-0 f5-0) + ) + ) + (when (>= f0-3 0.0) + (let ((f0-5 (vector-vector-distance-squared (-> s1-0 world-mat trans) s3-0))) + (when (or (= gp-0 -1) (< f0-5 f30-0)) + (set! f30-0 f0-5) + (set! gp-0 s2-0) + ) + ) + ) + ) + ) + ) + ) + (when (!= gp-0 -1) + (let ((s3-1 (-> s4-0 holds gp-0 lower-hold))) + (when (!= s3-1 -1) + (if (and (or (zero? (get-rand-int obj 2)) + (>= 14336.0 (vector-vector-xz-distance-squared (-> obj root-override2 trans) (target-pos 0))) + ) + (grunt-mech-info-method-9 s4-0 s3-1 obj #t) + ) + (set! gp-0 s3-1) + ) + ) + ) + (let ((a1-9 (new 'stack-no-clear 'collide-query))) + (set! (-> a1-9 start-pos quad) (-> obj root-override2 trans quad)) + (set! (-> a1-9 start-pos y) (+ 6144.0 (-> a1-9 start-pos y))) + (vector-! + (-> a1-9 move-dist) + (the-as vector (+ (the-as uint (-> s4-0 holds 0 world-mat trans)) (* 192 gp-0))) + (-> a1-9 start-pos) + ) + (let ((v1-41 a1-9)) + (set! (-> v1-41 radius) 2048.0) + (set! (-> v1-41 collide-with) (collide-spec backgnd obstacle hit-by-others-list pusher)) + (set! (-> v1-41 ignore-process0) obj) + (set! (-> v1-41 ignore-process1) #f) + (set! (-> v1-41 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-41 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* a1-9) 0.0) + (set! gp-0 -1) + ) + ) + ) + gp-0 + ) + ) + ) + +(defmethod grunt-method-184 grunt-mech ((obj grunt-mech) (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 (enemy-method-107 obj))) + (when gp-0 + (cond + ((logtest? (focus-status mech) (-> gp-0 focus-status)) + (let ((v1-4 (get-trans gp-0 0)) + (a1-2 (new 'stack-no-clear 'vector)) + ) + (vector-! a1-2 v1-4 (-> obj root-override2 trans)) + (.lvf vf1 (&-> a1-2 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 ((f0-0 v1-5) + (f1-0 28672.0) + ) + (when (>= (* f1-0 f1-0) f0-0) + (let ((a1-3 (grunt-mech-method-193 obj))) + (cond + ((= a1-3 -1) + (go (method-of-object obj mech-pre-circling)) + ) + (else + (set! (-> obj hold-id) a1-3) + (grunt-mech-info-method-9 *grunt-mech-info* a1-3 obj #f) + (go (method-of-object obj mech-lunge)) + ) + ) + ) + ) + ) + gp-0 + ) + (else + ((method-of-type grunt grunt-method-184) obj arg0) + ) + ) + ) + ) + ) + ) + +(defstate mech-lunge (grunt-mech) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior grunt-mech) enemy-event-handler) + :enter (behavior () + (set! (-> self enemy-flags) (logior (enemy-flag actor-pause-backup) (-> self enemy-flags))) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-4 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (set! (-> self dismount-dest quad) (-> self root-override2 trans quad)) + (logclear! (-> self root-override2 nav-flags) (nav-flags has-root-sphere)) + (none) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (logior! (-> self root-override2 nav-flags) (nav-flags has-root-sphere)) + (none) + ) + :trans (behavior () + (grunt-mech-info-method-9 *grunt-mech-info* (-> self hold-id) self #f) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.07)) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (quaternion-copy! (the-as quaternion (-> gp-0 vector)) (-> self root-override2 quat)) + (set! (-> gp-0 vector 1 quad) (-> self root-override2 trans quad)) + (ja-no-eval :group! (-> self draw art-group data 48) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 48)) frames num-frames) -1)) + 0.769 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (let ((s5-0 *grunt-mech-info*)) + (grunt-mech-info-method-10 s5-0) + (let ((s5-1 (-> s5-0 holds (-> self hold-id)))) + (matrix->quaternion (the-as quaternion (-> gp-0 vector 2)) (-> s5-1 world-mat)) + (let ((f30-0 (lerp-scale 0.0 1.0 (ja-aframe-num 0) 0.0 6.0))) + (quaternion-slerp! + (-> self root-override2 quat) + (the-as quaternion (-> gp-0 vector)) + (the-as quaternion (-> gp-0 vector 2)) + f30-0 + ) + (vector-lerp! (-> self root-override2 trans) (-> gp-0 vector 1) (-> s5-1 world-mat trans) f30-0) + ) + ) + ) + (suspend) + (ja :num! (seek! max 0.769)) + ) + ) + (go-virtual mech-hold) + (none) + ) + :post (the-as (function none :behavior grunt-mech) nav-enemy-simple-post) + ) + +(defbehavior grunt-mech-hold-post grunt-mech () + (let ((gp-0 *grunt-mech-info*)) + (grunt-mech-info-method-10 gp-0) + (let ((v1-5 (-> gp-0 holds (-> self hold-id))) + (a0-2 (-> self root-override2)) + ) + (set! (-> a0-2 trans quad) (-> v1-5 world-mat trans quad)) + (matrix->quaternion (-> a0-2 quat) (-> v1-5 world-mat)) + ) + ) + (nav-enemy-simple-post) + (none) + ) + +(defmethod grunt-mech-method-195 grunt-mech ((obj grunt-mech) (arg0 vector) (arg1 vector) (arg2 vector)) + (local-vars (v1-13 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-avoid-spheres-params))) + (vector-! (-> s5-0 current-pos) (-> obj root-override2 trans) (-> obj nav state mesh bounds)) + (vector-normalize-copy! (-> s5-0 travel) arg0 (the-as float arg1)) + (set! (-> s5-0 pref-dir quad) (-> s5-0 travel quad)) + (avoid-spheres-1! (-> obj nav) s5-0) + (when (>= (fabs (vector-dot (the-as vector (-> s5-0 out-travel)) arg2)) 0.0) + (let ((t0-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-no-gaps + (-> obj nav) + (-> obj root-override2 trans) + (-> obj nav state current-poly) + (the-as vector (-> s5-0 out-travel)) + t0-0 + ) + ) + (.lvf vf1 (&-> (-> s5-0 out-travel) 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-13 vf1) + (let ((f0-3 v1-13) + (f1-1 14336.0) + ) + (when (>= f0-3 (* f1-1 f1-1)) + (let ((a1-3 (new 'stack-no-clear 'vector))) + (set! (-> a1-3 quad) (-> s5-0 out-travel 0 quad)) + (set! (-> a1-3 w) (-> obj nav-radius-backup)) + (when (not (add-root-sphere-to-hash! (-> obj nav) a1-3 #x80068)) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (vector+! s4-1 (-> obj root-override2 trans) (the-as vector (-> s5-0 out-travel))) + (let ((s5-1 (new 'stack-no-clear 'collide-query))) + (when (enemy-method-126 obj s5-1 s4-1 (the-as collide-spec (-> obj gnd-collide)) 4096.0 122880.0 1024.0) + (set! (-> s4-1 y) (-> s5-1 best-other-tri intersect y)) + (set! (-> obj dismount-dest quad) (-> s4-1 quad)) + #t + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +(defmethod grunt-mech-method-192 grunt-mech ((obj grunt-mech)) + (do-navigation-to-destination (-> obj nav state) (-> obj root-override2 trans)) + (let ((a1-1 *target*)) + (if (or (not a1-1) (zero? (logand (focus-status mech) (-> a1-1 focus-status)))) + (return #t) + ) + ) + (when (logtest? (-> obj nav state flags) (nav-state-flag in-mesh)) + (let ((s5-0 *grunt-mech-info*)) + (grunt-mech-info-method-10 s5-0) + (let* ((v1-15 (-> obj nav)) + (a0-7 (-> v1-15 state mesh sphere-hash sphere-array)) + (a1-3 (-> v1-15 sphere-id-array)) + (a2-1 (-> v1-15 state mesh bounds)) + (a3-0 (-> v1-15 root-nav-sphere)) + (t0-0 (-> v1-15 sphere-count)) + ) + (dotimes (t1-0 t0-0) + (let ((t3-0 (-> a0-7 (-> a1-3 t1-0))) + (t2-4 (-> v1-15 sphere-array t1-0)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) a2-1) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-0 w))) + ) + ) + ) + 0 + (let ((v1-22 (-> s5-0 holds (-> obj hold-id))) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (vector-negate! s5-1 (-> v1-22 world-mat vector 2)) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (countdown (s4-0 3) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-rotate-around-y! s3-0 s5-1 (get-rand-float-range obj -10922.667 10922.667)) + (when (grunt-mech-method-195 obj s3-0 (the-as vector (get-rand-float-range obj 16384.0 24576.0)) s5-1) + #t + (goto cfg-16) + ) + ) + ) + ) + ) + ) + (label cfg-16) + (let ((a0-15 (-> obj root-override2 trans))) + (if (or (>= 0.0 (- (-> a0-15 y) (-> obj dismount-dest y))) + (let ((f0-4 40960.0)) + (< (* f0-4 f0-4) (vector-vector-xz-distance-squared a0-15 (-> obj dismount-dest))) + ) + ) + (return #t) + ) + ) + #f + ) + +;; WARN: Return type mismatch object vs none. +(defmethod grunt-mech-method-194 grunt-mech ((obj grunt-mech)) + (with-pp + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer pp)) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'attack) + (set! (-> a1-0 param 0) (the-as uint #f)) + (let ((v1-3 (new 'static 'attack-info :mask (attack-info-mask mode id)))) + (let* ((a0-2 *game-info*) + (a2-1 (+ (-> a0-2 attack-id) 1)) + ) + (set! (-> a0-2 attack-id) a2-1) + (set! (-> v1-3 id) a2-1) + ) + (set! (-> v1-3 mode) 'grunt) + (set! (-> a1-0 param 1) (the-as uint v1-3)) + ) + (send-event-function *target* a1-0) + ) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod grunt-mech-method-191 grunt-mech ((obj grunt-mech)) + (with-pp + (if (>= (-> pp clock frame-counter) (the-as time-frame (-> obj state-timeout))) + (go (method-of-object obj mech-dismount)) + ) + (none) + ) + ) + +(defstate mech-hold (grunt-mech) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior grunt-mech) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self enemy-flags) (logior (enemy-flag actor-pause-backup) (-> self enemy-flags))) + (set! (-> self root-override2 root-prim prim-core collide-as) (collide-spec)) + (enemy-method-110 self) + (set! (-> self state-timeout) + (the-as uint (+ (-> self clock frame-counter) (get-rand-int-range self 450 900))) + ) + (logclear! (-> self root-override2 nav-flags) (nav-flags has-root-sphere)) + (none) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (let ((v1-3 (-> self root-override2 root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root-override2 backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root-override2 backup-collide-with)) + ) + (logior! (-> self root-override2 nav-flags) (nav-flags has-root-sphere)) + (none) + ) + :trans (behavior () + (if (or (not (grunt-mech-info-method-9 *grunt-mech-info* (-> self hold-id) self #f)) (grunt-mech-method-192 self)) + (go-virtual mech-dismount) + ) + (none) + ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 49) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 49)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (grunt-mech-method-191 self) + (let ((gp-0 0)) + 0 + (until #f + (set! gp-0 (enemy-method-120 self 3 (ash 1 gp-0))) + (let ((v1-30 gp-0)) + (cond + ((zero? v1-30) + (ja-channel-push! 1 (seconds 0.13)) + (countdown (s5-0 (get-rand-int-range self 1 2)) + (let ((s4-0 #t)) + (ja-no-eval :group! (-> self draw art-group data 51) :num! (seek! (ja-aframe 17.0 0) 0.222) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 17.0 0) 0.222)) + ) + (ja-no-eval :group! (-> self draw art-group data 51) + :num! (seek! (ja-aframe 20.0 0)) + :frame-num (ja-aframe 17.0 0) + ) + (until (ja-done? 0) + (when (and s4-0 (>= (ja-aframe-num 0) 18.5)) + (grunt-mech-method-194 self) + (set! s4-0 #f) + ) + (suspend) + (ja :num! (seek! (ja-aframe 20.0 0))) + ) + ) + (grunt-mech-method-191 self) + ) + ) + ((= v1-30 1) + (ja-channel-push! 1 (seconds 0.13)) + (countdown (s5-1 (get-rand-int-range self 1 3)) + (let ((s4-1 #t)) + (ja-no-eval :group! (-> self draw art-group data 52) :num! (seek! (ja-aframe 24.0 0) 0.568) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 24.0 0) 0.568)) + ) + (ja-no-eval :group! (-> self draw art-group data 52) + :num! (seek! (ja-aframe 28.0 0) 2.0) + :frame-num (ja-aframe 24.0 0) + ) + (until (ja-done? 0) + (when (and s4-1 (>= (ja-aframe-num 0) 27.0)) + (grunt-mech-method-194 self) + (set! s4-1 #f) + ) + (suspend) + (ja :num! (seek! (ja-aframe 28.0 0) 2.0)) + ) + ) + (grunt-mech-method-191 self) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.13)) + (countdown (s5-2 (get-rand-int-range self 1 3)) + (let ((s4-2 #t)) + (ja-no-eval :group! (-> self draw art-group data 53) :num! (seek! (ja-aframe 30.0 0) 0.111) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 30.0 0) 0.111)) + ) + (ja-no-eval :group! (-> self draw art-group data 53) + :num! (seek! (ja-aframe 32.0 0) 0.5) + :frame-num (ja-aframe 30.0 0) + ) + (until (ja-done? 0) + (when (and s4-2 (>= (ja-aframe-num 0) 31.0)) + (grunt-mech-method-194 self) + (set! s4-2 #f) + ) + (suspend) + (ja :num! (seek! (ja-aframe 32.0 0) 0.5)) + ) + ) + (grunt-mech-method-191 self) + ) + ) + ) + ) + (when (= (get-rand-int self 4) 3) + (ja-channel-push! 1 (seconds 0.13)) + (ja-no-eval :group! (-> self draw art-group data 50) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 50)) frames num-frames) -1)) + 0.090909 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.090909)) + ) + (grunt-mech-method-191 self) + ) + ) + ) + #f + (none) + ) + :post grunt-mech-hold-post + ) + +(defstate mech-dismount (grunt-mech) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior grunt-mech) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self root-override2 root-prim prim-core collide-as) (collide-spec)) + (let* ((v1-4 (-> self nav)) + (a1-0 (-> self dismount-dest)) + (f0-0 (-> v1-4 extra-nav-sphere w)) + ) + (set! (-> v1-4 extra-nav-sphere quad) (-> a1-0 quad)) + (set! (-> v1-4 extra-nav-sphere w) f0-0) + ) + 0 + (let ((v1-7 (-> self nav))) + (set! (-> v1-7 extra-nav-sphere w) (-> self nav-radius-backup)) + ) + 0 + (let ((v1-9 (-> self nav))) + (logior! (-> v1-9 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (logclear! (-> self root-override2 nav-flags) (nav-flags has-root-sphere)) + (none) + ) + :exit (behavior () + (let ((v1-1 (-> self root-override2 root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self root-override2 backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self root-override2 backup-collide-with)) + ) + (let ((v1-2 (-> self nav))) + (logclear! (-> v1-2 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (logior! (-> self root-override2 nav-flags) (nav-flags has-root-sphere)) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.07)) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (vector-! (-> gp-0 vector 1) (-> self root-override2 trans) (-> self dismount-dest)) + (set! (-> gp-0 vector 1 y) 0.0) + (vector-normalize! (-> gp-0 vector 1) 1.0) + (quaternion-look-at! (the-as quaternion (-> gp-0 vector 2)) (-> gp-0 vector 1) *up-vector*) + (quaternion-copy! (the-as quaternion (-> gp-0 vector)) (-> self root-override2 quat)) + (set! (-> gp-0 vector 1 quad) (-> self root-override2 trans quad)) + (ja-no-eval :group! (-> self draw art-group data 54) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 54)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (let ((f30-0 (lerp-scale 0.0 1.0 (ja-aframe-num 0) 33.0 41.0))) + (quaternion-slerp! + (-> self root-override2 quat) + (the-as quaternion (-> gp-0 vector)) + (the-as quaternion (-> gp-0 vector 2)) + f30-0 + ) + (vector-lerp! (-> self root-override2 trans) (-> gp-0 vector 1) (-> self dismount-dest) f30-0) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((v1-32 (-> self root-override2 root-prim))) + (set! (-> v1-32 prim-core collide-as) (-> self root-override2 backup-collide-as)) + (set! (-> v1-32 prim-core collide-with) (-> self root-override2 backup-collide-with)) + ) + (let ((v1-33 (-> self nav))) + (logclear! (-> v1-33 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (let ((v1-37 (-> self nav state))) + (set! (-> v1-37 current-poly) (the-as nav-poly #f)) + ) + 0 + (logclear! (-> self nav state flags) (nav-state-flag at-target)) + (ja-no-eval :group! (-> self draw art-group data 55) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 55)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.13)) + (go-virtual mech-post-circling) + (none) + ) + :post (the-as (function none :behavior grunt-mech) nav-enemy-simple-post) + ) + +(defstate mech-post-circling (grunt-mech) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior grunt-mech) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type grunt circling) enter)) + (set! (-> self state-timeout) + (the-as uint (+ (-> self clock frame-counter) (get-rand-int-range self 750 1200))) + ) + (none) + ) + :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 (enemy-method-107 self))) + (set! (-> self starting-time) (the-as uint (-> self clock frame-counter))) + ) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self reaction-time))) + (when (>= 1 (the-as int gp-1)) + (nav-enemy-method-161 self) + (if (-> self enemy-info-override use-stop-chase) + (go-virtual stop-chase) + (go-virtual active) + ) + ) + (when (= gp-1 (enemy-aware enemy-aware-3)) + (let ((v1-33 (enemy-method-107 self))) + (when v1-33 + (cond + ((logtest? (focus-status mech) (-> v1-33 focus-status)) + (when (>= (-> self clock frame-counter) (the-as time-frame (-> self state-timeout))) + (nav-enemy-method-161 self) + (go-hostile self) + ) + ) + (else + (when (>= (- (-> self clock frame-counter) (the-as int (-> self starting-time))) + (the-as time-frame (-> self reaction-time)) + ) + (nav-enemy-method-161 self) + (go-hostile self) + ) + ) + ) + ) + ) + ) + (if (= gp-1 (enemy-aware enemy-aware-2)) + (go-stare self) + ) + (if (or (nav-enemy-method-163 self) (logtest? (enemy-flag enemy-flag41) (-> self enemy-flags))) + (go-stare2 self) + ) + ) + ) + (none) + ) + :code (-> (method-of-type grunt circling) code) + :post (-> (method-of-type grunt circling) post) + ) + +(defstate mech-pre-circling (grunt-mech) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior grunt-mech) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type grunt-mech mech-post-circling) enter)) + (set! (-> self state-timeout) + (the-as uint (+ (-> self clock frame-counter) (get-rand-int-range self 900 1800))) + ) + (none) + ) + :trans (-> (method-of-type grunt-mech mech-post-circling) trans) + :code (-> (method-of-type grunt-mech mech-post-circling) code) + :post (-> (method-of-type grunt-mech mech-post-circling) post) + ) diff --git a/goal_src/jak2/engine/target/target-h.gc b/goal_src/jak2/engine/target/target-h.gc index 7e59a9a5e8..de867e8c81 100644 --- a/goal_src/jak2/engine/target/target-h.gc +++ b/goal_src/jak2/engine/target/target-h.gc @@ -15,6 +15,7 @@ (declare-type gun-info basic) (declare-type darkjak-info basic) (declare-type mech-info basic) +(declare-type indax-info basic) (declare-type sparticle-launcher basic) ;; NOTE - for level-info, defined in `logic-target` @@ -197,7 +198,7 @@ (leg-ik joint-mod-ik 2 :offset-assert 256) (foot joint-mod 2 :offset-assert 264) (mech-ik joint-mod-ik 2 :offset-assert 272) - (init-time time-frame :offset 272) + (init-time time-frame :offset 272) (teleport-time time-frame :offset-assert 280) (state-hook-time time-frame :offset-assert 288) (state-hook (function none :behavior target) :offset-assert 296) @@ -245,7 +246,7 @@ (mech mech-info :offset-assert 2216) (turret basic :offset-assert 2220) (darkjak darkjak-info :offset-assert 2224) - (indax basic :offset-assert 2228) + (indax indax-info :offset-assert 2228) ) :heap-base #x840 :method-count-assert 29 diff --git a/goal_src/jak2/game.gp b/goal_src/jak2/game.gp index c6ff742393..e0abce1535 100644 --- a/goal_src/jak2/game.gp +++ b/goal_src/jak2/game.gp @@ -3861,6 +3861,8 @@ "ruins-vis" ) +(copy-strs "RUB1" "RUBW1" "RUBW2" "RUBW3" "RUBW4" "RUBW5" "RUBW6" "RUDPA1" "RUPC1" "RUPC2") + ;; ;;;;;;;;;;;;;;;;;;;;; ;; ;; SAG ;; ;;;;;;;;;;;;;;;;;;;;; @@ -4388,26 +4390,26 @@ ;; ;; TOE ;; ;;;;;;;;;;;;;;;;;;;;; -;; (cgo "TOE.DGO" "toe.gd") +(cgo "TOE.DGO" "toe.gd") -;; (goal-src-sequence -;; "" -;; :deps ("$OUT/obj/los-control.o") -;; "levels/mars_tomb/left/chase/target-indax.gc" -;; "levels/mars_tomb/left/chase/tomb-boulder.gc" -;; ) +(goal-src-sequence + "" + :deps ("$OUT/obj/los-control.o") + "levels/mars_tomb/left/chase/target-indax.gc" + "levels/mars_tomb/left/chase/tomb-boulder.gc" + ) -;; (copy-textures 2374 2375 2376) +(copy-textures 2374 2375 2376) -;; (copy-gos -;; "jak-indax+0-ag" -;; "tomb-boulder-ag" -;; "tomb-baby-spider-ag" -;; "tomb-plat-pillar-ag" -;; "spider-eyes-ag" -;; "tomb-bounce-web-ag" -;; "tombe-vis" -;; ) +(copy-gos + "jak-indax+0-ag" + "tomb-boulder-ag" + ;; "tomb-baby-spider-ag" + "tomb-plat-pillar-ag" + "spider-eyes-ag" + "tomb-bounce-web-ag" + "tombe-vis" + ) ;; ;;;;;;;;;;;;;;;;;;;;; ;; ;; TOMBEXT diff --git a/goal_src/jak2/levels/city/common/vehicle-effects.gc b/goal_src/jak2/levels/city/common/vehicle-effects.gc index 0390abf03b..ab682d7be2 100644 --- a/goal_src/jak2/levels/city/common/vehicle-effects.gc +++ b/goal_src/jak2/levels/city/common/vehicle-effects.gc @@ -194,7 +194,7 @@ :color (new 'static 'rgbaf :x 255.0 :y 128.0 :w 16.0) :fade-a -0.0000122044 :fade-b 8.997864 - :tex-id #xc0bb00 + :tex-id (new 'static 'texture-id :index #xbb :page #xc) ) ) @@ -206,7 +206,7 @@ :color (new 'static 'rgbaf :x 255.0 :y 64.0 :w 16.0) :fade-a -0.0000122044 :fade-b 8.997864 - :tex-id #xc0bc00 + :tex-id (new 'static 'texture-id :index #xbc :page #xc) ) ) @@ -217,7 +217,7 @@ :color (new 'static 'rgbaf :x 255.0 :y 64.0 :w 16.0) :fade-a -0.0000122044 :fade-b 8.997864 - :tex-id #xc0ca00 + :tex-id (new 'static 'texture-id :index #xca :page #xc) ) ) @@ -269,11 +269,7 @@ (set! (-> s3-1 1 normal w) f0-14) (set! (-> s3-1 1 normal x) (* 0.025 f0-14)) ) - *simple-sprite-system* - (let ((t9-4 (method-of-type simple-sprite-system add!))) - (-> s3-1 1) - (t9-4) - ) + (add! *simple-sprite-system* (the-as dma-buffer (-> s3-1 1))) (forward-up->quaternion (the-as quaternion (-> s3-1 0)) arg1 (the-as vector (-> obj rbody state matrix))) (quaternion-rotate-local-x! (the-as quaternion (-> s3-1 0)) (the-as quaternion (-> s3-1 0)) 32768.0) (let ((v1-16 (-> s3-1 0 normal))) @@ -387,8 +383,7 @@ (set! (-> s4-0 color x) 255.0) (set! (-> s4-0 color y) (rand-vu-float-range 192.0 255.0)) (set! (-> s4-0 color w) (* f30-1 (rand-vu-float-range 16.0 18.0))) - *simple-sprite-system* - ((method-of-type simple-sprite-system add!)) + (add! *simple-sprite-system* (the-as dma-buffer s4-0)) (let ((f0-21 (-> obj camera-dist2)) (f1-6 245760.0) ) @@ -401,8 +396,7 @@ (set! (-> s4-0 fade-b) 2.3332994) (set! (-> s4-0 color z) (rand-vu-float-range 128.0 160.0)) (set! (-> s4-0 color w) (* f30-1 (rand-vu-float-range 32.0 36.0))) - *simple-sprite-system* - ((method-of-type simple-sprite-system add!)) + (add! *simple-sprite-system* (the-as dma-buffer s4-0)) ) ) ) @@ -422,8 +416,7 @@ (set! (-> s4-1 rot-angle) (* 182.04445 (rand-vu-float-range -4.0 4.0))) (set! (-> s4-1 color y) (* 64.0 (rand-vu))) (set! (-> s4-1 color w) (* f30-1 (rand-vu-float-range 16.0 21.0))) - *simple-sprite-system* - ((method-of-type simple-sprite-system add!)) + (add! *simple-sprite-system* (the-as dma-buffer s4-1)) ) ) ) diff --git a/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc b/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc index ce24977902..017f687ea1 100644 --- a/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc +++ b/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc @@ -117,109 +117,115 @@ ) ) -(define *amphibian-nav-enemy-info* (new 'static 'nav-enemy-info - :use-die-falling #t - :use-victory #f - :use-jump-blocked #t - :debug-draw-neck #f - :jump-debug-draw #f - :move-to-ground #t - :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1010401 #x0 #x0 #x0) - :idle-anim 4 - :notice-anim 28 - :hostile-anim 26 - :hit-anim 6 - :knocked-anim 6 - :knocked-land-anim 7 - :die-anim 12 - :die-falling-anim 21 - :victory-anim -1 - :jump-wind-up-anim 30 - :jump-in-air-anim 31 - :jump-land-anim 32 - :neck-joint 11 - :look-at-joint 12 - :bullseye-joint 4 - :sound-hit (static-sound-name "amphibian-hit") - :sound-die (static-sound-name "amphibian-die") - :notice-distance (meters 40) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 20) - :default-hit-points 4 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #x11fffdffa - :movement-gravity (meters -100) - :friction 0.8 - :attack-shove-back (meters 3.5) - :attack-shove-up (meters 2) - :attack-mode 'generic - :attack-damage 1 - :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) - :jump-height-min (meters 3) - :jump-height-factor 0.5 - :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 106496.0 - :knocked-soft-vxz-hi 94208.0 - :knocked-soft-vy-lo 122880.0 - :knocked-soft-vy-hi 139264.0 - :knocked-medium-vxz-lo 106496.0 - :knocked-medium-vxz-hi 94208.0 - :knocked-medium-vy-lo 122880.0 - :knocked-medium-vy-hi 139264.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 - :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) - :callback-info #f - :use-momentum #t - :use-frustration #t - :use-stop-chase #t - :use-circling #t - :use-pacing #t - :walk-anim 16 - :turn-anim -1 - :run-anim 26 - :taunt-anim -1 - :run-travel-speed (meters 6) - :run-acceleration (meters 8) - :run-turning-acceleration (meters 10) - :walk-travel-speed (meters 3) - :walk-acceleration (meters 4) - :walk-turning-acceleration (meters 3) - :maximum-rotation-rate (degrees 180.0) - :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 - ) - ) +(define *amphibian-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #t + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 28 + :hostile-anim 26 + :hit-anim 6 + :knocked-anim 6 + :knocked-land-anim 7 + :die-anim 12 + :die-falling-anim 21 + :victory-anim -1 + :jump-wind-up-anim 30 + :jump-in-air-anim 31 + :jump-land-anim 32 + :neck-joint 11 + :look-at-joint 12 + :bullseye-joint 4 + :sound-hit (static-sound-name "amphibian-hit") + :sound-die (static-sound-name "amphibian-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 4 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #x11fffdffa + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 1 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 106496.0 + :knocked-soft-vxz-hi 94208.0 + :knocked-soft-vy-lo 122880.0 + :knocked-soft-vy-hi 139264.0 + :knocked-medium-vxz-lo 106496.0 + :knocked-medium-vxz-hi 94208.0 + :knocked-medium-vy-lo 122880.0 + :knocked-medium-vy-hi 139264.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 + :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) + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #t + :use-circling #t + :use-pacing #t + :walk-anim 16 + :turn-anim -1 + :run-anim 26 + :taunt-anim -1 + :run-travel-speed (meters 6) + :run-acceleration (meters 8) + :run-turning-acceleration (meters 10) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 4) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 180.0) + :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! (-> *amphibian-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/goal_src/jak2/levels/common/enemy/baby_spider/tomb-baby-spider.gc b/goal_src/jak2/levels/common/enemy/baby_spider/tomb-baby-spider.gc index 4da375cacd..df7de1ef67 100644 --- a/goal_src/jak2/levels/common/enemy/baby_spider/tomb-baby-spider.gc +++ b/goal_src/jak2/levels/common/enemy/baby_spider/tomb-baby-spider.gc @@ -35,7 +35,12 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1e0002 #x64640401 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x64 :param1 #x64) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 4 :notice-anim 5 :hostile-anim 8 diff --git a/goal_src/jak2/levels/common/enemy/fodder/fodder.gc b/goal_src/jak2/levels/common/enemy/fodder/fodder.gc index 4bf26c0411..731ea6fe46 100644 --- a/goal_src/jak2/levels/common/enemy/fodder/fodder.gc +++ b/goal_src/jak2/levels/common/enemy/fodder/fodder.gc @@ -69,109 +69,115 @@ ) ) -(define *fodder-nav-enemy-info* (new 'static 'nav-enemy-info - :use-die-falling #t - :use-victory #f - :use-jump-blocked #t - :debug-draw-neck #f - :jump-debug-draw #f - :move-to-ground #t - :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1010401 #x0 #x0 #x0) - :idle-anim 6 - :notice-anim 13 - :hostile-anim 7 - :hit-anim 13 - :knocked-anim 16 - :knocked-land-anim 17 - :die-anim 14 - :die-falling-anim 21 - :victory-anim 6 - :jump-wind-up-anim 7 - :jump-in-air-anim 7 - :jump-land-anim 7 - :neck-joint 5 - :look-at-joint 5 - :bullseye-joint 4 - :sound-hit (static-sound-name "fodder-hit") - :sound-die (static-sound-name "fodder-die") - :notice-distance (meters 40) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 40) - :default-hit-points 1 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #x11fffdffa - :movement-gravity (meters -100) - :friction 0.8 - :attack-shove-back (meters 3) - :attack-shove-up (meters 2) - :attack-mode 'generic - :attack-damage 1 - :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) - :jump-height-min (meters 3) - :jump-height-factor 0.5 - :knocked-seek-ry-clamp 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 - :shadow-size (meters 2) - :shadow-max-y (meters 1) - :shadow-min-y (meters -1) - :shadow-locus-dist (meters 150) - :gem-joint -1 - :gem-offset (new 'static 'sphere :r 163840.0) - :callback-info #f - :use-momentum #f - :use-frustration #t - :use-stop-chase #f - :use-circling #t - :use-pacing #t - :walk-anim 12 - :turn-anim 7 - :run-anim 7 - :taunt-anim -1 - :run-travel-speed (meters 7.5) - :run-acceleration (meters 1) - :run-turning-acceleration (meters 100) - :walk-travel-speed (meters 4) - :walk-acceleration (meters 1) - :walk-turning-acceleration (meters 3) - :maximum-rotation-rate (degrees 360.0) - :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 - ) - ) +(define *fodder-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #t + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 6 + :notice-anim 13 + :hostile-anim 7 + :hit-anim 13 + :knocked-anim 16 + :knocked-land-anim 17 + :die-anim 14 + :die-falling-anim 21 + :victory-anim 6 + :jump-wind-up-anim 7 + :jump-in-air-anim 7 + :jump-land-anim 7 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :sound-hit (static-sound-name "fodder-hit") + :sound-die (static-sound-name "fodder-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 40) + :default-hit-points 1 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #x11fffdffa + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 1 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 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 + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 12 + :turn-anim 7 + :run-anim 7 + :taunt-anim -1 + :run-travel-speed (meters 7.5) + :run-acceleration (meters 1) + :run-turning-acceleration (meters 100) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 360.0) + :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! (-> *fodder-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc b/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc index 7b190266e3..218661d383 100644 --- a/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc +++ b/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc @@ -79,109 +79,115 @@ ) ) -(define *crimson-guard-level-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 'array uint32 4 #x1010401 #x0 #x0 #x0) - :idle-anim 4 - :notice-anim 7 - :hostile-anim 6 - :hit-anim 4 - :knocked-anim 8 - :knocked-land-anim 9 - :die-anim 17 - :die-falling-anim 39 - :victory-anim 4 - :jump-wind-up-anim 5 - :jump-in-air-anim 5 - :jump-land-anim 5 - :neck-joint 6 - :look-at-joint 6 - :bullseye-joint 5 - :sound-hit (static-sound-name "guard-hit") - :sound-die (static-sound-name "guard-die") - :notice-distance (meters 150) - :notice-distance-delta (meters 40) - :proximity-notice-distance (meters 4) - :default-hit-points 4 - :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list pusher) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #xffffffffffffffff - :movement-gravity (meters -100) - :friction 0.5 - :attack-shove-back (meters 3) - :attack-shove-up (meters 2) - :attack-mode 'generic - :attack-damage 2 - :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) - :jump-height-min (meters 3) - :jump-height-factor 0.5 - :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 53248.0 - :knocked-soft-vy-lo 61440.0 - :knocked-soft-vy-hi 61440.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 40960.0 - :knocked-hard-vxz-hi 61440.0 - :knocked-hard-vy-lo 98304.0 - :knocked-hard-vy-hi 106496.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 32768.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 32768.0 - :knocked-yellow-vy-hi 49152.0 - :knocked-red-vxz-lo 65536.0 - :knocked-red-vxz-hi 81920.0 - :knocked-red-vy-lo 61440.0 - :knocked-red-vy-hi 61440.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 - :shadow-size (meters 2) - :shadow-max-y (meters 1) - :shadow-min-y (meters -1) - :shadow-locus-dist (meters 150) - :gem-joint -1 - :gem-offset (new 'static 'sphere :r 163840.0) - :callback-info #f - :use-momentum #f - :use-frustration #t - :use-stop-chase #f - :use-circling #f - :use-pacing #f - :walk-anim 5 - :turn-anim 5 - :run-anim 6 - :taunt-anim -1 - :run-travel-speed (meters 12) - :run-acceleration (meters 2) - :run-turning-acceleration (meters 50) - :walk-travel-speed (meters 3) - :walk-acceleration (meters 1) - :walk-turning-acceleration (meters 8) - :maximum-rotation-rate (degrees 720.0) - :notice-nav-radius (meters 5) - :frustration-distance (meters 8) - :frustration-time (seconds 2) - :blocked-time (seconds 0.3) - :circle-dist-lo 20480.0 - :circle-dist-hi 61440.0 - :nav-mesh #f - ) - ) +(define *crimson-guard-level-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 7 + :hostile-anim 6 + :hit-anim 4 + :knocked-anim 8 + :knocked-land-anim 9 + :die-anim 17 + :die-falling-anim 39 + :victory-anim 4 + :jump-wind-up-anim 5 + :jump-in-air-anim 5 + :jump-land-anim 5 + :neck-joint 6 + :look-at-joint 6 + :bullseye-joint 5 + :sound-hit (static-sound-name "guard-hit") + :sound-die (static-sound-name "guard-die") + :notice-distance (meters 150) + :notice-distance-delta (meters 40) + :proximity-notice-distance (meters 4) + :default-hit-points 4 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list pusher) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #xffffffffffffffff + :movement-gravity (meters -100) + :friction 0.5 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 53248.0 + :knocked-soft-vy-lo 61440.0 + :knocked-soft-vy-hi 61440.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 40960.0 + :knocked-hard-vxz-hi 61440.0 + :knocked-hard-vy-lo 98304.0 + :knocked-hard-vy-hi 106496.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 32768.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 32768.0 + :knocked-yellow-vy-hi 49152.0 + :knocked-red-vxz-lo 65536.0 + :knocked-red-vxz-hi 81920.0 + :knocked-red-vy-lo 61440.0 + :knocked-red-vy-hi 61440.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 65536.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 5 + :turn-anim 5 + :run-anim 6 + :taunt-anim -1 + :run-travel-speed (meters 12) + :run-acceleration (meters 2) + :run-turning-acceleration (meters 50) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 720.0) + :notice-nav-radius (meters 5) + :frustration-distance (meters 8) + :frustration-time (seconds 2) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) (set! (-> *crimson-guard-level-info* fact-defaults) *crimson-guard-fact*) @@ -194,7 +200,12 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1010401 #x0 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 4 :notice-anim 7 :hostile-anim 6 @@ -301,7 +312,12 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1010401 #x0 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 4 :notice-anim 7 :hostile-anim 6 @@ -408,7 +424,12 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1010401 #x0 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 4 :notice-anim 7 :hostile-anim 6 @@ -515,7 +536,12 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1010401 #x0 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 4 :notice-anim 7 :hostile-anim 6 diff --git a/goal_src/jak2/levels/common/enemy/hopper.gc b/goal_src/jak2/levels/common/enemy/hopper.gc index 0c686fbbd6..7703284c23 100644 --- a/goal_src/jak2/levels/common/enemy/hopper.gc +++ b/goal_src/jak2/levels/common/enemy/hopper.gc @@ -169,7 +169,16 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 8 #x5010401 #x1010501 #x5010401 #x1010601 #x0 #x0 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 8 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x5) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x5) + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 4 :notice-anim 7 :hostile-anim 4 diff --git a/goal_src/jak2/levels/common/enemy/metalhead_bearer/centurion.gc b/goal_src/jak2/levels/common/enemy/metalhead_bearer/centurion.gc index 47a57ef799..4bacd254f8 100644 --- a/goal_src/jak2/levels/common/enemy/metalhead_bearer/centurion.gc +++ b/goal_src/jak2/levels/common/enemy/metalhead_bearer/centurion.gc @@ -239,111 +239,117 @@ ) ) -(define *centurion-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 'array uint32 4 #x1010601 #x0 #x0 #x0) - :idle-anim 6 - :notice-anim 8 - :hostile-anim 13 - :hit-anim 16 - :knocked-anim 21 - :knocked-land-anim 22 - :die-anim 34 - :die-falling-anim 23 - :victory-anim 4 - :jump-wind-up-anim -1 - :jump-in-air-anim -1 - :jump-land-anim -1 - :neck-joint 8 - :look-at-joint 8 - :bullseye-joint 5 - :sound-hit (static-sound-name "centurion-hit") - :sound-die (static-sound-name "centurion-die") - :notice-distance (meters 100) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 100) - :default-hit-points 3 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #xffffffffffffffff - :movement-gravity (meters -100) - :friction 0.1 - :attack-shove-back (meters 3) - :attack-shove-up (meters 2) - :attack-mode 'generic - :attack-damage 2 - :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) - :jump-height-min (meters 3) - :jump-height-factor 0.5 - :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 65536.0 - :knocked-soft-vy-lo 32768.0 - :knocked-soft-vy-hi 49152.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 16384.0 - :knocked-yellow-vxz-hi 32768.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 20480.0 - :knocked-blue-vy-hi 40960.0 - :shadow-size (meters 1) - :shadow-max-y (meters 1) - :shadow-min-y (meters -1) - :shadow-locus-dist (meters 150) - :gem-joint 8 - :gem-seg #x2 - :gem-no-seg #x4 - :gem-offset (new 'static 'sphere :y 1843.2 :z 1146.88 :r 163840.0) - :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 -1 - :taunt-anim -1 - :run-travel-speed (meters 6) - :run-acceleration (meters 1) - :run-turning-acceleration (meters 2) - :walk-travel-speed (meters 1.8) - :walk-acceleration (meters 1) - :walk-turning-acceleration (meters 16) - :maximum-rotation-rate (degrees 720.0) - :notice-nav-radius (meters 100) - :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 - ) - ) +(define *centurion-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 6 + :notice-anim 8 + :hostile-anim 13 + :hit-anim 16 + :knocked-anim 21 + :knocked-land-anim 22 + :die-anim 34 + :die-falling-anim 23 + :victory-anim 4 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 8 + :look-at-joint 8 + :bullseye-joint 5 + :sound-hit (static-sound-name "centurion-hit") + :sound-die (static-sound-name "centurion-die") + :notice-distance (meters 100) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 100) + :default-hit-points 3 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #xffffffffffffffff + :movement-gravity (meters -100) + :friction 0.1 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 65536.0 + :knocked-soft-vy-lo 32768.0 + :knocked-soft-vy-hi 49152.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 16384.0 + :knocked-yellow-vxz-hi 32768.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 20480.0 + :knocked-blue-vy-hi 40960.0 + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 8 + :gem-seg #x2 + :gem-no-seg #x4 + :gem-offset (new 'static 'sphere :y 1843.2 :z 1146.88 :r 163840.0) + :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 -1 + :taunt-anim -1 + :run-travel-speed (meters 6) + :run-acceleration (meters 1) + :run-turning-acceleration (meters 2) + :walk-travel-speed (meters 1.8) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 16) + :maximum-rotation-rate (degrees 720.0) + :notice-nav-radius (meters 100) + :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! (-> *centurion-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/goal_src/jak2/levels/common/enemy/metalhead_brown/metalmonk.gc b/goal_src/jak2/levels/common/enemy/metalhead_brown/metalmonk.gc index c66ab0f28e..41cac14300 100644 --- a/goal_src/jak2/levels/common/enemy/metalhead_brown/metalmonk.gc +++ b/goal_src/jak2/levels/common/enemy/metalhead_brown/metalmonk.gc @@ -76,109 +76,115 @@ ) ) -(define *metalmonk-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 'array uint32 4 #x1010501 #x0 #x0 #x0) - :idle-anim 5 - :notice-anim 10 - :hostile-anim 12 - :hit-anim -1 - :knocked-anim 16 - :knocked-land-anim 17 - :die-anim 32 - :die-falling-anim 33 - :victory-anim 22 - :jump-wind-up-anim 12 - :jump-in-air-anim 12 - :jump-land-anim 12 - :neck-joint 7 - :look-at-joint 7 - :bullseye-joint 4 - :sound-hit (static-sound-name "metalmonk-hit") - :sound-die (static-sound-name "metalmonk-die") - :notice-distance (meters 40) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 40) - :default-hit-points 4 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #xffffffffffffffff - :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) - :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 - :shadow-size (meters 2) - :shadow-max-y (meters 1) - :shadow-min-y (meters -1) - :shadow-locus-dist (meters 150) - :gem-joint 7 - :gem-offset (new 'static 'sphere :r 163840.0) - :callback-info #f - :use-momentum #t - :use-frustration #t - :use-stop-chase #f - :use-circling #t - :use-pacing #t - :walk-anim 8 - :turn-anim -1 - :run-anim 12 - :taunt-anim 22 - :run-travel-speed (meters 7) - :run-acceleration (meters 7) - :run-turning-acceleration (meters 20) - :walk-travel-speed (meters 2) - :walk-acceleration (meters 3) - :walk-turning-acceleration (meters 3) - :maximum-rotation-rate (degrees 360.0) - :notice-nav-radius (meters 1) - :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 - ) - ) +(define *metalmonk-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 10 + :hostile-anim 12 + :hit-anim -1 + :knocked-anim 16 + :knocked-land-anim 17 + :die-anim 32 + :die-falling-anim 33 + :victory-anim 22 + :jump-wind-up-anim 12 + :jump-in-air-anim 12 + :jump-land-anim 12 + :neck-joint 7 + :look-at-joint 7 + :bullseye-joint 4 + :sound-hit (static-sound-name "metalmonk-hit") + :sound-die (static-sound-name "metalmonk-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 40) + :default-hit-points 4 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #xffffffffffffffff + :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) + :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 + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 7 + :gem-offset (new 'static 'sphere :r 163840.0) + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 8 + :turn-anim -1 + :run-anim 12 + :taunt-anim 22 + :run-travel-speed (meters 7) + :run-acceleration (meters 7) + :run-turning-acceleration (meters 20) + :walk-travel-speed (meters 2) + :walk-acceleration (meters 3) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 360.0) + :notice-nav-radius (meters 1) + :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! (-> *metalmonk-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/goal_src/jak2/levels/common/enemy/metalhead_slinger/grenadier.gc b/goal_src/jak2/levels/common/enemy/metalhead_slinger/grenadier.gc index 63d1c4d32d..4a24f80ed2 100644 --- a/goal_src/jak2/levels/common/enemy/metalhead_slinger/grenadier.gc +++ b/goal_src/jak2/levels/common/enemy/metalhead_slinger/grenadier.gc @@ -85,132 +85,133 @@ ) -(define *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 'array uint32 20 - #x270002 - #x6040501 - #x270002 - #x1010701 - #x1010601 - #x270002 - #x6040501 - #x1010801 - #x1010701 - #x1010601 - #x270002 - #x8040501 - #x270002 - #x1010801 - #x270002 - #x1010601 - #x0 - #x0 - #x0 - #x0 - ) - :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 -1 - :jump-in-air-anim -1 - :jump-land-anim -1 - :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 50) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 12.5) - :default-hit-points 14 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #xffffffffffffffff - :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) - :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 - :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) - :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.0) - :notice-nav-radius (meters 50) - :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 - ) - ) +(define *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 'array idle-control-frame 20 + (new 'static 'idle-control-frame :command #x2 :param0 #x27) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x4 :param1 #x6) + (new 'static 'idle-control-frame :command #x2 :param0 #x27) + (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x2 :param0 #x27) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x4 :param1 #x6) + (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x2 :param0 #x27) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x4 :param1 #x8) + (new 'static 'idle-control-frame :command #x2 :param0 #x27) + (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x2 :param0 #x27) + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (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 -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :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 50) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 12.5) + :default-hit-points 14 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #xffffffffffffffff + :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) + :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 + :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) + :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.0) + :notice-nav-radius (meters 50) + :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! (-> *grenadier-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/goal_src/jak2/levels/common/entities/sew-gunturret.gc b/goal_src/jak2/levels/common/entities/sew-gunturret.gc index c53fb01543..9caee93ad2 100644 --- a/goal_src/jak2/levels/common/entities/sew-gunturret.gc +++ b/goal_src/jak2/levels/common/entities/sew-gunturret.gc @@ -472,79 +472,85 @@ ) -(define *sew-gunturret-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 'array uint32 4 #x1010201 #x0 #x0 #x0) - :idle-anim 2 - :notice-anim 2 - :hostile-anim 2 - :hit-anim 2 - :knocked-anim -1 - :knocked-land-anim -1 - :die-anim 2 - :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 - :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 - :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 - :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) - ) - ) +(define *sew-gunturret-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x2 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 2 + :notice-anim 2 + :hostile-anim 2 + :hit-anim 2 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim 2 + :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 + :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 + :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 + :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) + ) + ) (set! (-> *sew-gunturret-enemy-info* fact-defaults) *fact-info-enemy-defaults*) @@ -566,12 +572,12 @@ ) (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-! s4-0 (-> obj aim-pos) (-> obj root-override2 trans)) - (vector-flatten! s4-0 s4-0 (the-as vector (&-> obj stack 496))) + (vector-flatten! s4-0 s4-0 (-> obj init-mat vector 1)) (vector-normalize! s4-0 1.0) (set! (-> obj desired-twist) (asin (vector-dot (the-as vector (-> obj init-mat)) s4-0))) (set! (-> obj desired-twist) (fmin 5461.3335 (fmax -5461.3335 (-> obj desired-twist)))) (cond - ((< 0.0 (vector-dot (the-as vector (&-> obj stack 512)) s4-0)) + ((< 0.0 (vector-dot (-> obj init-mat vector 2) s4-0)) ) ((< (-> obj desired-twist) 0.0) (set! (-> obj desired-twist) -5461.3335) @@ -625,10 +631,7 @@ (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj params gun-joint)))) (s5-3 (vector-! (new 'stack-no-clear 'vector) (-> obj aim-pos) s4-0)) ) - (when (< (vector-dot - (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-3 1.0) - (the-as vector (&-> obj stack 512)) - ) + (when (< (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-3 1.0) (-> obj init-mat vector 2)) (cos 364.0889) ) (let ((a1-5 (new 'stack-no-clear 'collide-query))) @@ -656,7 +659,7 @@ ) (defmethod sew-gunturret-method-139 sew-gunturret ((obj sew-gunturret)) - (vector+float*! (-> obj aim-pos) (-> obj root-override2 trans) (the-as vector (&-> obj stack 512)) 163840.0) + (vector+float*! (-> obj aim-pos) (-> obj root-override2 trans) (-> obj init-mat vector 2) 163840.0) 0 (none) ) @@ -975,7 +978,7 @@ (else (let ((f0-2 (vector-dot (vector-! (new 'stack-no-clear 'vector) (get-trans arg0 3) (-> obj root-override2 trans)) - (the-as vector (&-> obj stack 512)) + (-> obj init-mat vector 2) ) ) ) @@ -1092,79 +1095,85 @@ :bounds (static-spherem 0 0 0 15) ) -(define *pal-gun-turret-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 'array uint32 4 #x2020201 #x0 #x0 #x0) - :idle-anim 2 - :notice-anim 2 - :hostile-anim 2 - :hit-anim 2 - :knocked-anim -1 - :knocked-land-anim -1 - :die-anim 2 - :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 - :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 - :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 - :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) - ) - ) +(define *pal-gun-turret-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x2 :param0 #x2 :param1 #x2) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 2 + :notice-anim 2 + :hostile-anim 2 + :hit-anim 2 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim 2 + :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 + :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 + :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 + :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) + ) + ) (set! (-> *pal-gun-turret-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/goal_src/jak2/levels/common/flitter.gc b/goal_src/jak2/levels/common/flitter.gc index 5525b59cd9..8d6077a8e9 100644 --- a/goal_src/jak2/levels/common/flitter.gc +++ b/goal_src/jak2/levels/common/flitter.gc @@ -406,128 +406,129 @@ :origin-joint-index 3 ) -(define *flitter-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 'array uint32 16 - #x1e0002 - #x6030501 - #x1e0002 - #x1010601 - #x1e0f0701 - #x1e0002 - #x4020501 - #x1e0002 - #x1010801 - #x140a0901 - #x1e0002 - #x2010501 - #x1e0002 - #x1010801 - #x1e0f0901 - #x0 - ) - :idle-anim 5 - :notice-anim 12 - :hostile-anim 14 - :hit-anim 5 - :knocked-anim 20 - :knocked-land-anim 21 - :die-anim 19 - :die-falling-anim 18 - :victory-anim 5 - :jump-wind-up-anim 5 - :jump-in-air-anim 5 - :jump-land-anim 5 - :neck-joint -1 - :look-at-joint 28 - :bullseye-joint 3 - :sound-hit (static-sound-name "flitter-hit") - :sound-die (static-sound-name "flitter-die") - :notice-distance (meters 40) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 20) - :default-hit-points 1 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #x11fffdffa - :movement-gravity (meters -100) - :friction 0.8 - :attack-shove-back (meters 6) - :attack-shove-up (meters 3) - :attack-mode 'generic - :attack-damage 1 - :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) - :jump-height-min (meters 3) - :jump-height-factor 0.5 - :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 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 275251.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 - :shadow-size (meters 2) - :shadow-max-y (meters 1) - :shadow-min-y (meters -1) - :shadow-locus-dist (meters 150) - :gem-joint 28 - :gem-seg #x2 - :gem-no-seg #x4 - :gem-offset (new 'static 'sphere :y 696.32 :z 1843.2 :r 163840.0) - :callback-info #f - :use-momentum #f - :use-frustration #t - :use-stop-chase #f - :use-circling #t - :use-pacing #t - :walk-anim 13 - :turn-anim 15 - :run-anim 14 - :taunt-anim -1 - :run-travel-speed (meters 12) - :run-acceleration (meters 8) - :run-turning-acceleration (meters 120) - :walk-travel-speed (meters 4) - :walk-acceleration (meters 1) - :walk-turning-acceleration (meters 5) - :maximum-rotation-rate (degrees 720.0) - :notice-nav-radius (meters 5) - :frustration-distance (meters 12) - :frustration-time (seconds 4) - :blocked-time (seconds 0.3) - :circle-dist-lo 20480.0 - :circle-dist-hi 61440.0 - :nav-mesh #f - ) - ) +(define *flitter-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 'array idle-control-frame 16 + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x3 :param1 #x6) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #xf :param1 #x1e) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x2 :param1 #x4) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #xa :param1 #x14) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x2) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #xf :param1 #x1e) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 12 + :hostile-anim 14 + :hit-anim 5 + :knocked-anim 20 + :knocked-land-anim 21 + :die-anim 19 + :die-falling-anim 18 + :victory-anim 5 + :jump-wind-up-anim 5 + :jump-in-air-anim 5 + :jump-land-anim 5 + :neck-joint -1 + :look-at-joint 28 + :bullseye-joint 3 + :sound-hit (static-sound-name "flitter-hit") + :sound-die (static-sound-name "flitter-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 1 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #x11fffdffa + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 6) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 1 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 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 275251.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 + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 28 + :gem-seg #x2 + :gem-no-seg #x4 + :gem-offset (new 'static 'sphere :y 696.32 :z 1843.2 :r 163840.0) + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 13 + :turn-anim 15 + :run-anim 14 + :taunt-anim -1 + :run-travel-speed (meters 12) + :run-acceleration (meters 8) + :run-turning-acceleration (meters 120) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 5) + :maximum-rotation-rate (degrees 720.0) + :notice-nav-radius (meters 5) + :frustration-distance (meters 12) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) (set! (-> *flitter-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/goal_src/jak2/levels/common/grunt.gc b/goal_src/jak2/levels/common/grunt.gc index 096d395a63..49238f268f 100644 --- a/goal_src/jak2/levels/common/grunt.gc +++ b/goal_src/jak2/levels/common/grunt.gc @@ -126,148 +126,149 @@ ) ) -(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 'array uint32 36 - #x1e0002 - #x3010501 - #x1e0002 - #x1010601 - #x691e0701 - #x3c0002 - #x3010501 - #x1e0002 - #x1010601 - #x691e0701 - #x1e0002 - #x1010801 - #x691e0901 - #x1010a01 - #x1e0002 - #x3010501 - #x1e0002 - #x1010801 - #x691e0901 - #x1010a01 - #x1e0002 - #x3010501 - #x1e0002 - #x1010601 - #x691e0701 - #x1e0002 - #x1010801 - #x691e0901 - #x1010a01 - #x1e0002 - #x3010501 - #x1e0002 - #x1011e01 - #x3c0002 - #x1010501 - #x0 - ) - :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 "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 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #xffffffffffffffff - :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) - :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 - :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) - :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.0) - :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 - ) - ) +(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 'array idle-control-frame 36 + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command #x2 :param0 #x3c) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command #x1 :anim #xa :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command #x1 :anim #xa :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command #x1 :anim #xa :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x1e :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x2 :param0 #x3c) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (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 "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 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #xffffffffffffffff + :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) + :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 + :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) + :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.0) + :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*) diff --git a/goal_src/jak2/levels/drill_platform/ginsu.gc b/goal_src/jak2/levels/drill_platform/ginsu.gc index 6464c38662..fb48288231 100644 --- a/goal_src/jak2/levels/drill_platform/ginsu.gc +++ b/goal_src/jak2/levels/drill_platform/ginsu.gc @@ -168,108 +168,114 @@ (new 'static 'ginsu-global-info :blue-hit-anim (new 'static 'array int32 3 5 5 5)) ) -(define *ginsu-nav-enemy-info* (new 'static 'nav-enemy-info - :use-die-falling #t - :use-victory #f - :use-jump-blocked #t - :debug-draw-neck #f - :jump-debug-draw #f - :move-to-ground #t - :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1010501 #x0 #x0 #x0) - :idle-anim 5 - :notice-anim 10 - :hostile-anim 5 - :hit-anim 5 - :knocked-anim 11 - :knocked-land-anim 12 - :die-anim 11 - :die-falling-anim 5 - :victory-anim 5 - :jump-wind-up-anim 5 - :jump-in-air-anim 5 - :jump-land-anim 5 - :neck-joint 7 - :look-at-joint 7 - :bullseye-joint 4 - :sound-die (static-sound-name "ginsu-die") - :notice-distance (meters 40) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 40) - :default-hit-points 1 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot enemy hit-by-others-list player-list) - :penetrate-knocked #x11fffdffa - :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) - :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 - :shadow-size (meters 2) - :shadow-max-y (meters 1) - :shadow-min-y (meters -1) - :shadow-locus-dist (meters 150) - :gem-joint 7 - :gem-offset (new 'static 'sphere :r 163840.0) - :callback-info #f - :use-momentum #f - :use-frustration #t - :use-stop-chase #f - :use-circling #t - :use-pacing #t - :walk-anim 5 - :turn-anim 5 - :run-anim 5 - :taunt-anim -1 - :run-travel-speed (meters 16) - :run-acceleration (meters 1) - :run-turning-acceleration (meters 100) - :walk-travel-speed (meters 16) - :walk-acceleration (meters 1) - :walk-turning-acceleration (meters 3) - :maximum-rotation-rate (degrees 360.0) - :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 - ) - ) +(define *ginsu-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #t + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 10 + :hostile-anim 5 + :hit-anim 5 + :knocked-anim 11 + :knocked-land-anim 12 + :die-anim 11 + :die-falling-anim 5 + :victory-anim 5 + :jump-wind-up-anim 5 + :jump-in-air-anim 5 + :jump-land-anim 5 + :neck-joint 7 + :look-at-joint 7 + :bullseye-joint 4 + :sound-die (static-sound-name "ginsu-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 40) + :default-hit-points 1 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot enemy hit-by-others-list player-list) + :penetrate-knocked #x11fffdffa + :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) + :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 + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 7 + :gem-offset (new 'static 'sphere :r 163840.0) + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 5 + :turn-anim 5 + :run-anim 5 + :taunt-anim -1 + :run-travel-speed (meters 16) + :run-acceleration (meters 1) + :run-turning-acceleration (meters 100) + :walk-travel-speed (meters 16) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 360.0) + :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! (-> *ginsu-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/goal_src/jak2/levels/forest/pegasus.gc b/goal_src/jak2/levels/forest/pegasus.gc index 0af4c594e5..2ec021d506 100644 --- a/goal_src/jak2/levels/forest/pegasus.gc +++ b/goal_src/jak2/levels/forest/pegasus.gc @@ -59,88 +59,94 @@ ) -(defskelgroup skel-pegasus pegasus 0 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) +(defskelgroup skel-pegasus pegasus pegasus-lod0-jg pegasus-idle-ja + ((pegasus-lod0-mg (meters 20)) (pegasus-lod1-mg (meters 40)) (pegasus-lod2-mg (meters 999999))) :bounds (static-spherem 0 0 0 4) - :shadow 4 + :shadow pegasus-shadow-mg ) -(define *pegasus-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 'array uint32 4 #x1010501 #x0 #x0 #x0) - :idle-anim 5 - :notice-anim 6 - :hostile-anim 8 - :hit-anim 5 - :knocked-anim -1 - :knocked-land-anim -1 - :die-anim 15 - :die-falling-anim -1 - :victory-anim -1 - :jump-wind-up-anim -1 - :jump-in-air-anim -1 - :jump-land-anim -1 - :neck-joint -1 - :sound-die (static-sound-name "pegasus-die") - :notice-distance (meters 45) - :notice-distance-delta (meters 30) - :proximity-notice-distance (meters 55) - :default-hit-points 6 - :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 - :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 - :shadow-size (meters 1) - :shadow-max-y (meters 1) - :shadow-min-y (meters -1) - :shadow-locus-dist (meters 150) - :gem-joint 9 - :gem-seg #x2 - :gem-no-seg #x4 - :gem-offset (new 'static 'sphere :y 942.08 :z 40.96 :r 163840.0) - ) - ) +(define *pegasus-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 6 + :hostile-anim 8 + :hit-anim 5 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim 15 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint -1 + :sound-die (static-sound-name "pegasus-die") + :notice-distance (meters 45) + :notice-distance-delta (meters 30) + :proximity-notice-distance (meters 55) + :default-hit-points 6 + :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 + :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 + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 9 + :gem-seg #x2 + :gem-no-seg #x4 + :gem-offset (new 'static 'sphere :y 942.08 :z 40.96 :r 163840.0) + ) + ) (set! (-> *pegasus-enemy-info* fact-defaults) *fact-info-enemy-defaults*) @@ -592,7 +598,7 @@ ) (let ((v1-22 (ja-group))) (cond - ((and v1-22 (= v1-22 (-> self draw art-group data 13))) + ((and v1-22 (= v1-22 pegasus-flip-around-a-ja)) (if (< 1.0 (fabs (-> self speed))) (set! (-> self speed) (* 0.92 (-> self speed))) ) @@ -600,7 +606,7 @@ (else (let ((v1-31 (ja-group))) (cond - ((and v1-31 (= v1-31 (-> self draw art-group data 14))) + ((and v1-31 (= v1-31 pegasus-flip-around-b-ja)) (if (< (-> self speed) 0.0) (seek! (-> self speed) (- f0-6) 13.653334) (seek! (-> self speed) f0-6 13.653334) @@ -699,14 +705,14 @@ (-> self speed) (ja-channel-push! 1 (seconds 0.1)) (let ((a0-7 (-> self skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 20))) + (set! (-> a0-7 frame-group) (the-as art-joint-anim pegasus-board-attack-pegasus-ja)) (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 20)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim pegasus-board-attack-pegasus-ja) frames num-frames) -1)) ) (set! (-> a0-7 param 1) 1.5) (set! (-> a0-7 frame-num) 0.0) (let ((t9-3 joint-control-channel-group!) - (a1-3 (-> self draw art-group data 20)) + (a1-3 pegasus-board-attack-pegasus-ja) (a2-2 (the-as object num-func-seek!)) ) (t9-3 @@ -788,9 +794,9 @@ ) :code (behavior () (let ((v1-2 (ja-group))) - (when (not (and v1-2 (= v1-2 (-> self draw art-group data 8)))) + (when (not (and v1-2 (= v1-2 pegasus-fly-ja))) (ja-channel-push! 1 (seconds 0.2)) - (ja :group! (-> self draw art-group data 8)) + (ja :group! pegasus-fly-ja) ) ) (until #f @@ -883,15 +889,15 @@ ) (let ((a0-13 (ja-group))) (when (not (and a0-13 (begin - (set! a2-3 (= a0-13 (-> self draw art-group data 10))) + (set! a2-3 (= a0-13 pegasus-fly-glide-ja)) (or (the-as symbol a2-3) - (begin (set! a2-3 (= a0-13 (-> self draw art-group data 9))) (the-as symbol a2-3)) - (begin (set! a2-3 (= a0-13 (-> self draw art-group data 8))) (the-as symbol a2-3)) - (begin (set! a2-3 (= a0-13 (-> self draw art-group data 13))) (the-as symbol a2-3)) - (begin (set! a2-3 (= a0-13 (-> self draw art-group data 14))) (the-as symbol a2-3)) - (begin (set! a2-3 (= a0-13 (-> self draw art-group data 16))) (the-as symbol a2-3)) - (begin (set! a2-3 (= a0-13 (-> self draw art-group data 17))) (the-as symbol a2-3)) - (= a0-13 (-> self draw art-group data 18)) + (begin (set! a2-3 (= a0-13 pegasus-fly-doublespeed-ja)) (the-as symbol a2-3)) + (begin (set! a2-3 (= a0-13 pegasus-fly-ja)) (the-as symbol a2-3)) + (begin (set! a2-3 (= a0-13 pegasus-flip-around-a-ja)) (the-as symbol a2-3)) + (begin (set! a2-3 (= a0-13 pegasus-flip-around-b-ja)) (the-as symbol a2-3)) + (begin (set! a2-3 (= a0-13 pegasus-fly-to-run-ja)) (the-as symbol a2-3)) + (begin (set! a2-3 (= a0-13 pegasus-run-ja)) (the-as symbol a2-3)) + (= a0-13 pegasus-run-to-fly-ja) ) ) ) @@ -903,15 +909,15 @@ (cond ((and s4-0 (let ((a0-21 (ja-group))) (not (and a0-21 (begin - (set! a2-3 (= a0-21 (-> self draw art-group data 13))) - (or (the-as symbol a2-3) (= a0-21 (-> self draw art-group data 14))) + (set! a2-3 (= a0-21 pegasus-flip-around-a-ja)) + (or (the-as symbol a2-3) (= a0-21 pegasus-flip-around-b-ja)) ) ) ) ) ) (ja-channel-push! 1 (seconds 0.125)) - (ja :group! (-> self draw art-group data 13)) + (ja :group! pegasus-flip-around-a-ja) (ja :num-func num-func-identity :frame-num 0.0) ) ((and (not v1-34) (not (ja-done? 0))) @@ -919,14 +925,14 @@ (else (let ((v1-46 (ja-group))) (cond - ((and v1-46 (= v1-46 (-> self draw art-group data 16))) - (ja :group! (-> self draw art-group data 17)) + ((and v1-46 (= v1-46 pegasus-fly-to-run-ja)) + (ja :group! pegasus-run-ja) (ja :num-func num-func-identity :frame-num 0.0) ) ((let ((v1-58 (ja-group))) - (and v1-58 (= v1-58 (-> self draw art-group data 13))) + (and v1-58 (= v1-58 pegasus-flip-around-a-ja)) ) - (ja :group! (-> self draw art-group data 14) :num! min) + (ja :group! pegasus-flip-around-b-ja :num! min) (set! (-> self speed) (- (-> self speed))) (let ((s5-3 (new 'stack-no-clear 'vector)) (s4-1 (new 'stack-no-clear 'matrix)) @@ -941,16 +947,16 @@ (vector-matrix*! (-> self facing) (-> self facing) (the-as matrix a2-3)) ) ((let ((v1-72 (ja-group))) - (and v1-72 (= v1-72 (-> self draw art-group data 17))) + (and v1-72 (= v1-72 pegasus-run-ja)) ) (if (or (not (-> self can-run)) (< (the-as time-frame (-> self ambient-expire)) (-> self clock frame-counter))) - (ja :group! (-> self draw art-group data 18)) + (ja :group! pegasus-run-to-fly-ja) ) (ja :num-func num-func-identity :frame-num 0.0) ) ((and gp-0 (-> self on-ground)) (ja-channel-push! 1 (seconds 0.125)) - (ja :group! (-> self draw art-group data 16)) + (ja :group! pegasus-fly-to-run-ja) (ja :num-func num-func-identity :frame-num 0.0) (let* ((s5-4 (-> self clock frame-counter)) (f30-1 300.0) @@ -979,27 +985,27 @@ (and (< 0.0 (-> self speed)) (< (-> self tangent y) -0.125)) ) (let ((v1-121 (ja-group))) - (when (not (and v1-121 (= v1-121 (-> self draw art-group data 10)))) + (when (not (and v1-121 (= v1-121 pegasus-fly-glide-ja))) (ja-channel-push! 1 (the-as time-frame s5-1)) - (ja :group! (-> self draw art-group data 10)) + (ja :group! pegasus-fly-glide-ja) ) ) (ja :num-func num-func-identity :frame-num 0.0) ) ((< 1.25 f30-0) (let ((v1-135 (ja-group))) - (when (not (and v1-135 (= v1-135 (-> self draw art-group data 9)))) + (when (not (and v1-135 (= v1-135 pegasus-fly-doublespeed-ja))) (ja-channel-push! 1 (the-as time-frame s5-1)) - (ja :group! (-> self draw art-group data 9)) + (ja :group! pegasus-fly-doublespeed-ja) ) ) (ja :num-func num-func-identity :frame-num 0.0) ) (else (let ((v1-148 (ja-group))) - (when (not (and v1-148 (= v1-148 (-> self draw art-group data 8)))) + (when (not (and v1-148 (= v1-148 pegasus-fly-ja))) (ja-channel-push! 1 (the-as time-frame s5-1)) - (ja :group! (-> self draw art-group data 8)) + (ja :group! pegasus-fly-ja) ) ) (ja :num-func num-func-identity :frame-num 0.0) @@ -1014,13 +1020,12 @@ 0.0 (the-as symbol - (or gp-0 (let ((v1-161 (ja-group))) - (and v1-161 (begin - (set! a2-3 (= v1-161 (-> self draw art-group data 16))) - (or (the-as symbol a2-3) (= v1-161 (-> self draw art-group data 17))) - ) - ) + (or gp-0 + (let ((v1-161 (ja-group))) + (and v1-161 + (begin (set! a2-3 (= v1-161 pegasus-fly-to-run-ja)) (or (the-as symbol a2-3) (= v1-161 pegasus-run-ja))) ) + ) ) ) (the-as symbol a2-3) @@ -1157,10 +1162,10 @@ :code (behavior () (set! (-> self allow-idle) #f) (let ((v1-2 (ja-group))) - (when (not (and v1-2 (= v1-2 (-> self draw art-group data 5)))) + (when (not (and v1-2 (= v1-2 pegasus-idle-ja))) (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! (-> self draw art-group data 19) - :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 19)) frames num-frames) -1))) + (ja-no-eval :group! pegasus-fly-to-idle-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim pegasus-fly-to-idle-ja) frames num-frames) -1))) :frame-num 0.0 ) (until (ja-done? 0) @@ -1233,11 +1238,8 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (ja-no-eval :group! (-> self draw art-group data 7) - :num! (seek! - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) frames num-frames) -1)) - f30-0 - ) + (ja-no-eval :group! pegasus-idle-takeoff-in-air-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim pegasus-idle-takeoff-in-air-ja) frames num-frames) -1)) f30-0) :frame-num 0.0 ) (until (ja-done? 0) diff --git a/goal_src/jak2/levels/forest/predator.gc b/goal_src/jak2/levels/forest/predator.gc index 842250a738..c85b879dd1 100644 --- a/goal_src/jak2/levels/forest/predator.gc +++ b/goal_src/jak2/levels/forest/predator.gc @@ -231,109 +231,115 @@ ) -(define *predator-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 'array uint32 4 #x1010501 #x0 #x0 #x0) - :idle-anim 5 - :notice-anim 5 - :hostile-anim 7 - :hit-anim 5 - :knocked-anim 12 - :knocked-land-anim 13 - :die-anim 11 - :die-falling-anim 11 - :victory-anim 5 - :jump-wind-up-anim -1 - :jump-in-air-anim -1 - :jump-land-anim -1 - :neck-joint 7 - :look-at-joint 8 - :bullseye-joint 6 - :sound-hit (static-sound-name "predator-hit") - :sound-die (static-sound-name "predator-die") - :notice-distance (meters 150) - :notice-distance-delta (meters 150) - :proximity-notice-distance (meters 4) - :default-hit-points 5 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #xffffffffffffffff - :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) - :jump-height-min (meters 3) - :jump-height-factor 0.5 - :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 81920.0 - :knocked-soft-vxz-hi 81920.0 - :knocked-soft-vy-lo 69632.0 - :knocked-soft-vy-hi 69632.0 - :knocked-medium-vxz-lo 81920.0 - :knocked-medium-vxz-hi 81920.0 - :knocked-medium-vy-lo 69632.0 - :knocked-medium-vy-hi 69632.0 - :knocked-hard-vxz-lo 81920.0 - :knocked-hard-vxz-hi 81920.0 - :knocked-hard-vy-lo 69632.0 - :knocked-hard-vy-hi 69632.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 53248.0 - :knocked-yellow-vy-lo 40960.0 - :knocked-yellow-vy-hi 53248.0 - :knocked-red-vxz-lo 102400.0 - :knocked-red-vxz-hi 102400.0 - :knocked-red-vy-lo 81920.0 - :knocked-red-vy-hi 81920.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 32768.0 - :knocked-blue-vy-hi 49152.0 - :shadow-size (meters 1) - :shadow-max-y (meters 1) - :shadow-min-y (meters -1) - :shadow-locus-dist (meters 150) - :gem-joint 6 - :gem-offset (new 'static 'sphere :y -2252.8 :z -2170.88 :r 163840.0) - :callback-info #f - :use-momentum #t - :use-frustration #t - :use-stop-chase #f - :use-circling #f - :use-pacing #f - :walk-anim 6 - :turn-anim -1 - :run-anim 7 - :taunt-anim -1 - :run-travel-speed (meters 8) - :run-acceleration (meters 6) - :run-turning-acceleration (meters 30) - :walk-travel-speed (meters 4) - :walk-acceleration (meters 3) - :walk-turning-acceleration (meters 8) - :maximum-rotation-rate (degrees 720.0) - :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 - ) - ) +(define *predator-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 5 + :hostile-anim 7 + :hit-anim 5 + :knocked-anim 12 + :knocked-land-anim 13 + :die-anim 11 + :die-falling-anim 11 + :victory-anim 5 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 7 + :look-at-joint 8 + :bullseye-joint 6 + :sound-hit (static-sound-name "predator-hit") + :sound-die (static-sound-name "predator-die") + :notice-distance (meters 150) + :notice-distance-delta (meters 150) + :proximity-notice-distance (meters 4) + :default-hit-points 5 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #xffffffffffffffff + :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) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 81920.0 + :knocked-soft-vxz-hi 81920.0 + :knocked-soft-vy-lo 69632.0 + :knocked-soft-vy-hi 69632.0 + :knocked-medium-vxz-lo 81920.0 + :knocked-medium-vxz-hi 81920.0 + :knocked-medium-vy-lo 69632.0 + :knocked-medium-vy-hi 69632.0 + :knocked-hard-vxz-lo 81920.0 + :knocked-hard-vxz-hi 81920.0 + :knocked-hard-vy-lo 69632.0 + :knocked-hard-vy-hi 69632.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 53248.0 + :knocked-yellow-vy-lo 40960.0 + :knocked-yellow-vy-hi 53248.0 + :knocked-red-vxz-lo 102400.0 + :knocked-red-vxz-hi 102400.0 + :knocked-red-vy-lo 81920.0 + :knocked-red-vy-hi 81920.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 65536.0 + :knocked-blue-vy-lo 32768.0 + :knocked-blue-vy-hi 49152.0 + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 6 + :gem-offset (new 'static 'sphere :y -2252.8 :z -2170.88 :r 163840.0) + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 6 + :turn-anim -1 + :run-anim 7 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 30) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 3) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 720.0) + :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! (-> *predator-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/goal_src/jak2/levels/fortress/fort-turret.gc b/goal_src/jak2/levels/fortress/fort-turret.gc index f8e1028e8c..ee92497fce 100644 --- a/goal_src/jak2/levels/fortress/fort-turret.gc +++ b/goal_src/jak2/levels/fortress/fort-turret.gc @@ -462,79 +462,85 @@ #f ) -(define *fort-turret-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 'array uint32 4 #x1010401 #x0 #x0 #x0) - :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 - :notice-distance (meters 150) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 150) - :default-hit-points 1 - :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 - :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 - :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) - ) - ) +(define *fort-turret-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim 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 + :notice-distance (meters 150) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 150) + :default-hit-points 1 + :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 + :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 + :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) + ) + ) (set! (-> *fort-turret-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/goal_src/jak2/levels/mars_tomb/left/chase/target-indax.gc b/goal_src/jak2/levels/mars_tomb/left/chase/target-indax.gc index 97f2dc319d..16e018cdf5 100644 --- a/goal_src/jak2/levels/mars_tomb/left/chase/target-indax.gc +++ b/goal_src/jak2/levels/mars_tomb/left/chase/target-indax.gc @@ -5,5 +5,1565 @@ ;; name in dgo: target-indax ;; dgos: TOE +(define-extern *indax-walk-mods* surface) +(define-extern *indax-jump-mods* surface) +(define-extern *indax-double-jump-mods* surface) +(define-extern *indax-bounce-mods* surface) +(define-extern target-indax-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-indax-dangerous-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-indax-jump-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-indax-init (function none :behavior target)) +(define-extern target-indax-exit (function none :behavior target)) +(define-extern target-indax-real-post (function none :behavior target)) +(define-extern target-indax-post (function none :behavior target)) +(define-extern target-indax-stance (state target)) +(define-extern target-indax-walk (state target)) +(define-extern target-indax-falling (state symbol target)) +(define-extern target-indax-jump (state float float surface target)) +(define-extern target-indax-double-jump (state float float target)) +(define-extern target-indax-hit-ground (state symbol target)) +(define-extern target-indax-trip (state target)) +(define-extern target-indax-attack (state target)) +(define-extern target-indax-attack-air (state symbol target)) +(define-extern target-indax-running-attack (state target)) +(define-extern target-indax-hit-setup-anim (function attack-info none :behavior target)) +(define-extern target-indax-hit (state symbol attack-info target)) +(define-extern target-indax-death (state symbol target)) + ;; DECOMP BEGINS +(deftype indax-info (basic) + ((indax-start-time time-frame :offset-assert 8) + (indax-time time-frame :offset-assert 16) + (art-group-backup art-group :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + + +(let ((v1-2 (copy *walk-mods* 'loading-level))) + (set! (-> v1-2 flags) (surface-flag gun-off gun-fast-exit)) + (set! (-> v1-2 target-speed) 32768.0) + (set! (-> v1-2 transv-max) 32768.0) + (set! *indax-walk-mods* v1-2) + ) + +(let ((v1-4 (copy *jump-mods* 'loading-level))) + (set! (-> v1-4 target-speed) 32768.0) + (set! (-> v1-4 transv-max) 32768.0) + (set! *indax-jump-mods* v1-4) + ) + +(let ((v1-6 (copy *double-jump-mods* 'loading-level))) + (set! (-> v1-6 target-speed) 32768.0) + (set! (-> v1-6 transv-max) 32768.0) + (set! *indax-double-jump-mods* v1-6) + ) + +(let ((v1-8 (copy *jump-mods* 'loading-level))) + (set! (-> v1-8 target-speed) 49152.0) + (set! (-> v1-8 transv-max) 49152.0) + (set! (-> v1-8 seek0) 0.7) + (set! (-> v1-8 seek90) 0.7) + (set! (-> v1-8 seek180) 0.7) + (set! *indax-bounce-mods* v1-8) + ) + +(defbehavior target-indax-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (a0-10 symbol)) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + 'indax + ) + (else + (case arg2 + (('end-mode) + (go target-stance) + ) + (('change-mode) + (let ((v1-5 (-> arg3 param 0))) + (cond + ((= v1-5 'grab) + (when (not (logtest? (-> self focus-status) (focus-status dead))) + (if (not (-> arg3 param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + ((= v1-5 'normal) + (go target-stance) + ) + ((begin (set! a0-10 'falling) (= v1-5 a0-10)) + (go target-indax-falling a0-10) + ) + ) + ) + ) + (('trip) + (if (not (or (logtest? (-> self focus-status) (focus-status dead hit grabbed)) + (and (-> self next-state) (= (-> self next-state name) 'target-indax-trip)) + ) + ) + (go target-indax-trip) + ) + ) + (('swim 'slide 'edge-grab) + #f + ) + (('clone-anim) + (go target-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + target-indax-hit + ) + ) + (('shove) + (when (not (and (-> self next-state) (let ((v1-25 (-> self next-state name))) + (or (= v1-25 'target-indax-hit) (= v1-25 'target-hit)) + ) + ) + ) + (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 160) + (when (not (logtest? (-> self attack-info-rec mask) (attack-info-mask attacker))) + (set! (-> self attack-info-rec attacker) (process->handle arg0)) + (logior! (-> self attack-info-rec mask) (attack-info-mask attacker)) + ) + (go target-indax-hit 'shove (-> self attack-info-rec)) + ) + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + +(defbehavior target-indax-dangerous-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('touched) + (cond + ((< 0.0 (-> self fact-override shield-level)) + (let ((s4-1 (-> self control penetrate-using))) + (set! (-> self control penetrate-using) (penetrate touch shield)) + (let ((v0-0 (the-as object (target-send-attack + arg0 + 'shield + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self fact-override shield-attack-id)) + 0 + (-> self control penetrate-using) + ) + ) + ) + ) + (set! (-> self control penetrate-using) s4-1) + v0-0 + ) + ) + ) + (((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 1920) + ) + (target-send-attack + arg0 + (-> self control danger-mode) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) + ) + ) + (else + (target-indax-handler arg0 arg1 arg2 arg3) + ) + ) + ) + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + target-indax-hit + ) + ) + (else + (target-indax-handler arg0 arg1 arg2 arg3) + ) + ) + ) + +(defbehavior target-indax-jump-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (cond + ((and (= arg2 'touched) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 6) + ) + (< (* 16384.0 (-> self clock time-adjust-ratio)) + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control transv) (-> self control last-transv)) + ) + ) + (begin + (vector-normalize! + (vector-! + s2-0 + (the-as vector (-> self control collision-spheres 0 prim-core)) + (-> self control actor-contact-pt) + ) + 1.0 + ) + (< 0.01 (-> s2-0 y)) + ) + ) + (if (< 0.75 (-> s2-0 y)) + (send-event + arg0 + 'bonk + (-> arg3 param 0) + (fmax + (-> self control ground-impact-vel) + (- (vector-dot (-> self control transv) (-> self control dynam gravity-normal))) + ) + ) + ) + (target-indax-handler arg0 arg1 arg2 arg3) + ) + ((= arg2 'jump) + (sound-play "jump-long") + (go + target-indax-jump + (the-as float (-> arg3 param 0)) + (the-as float (-> arg3 param 1)) + (the-as surface (-> arg3 param 2)) + ) + ) + (else + (target-indax-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior target-indax-init target () + (set! (-> self control current-surface flags) + (logior (surface-flag gun-fast-exit) (-> self control current-surface flags)) + ) + (target-gun-end-mode #t) + (target-exit) + (logior! (-> self game features) (game-feature sidekick)) + (target-sidekick-setup #t) + (if (zero? (-> self indax)) + (set! (-> self indax) (new 'process 'indax-info)) + ) + (set! (-> self control reaction) target-collision-reaction) + (set! (-> self control transv quad) (the-as uint128 0)) + (set! (-> self control ctrl-xz-vel) 0.0) + (set! (-> self focus-status) (logior (focus-status indax) (-> self focus-status))) + (set! (-> self control bend-target) 0.0) + (target-collide-set! 'indax 0.0) + (set! (-> self fact-override health) (-> self fact-override health-max)) + (set! (-> self indax indax-start-time) (-> self clock frame-counter)) + (set! (-> self indax 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) + (remove-exit) + (go target-indax-stance) + (none) + ) + +(defbehavior target-indax-exit target () + (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-indax-stance) + (= v1-3 'target-indax-walk) + (= v1-3 'target-indax-jump) + (= v1-3 'target-indax-double-jump) + (= v1-3 'target-indax-falling) + (= v1-3 'target-indax-hit-ground) + (= v1-3 'target-indax-attack) + (= v1-3 'target-indax-attack-air) + (= v1-3 'target-indax-running-attack) + (= v1-3 'target-indax-trip) + (= v1-3 'target-indax-hit) + (= v1-3 'target-indax-death) + ) + ) + ) + ) + (logclear! (-> self focus-status) (focus-status indax)) + (logclear! (-> self control root-prim prim-core action) (collide-action stuck-wall-escape)) + (set! (-> self control mod-surface) *walk-mods*) + (logclear! (-> self state-flags) (state-flags sf6)) + (target-collide-set! 'normal 0.0) + (set! (-> self draw art-group) (-> self indax art-group-backup)) + (logclear! (-> self draw status) (draw-control-status no-draw-bounds2)) + (send-event (ppointer->process (-> self sidekick)) 'matrix #f) + (if (not (logtest? (-> self focus-status) (focus-status dead))) + (set! (-> self fact-override health) (-> self fact-override health-max)) + ) + (target-exit) + ) + (none) + ) + +(defbehavior target-indax-real-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (if (< (-> self control force-turn-to-strength) 0.0) + (set! (-> self control force-turn-to-strength) (- 1.0 (-> self control cpad stick0-speed))) + ) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s5-0 (new-stack-vector0))) + (read-pad s5-0) + (let ((f28-0 (debounce-speed + (-> self control pad-magnitude) + (-> self control last-pad-magnitude) + (-> self control pad-xz-dir) + (-> self control last-pad-xz-dir) + ) + ) + ) + (when (!= (-> self control force-turn-to-strength) 0.0) + (let ((f0-12 (fmin 1.0 (-> self control force-turn-to-strength)))) + (set! (-> self control force-turn-to-strength) f0-12) + (let ((a1-3 (vector-float*! + (new 'stack-no-clear 'vector) + (if (= f28-0 0.0) + *zero-vector* + s5-0 + ) + f28-0 + ) + ) + (a2-2 (vector-float*! + (new 'stack-no-clear 'vector) + (-> self control force-turn-to-direction) + (-> self control force-turn-to-speed) + ) + ) + ) + (vector-lerp! s5-0 a1-3 a2-2 f0-12) + ) + ) + (set! f28-0 (vector-length s5-0)) + (vector-normalize! s5-0 1.0) + ) + (turn-to-vector s5-0 f28-0) + ) + ) + (add-thrust) + (add-gravity) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (pre-collide-setup) + (when *debug-segment* + (let ((s5-1 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-38 'target) + (s4-0 *profile-target-color*) + ) + (when (and *dproc* *debug-segment*) + (let ((s3-0 (-> s5-1 data (-> s5-1 count)))) + (let ((s2-0 (-> s5-1 base-time))) + (set! (-> s3-0 name) v1-38) + (set! (-> s3-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s2-0)))) + ) + (set! (-> s3-0 depth) (the-as uint (-> s5-1 depth))) + (set! (-> s3-0 color) s4-0) + (set! (-> s5-1 segment (-> s5-1 depth)) s3-0) + ) + (+! (-> s5-1 count) 1) + (+! (-> s5-1 depth) 1) + (set! (-> s5-1 max-depth) (max (-> s5-1 max-depth) (-> s5-1 depth))) + ) + ) + 0 + ) + (let ((a2-3 (new 'stack-no-clear 'collide-query))) + (let ((v1-51 (-> self control))) + (set! (-> a2-3 collide-with) (-> v1-51 root-prim prim-core collide-with)) + (set! (-> a2-3 ignore-process0) self) + (set! (-> a2-3 ignore-process1) #f) + (set! (-> a2-3 ignore-pat) (-> v1-51 pat-ignore-mask)) + ) + (set! (-> a2-3 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide (-> self control) (-> self control transv) a2-3 (meters 1)) + ) + (when *debug-segment* + (let ((s5-2 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-68 (+ (-> s5-2 depth) -1)) + (s4-1 (-> s5-2 segment v1-68)) + (s3-1 (-> s5-2 base-time)) + ) + (when (>= v1-68 0) + (set! (-> s4-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-1)))) + (+! (-> s5-2 depth) -1) + ) + ) + ) + ) + 0 + ) + (bend-gravity) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (logclear! (-> self draw status) (draw-control-status no-draw-temp uninited)) + (evaluate-joint-control self) + (joint-points) + (do-target-gspot) + (target-powerup-process) + (none) + ) + +(defbehavior target-indax-post target () + (target-indax-real-post) + (none) + ) + +(defstate target-indax-start (target) + :event target-standard-event-handler + :code (behavior () + (target-indax-init) + (go target-indax-stance) + (none) + ) + :post target-indax-post + ) + +(defstate target-indax-stance (target) + :event target-indax-handler + :enter (behavior () + ((-> target-stance enter)) + (set! (-> self control mod-surface) *indax-walk-mods*) + (none) + ) + :exit (behavior () + ((-> target-stance exit)) + (target-indax-exit) + (none) + ) + :trans (behavior () + ((-> self state-hook)) + (when (move-legs?) + (set! (-> self control bend-target) 0.0) + (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) + (remove-exit) + (go target-indax-walk) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (go + target-indax-jump + (-> *TARGET-bank* indax-jump-height-min) + (-> *TARGET-bank* indax-jump-height-max) + (the-as surface #f) + ) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-indax-running-attack) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-indax-attack) + ) + (fall-test target-indax-falling -4096000.0) + (none) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 (-> self draw art-group data 421))) + (ja-no-eval :group! (-> self draw art-group data 422) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 422)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.05)) + ) + ((let ((v1-32 (ja-group))) + (and v1-32 (= v1-32 (-> self draw art-group data 437))) + ) + (ja-no-eval :group! (-> self draw art-group data 442) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 442)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.05)) + ) + ((let ((v1-62 (ja-group))) + (and (and v1-62 (= v1-62 (-> self draw art-group data 417))) + (< (-> self skel root-channel 2 frame-interp (-> self skel active-frame-interp)) 0.5) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 429) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 429)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.05)) + ) + ) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 415) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 415)) frames num-frames) -1)) + 1.5 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + #f + (none) + ) + :post target-indax-post + ) + +(defstate target-indax-walk (target) + :event target-indax-handler + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self control mod-surface) *indax-walk-mods*) + (none) + ) + :exit (behavior () + (target-effect-exit) + (target-state-hook-exit) + (target-indax-exit) + (none) + ) + :trans (behavior () + ((-> self state-hook)) + (when (not (move-legs?)) + (target-effect-exit) + (remove-exit) + (go target-indax-stance) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (go + target-indax-jump + (-> *TARGET-bank* indax-jump-height-min) + (-> *TARGET-bank* indax-jump-height-max) + (the-as surface #f) + ) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-indax-running-attack) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-indax-attack) + ) + (fall-test target-indax-falling -4096000.0) + (none) + ) + :code (behavior () + (let ((f26-0 0.0) + (f30-0 0.0) + (f28-0 0.0) + (gp-0 (-> self clock frame-counter)) + ) + (let ((v1-3 (ja-group))) + (cond + ((and v1-3 (or (= v1-3 (-> self draw art-group data 416)) (= v1-3 (-> self draw art-group data 417)))) + (set! f26-0 (ja-frame-num 0)) + ) + ((let ((v1-9 (ja-group))) + (and (or (and v1-9 (= v1-9 (-> self draw art-group data 419))) + (let ((v1-15 (ja-group))) + (and (and v1-15 (= v1-15 (-> self draw art-group data 418))) (< 15.0 (ja-aframe-num 0))) + ) + ) + (< 12288.0 (-> self control ctrl-xz-vel)) + ) + ) + (ja-channel-push! 1 (seconds 0.01)) + (ja-no-eval :group! (-> self draw art-group data 427) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 427)) frames num-frames) -1)) + 2.0 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 2.0)) + ) + (ja-channel-push! 3 (seconds 0.05)) + ) + (else + (ja-channel-push! 3 (seconds 0.05)) + ) + ) + ) + (ja-no-eval :group! (-> self draw art-group data 417) :num! (identity f26-0) :dist 13107.2) + (ja-no-eval :chan 1 :group! (-> self draw art-group data 423) :num! (identity f26-0) :dist 12697.6) + (let ((a0-25 (-> self skel root-channel 2))) + (let ((f0-12 (- 1.0 f30-0))) + (set! (-> a0-25 frame-interp 1) f0-12) + (set! (-> a0-25 frame-interp 0) f0-12) + ) + (set! (-> a0-25 dist) 5939.2) + (set! (-> a0-25 frame-group) (the-as art-joint-anim (-> self draw art-group data 416))) + (set! (-> a0-25 param 0) 1.0) + (set! (-> a0-25 frame-num) f26-0) + (joint-control-channel-group! a0-25 (the-as art-joint-anim (-> self draw art-group data 416)) num-func-loop!) + ) + (until #f + (suspend) + (let ((f26-1 (lerp-scale 0.0 1.0 (-> self control ctrl-xz-vel) 16384.0 32768.0))) + (cond + ((>= (- (-> self clock frame-counter) gp-0) (seconds 5)) + (set! gp-0 (-> self clock frame-counter)) + ) + ((>= (- (-> self clock frame-counter) gp-0) (seconds 2.5)) + ) + ((>= (- (-> self clock frame-counter) gp-0) (seconds 1)) + (set! f28-0 (seek f28-0 1.0 (* 2.0 (-> self clock seconds-per-frame)))) + ) + (else + (set! f28-0 (seek f28-0 0.0 (* 2.0 (-> self clock seconds-per-frame)))) + ) + ) + (set! f30-0 (seek f30-0 f26-1 (* 4.0 (-> self clock seconds-per-frame)))) + ) + (let ((v1-94 (-> self skel root-channel 1))) + (set! (-> v1-94 frame-interp 1) f28-0) + (set! (-> v1-94 frame-interp 0) f28-0) + ) + (let ((v1-98 (-> self skel root-channel 2)) + (f0-23 (- 1.0 f30-0)) + ) + (set! (-> v1-98 frame-interp 1) f0-23) + (set! (-> v1-98 frame-interp 0) f0-23) + ) + (let ((v1-101 (-> self skel effect)) + (a0-33 (cond + ((< 0.5 f30-0) + (if (< 0.5 f28-0) + 1 + 0 + ) + ) + (else + 2 + ) + ) + ) + ) + (set! (-> v1-101 channel-offset) a0-33) + ) + 0 + (let* ((f0-27 (* (current-cycle-distance (-> self skel)) (-> self control scale x))) + (f0-29 (/ (* 60.0 (-> self control ctrl-xz-vel)) (* 60.0 f0-27))) + ) + (ja :num! (loop! f0-29)) + ) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) + ) + ) + #f + (none) + ) + :post target-indax-post + ) + +(defstate target-indax-falling (target) + :event target-indax-jump-event-handler + :enter (behavior ((arg0 symbol)) + ((-> target-falling enter) arg0) + (set! (-> self control mod-surface) *indax-jump-mods*) + (none) + ) + :exit target-indax-exit + :trans (behavior () + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control cpad number) abutton 6))) + ) + ) + (if (logtest? (-> self control status) (collide-status on-surface)) + (go target-indax-hit-ground #f) + ) + (if (and (cpad-pressed? (-> self control cpad number) circle) (can-feet? #f)) + (go target-indax-attack-air #f) + ) + (let ((f0-3 (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))))) + (if (< (-> self control unknown-float35) f0-3) + (seek! (-> self control unknown-float35) f0-3 (* 4.0 (-> self clock seconds-per-frame))) + ) + ) + (none) + ) + :code (behavior ((arg0 symbol)) + (let ((a1-0 75)) + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (or (= v1-2 (-> self draw art-group data 418)) (= v1-2 (-> self draw art-group data 419)))) + ) + (else + (let ((v1-8 (ja-group))) + (cond + ((and v1-8 (= v1-8 (-> self draw art-group data 428))) + (set! a1-0 15) + (set! (-> self control unknown-float35) 0.0) + ) + (else + (set! (-> self control unknown-float35) 0.0) + ) + ) + ) + ) + ) + ) + (ja-channel-push! 1 (the-as time-frame a1-0)) + ) + (ja-no-eval :group! (-> self draw art-group data 419) :num! (loop!) :frame-num 0.0) + (until #f + (seek! (-> self control unknown-float35) 0.0 (* 10.0 (-> self clock seconds-per-frame))) + (suspend) + (ja-blend-eval) + (ja :num! (loop!)) + ) + #f + (none) + ) + :post target-indax-post + ) + +(defstate target-indax-jump (target) + :event target-indax-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 surface)) + (let ((t9-0 (-> target-jump enter))) + (set! arg2 (cond + (arg2 + (empty) + arg2 + ) + (else + *indax-jump-mods* + ) + ) + ) + (t9-0 arg0 arg1 arg2) + ) + (set! (-> self control unknown-float35) 0.0) + (none) + ) + :exit (behavior () + (target-exit) + (target-indax-exit) + (none) + ) + :trans (behavior () + ((-> target-indax-falling trans)) + (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + (if (and (cpad-pressed? (-> self control cpad number) x) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 12288.0) + (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (not (logtest? (water-flags touch-water) (-> self water flags))) + (zero? (logand (state-flags prevent-jump prevent-double-jump) (-> self state-flags))) + ) + ) + (go + target-indax-double-jump + (-> *TARGET-bank* indax-double-jump-height-min) + (-> *TARGET-bank* indax-double-jump-height-max) + ) + ) + (none) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) + (ja-channel-push! 2 (seconds 0.02)) + (ja :group! (-> self draw art-group data 418) :num! min) + (ja :chan 1 :group! (-> self draw art-group data 424) :num! (chan 0)) + (suspend) + (until (ja-done? 0) + (let ((f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f0-4 (- 10.0 (ja-aframe-num 0))) + (gp-1 (-> self skel root-channel 0)) + ) + (set! (-> gp-1 param 0) (the float (+ (-> gp-1 frame-group frames num-frames) -1))) + (let ((v1-26 (and (< 0.0 f30-0) (< 0.0 f0-4)))) + (set! (-> gp-1 param 1) + (if v1-26 + (fmin (fmin 3.0 f0-4) (/ (* 10.0 f0-4) (the float (time-to-apex f30-0 -245760.0)))) + 1.0 + ) + ) + ) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) + ) + (let ((a0-8 (-> self skel root-channel 1))) + (let ((f0-10 (-> self control unknown-float35))) + (set! (-> a0-8 frame-interp 1) f0-10) + (set! (-> a0-8 frame-interp 0) f0-10) + ) + (set! (-> a0-8 param 0) 0.0) + (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-chan) + ) + (suspend) + ) + (go target-indax-falling #f) + (none) + ) + :post target-indax-post + ) + +(defstate target-indax-double-jump (target) + :event target-indax-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float)) + (set! (-> self state-time) (-> self clock frame-counter)) + (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (if (!= (-> self control mod-surface) *slide-jump-mods*) + (set! (-> self control mod-surface) *indax-double-jump-mods*) + ) + (let ((v1-10 (ja-group))) + (cond + ((and v1-10 (or (= v1-10 (-> self draw art-group data 418)) (= v1-10 (-> self draw art-group data 419)))) + ) + (else + (set! (-> self control unknown-float35) 0.0) + ) + ) + ) + (none) + ) + :exit (-> target-indax-jump exit) + :trans (behavior () + ((-> target-indax-falling trans)) + (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + (none) + ) + :code (behavior ((arg0 float) (arg1 float)) + (sound-play "jump-double") + (let ((v1-3 (ja-group))) + (cond + ((and (and v1-3 (= v1-3 (-> self draw art-group data 418))) (< 0.6 (-> self control unknown-float35))) + (ja-channel-push! 2 (seconds 0.04)) + (ja-no-eval :group! (-> self draw art-group data 418) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 418)) frames num-frames) -1))) + :frame-num (ja-aframe 1.0 0) + ) + (ja :chan 1 :group! (-> self draw art-group data 424) :num! (chan 0)) + ) + (else + (ja-channel-push! 2 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 418) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 418)) frames num-frames) -1))) + :frame-num (ja-aframe 5.0 0) + ) + (ja :chan 1 :group! (-> self draw art-group data 424) :num! (chan 0)) + ) + ) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + (let ((a0-16 (-> self skel root-channel 1))) + (let ((f0-14 (-> self control unknown-float35))) + (set! (-> a0-16 frame-interp 1) f0-14) + (set! (-> a0-16 frame-interp 0) f0-14) + ) + (set! (-> a0-16 param 0) 0.0) + (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (go target-indax-falling #f) + (none) + ) + :post target-post + ) + +(defstate target-indax-hit-ground (target) + :event target-indax-handler + :enter (behavior ((arg0 symbol)) + ((-> target-hit-ground enter) arg0) + (set! (-> self control mod-surface) *indax-walk-mods*) + (none) + ) + :exit target-indax-exit + :trans (behavior () + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (go + target-indax-jump + (-> *TARGET-bank* indax-jump-height-min) + (-> *TARGET-bank* indax-jump-height-max) + (the-as surface #f) + ) + ) + (if (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (go target-indax-walk) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-indax-running-attack) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-indax-attack) + ) + (fall-test target-falling -4096000.0) + (none) + ) + :code (behavior ((arg0 symbol)) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 420) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 420)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go target-indax-stance) + (none) + ) + :post target-indax-post + ) + +(defstate target-indax-trip (target) + :event target-indax-jump-event-handler + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (sound-play "jump" :vol 70) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (none) + ) + :exit (behavior () + (target-exit) + (target-indax-exit) + (none) + ) + :code (behavior () + (set! (-> self control mod-surface) *indax-bounce-mods*) + (ja-channel-push! 1 (seconds 0.02)) + (ja-no-eval :group! (-> self draw art-group data 443) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 443)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-y-vel adjust-xz-vel) 1.0 1.0 2.0) + (suspend) + (ja :num! (seek!)) + ) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (suspend) + ) + (ja-no-eval :group! (-> self draw art-group data 444) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 444)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + (none) + ) + :post target-no-stick-post + ) + +(defstate target-indax-attack (target) + :event target-indax-dangerous-event-handler + :enter (-> target-attack enter) + :exit (behavior () + ((-> target-attack exit)) + (target-indax-exit) + (none) + ) + :code (behavior () + (let ((gp-0 (-> self draw art-group data 421))) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! gp-0 + :num! (seek! + (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1)) + (-> self control current-surface align-speed) + ) + :frame-num 0.0 + ) + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (go + target-indax-jump + (-> *TARGET-bank* indax-jump-height-min) + (-> *TARGET-bank* indax-jump-height-max) + (the-as surface #f) + ) + ) + (suspend) + (ja :num! (seek! max (-> self control current-surface align-speed))) + ) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (if (< 11.4 (ja-aframe-num 0)) + (ja :num-func num-func-identity :frame-num max) + ) + (go target-indax-stance) + (none) + ) + :post target-indax-post + ) + +(defstate target-indax-attack-air (target) + :event target-indax-dangerous-event-handler + :enter (-> target-attack-air enter) + :exit (behavior () + ((-> target-attack-air exit)) + (target-indax-exit) + (none) + ) + :code (behavior ((arg0 symbol)) + (let ((gp-0 (-> self draw art-group data 428))) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! gp-0 + :num! (seek! + (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1)) + (-> self control current-surface align-speed) + ) + :frame-num 0.0 + ) + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (go + target-indax-jump + (-> *TARGET-bank* indax-jump-height-min) + (-> *TARGET-bank* indax-jump-height-max) + (the-as surface #f) + ) + ) + (suspend) + (ja :num! (seek! max (-> self control current-surface align-speed))) + ) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (go target-indax-falling #f) + (none) + ) + :post target-indax-post + ) + +(defstate target-indax-running-attack (target) + :event target-indax-dangerous-event-handler + :enter (-> target-running-attack enter) + :exit (behavior () + ((-> target-running-attack enter)) + (target-indax-exit) + (none) + ) + :code (behavior () + (if (logtest? (water-flags touch-water) (-> self water flags)) + (sound-play "swim-stroke") + ) + (set! (-> self control dynam gravity-max) 368640.0) + (set! (-> self control dynam gravity-length) 368640.0) + (let ((gp-1 (-> self draw art-group data 437))) + (ja-channel-push! 1 (seconds 0.02)) + (ja-no-eval :group! gp-1 :num! (seek! (the float (+ (-> (the-as art-joint-anim gp-1) frames num-frames) -1)))) + ) + (target-start-attack) + (target-danger-set! 'punch #f) + (let ((f26-0 (the-as number 0.0)) + (f30-0 1.0) + (gp-2 0) + (f28-0 1.0) + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (when (not (ja-min? 0)) + (cond + ((and (>= (ja-aframe-num 0) 20.0) + (and (and (not (logtest? (-> self control status) (collide-status on-surface))) + (>= (- (-> self clock frame-counter) (-> self control last-time-on-surface)) + (the-as time-frame (-> *TARGET-bank* ground-timeout)) + ) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (>= (- (-> self clock frame-counter) (-> self control sliding-start-time)) (seconds 0.04)) + ) + ) + (go target-indax-falling #f) + ) + ((< (the-as float f26-0) 0.0) + (set! f26-0 (seek (the-as float f26-0) -0.04096 (* 491520.0 (-> self clock seconds-per-frame)))) + (set-forward-vel (the-as float f26-0)) + ) + ((and (nonzero? (-> self control unknown-time-frame18)) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame18)) (seconds 0.04)) + ) + (set-forward-vel 0.0) + ) + ((and (not (cpad-hold? (-> self control cpad number) square)) + (>= (- (-> self clock frame-counter) (-> self control unknown-combo-tracker00 move-start-time)) + (seconds 0.05) + ) + ) + (if (= (-> self control ground-pat material) (pat-material ice)) + (set-forward-vel (fmax 32768.0 (* 0.8 (-> self control ctrl-xz-vel)))) + (set-forward-vel (* 0.8 (-> self control ctrl-xz-vel))) + ) + ) + ((ja-done? 0) + (set-forward-vel (the-as float f26-0)) + ) + (else + (set! f26-0 + (* (target-align-vel-z-adjust (-> self align delta trans z)) (-> self clock frames-per-second) f30-0) + ) + (set-forward-vel (the-as float f26-0)) + ) + ) + ) + (let ((s5-1 (new-stack-vector0))) + (vector-matrix*! s5-1 (-> self control transv) (-> self control w-R-c)) + (set! (-> s5-1 y) 0.0) + (vector-matrix*! (-> self control align-xz-vel) s5-1 (-> self control c-R-w)) + ) + (when (!= (the-as float (-> self control unknown-word04)) 0.0) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! f26-0 (-> self control unknown-word04)) + (set! (-> self control unknown-word04) (the-as uint 0.0)) + ) + (suspend) + (ja :num! (seek! max (* (-> self control current-surface align-speed) f28-0))) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1)) + (set! (-> *run-attack-mods* turnvv) 0.0) + ) + (if (< 2 gp-2) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control zx-vel-frac)))) + ) + (+! gp-2 1) + ) + ) + (if (and (not (logtest? (-> self control status) (collide-status on-surface))) + (>= (- (-> self clock frame-counter) (-> self control last-time-on-surface)) + (the-as time-frame (-> *TARGET-bank* ground-timeout)) + ) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (go target-indax-falling #f) + ) + (go target-indax-stance) + (none) + ) + :post target-post + ) + +;; WARN: Return type mismatch float vs none. +(defbehavior target-indax-hit-setup-anim target ((arg0 attack-info)) + (case (-> arg0 angle) + (('back) + (let ((v1-3 (ja-group))) + (when (not (and v1-3 (= v1-3 (-> self draw art-group data 431)))) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! (-> self draw art-group data 431) :num! min) + ) + ) + ) + (else + (let ((v1-12 (ja-group))) + (when (not (and v1-12 (= v1-12 (-> self draw art-group data 430)))) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! (-> self draw art-group data 430) :num! min) + ) + ) + ) + ) + (none) + ) + +(defstate target-indax-hit (target) + :event target-indax-handler + :exit (behavior () + ((-> target-hit exit)) + (target-indax-exit) + (none) + ) + :trans (behavior () + (when (= *cheat-mode* 'debug) + (when (and (not *pause-lock*) (cpad-hold? (-> self control cpad number) r2)) + (pickup-collectable! (-> self fact-override) (pickup-type health) 100.0 (the-as handle #f)) + (go target-indax-stance) + ) + ) + (none) + ) + :code (behavior ((arg0 symbol) (arg1 attack-info)) + (logclear! (-> self water flags) (water-flags jump-out)) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self neck flex-blend) 0.0) + (let ((gp-0 (-> self attack-info))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((v1-5 gp-0)) + (set! (-> v1-5 attacker) (the-as handle #f)) + (set! (-> v1-5 mode) 'generic) + (set! (-> v1-5 shove-back) 6144.0) + (set! (-> v1-5 shove-up) 4915.2) + (set! (-> v1-5 angle) #f) + (set! (-> v1-5 trans quad) (-> self control trans quad)) + (set! (-> v1-5 control) 0.0) + (set! (-> v1-5 invinc-time) (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout))) + (set! (-> v1-5 damage) (-> *FACT-bank* health-default-inc)) + ) + (case arg0 + (('shove) + (let ((v1-8 gp-0)) + (set! (-> v1-8 shove-back) (-> *TARGET-bank* smack-surface-dist)) + (set! (-> v1-8 shove-up) (-> *TARGET-bank* smack-surface-height)) + (set! (-> v1-8 angle) 'shove) + ) + ) + ) + (combine! gp-0 arg1 self) + (when (not (logtest? (-> gp-0 mask) (attack-info-mask vector))) + (vector-z-quaternion! (-> gp-0 vector) (-> self control quat-for-control)) + (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) + (set! (-> gp-0 vector y) (-> gp-0 shove-up)) + ) + (set! (-> s5-0 quad) (-> gp-0 vector quad)) + (let ((f0-12 (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-0 1.0) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) + ) + ) + ) + (if (not (-> self attack-info angle)) + (set! (-> self attack-info angle) (if (>= 0.0 f0-12) + 'front + 'back + ) + ) + ) + ) + (cond + ((= arg0 'attack) + (logior! (-> self focus-status) (focus-status hit)) + (set! (-> self game hit-time) (-> self clock frame-counter)) + (case (-> gp-0 mode) + (('endlessfall) + (cond + ((= (-> self game mode) 'debug) + (let ((s4-1 (new-stack-vector0))) + (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) + (ja-channel-set! 0) + (let ((s3-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s3-1) (seconds 1)) + (suspend) + ) + ) + (move-to-point! (-> self control) s4-1) + ) + (set! (-> self control camera-pos quad) (-> self control trans quad)) + (send-event *camera* 'teleport) + (go target-indax-stance) + ) + (else + (pickup-collectable! (-> self fact-override) (pickup-type health) -1000.0 (the-as handle #f)) + (go target-indax-death (-> gp-0 mode)) + ) + ) + ) + (('instant-death 'smush 'tomb-spider 'bot) + (pickup-collectable! (-> self fact-override) (pickup-type health) -1000.0 (the-as handle #f)) + (if (= (-> self game mode) 'play) + (go target-indax-death (-> gp-0 mode)) + ) + ) + (else + (pickup-collectable! (-> self fact-override) (pickup-type health) (- (-> gp-0 damage)) (the-as handle #f)) + ) + ) + (target-hit-effect gp-0) + ) + (else + (case (-> gp-0 mode) + (('burn 'burnup) + (sound-play "get-burned") + ) + ) + ) + ) + (set! (-> self control mod-surface) *smack-mods*) + (target-indax-hit-setup-anim gp-0) + (target-hit-move gp-0 (target-hit-orient gp-0 s5-0) target-falling-anim-trans 1.0) + ) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-override health))) + (go target-indax-death (-> gp-0 mode)) + ) + ) + (go target-indax-hit-ground #f) + (none) + ) + :post target-indax-post + ) + +(defstate target-indax-death (target) + :event (-> target-death event) + :exit (behavior () + ((-> target-death exit)) + (target-indax-exit) + (none) + ) + :trans (-> target-indax-hit trans) + :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) + (set-setting! 'process-mask 'set 0 (process-mask enemy platform projectile death)) + (apply-settings *setting-control*) + (set! (-> self control transv quad) (the-as uint128 0)) + (logior! (-> self focus-status) (focus-status dead)) + (cond + ((or (= arg0 'none) (= arg0 'instant-death) (= arg0 'bot)) + ) + ((= arg0 'endlessfall) + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "ds175" -99.0 0) + ) + (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) + (set! (-> self control pat-ignore-mask) + (logior (new 'static 'pat-surface :noendlessfall #x1) (-> self control pat-ignore-mask)) + ) + (logclear! (-> self water flags) (water-flags swim-ground)) + (set! (-> self post-hook) target-no-move-post) + (let ((f30-0 (if (rand-vu-percent? 0.2) + 0.0 + 55.0 + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 434) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 434)) frames num-frames) -1))) + :frame-num (ja-aframe f30-0 0) + ) + ) + (until (ja-done? 0) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (let ((v1-50 (process->ppointer self))) + (set! (-> a1-8 from) v1-50) + ) + (set! (-> a1-8 num-params) 2) + (set! (-> a1-8 message) 'joystick) + (set! (-> a1-8 param 0) (the-as uint 0)) + (set! (-> a1-8 param 1) (the-as uint -1082130432)) + (send-event-function *camera* a1-8) + ) + (vector-reset! (-> self control transv)) + (suspend) + (ja :num! (seek!)) + ) + (remove-setting! 'mode-name) + ) + ((= arg0 'smush) + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "ds173" -99.0 0) + ) + (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) + (set! (-> self control mod-surface) *neutral-mods*) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 433) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 433)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((= arg0 'tomb-spider) + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "ds173" -99.0 0) + ) + (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) + (set! (-> self control mod-surface) *neutral-mods*) + (ja-channel-push! 1 (seconds 0.1)) + (cond + ((rand-vu-percent? 0.5) + (ja-no-eval :group! (-> self draw art-group data 436) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 436)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 435) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 435)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (else + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "ds173" -99.0 0) + ) + (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) + (set! (-> self control mod-surface) *neutral-mods*) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 435) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 435)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (set! (-> self control transv quad) (the-as uint128 0)) + (initialize! (-> self game) 'life (the-as game-save #f) (the-as string #f)) + (set! (-> self state-time) (-> self clock frame-counter)) + (sleep-code) + (none) + ) + :post target-no-stick-post + ) diff --git a/goal_src/jak2/levels/mars_tomb/left/chase/tomb-boulder.gc b/goal_src/jak2/levels/mars_tomb/left/chase/tomb-boulder.gc index d4df71ba26..85023edc9c 100644 --- a/goal_src/jak2/levels/mars_tomb/left/chase/tomb-boulder.gc +++ b/goal_src/jak2/levels/mars_tomb/left/chase/tomb-boulder.gc @@ -5,5 +5,1415 @@ ;; name in dgo: tomb-boulder ;; dgos: TOE +(declare-type tomb-wing-door com-airlock) + ;; DECOMP BEGINS +(defpartgroup group-tomb-boulder-roll :id 739 :bounds (static-bspherem 0 0 0 40) :parts ((sp-item 3282))) + +(defpart 3282 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 2.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 96.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.08) (meters 0.026666667) 1.0) + (sp-flt spt-scalevel-x (meters 0.0033333334)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.16) + (sp-flt spt-accel-y -1.3653333) + (sp-flt spt-friction 0.95) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-conerot-x (degrees 80.0) (degrees 10.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpartgroup group-tomb-boulder-bounce + :id 740 + :duration (seconds 0.25) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 3282) + (sp-item 3282) + (sp-item 3282) + (sp-item 3282) + (sp-item 3282) + (sp-item 3282) + (sp-item 3282) + (sp-item 3282) + (sp-item 3282) + (sp-item 3282) + (sp-item 3282) + (sp-item 3282) + ) + ) + +(defskelgroup skel-tomb-boulder tomb-boulder 0 -1 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 7) + :origin-joint-index 4 + ) + +(defskelgroup skel-tomb-spider tomb-boulder 38 -1 + ((39 (meters 999999))) + :bounds (static-spherem 0 2 0 50) + :shadow 40 + :origin-joint-index 3 + :shadow-joint-index 3 + ) + +(defskelgroup skel-tomb-boulder-explode tomb-boulder 9 -1 + ((10 (meters 999999))) + :bounds (static-spherem 0 0 0 200) + :origin-joint-index 3 + ) + +(defskelgroup skel-tomb-boulder-stop tomb-boulder 15 -1 + ((16 (meters 999999))) + :bounds (static-spherem 0 0 0 200) + :origin-joint-index 7 + ) + +(defskelgroup skel-tomb-boulder-pillar tomb-boulder 24 -1 + ((25 (meters 999999))) + :bounds (static-spherem 0 15 0 30) + :origin-joint-index 3 + ) + +(defskelgroup skel-tomb-boulder-stick tomb-boulder 48 50 + ((49 (meters 999999))) + :bounds (static-spherem 0 0 0 3.5) + :origin-joint-index 3 + ) + +(defskelgroup skel-tomb-boulder-wing-door tomb-boulder 52 54 + ((53 (meters 999999))) + :bounds (static-spherem 0 -10 0 20) + :origin-joint-index 3 + ) + +(deftype tomb-spider (process-drawable) + ((root-override collide-shape-moving :offset 128) + ) + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defstate idle (tomb-spider) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('touch '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) (-> event param 0)) + (let ((v1-6 (new 'static 'attack-info :mask (attack-info-mask mode shove-up id)))) + (let* ((a2-3 *game-info*) + (a3-2 (+ (-> a2-3 attack-id) 1)) + ) + (set! (-> a2-3 attack-id) a3-2) + (set! (-> v1-6 id) a3-2) + ) + (set! (-> v1-6 shove-up) 12288.0) + (set! (-> v1-6 mode) 'tomb-spider) + (set! (-> a1-3 param 1) (the-as uint v1-6)) + ) + (send-event-function proc a1-3) + ) + ) + ) + ) + :code (behavior () + (until #f + ;; manually patched + (if (-> self parent) + (clone-anim-once (ppointer->handle (-> self parent)) #t "spider-") + ) + (update-transforms (-> self root-override)) + (suspend) + ) + #f + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior tomb-spider-init tomb-spider () + (let ((gp-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player)))) + (set! (-> gp-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> gp-0 reaction) cshape-reaction-default) + (set! (-> gp-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> gp-0 penetrated-by) (penetrate)) + (let ((s5-0 (new 'process 'collide-shape-prim-group gp-0 (the-as uint 2) 0))) + (set! (-> gp-0 total-prims) (the-as uint 3)) + (set! (-> s5-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s5-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s5-0 transform-index) 3) + (set-vector! (-> s5-0 local-sphere) 0.0 0.0 0.0 61440.0) + (set! (-> gp-0 root-prim) s5-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-sphere gp-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-12 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-12 transform-index) 6) + (set-vector! (-> v1-12 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere gp-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy pusher)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-14 transform-index) 4) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 10240.0 6963.2) + ) + (set! (-> gp-0 nav-radius) (* 0.75 (-> gp-0 root-prim local-sphere w))) + (let ((v1-17 (-> gp-0 root-prim))) + (set! (-> gp-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> gp-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> self root-override) gp-0) + ) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-spider" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (logior! (-> self skel status) (joint-control-status sync-math)) + (go-virtual idle) + (none) + ) + +(deftype tomb-boulder-stop (process-drawable) + ((root-override collide-shape-moving :offset 128) + (prefix string :offset-assert 200) + ) + :heap-base #x50 + :method-count-assert 21 + :size-assert #xcc + :flag-assert #x15005000cc + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defstate idle (tomb-boulder-stop) + :virtual #t + :code (behavior () + (until #f + ;; manually patched + (if (-> self parent) + (clone-anim-once (ppointer->handle (-> self parent)) #t (-> self prefix)) + ) + (update-transforms (-> self root-override)) + (suspend) + ) + #f + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior tomb-boulder-stop-init tomb-boulder-stop ((arg0 string)) + (let ((s5-0 (new 'process 'collide-shape-moving self (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 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 enemy pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 transform-index) 7) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 122880.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle)) + (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! (-> v1-14 transform-index) 7) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 122880.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! (-> self root-override) s5-0) + ) + (set! (-> self prefix) arg0) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boulder-stop" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (logior! (-> self skel status) (joint-control-status sync-math)) + (go-virtual idle) + (none) + ) + +(deftype tomb-boulder-pillar (process-drawable) + ((root-override collide-shape-moving :offset 128) + (prefix string :offset-assert 200) + ) + :heap-base #x50 + :method-count-assert 21 + :size-assert #xcc + :flag-assert #x15005000cc + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defstate idle (tomb-boulder-pillar) + :virtual #t + :trans (the-as (function none :behavior tomb-boulder-pillar) rider-trans) + :code (behavior () + (until #f + ;; manually patched + (if (-> self parent) + (clone-anim-once (ppointer->handle (-> self parent)) #t (-> self prefix)) + ) + (update-transforms (-> self root-override)) + (pull-riders! (-> self root-override)) + (do-push-aways (-> self root-override)) + (suspend) + ) + #f + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior tomb-boulder-pillar-init tomb-boulder-pillar ((arg0 string)) + (let ((s5-0 (new 'process 'collide-shape-moving self (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) + ) + (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 36864.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-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! (-> self root-override) s5-0) + ) + (set! (-> self prefix) arg0) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-tomb-boulder-pillar" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (logior! (-> self skel status) (joint-control-status sync-math)) + (go-virtual idle) + (none) + ) + +(deftype tomb-boulder (process-drawable) + ((root-override collide-shape-moving :offset 128) + (art-name string :offset-assert 200) + (anim spool-anim :offset-assert 204) + (loop-id uint32 :offset-assert 208) + (spider (pointer tomb-spider) :offset-assert 212) + (explode (pointer process) :offset-assert 216) + (stick basic :offset-assert 220) + (wing-door (pointer tomb-wing-door) :offset-assert 224) + (stop (pointer tomb-boulder-stop) 2 :offset-assert 228) + (pillar (pointer tomb-boulder-pillar) 4 :offset-assert 236) + (mode uint32 :offset-assert 252) + (sub-mode uint32 :offset-assert 256) + (gui-id uint32 :offset-assert 260) + (target-pause symbol :offset-assert 264) + (current-pause symbol :offset-assert 268) + (previous-y-vel float :offset-assert 272) + (previous-y float :offset-assert 276) + (target-speed float :offset-assert 280) + (current-speed float :offset-assert 284) + (distance meters :offset-assert 288) + (distance-target meters :offset-assert 292) + (distance-offset float :offset-assert 296) + (speed-time time-frame :offset-assert 304) + (trans vector 2 :inline :offset-assert 320) + (dir vector :inline :offset-assert 352) + (distance-adjust (array float) :offset-assert 368) + ) + :heap-base #x100 + :method-count-assert 22 + :size-assert #x174 + :flag-assert #x1601000174 + (:methods + (chase (spool-anim) _type_ :state 20) + (idle () _type_ :state 21) + ) + ) + + +(defstate idle (tomb-boulder) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('draw) + (if (-> event param 0) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + (let ((s5-0 (-> self child))) + (while s5-0 + (send-event (ppointer->process s5-0) 'draw (-> event param 0)) + (set! s5-0 (-> s5-0 0 brother)) + ) + ) + #f + ) + ) + ) + ) + :exit (behavior () + (while (-> self child) + (deactivate (-> self child 0)) + ) + (none) + ) + :trans (behavior () + (cond + ((or (not *target*) + *scene-player* + (logtest? (focus-status teleporting) (-> *target* focus-status)) + (task-node-closed? (game-task-node tomb-poles-boulder)) + ) + ) + ((string= (-> *game-info* current-continue name) "tomb-boulder") + (set! (-> self mode) (the-as uint 0)) + (go-virtual chase (new 'static 'spool-anim + :name "tomb-spider-chase-0" + :anim-name "tomb-spider-chase-0" + :parts 5 + :command-list '() + ) + ) + ) + ((string= (-> *game-info* current-continue name) "tomb-boulder-explode") + (set! (-> self mode) (the-as uint 10)) + (go-virtual chase (new 'static 'spool-anim + :name "tomb-spider-chase-1" + :anim-name "tomb-spider-chase-1" + :parts 18 + :command-list '() + ) + ) + ) + ((string= (-> *game-info* current-continue name) "tomb-boulder-climb") + (set! (-> self mode) (the-as uint 11)) + (go-virtual chase (new 'static 'spool-anim + :name "tomb-spider-chase-2" + :anim-name "tomb-spider-chase-2" + :parts 9 + :command-list '() + ) + ) + ) + ) + (none) + ) + :code (behavior () + (cond + ((task-node-closed? (game-task-node tomb-poles-boulder)) + (ja-channel-set! 0) + (transform-post) + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + ) + (else + (set! (-> self stick) + (the-as basic (process-spawn + manipy + :init manipy-init + (-> self root-override trans) + (-> self entity) + (art-group-get-by-name *level* "skel-tomb-boulder-stick" (the-as (pointer uint32) #f)) + #f + 0 + :name "tomb-boulder-stick" + :to self + ) + ) + ) + (let ((v1-9 (-> self root-override root-prim))) + (set! (-> v1-9 prim-core collide-as) (-> self root-override backup-collide-as)) + (set! (-> v1-9 prim-core collide-with) (-> self root-override backup-collide-with)) + ) + (ja-channel-set! 1) + (ja :group! (-> self draw art-group data 2)) + (transform-post) + (until #f + (when (and (not *scene-player*) + *target* + (and (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (let ((gp-2 (ppointer->handle (process-spawn scene-player :init scene-player-init "tomb-boulder-start" #t #f)))) + (while (handle->process (the-as handle gp-2)) + (suspend) + ) + ) + (sleep-code) + ) + (suspend) + ) + #f + ) + ) + (sleep-code) + (none) + ) + ) + +(defstate chase (tomb-boulder) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (local-vars (v0-0 object)) + (case event-type + (('touch 'attack) + (when (not (-> self current-pause)) + (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) 'attack) + (set! (-> a1-5 param 0) (-> event param 0)) + (let ((v1-6 (new 'static 'attack-info :mask (attack-info-mask mode shove-up id)))) + (let* ((a2-3 *game-info*) + (a3-2 (+ (-> a2-3 attack-id) 1)) + ) + (set! (-> a2-3 attack-id) a3-2) + (set! (-> v1-6 id) a3-2) + ) + (set! (-> v1-6 shove-up) 12288.0) + (set! (-> v1-6 mode) 'smush) + (set! (-> a1-5 param 1) (the-as uint v1-6)) + ) + (send-event-function proc a1-5) + ) + ) + ) + (('end-mode 'reset) + (go-virtual idle) + ) + (('pause) + (set! v0-0 (-> event param 0)) + (set! (-> self target-pause) (the-as symbol v0-0)) + v0-0 + ) + (('draw) + (cond + ((-> event param 0) + (set! v0-0 (logclear (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + ) + (else + (set! v0-0 (logior (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + ) + ) + v0-0 + ) + (('trigger) + (set! v0-0 1) + (set! (-> self sub-mode) (the-as uint v0-0)) + v0-0 + ) + (('mode) + (set! v0-0 (command-get-int (-> event param 0) 0)) + (set! (-> self mode) (the-as uint v0-0)) + v0-0 + ) + ) + ) + :enter (behavior ((arg0 spool-anim)) + (set! (-> self anim) arg0) + (set! (-> self sub-mode) (the-as uint 0)) + (set! (-> self current-speed) 0.0) + (set! (-> self previous-y-vel) 0.0) + (set! (-> self previous-y) (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4)) y)) + (set! (-> self spider) (process-spawn tomb-spider :init tomb-spider-init :to self)) + (set! (-> self explode) + (process-spawn + manipy + :init manipy-init + (-> self root-override trans) + (-> self entity) + (art-group-get-by-name *level* "skel-tomb-boulder-explode" (the-as (pointer uint32) #f)) + #f + 0 + :name "tomb-boulder-explode" + :to self + ) + ) + (send-event (ppointer->process (-> self explode)) 'anim-mode 'clone-anim) + (send-event (ppointer->process (-> self explode)) 'prefix "explode-") + (set! (-> self wing-door) + (the-as + (pointer tomb-wing-door) + (process-spawn + manipy + :init manipy-init + (-> self root-override trans) + (-> self entity) + (art-group-get-by-name *level* "skel-tomb-boulder-wing-door" (the-as (pointer uint32) #f)) + #f + 0 + :name "tomb-boulder-wing-door" + :to self + ) + ) + ) + (send-event (ppointer->process (-> self wing-door)) 'anim-mode 'clone-anim) + (send-event (ppointer->process (-> self wing-door)) 'prefix "wing-door-") + (set! (-> self stop 0) (process-spawn tomb-boulder-stop :init tomb-boulder-stop-init "stop-a-" :to self)) + (set! (-> self stop 1) (process-spawn tomb-boulder-stop :init tomb-boulder-stop-init "stop-b-" :to self)) + (set! (-> self pillar 0) + (process-spawn tomb-boulder-pillar :init tomb-boulder-pillar-init "pillar-a-" :to self) + ) + (set! (-> self pillar 1) + (process-spawn tomb-boulder-pillar :init tomb-boulder-pillar-init "pillar-b-" :to self) + ) + (set! (-> self pillar 2) + (process-spawn tomb-boulder-pillar :init tomb-boulder-pillar-init "pillar-c-" :to self) + ) + (set! (-> self pillar 3) + (process-spawn tomb-boulder-pillar :init tomb-boulder-pillar-init "pillar-d-" :to self) + ) + (cond + ((< (-> self mode) (the-as uint 10)) + (set! (-> self root-override root-prim prim-core collide-with) (collide-spec jak player-list)) + (set! (-> self distance-adjust) (new 'static 'boxed-array :type float + 0.0 + 15.0 + 0.25 + 160.0 + 15.0 + 0.25 + 180.0 + 25.0 + 0.25 + 220.0 + 25.0 + 0.25 + 250.0 + 10.0 + 0.25 + ) + ) + ) + (else + (set! (-> self root-override root-prim prim-core collide-with) (collide-spec)) + (set! (-> self distance-adjust) (new 'static 'boxed-array :type float + 0.0 + 15.0 + 0.25 + 300.0 + 25.0 + 0.25 + 340.0 + 25.0 + 0.25 + 355.0 + 10.0 + 0.25 + 365.0 + 15.0 + 0.25 + 430.0 + 25.0 + 0.25 + 460.0 + 25.0 + 0.25 + 475.0 + 10.0 + 0.25 + 480.0 + 15.0 + 0.25 + 550.0 + 30.0 + 0.25 + 580.0 + 30.0 + 0.25 + 615.0 + 10.0 + 0.25 + 620.0 + 10.0 + 0.25 + 640.0 + 15.0 + 0.25 + 840.0 + 10.0 + 0.5 + 900.0 + 10.0 + 0.25 + 950.0 + 5.0 + 0.4 + 1050.0 + 5.0 + 0.4 + 1051.0 + 15.0 + 0.25 + 1150.0 + 25.0 + 0.25 + 1250.0 + 10.0 + 0.25 + 1270.0 + 10.0 + 0.25 + 1290.0 + 15.0 + 0.25 + ) + ) + ) + ) + (set-setting! 'music 'danger11 0 0) + (process-entity-status! self (entity-perm-status no-kill) #t) + (none) + ) + :exit (behavior () + (when (= (-> *setting-control* user-current spooling) (process->ppointer self)) + (ja-abort-spooled-anim (-> self anim) (the-as art-joint-anim #f) -1) + (ja-channel-set! 0) + ) + (remove-process *gui-control* self (gui-channel art-load-next)) + (let ((v1-5 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-5 command) (sound-command set-param)) + (set! (-> v1-5 id) (the-as sound-id (-> self loop-id))) + (set! (-> v1-5 params volume) -4) + (set! (-> v1-5 auto-time) 240) + (set! (-> v1-5 auto-from) 2) + (set! (-> v1-5 params mask) (the-as uint 17)) + (-> v1-5 id) + ) + (while (-> self child) + (deactivate (-> self child 0)) + ) + (set! (-> self target-pause) #f) + (set! (-> self current-pause) #f) + (set! (-> self mode) (the-as uint 0)) + (remove-setting! 'music) + (persist-with-delay *setting-control* 'music (seconds 1) 'music 'danger11 0.0 0) + (process-entity-status! self (entity-perm-status no-kill) #f) + (none) + ) + :code (behavior ((arg0 spool-anim)) + (play-clean #f) + (set! (-> self gui-id) + (the-as + uint + (add-process *gui-control* self (gui-channel art-load-next) (gui-action queue) (-> self anim name) -1.0 0) + ) + ) + (while (!= (get-status *gui-control* (the-as sound-id (-> self gui-id))) (gui-status ready)) + (set-blackout-frames (seconds 0.1)) + (suspend) + ) + (let ((v1-7 (lookup-gui-connection + *gui-control* + self + (gui-channel art-load-next) + (the-as string #f) + (new 'static 'sound-id) + ) + ) + ) + (if v1-7 + (set! (-> v1-7 channel) (gui-channel art-load)) + ) + ) + (ja-play-spooled-anim + (-> self anim) + (if (string= (the-as string (-> self anim anim-name)) "tomb-spider-chase-0") + (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) + (get-art-by-name (-> self draw art-group) "mid" art-joint-anim) + ) + (if (string= (the-as string (-> self anim anim-name)) "tomb-spider-chase-0") + (get-art-by-name (-> self draw art-group) "mid" art-joint-anim) + (get-art-by-name (-> self draw art-group) "end" art-joint-anim) + ) + (the-as (function process-drawable symbol) false-func) + ) + (case (-> self mode) + ((2) + (set-blackout-frames (seconds 0.1)) + (ja-channel-set! 0) + (let ((gp-3 (ppointer->handle (process-spawn scene-player :init scene-player-init "tomb-spider-scare" #t #f)))) + (while (handle->process (the-as handle gp-3)) + (suspend) + ) + ) + ) + ((10 11 12 13 14) + (remove-setting! 'music) + (task-node-close! (game-task-node tomb-poles-boulder)) + (auto-save-user) + (if (and *target* (zero? (logand (-> *target* focus-status) (focus-status dead)))) + (start 'play (get-continue-by-name *game-info* "tomb-boulder-end")) + ) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + ) + ) + (sleep-code) + (none) + ) + :post (behavior () + (let ((v1-0 (-> self mode))) + (cond + ((or (zero? v1-0) (= v1-0 1)) + (when (and (not (-> self target-pause)) (not (-> self current-pause))) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (vector<-cspace! (-> gp-0 start-pos) (-> self node-list data 4)) + (set-vector! (-> gp-0 move-dist) 0.0 -24576.0 0.0 1.0) + (let ((v1-7 gp-0)) + (set! (-> v1-7 radius) 409.6) + (set! (-> v1-7 collide-with) (collide-spec backgnd)) + (set! (-> v1-7 ignore-process0) self) + (set! (-> v1-7 ignore-process1) #f) + (set! (-> v1-7 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-7 action-mask) (collide-action solid)) + ) + (let ((f30-0 (- (-> gp-0 start-pos y) (-> self previous-y)))) + (if *debug-segment* + (format *stdcon* "yvel ~M pyvel ~M~%" f30-0 (-> self previous-y-vel)) + ) + (when (< 409.6 (- f30-0 (-> self previous-y-vel))) + (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when s5-0 + (let ((t9-3 (method-of-type part-tracker activate))) + (t9-3 (the-as part-tracker s5-0) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-4 run-function-in-process) + (a0-12 s5-0) + (a1-5 part-tracker-init) + (a2-5 (-> *part-group-id-table* 740)) + (a3-2 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) + (-> (vector+! (new 'stack-no-clear 'vector) (-> gp-0 start-pos) (-> gp-0 move-dist)) quad) + ) + ((the-as (function object object object object object object object object none) t9-4) + a0-12 + a1-5 + a2-5 + a3-2 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> s5-0 ppointer) + ) + ) + ) + (set! (-> self previous-y-vel) f30-0) + ) + (set! (-> self previous-y) (-> gp-0 start-pos y)) + (let ((f0-9 (fill-and-probe-using-line-sphere *collide-cache* gp-0))) + (if (< 0.0 f0-9) + (spawn + (-> self part) + (vector+float*! (new 'stack-no-clear 'vector) (-> gp-0 start-pos) (-> gp-0 move-dist) f0-9) + ) + ) + ) + ) + ) + (when (>= (ja-aframe-num 0) 250.0) + (set! (-> self target-pause) #t) + (ja :num-func num-func-identity :frame-num (ja-aframe 250.0 0)) + (set! (-> self mode) (the-as uint 1)) + ) + (case (-> self sub-mode) + ((1) + (when (send-event *target* 'trip) + (set! (-> self sub-mode) (the-as uint 2)) + (set! (-> self mode) (the-as uint 2)) + (set! (-> self target-pause) #f) + (sound-play "spider-wall1" :position (-> self trans)) + ) + ) + ) + ) + ((or (= v1-0 10) (= v1-0 11)) + (when (>= (ja-aframe-num 0) 840.0) + (set! (-> self target-pause) #t) + (ja :num-func num-func-identity :frame-num (ja-aframe 840.0 0)) + (if (= (-> self mode) 10) + (set-continue! *game-info* "tomb-boulder-climb" #f) + ) + (set! (-> self mode) (the-as uint 11)) + ) + ) + ((= v1-0 12) + (set-continue! *game-info* "tomb-boulder-climb" #f) + (set! (-> self target-pause) #f) + (set! (-> self mode) (the-as uint 13)) + ) + ((= v1-0 13) + (case (-> self sub-mode) + ((1) + (when (send-event *target* 'trip) + (set! (-> self sub-mode) (the-as uint 2)) + (set! (-> self mode) (the-as uint 14)) + ) + ) + ) + ) + ) + ) + (transform-post) + (cond + ((-> self target-pause) + (set! (-> self current-pause) #t) + (sound-pause (the-as sound-id (-> self gui-id))) + ) + ((-> self current-pause) + (set! (-> self current-pause) #f) + (sound-continue (the-as sound-id (-> self gui-id))) + ) + ) + (set! (-> (the-as vector (&-> self stack 208)) quad) (-> self trans 0 quad)) + (if (< (-> self mode) (the-as uint 10)) + (vector<-cspace! (the-as vector (-> self trans)) (-> self node-list data (-> self draw origin-joint-index))) + (vector<-cspace! (the-as vector (-> self trans)) (-> self spider 0 node-list data 3)) + ) + (let ((s4-1 + (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> self trans)) (the-as vector (&-> self stack 208))) + ) + ) + (case (-> self mode) + ((11) + (vector-normalize-copy! (-> self dir) s4-1 1.0) + ) + (else + (let ((f30-1 (deg-seek + (vector-y-angle (-> self dir)) + (vector-y-angle s4-1) + (* 5461.3335 (-> self clock seconds-per-frame)) + ) + ) + ) + (set-vector! (-> self dir) (sin f30-1) 0.0 (cos f30-1) 1.0) + ) + ) + ) + ) + (let* ((gp-8 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (the-as vector (-> self trans)))) + (f0-20 (vector-length gp-8)) + ) + (set! (-> self distance) (if (< 81920.0 f0-20) + f0-20 + (vector-dot (-> self dir) gp-8) + ) + ) + ) + (when (or (< (-> self distance) -40960.0) (< (-> self target-speed) -5.0)) + (cond + ((< (-> self mode) (the-as uint 10)) + (let ((a1-23 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-23 from) (process->ppointer self)) + (set! (-> a1-23 num-params) 2) + (set! (-> a1-23 message) 'attack) + (set! (-> a1-23 param 0) (the-as uint #f)) + (let ((v1-109 (new 'static 'attack-info :mask (attack-info-mask mode shove-up id)))) + (let* ((a0-53 *game-info*) + (a2-13 (+ (-> a0-53 attack-id) 1)) + ) + (set! (-> a0-53 attack-id) a2-13) + (set! (-> v1-109 id) a2-13) + ) + (set! (-> v1-109 shove-up) 12288.0) + (set! (-> v1-109 mode) 'smush) + (set! (-> a1-23 param 1) (the-as uint v1-109)) + ) + (send-event-function *target* a1-23) + ) + ) + (else + (let ((a1-24 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-24 from) (process->ppointer self)) + (set! (-> a1-24 num-params) 2) + (set! (-> a1-24 message) 'attack) + (set! (-> a1-24 param 0) (the-as uint #f)) + (let ((v1-114 (new 'static 'attack-info :mask (attack-info-mask mode shove-up id)))) + (let* ((a0-58 *game-info*) + (a2-15 (+ (-> a0-58 attack-id) 1)) + ) + (set! (-> a0-58 attack-id) a2-15) + (set! (-> v1-114 id) a2-15) + ) + (set! (-> v1-114 shove-up) 12288.0) + (set! (-> v1-114 mode) 'tomb-spider) + (set! (-> a1-24 param 1) (the-as uint v1-114)) + ) + (send-event-function *target* a1-24) + ) + ) + ) + ) + (let ((f30-2 0.0) + (f26-0 0.0) + (f0-27 (ja-aframe-num 0)) + (v1-116 (-> self distance-adjust)) + (f28-0 0.25) + ) + (dotimes (t0-2 (/ (the-as int (-> v1-116 length)) 3)) + (set! f28-0 (cond + ((>= f0-27 (-> (the-as (array float) (+ (* 12 t0-2) (the-as int v1-116))) 0)) + (set! f30-2 (-> (the-as (array float) (+ (* 12 t0-2) (the-as int v1-116))) 0)) + (set! f26-0 (-> (the-as (array float) (+ (* (+ (* 3 t0-2) 1) 4) (the-as int v1-116))) 0)) + (-> v1-116 (+ (* 3 t0-2) 2)) + ) + (else + (set! f26-0 (lerp-scale + f26-0 + (-> v1-116 (+ (* 3 t0-2) 1)) + f0-27 + f30-2 + (-> (the-as (array float) (+ (* 12 t0-2) (the-as int v1-116))) 0) + ) + ) + (goto cfg-76) + f28-0 + ) + ) + ) + ) + (label cfg-76) + (set! (-> self distance-target) (* 4096.0 f26-0)) + (set! (-> self distance-offset) f28-0) + ) + (let ((f30-3 (lerp-scale + (- (-> self distance-offset)) + (-> self distance-offset) + (-> self distance) + (+ -20480.0 (-> self distance-target)) + (+ 20480.0 (-> self distance-target)) + ) + ) + ) + (if (and *target* (logtest? (-> *target* focus-status) (focus-status dead))) + (set! f30-3 0.5) + ) + (when (or (< (vector-vector-distance (the-as vector (-> self trans)) (camera-pos)) 36864.0) + (< (-> self target-speed) -5.0) + ) + (set! f30-3 -20.0) + (seek! (-> self target-speed) f30-3 (* 20.0 (-> self clock seconds-per-frame))) + ) + (seek! (-> self target-speed) f30-3 (-> self clock seconds-per-frame)) + (when (or (!= (-> self target-speed) (-> self current-speed)) + (>= (- (-> self clock frame-counter) (-> self speed-time)) (seconds 0.2)) + ) + (set! (-> self current-speed) (-> self target-speed)) + (set! (-> self speed-time) (-> self clock frame-counter)) + (when *sound-player-enable* + (let ((v1-151 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-151 command) (sound-command set-param)) + (set! (-> v1-151 id) (the-as sound-id (-> self gui-id))) + (set! (-> v1-151 params pitch-mod) (the int (* 1524.0 (-> self current-speed)))) + (set! (-> v1-151 params mask) (the-as uint 2)) + (-> v1-151 id) + ) + ) + ) + (if *debug-segment* + (format + *stdcon* + "distance ~,,2m ~,,2m targ ~,,2f speed ~,,2f~%" + (-> self distance) + (-> self distance-target) + f30-3 + (-> self target-speed) + ) + ) + ) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-boulder ((obj tomb-boulder) (arg0 entity-actor)) + (stack-size-set! (-> obj main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum 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 penetrated-by) (penetrate)) + (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy pusher)) + (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) 4) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 25395.2) + (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-18 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (logclear! (-> obj mask) (process-mask actor-pause)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boulder" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (logior! (-> obj skel status) (joint-control-status sync-math)) + (set! (-> obj art-name) "tomb-boulder") + (set! (-> obj loop-id) (the-as uint (new-sound-id))) + (set! (-> obj target-pause) #f) + (set! (-> obj current-pause) #f) + (set-vector! (-> obj dir) 1.0 0.0 0.0 1.0) + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 739) obj)) + (set! (-> obj draw light-index) (the-as uint 11)) + (go (method-of-object obj idle)) + (none) + ) + +(scene-method-16 + (new 'static 'scene + :name "tomb-boulder-start" + :extra #f + :info #f + :mask-to-clear #x1282000 + :entity "scene-stage-46" + :art-group "scenecamera" + :anim "tomb-boulder-start" + :parts 5 + :command-list '((0 + (send-event "tomb-boulder-4" 'draw #f) + (send-event "jak-highres" 'eval ,(lambda ((arg0 process-drawable)) (let ((v0-0 (-> arg0 root scale))) + (set! (-> v0-0 x) 1.4) + (set! (-> v0-0 y) 1.4) + (set! (-> v0-0 z) 1.4) + (set! (-> v0-0 w) 1.0) + v0-0 + ) + ) + ) + (fadein (frame-time-30 10)) + (setting-reset music mode 'danger11) + ) + (10000 + (send-event "tomb-boulder-4" 'draw #t) + (send-event "tomb-boulder-4" 'trigger) + (task-close! "tomb-poles-poles") + ) + ) + :cut-list '() + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :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 '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'tomba + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'tomba + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tomb-boulder" + :level 'tombe + :art-group "skel-tomb-boulder" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tomb-boulder-stick" + :level 'tombe + :art-group "skel-tomb-boulder-stick" + :prefix "stick-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "tomb-boulder" + :end-point-obj "tomb-boulder" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :save #t + ) + ) + +(defskelgroup skel-spider-eyes spider-eyes 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :origin-joint-index 3 + ) + +(deftype spider-eyes (process-drawable) + ((root-override collide-shape-moving :offset 128) + (node-index uint32 :offset-assert 200) + ) + :heap-base #x50 + :method-count-assert 22 + :size-assert #xcc + :flag-assert #x16005000cc + (:methods + (idle () _type_ :state 20) + (spider-eyes-method-21 (_type_) none 21) + ) + ) + + +(defmethod spider-eyes-method-21 spider-eyes ((obj spider-eyes)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s3-0 *camera-other-matrix*) + (s5-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (let ((f0-3 (* 0.25 (sin (* 0.5 (-> *camera-other-fov* data)))))) + (set-vector! (-> obj root-override scale) f0-3 f0-3 f0-3 1.0) + ) + (set! (-> gp-0 quad) (-> *camera-other-trans* quad)) + (vector-normalize-copy! s5-0 (-> s3-0 vector 2) 1.0) + (matrix->quaternion (-> obj root-override quat) s3-0) + (let ((v1-8 (-> obj root-override trans))) + (let ((a0-8 2048.0)) + (.mov vf7 a0-8) + ) + (.lvf vf5 (&-> s5-0 quad)) + (.lvf vf4 (&-> gp-0 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-8 quad) vf6) + ) + ) + 0 + (none) + ) + ) + +(defstate idle (spider-eyes) + :virtual #t + :code (the-as (function none :behavior spider-eyes) sleep-code) + :post (behavior () + (spider-eyes-method-21 self) + (ja-post) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior spider-eyes-init-by-other spider-eyes ((arg0 entity-actor) (arg1 object) (arg2 uint)) + (process-entity-set! self arg0) + (set! (-> self node-index) arg2) + (set! (-> self root-override) (the-as collide-shape-moving (new 'process 'trsqv))) + (set! (-> self root-override trans quad) (-> *null-vector* quad)) + (quaternion-copy! (-> self root-override quat) *unity-quaternion*) + (vector-identity! (-> self root-override scale)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-spider-eyes" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (go-virtual idle) + (none) + ) + +(scene-method-16 (new 'static 'scene + :name "tomb-spider-scare" + :extra #f + :info #f + :mask-to-clear #x1282000 + :entity "scene-stage-46" + :art-group "scenecamera" + :anim "tomb-spider-scare" + :parts 3 + :command-list '((0 (send-event "tomb-boulder-4" 'draw #f)) + (115 (part-tracker + "group-tomb-spider-chase-explosion-fma" + entity + "tomb-spider" + joint + "head" + track + #t + duration + (frame-time 1) + ) + ) + (240 (joint-eval + ,(lambda ((arg0 process) (arg1 vector) (arg2 cspace) (arg3 object) (arg4 object)) + (process-spawn + spider-eyes + (entity-by-type tomb-boulder) + (+ (-> arg2 joint number) 1) + (the-as none arg4) + :to (-> arg0 child 0) + ) + ) + entity + "scenecamera" + joint + "camera" + ) + ) + (10000 (send-event "tomb-boulder-4" 'draw #t) (send-event "tomb-boulder-4" 'trigger)) + ) + :cut-list '(240) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :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 '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'tomba + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tomb-spider" + :level 'tombe + :art-group "skel-tomb-spider" + :prefix "spider-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "tomb-boulder-explode" + :end-point-obj "tomb-boulder-explode" + :borrow '() + :sfx-volume 1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :save #f + ) + ) diff --git a/goal_src/jak2/levels/mars_tomb/monster-frog.gc b/goal_src/jak2/levels/mars_tomb/monster-frog.gc index f7c8f40841..d1e181d7ec 100644 --- a/goal_src/jak2/levels/mars_tomb/monster-frog.gc +++ b/goal_src/jak2/levels/mars_tomb/monster-frog.gc @@ -37,7 +37,16 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 8 #x1e0002 #x3020401 #x1e0002 #x2010501 #x0 #x0 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 8 + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x2 :param1 #x3) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x2) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 4 :notice-anim 8 :hostile-anim 18 diff --git a/goal_src/jak2/levels/mars_tomb/tomb-beetle.gc b/goal_src/jak2/levels/mars_tomb/tomb-beetle.gc index c664d6bd78..a8f847833d 100644 --- a/goal_src/jak2/levels/mars_tomb/tomb-beetle.gc +++ b/goal_src/jak2/levels/mars_tomb/tomb-beetle.gc @@ -7,3 +7,1056 @@ ;; DECOMP BEGINS +(defskelgroup skel-tomb-beetle tomb-beetle 0 -1 + ((1 (meters 999999))) + :bounds (static-spherem 0 0.6 0 2) + :shadow 2 + ) + +(deftype tomb-beetle-fly-info (structure) + ((dst vector :inline :offset-assert 0) + (dst-quat quaternion :inline :offset-assert 16) + (dist meters :offset-assert 32) + (threshold meters :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + + +(deftype tomb-beetle (nav-enemy) + ((src-quat quaternion :inline :offset-assert 608) + (fly-info tomb-beetle-fly-info 2 :inline :offset-assert 624) + (speed meters :offset-assert 720) + (init-height meters :offset-assert 724) + (flags uint16 :offset-assert 728) + (dest-index int32 :offset-assert 732) + (round uint32 :offset-assert 736) + (flying? symbol :offset-assert 740) + (fly-away-radius float :offset-assert 744) + (fly-away-ry float :offset-assert 748) + (fly-away-ry-speed float :offset-assert 752) + (fly-away-acc float :offset-assert 756) + (fly-away-dir vector :inline :offset-assert 768) + ) + :heap-base #x290 + :method-count-assert 186 + :size-assert #x310 + :flag-assert #xba02900310 + (:methods + (tomb-beetle-method-178 (_type_) none 178) + (explode () _type_ :state 179) + (fly-away () _type_ :state 180) + (go-to-door () _type_ :state 181) + (key () _type_ :state 182) + (land () _type_ :state 183) + (stand () _type_ :state 184) + (tomb-beetle-method-185 (_type_) none 185) + ) + ) + + +(define *tomb-beetle-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 #f + :idle-anim 5 + :notice-anim -1 + :hostile-anim -1 + :hit-anim -1 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim 13 + :die-falling-anim 3 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint -1 + :look-at-joint 3 + :bullseye-joint 3 + :sound-hit (static-sound-name "tomb-beetle-hit") + :sound-die (static-sound-name "tomb-beetle-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 40) + :default-hit-points 1 + :gnd-collide-with (collide-spec backgnd) + :penetrate-knocked #x11fffdffa + :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) + :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 + :shadow-size (meters 2) + :shadow-max-y (meters 10) + :shadow-min-y (meters -15) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim -1 + :turn-anim -1 + :run-anim -1 + :taunt-anim -1 + :run-travel-speed (meters 10) + :run-acceleration (meters 1) + :run-turning-acceleration (meters 500) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 1080.0) + :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! (-> *tomb-beetle-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defmethod enemy-method-74 tomb-beetle ((obj tomb-beetle) (arg0 process) (arg1 object) (arg2 symbol) (arg3 event-message-block)) + (with-pp + (let ((v1-0 (new 'static 'array int64 2 -1 0))) + (case arg2 + (('cue-chase) + (set! (-> obj round) (-> arg3 param 0)) + ((method-of-type nav-enemy enemy-method-74) obj arg0 arg1 arg2 arg3) + ) + (('attack) + (when (and (-> obj next-state) (let ((a1-4 (-> obj next-state name))) + (or (= a1-4 'active) (= a1-4 'stand)) + ) + ) + (-> arg3 param 1) + (cond + ((logtest? (-> obj fact-info-override enemy-options) (ash 1 (+ (-> obj round) 8))) + (set! (-> v1-0 0) (the-as int (-> pp clock frame-counter))) + (go (method-of-object obj go-to-door)) + ) + ((>= (- (-> pp clock frame-counter) (the-as time-frame (-> v1-0 0))) (seconds 0.5)) + (logior! (-> obj flags) 1) + (go (method-of-object obj die)) + ) + ) + ) + ) + (('die) + (cond + ((and (-> obj next-state) (= (-> obj next-state name) 'key)) + (go (method-of-object obj explode)) + ) + ((not (and (-> obj next-state) (= (-> obj next-state name) 'dormant))) + (go (method-of-object obj fly-away)) + ) + ) + ) + (else + ((method-of-type nav-enemy enemy-method-74) obj arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + +(defmethod tomb-beetle-method-185 tomb-beetle ((obj tomb-beetle)) + (cond + ((-> obj draw shadow) + (new 'stack-no-clear 'vector) + (let ((f30-0 81920.0) + (s5-0 (new 'stack-no-clear 'collide-query)) + ) + (set! (-> s5-0 start-pos quad) (-> obj root-override2 trans quad)) + (set-vector! (-> s5-0 move-dist) 0.0 (- f30-0) 0.0 1.0) + (let ((v1-6 s5-0)) + (set! (-> v1-6 radius) 8192.0) + (set! (-> v1-6 collide-with) (collide-spec backgnd)) + (set! (-> v1-6 ignore-process0) obj) + (set! (-> v1-6 ignore-process1) #f) + (set! (-> v1-6 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-6 action-mask) (collide-action solid)) + ) + (let ((f0-5 (fill-and-probe-using-line-sphere *collide-cache* s5-0))) + (cond + ((>= f0-5 0.0) + (let ((v1-10 (-> obj draw shadow-ctrl))) + (logclear! (-> v1-10 settings flags) (shadow-flags disable-draw)) + ) + 0 + (-> s5-0 best-other-tri intersect) + (let ((a1-2 (-> obj root-override2 trans))) + (-> a1-2 y) + (let ((f0-6 (* f0-5 f30-0))) + (shadow-control-method-14 + (-> obj draw shadow-ctrl) + a1-2 + (-> obj draw shadow-ctrl settings shadow-dir) + (- -8192.0 f30-0) + (+ -8192.0 f0-6) + (+ 8192.0 f0-6) + ) + ) + ) + ) + (else + (let ((v1-22 (-> obj draw shadow-ctrl))) + (logior! (-> v1-22 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + ) + ) + ) + (else + (let ((v1-24 (-> obj draw shadow-ctrl))) + (logior! (-> v1-24 settings flags) (shadow-flags disable-draw)) + ) + 0 + (set! (-> obj draw bounds y) 2457.6) + (set! (-> obj draw bounds w) 8192.0) + ) + ) + (none) + ) + +(defstate dormant (tomb-beetle) + :virtual #t + :enter (behavior () + (set! (-> self root-override2 trans quad) (-> self entity extra trans quad)) + (quaternion-copy! (-> self root-override2 quat) (-> self entity quat)) + (let ((t9-2 (-> (the-as (state enemy) (find-parent-method tomb-beetle 27)) enter))) + (if t9-2 + (t9-2) + ) + ) + (none) + ) + ) + +(defstate ambush (tomb-beetle) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root-override2 root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (vector-reset! (-> self root-override2 transv)) + (set! (-> self move-dest quad) (-> self root-override2 trans quad)) + (+! (-> self root-override2 trans y) (* 4096.0 (rand-vu-float-range 32.0 52.0))) + (set! (-> self init-height) (-> self root-override2 trans y)) + (quaternion-rotate-y! + (-> self root-override2 quat) + (-> self root-override2 quat) + (* 182.04445 (rand-vu-float-range -180.0 180.0)) + ) + (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) 'get-round) + (let ((t9-3 send-event-function) + (v1-18 (-> self actor-group 1 data 0 actor)) + ) + (set! (-> self round) (the-as uint (t9-3 + (if v1-18 + (-> v1-18 extra process) + ) + a1-3 + ) + ) + ) + ) + ) + (setup-masks (-> self draw) 0 -1) + (setup-masks (-> self draw) 2 0) + (if (logtest? (-> self fact-info-override enemy-options) (ash 1 (+ (-> self round) 8))) + (setup-masks (-> self draw) 4 0) + (setup-masks (-> self draw) 8 0) + ) + (none) + ) + :exit (behavior () + (let ((v1-1 (-> self root-override2 root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self root-override2 backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self root-override2 backup-collide-with)) + ) + (none) + ) + :trans (behavior () + (if (< (fabs (- (-> self root-override2 trans y) (-> self move-dest y))) 4096.0) + (go-virtual land) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (behavior () + (tomb-beetle-method-185 self) + (nav-enemy-falling-post) + (none) + ) + ) + +(defstate land (tomb-beetle) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self draw shadow-ctrl))) + (logclear! (-> v1-1 settings flags) (shadow-flags disable-draw)) + ) + 0 + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-0 (-> self clock frame-counter)) + (s5-0 (the int (* 300.0 (rand-vu-float-range 1.1 2.3)))) + (f30-1 (rand-vu-float-range 0.8 1.4)) + ) + (ja-no-eval :group! (-> self draw art-group data 5) :num! (loop! f30-1) :frame-num 0.0) + (until (>= (- (-> self clock frame-counter) gp-0) s5-0) + (suspend) + (ja :num! (loop! f30-1)) + ) + ) + (ja-no-eval :group! (-> self draw art-group data 6) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual active) + (none) + ) + :post (the-as (function none :behavior tomb-beetle) nav-enemy-falling-post) + ) + +(defstate active (tomb-beetle) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior tomb-beetle) enemy-event-handler) + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info-override callback-info)) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-3 enemy-flags)))) + ) + 0 + (nav-enemy-method-166 self) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 x) 0.0) + (set! (-> gp-0 y) 0.0) + (set! (-> gp-0 z) (* 4096.0 (rand-vu-float-range 3.0 9.0))) + (set! (-> gp-0 w) 0.0) + (let ((f30-1 (rand-vu-float-range 100.0 270.0))) + (vector-orient-by-quat! gp-0 gp-0 (-> self root-override2 quat)) + (if (< 180.0 f30-1) + (set! f30-1 (+ -360.0 f30-1)) + ) + (vector-rotate-y! gp-0 gp-0 (* 182.04445 f30-1)) + ) + (vector+! (-> self move-dest) (-> self root-override2 trans) gp-0) + ) + (cloest-point-on-mesh (-> self nav) (-> self move-dest) (-> self move-dest) (the-as nav-poly #f)) + (let ((a0-23 (-> self nav state)) + (v1-19 (-> self move-dest)) + ) + (logclear! (-> a0-23 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-23 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-23 target-post quad) (-> v1-19 quad)) + ) + 0 + (none) + ) + :trans (behavior () + (if (< (vector-vector-xz-distance (-> self root-override2 trans) (-> self move-dest)) 16384.0) + (go-virtual stand) + ) + (none) + ) + :code (behavior () + (until #f + (let ((gp-0 (rand-vu-int-range 2 6)) + (f30-0 (rand-vu-float-range 1.8 1.2)) + ) + (dotimes (s5-0 gp-0) + (ja-no-eval :group! (-> self draw art-group data 7) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) frames num-frames) -1)) + f30-0 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (ja-no-eval :group! (-> self draw art-group data 8) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) frames num-frames) -1)) + f30-0 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + (none) + ) + :post (behavior () + (nav-enemy-travel-post) + (none) + ) + ) + +(defstate stand (tomb-beetle) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior tomb-beetle) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (set! (-> self state-timeout) (the-as uint (the int (* 300.0 (rand-vu-float-range 0.2 0.8))))) + (none) + ) + :trans (behavior () + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self state-timeout))) + (go-virtual active) + ) + (none) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (-> self draw art-group data 9) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior tomb-beetle) nav-enemy-simple-post) + ) + +(defstate fly-away (tomb-beetle) + :virtual #t + :enter (behavior () + (let ((s5-0 (-> self fly-info)) + (gp-0 (the-as (inline-array tomb-beetle-fly-info) (&-> self stack 544))) + ) + (set! (-> s5-0 0 dst quad) (the-as uint128 (the-as vector (-> self root-override2 trans quad)))) + (set! (-> gp-0 0 dst quad) (-> self entity extra trans quad)) + (set! (-> gp-0 0 dst y) (+ 106496.0 (-> gp-0 0 dst y))) + (vector-! (-> self fly-away-dir) (the-as vector (-> gp-0 0)) (the-as vector (-> s5-0 0))) + (vector-normalize! (-> self fly-away-dir) 1.0) + (quaternion-copy! (-> s5-0 0 dst-quat) (-> self root-override2 quat)) + (quaternion-look-at! (-> gp-0 0 dst-quat) (-> self fly-away-dir) *up-vector*) + (set! (-> self speed) 0.0) + (set! (-> self fly-away-radius) 0.0) + (set! (-> self fly-away-ry) (quaternion-y-angle (-> self root-override2 quat))) + (set! (-> gp-0 0 dist) (vector-vector-distance (-> self root-override2 trans) (the-as vector (-> gp-0 0)))) + ) + (vector-reset! (-> self root-override2 transv)) + (set! (-> self fly-away-acc) (get-rand-float-range self 204800.0 512000.0)) + (set! (-> self fly-away-ry-speed) (get-rand-float-range self 32768.0 109226.664)) + (set! (-> self flying?) #f) + (none) + ) + :trans (behavior () + (let ((f30-0 (- (-> self root-override2 trans y) (-> self fly-info 1 dst y)))) + (when (>= f30-0 0.0) + (send-event self 'death-end) + (go empty-state) + ) + (let ((f0-2 (lerp-scale 1.0 0.0 f30-0 -40960.0 0.0))) + (set-vector! (-> self root-override2 scale) f0-2 f0-2 f0-2 1.0) + ) + ) + (none) + ) + :code (behavior () + (set! (-> self state-timeout) + (the-as uint (+ (-> self clock frame-counter) (the int (* 300.0 (rand-vu-float-range 0.0 0.8))))) + ) + (let ((v1-6 (ja-group))) + (cond + ((and v1-6 (= v1-6 (-> self draw art-group data 9))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (if (>= (-> self clock frame-counter) (the-as time-frame (-> self state-timeout))) + (goto cfg-20) + ) + (suspend) + (ja-eval) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.075)) + ) + ) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 9) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (if (>= (-> self clock frame-counter) (the-as time-frame (-> self state-timeout))) + (goto cfg-20) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (label cfg-20) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek! 6.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 6.0)) + ) + (set! (-> self flying?) #t) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 11) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (behavior () + (local-vars (at-0 int)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (when (-> self flying?) + (let ((gp-0 (-> self root-override2))) + (+! (-> self speed) (* (-> self fly-away-acc) (-> self clock seconds-per-frame))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-normalize-copy! s5-0 (-> self fly-away-dir) (-> self speed)) + (vector-v++! (the-as vector (-> self fly-info)) s5-0) + ) + (+! (-> self fly-away-ry) (* (-> self fly-away-ry-speed) (-> self clock seconds-per-frame))) + (+! (-> self fly-away-radius) (* 20480.0 (-> self clock seconds-per-frame))) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set-vector! s5-1 (sin (-> self fly-away-ry)) 0.0 (cos (-> self fly-away-ry)) 1.0) + (vector-normalize! s5-1 (-> self fly-away-radius)) + (vector+! s5-1 s5-1 (the-as vector (-> self fly-info))) + (vector-! (-> gp-0 transv) s5-1 (-> gp-0 trans)) + (let ((v1-10 (-> gp-0 transv))) + (.lvf vf1 (&-> (-> gp-0 transv) quad)) + (let ((f0-14 (-> self clock frames-per-second))) + (.mov at-0 f0-14) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-10 quad) vf1) + ) + (set! (-> gp-0 trans quad) (-> s5-1 quad)) + ) + ) + (quaternion-smooth-seek! + (-> self root-override2 quat) + (-> self root-override2 quat) + (the-as quaternion (&-> self stack 560)) + (* 12.0 (-> self clock seconds-per-frame)) + ) + ) + (tomb-beetle-method-185 self) + (transform-post) + (none) + ) + ) + ) + +(defstate die (tomb-beetle) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (get-rand-float-range self 1.8 2.2))) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info-override die-anim)) + :num! (seek! + (the float + (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self enemy-info-override die-anim))) + frames + num-frames + ) + -1 + ) + ) + f30-0 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (send-event self 'death-end) + (go-virtual explode) + (none) + ) + :post (the-as (function none :behavior tomb-beetle) nav-enemy-simple-post) + ) + +(defstate explode (tomb-beetle) + :virtual #t + :code (behavior () + (when (logtest? (-> self flags) 1) + (let* ((s5-0 *target*) + (gp-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when gp-0 + (let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (get-trans gp-0 0) (-> self root-override2 trans)))) + (when (< (vector-length s5-2) 16384.0) + (vector-normalize! s5-2 1.0) + (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-or-shove) + (set! (-> a1-3 param 0) (the-as uint #f)) + (let ((v1-13 (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up id damage)))) + (let* ((a0-6 *game-info*) + (a2-1 (+ (-> a0-6 attack-id) 1)) + ) + (set! (-> a0-6 attack-id) a2-1) + (set! (-> v1-13 id) a2-1) + ) + (set! (-> v1-13 damage) 1.0) + (set! (-> v1-13 vector quad) (-> s5-2 quad)) + (set! (-> v1-13 shove-back) 20480.0) + (set! (-> v1-13 shove-up) 12288.0) + (set! (-> a1-3 param 1) (the-as uint v1-13)) + ) + (send-event-function gp-0 a1-3) + ) + ) + ) + ) + ) + ) + (let ((v1-16 (-> self root-override2 root-prim))) + (set! (-> v1-16 prim-core collide-as) (collide-spec)) + (set! (-> v1-16 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-1 + (let ((t9-5 (method-of-type part-tracker activate))) + (t9-5 (the-as part-tracker gp-1) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-6 run-function-in-process) + (a0-15 gp-1) + (a1-6 part-tracker-init) + (a2-6 (-> *part-group-id-table* 708)) + (a3-1 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> self root-override2 trans quad)) + ((the-as (function object object object object object object object object none) t9-6) + a0-15 + a1-6 + a2-6 + a3-1 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> gp-1 ppointer) + ) + ) + (let ((gp-2 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-2) (seconds 2)) + (suspend) + ) + ) + (none) + ) + :post (the-as (function none :behavior tomb-beetle) nav-enemy-simple-post) + ) + +(defstate go-to-door (tomb-beetle) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root-override2 root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logclear (-> v1-3 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-3 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (let ((v1-6 self)) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (set! (-> self flying?) #f) + (let ((s5-0 (-> self fly-info)) + (gp-0 (the-as (inline-array tomb-beetle-fly-info) (&-> self stack 544))) + ) + (cond + ((nonzero? (-> self actor-group-count)) + (let ((v1-12 (-> self actor-group 0 data (-> self round) actor))) + (set! (-> (the-as vector (-> gp-0 0)) quad) (-> v1-12 extra trans quad)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (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) 'add-beetle) + (set! (-> s4-0 quad) (-> (the-as vector (send-event-function + (if v1-12 + (-> v1-12 extra process) + ) + a1-5 + ) + ) + quad + ) + ) + ) + (vector+! (the-as vector (-> gp-0 0)) (the-as vector (-> gp-0 0)) s4-0) + (set! (-> gp-0 0 dst w) (-> s4-0 w)) + ) + ) + ) + (else + (set! (-> (the-as vector (-> gp-0 0)) quad) (-> self root-override2 trans quad)) + (set! (-> gp-0 0 dst y) (+ 16384.0 (-> gp-0 0 dst y))) + ) + ) + (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> gp-0 0)) (-> self root-override2 trans)))) + (cond + ((< (vector-length s4-2) 122880.0) + (set! (-> s5-0 0 dst quad) (-> self root-override2 trans quad)) + ) + (else + (vector-float*! s4-2 s4-2 0.25) + (vector+! (the-as vector (-> s5-0 0)) (-> self root-override2 trans) s4-2) + (set! (-> s5-0 0 dst y) (+ 20480.0 (-> gp-0 0 dst y))) + ) + ) + (vector-normalize! s4-2 1.0) + (forward-up-nopitch->quaternion (-> s5-0 0 dst-quat) s4-2 *up-vector*) + ) + (quaternion-copy! (-> self src-quat) (-> self root-override2 quat)) + (quaternion-axis-angle! (-> gp-0 0 dst-quat) -1.0 0.0 0.0 16384.0) + (quaternion-rotate-local-z! (-> gp-0 0 dst-quat) (-> gp-0 0 dst-quat) (-> gp-0 0 dst w)) + (set! (-> s5-0 0 threshold) 16384.0) + (set! (-> gp-0 0 threshold) 12288.0) + (set! (-> s5-0 0 dist) (vector-vector-distance (-> self root-override2 trans) (the-as vector (-> s5-0 0)))) + (set! (-> gp-0 0 dist) (vector-vector-distance (-> self root-override2 trans) (the-as vector (-> gp-0 0)))) + ) + (set! (-> self dest-index) 0) + (set! (-> self speed) 122880.0) + (vector-reset! (-> self root-override2 transv)) + (none) + ) + :trans (behavior () + (when (< (vector-length (vector-! + (new 'stack-no-clear 'vector) + (-> self root-override2 trans) + (the-as vector (-> self fly-info (-> self dest-index))) + ) + ) + (-> self fly-info (-> self dest-index) threshold) + ) + (when (= (-> self dest-index) 1) + (set! (-> self root-override2 trans quad) (-> (the-as vector (&-> self stack 544)) quad)) + (quaternion-copy! (-> self root-override2 quat) (the-as quaternion (&-> self stack 560))) + (go-virtual key) + ) + (set! (-> self speed) 81920.0) + (vector-normalize! (-> self root-override2 transv) (-> self speed)) + (quaternion-copy! (-> self src-quat) (-> self root-override2 quat)) + (+! (-> self dest-index) 1) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek! 6.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 6.0)) + ) + (set! (-> self flying?) #t) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 11) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (behavior () + (local-vars (at-0 int)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (when (-> self flying?) + (let* ((gp-0 (-> self fly-info (-> self dest-index))) + (f30-0 (vector-vector-distance (-> self root-override2 trans) (-> gp-0 dst))) + ) + (seek! (-> self speed) (* 4.0 f30-0) (* 409600.0 (-> self clock seconds-per-frame))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> gp-0 dst) (-> self root-override2 trans)))) + (vector-normalize! s5-1 (-> self speed)) + (vector-seek! (-> self root-override2 transv) s5-1 (* (-> self speed) (-> self clock seconds-per-frame))) + ) + (let ((v1-13 (new 'stack-no-clear 'vector))) + (.lvf vf1 (&-> (-> self root-override2 transv) quad)) + (let ((f0-9 (-> self clock seconds-per-frame))) + (.mov at-0 f0-9) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-13 quad) vf1) + (vector+! (-> self root-override2 trans) (-> self root-override2 trans) v1-13) + ) + (let ((f0-11 (/ f30-0 (-> gp-0 dist)))) + (quaternion-slerp! (-> self root-override2 quat) (-> self src-quat) (-> gp-0 dst-quat) (- 1.0 f0-11)) + ) + ) + ) + (tomb-beetle-method-185 self) + (transform-post) + (none) + ) + ) + ) + +(defstate key (tomb-beetle) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior tomb-beetle) enemy-event-handler) + :enter (behavior () + (let ((v1-1 (-> self draw shadow-ctrl))) + (logclear! (-> v1-1 settings flags) (shadow-flags disable-draw)) + ) + 0 + (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) 'key) + (let ((t9-0 send-event-function) + (v1-9 (-> self actor-group 0 data (-> self round) actor)) + ) + (t9-0 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + ) + (none) + ) + :trans (the-as (function none :behavior tomb-beetle) ja-post) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 12) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + (none) + ) + ) + +(defmethod enemy-method-114 tomb-beetle ((obj tomb-beetle)) + "@abstract" + (let ((s5-0 (new 'process 'collide-shape-moving obj (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 + vehicle + flut-attack + board + mech-punch + dark-punch + dark-giant + ) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-7 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-7 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-7 local-sphere) 0.0 2048.0 0.0 2457.6) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-7) + ) + (set! (-> s5-0 nav-radius) 4915.2) + (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 3)) + (set! (-> obj root-override2) s5-0) + ) + 0 + (none) + ) + +(defmethod enemy-method-115 tomb-beetle ((obj tomb-beetle)) + "@abstract" + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-beetle" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (enemy-method-113 obj *tomb-beetle-nav-enemy-info*) + (let ((v1-5 (-> obj nav))) + (set! (-> v1-5 sphere-mask) (the-as uint #x800fa)) + ) + 0 + (logclear! (-> obj enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground)) + (set! (-> obj flags) (the-as uint 0)) + (logclear! (-> obj mask) (process-mask actor-pause)) + 0 + (none) + ) diff --git a/goal_src/jak2/levels/mars_tomb/tomb-obs.gc b/goal_src/jak2/levels/mars_tomb/tomb-obs.gc index e5f8ae12ae..1f24dbc5dd 100644 --- a/goal_src/jak2/levels/mars_tomb/tomb-obs.gc +++ b/goal_src/jak2/levels/mars_tomb/tomb-obs.gc @@ -5,5 +5,1954 @@ ;; name in dgo: tomb-obs ;; dgos: TOA +(define-extern *indax-bounce-mods* surface) + ;; DECOMP BEGINS +(deftype tomb-plat-wall (plat) + ((position vector :inline :offset-assert 336) + (last-pos float :offset-assert 352) + ) + :heap-base #xf0 + :method-count-assert 37 + :size-assert #x164 + :flag-assert #x2500f00164 + ) + + +(defskelgroup skel-tomb-plat-wall tomb-plat-wall 0 3 + ((1 (meters 20)) (2 (meters 999999))) + :bounds (static-spherem 0 -5 4 8.5) + :origin-joint-index 3 + ) + +(defmethod get-art-group tomb-plat-wall ((obj tomb-plat-wall)) + "@returns The associated [[art-group]]" + (art-group-get-by-name *level* "skel-tomb-plat-wall" (the-as (pointer uint32) #f)) + ) + +(defstate plat-idle (tomb-plat-wall) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior tomb-plat-wall) plat-event) + :exit (behavior () + (when (nonzero? (-> self sound-id)) + (sound-stop (-> self sound-id)) + (set! (-> self sound-id) (new 'static 'sound-id)) + 0 + ) + (none) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((f30-0 (get-norm! (-> self sync) 0))) + (let ((s5-0 (-> self basetrans))) + (let ((gp-0 (-> self position))) + (let ((v1-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override quat)))) + (let ((a0-3 (* -32768.0 f30-0))) + (.mov vf7 a0-3) + ) + (.lvf vf5 (&-> v1-3 quad)) + ) + (.lvf vf4 (&-> gp-0 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 (&-> s5-0 quad) vf6) + ) + (cond + ((and (!= f30-0 0.0) (!= f30-0 1.0)) + (if (zero? (-> self sound-id)) + (set! (-> self sound-id) (sound-play "tomb-plat-wall")) + ) + ) + (else + (when (nonzero? (-> self sound-id)) + (sound-stop (-> self sound-id)) + (set! (-> self sound-id) (new 'static 'sound-id)) + 0 + ) + ) + ) + (if (or (and (= f30-0 1.0) (!= (-> self last-pos) 1.0)) (and (= f30-0 0.0) (!= (-> self last-pos) 0.0))) + (sound-play "plat-wall-hit") + ) + (set! (-> self last-pos) f30-0) + ) + (plat-trans) + (none) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) + :num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior tomb-plat-wall) plat-post) + ) + +(defmethod base-plat-method-32 tomb-plat-wall ((obj tomb-plat-wall)) + 0 + (none) + ) + +(defmethod base-plat-method-31 tomb-plat-wall ((obj tomb-plat-wall)) + "TODO - collision stuff" + (let ((s5-0 (new 'process 'collide-shape obj (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 bot player-list)) + (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 16384.0 0.0 30720.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! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-plat-wall ((obj tomb-plat-wall) (arg0 entity-actor)) + (set! (-> obj mask) (logior (process-mask platform) (-> obj mask))) + (base-plat-method-31 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton obj (the-as skeleton-group (get-art-group obj)) (the-as pair 0)) + (set! (-> obj draw light-index) (the-as uint 1)) + (update-transforms (-> obj root-override)) + (stop-bouncing! obj) + (base-plat-method-32 obj) + (set! (-> obj fact) + (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (let ((a1-4 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-16 0)) + (if (not (logtest? (-> obj fact options) (actor-option loop))) + (set! v1-16 (logior v1-16 1)) + ) + (set! (-> a1-4 sync-type) (the-as basic 'sync-eased)) + (set! (-> a1-4 sync-flags) (the-as sync-flags v1-16)) + ) + (set! (-> a1-4 period) (the-as uint 1200)) + (set! (-> a1-4 entity) arg0) + (set! (-> a1-4 percent) 0.0) + (set! (-> a1-4 ease-in) 0.15) + (set! (-> a1-4 ease-out) 0.15) + (set! (-> a1-4 pause-in) 0.0) + (set! (-> a1-4 pause-out) 0.0) + (initialize! (-> obj sync) a1-4) + ) + (set! (-> obj sound-id) (new 'static 'sound-id)) + (set! (-> obj position quad) (-> obj root-override trans quad)) + (set! (-> obj last-pos) 0.0) + (go (method-of-object obj plat-idle)) + (none) + ) + +(deftype tomb-stair-block-spikes (process-drawable) + ((root-override collide-shape-moving :offset 128) + ) + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-tomb-stair-block-spikes tomb-stair-block-spikes 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; WARN: Return type mismatch int vs object. +(defbehavior tomb-stair-block-collision tomb-stair-block-spikes ((arg0 symbol)) + (let ((v1-1 (-> self root-override root-prim))) + (the-as object (cond + (arg0 + (set! (-> v1-1 prim-core collide-with) (collide-spec jak bot player-list)) + (let ((v0-0 (the-as int (-> v1-1 specific 1)))) + (set! (-> v1-1 specific 0) (the-as uint v0-0)) + v0-0 + ) + ) + (else + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + (set! (-> v1-1 specific 0) (the-as uint 0)) + 0 + ) + ) + ) + ) + ) + +(defstate idle (tomb-stair-block-spikes) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('sound) + (sound-play "tomb-spikes") + ) + (('set-position) + (let ((v0-1 (the-as object (-> self root-override trans)))) + (set! (-> (the-as vector v0-1) quad) (-> (the-as vector (-> event param 0)) quad)) + v0-1 + ) + ) + (('enable-collision) + (tomb-stair-block-collision #t) + ) + (('touch) + (when (= proc *target*) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer self)) + (set! (-> a1-9 num-params) 2) + (set! (-> a1-9 message) 'attack) + (set! (-> a1-9 param 0) (the-as uint #f)) + (let ((v1-9 (new 'static 'attack-info :mask (attack-info-mask shove-back shove-up id)))) + (let* ((a2-3 *game-info*) + (a3-3 (+ (-> a2-3 attack-id) 1)) + ) + (set! (-> a2-3 attack-id) a3-3) + (set! (-> v1-9 id) a3-3) + ) + (set! (-> v1-9 shove-up) 8192.0) + (set! (-> v1-9 shove-back) 0.0) + (set! (-> a1-9 param 1) (the-as uint v1-9)) + ) + (send-event-function proc a1-9) + ) + (tomb-stair-block-collision #f) + ) + ) + ) + ) + :code (the-as (function none :behavior tomb-stair-block-spikes) sleep-code) + :post (the-as (function none :behavior tomb-stair-block-spikes) transform-post) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior tomb-stair-block-spikes-init-by-other tomb-stair-block-spikes ((arg0 vector)) + (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 type) (sv-48 collide-shape)) + (let ((s5-0 (new 'process 'collide-shape self (collide-list-enum 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 pusher)) + (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) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 root-prim) s4-0) + (pusher-init s5-0) + (let* ((s3-0 (the-as object '((0 3 20480)))) + (s2-0 (-> (the-as pair s3-0) car)) + ) + (while (not (null? s3-0)) + (let ((s1-0 (method-of-type collide-shape-prim-mesh new)) + (s0-0 'process) + ) + (set! sv-32 collide-shape-prim-mesh) + (set! sv-48 s5-0) + (let ((a3-2 (command-get-int (-> (the-as pair s2-0) car) 0)) + (t0-1 0) + ) + (set! sv-16 (s1-0 s0-0 sv-32 sv-48 (the-as uint a3-2) (the-as uint t0-1))) + ) + ) + (let ((s1-1 sv-16)) + (set! (-> s1-1 prim-core collide-as) (-> s4-0 prim-core collide-as)) + (set! (-> s1-1 prim-core collide-with) (-> s4-0 prim-core collide-with)) + (set! (-> s1-1 prim-core action) (-> s4-0 prim-core action)) + (set! (-> s1-1 transform-index) (command-get-int (-> (the-as pair (-> (the-as pair s2-0) cdr)) car) 0)) + ) + (set-vector! + (-> sv-16 local-sphere) + 0.0 + 0.0 + 0.0 + (command-get-float (-> (the-as pair (-> (the-as pair (-> (the-as pair s2-0) cdr)) cdr)) car) 0.0) + ) + (set! s3-0 (-> (the-as pair s3-0) cdr)) + (set! s2-0 (-> (the-as pair s3-0) car)) + ) + ) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-23 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-23 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) + ) + (set! (-> self root-override) (the-as collide-shape-moving s5-0)) + ) + (set! (-> self root-override trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-tomb-stair-block-spikes" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> self draw light-index) (the-as uint 1)) + (quaternion-rotate-y! (-> self root-override quat) (-> self root-override quat) 16384.0) + (go-virtual idle) + (none) + ) + +(deftype tomb-stair-block-spike-info (structure) + ((spike handle :offset-assert 0) + (joint int32 :offset-assert 8) + (y-offset float :offset-assert 12) + (up basic :offset-assert 16) + (sounded basic :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + + +(deftype tomb-stair-block (process-drawable) + ((root-override collide-shape-moving :offset 128) + (initial-y float :offset-assert 200) + (spike-info tomb-stair-block-spike-info 4 :inline :offset 208) + (camera-state int32 :offset 336) + (sink-sound uint32 :offset 340) + (rise-sound uint32 :offset 344) + ) + :heap-base #xe0 + :method-count-assert 25 + :size-assert #x15c + :flag-assert #x1900e0015c + (:methods + (wait-for-pools () _type_ :state 20) + (idle () _type_ :state 21) + (moving () _type_ :state 22) + (sink () _type_ :state 23) + (sunk () _type_ :state 24) + ) + ) + + +(defskelgroup skel-tomb-stair-block tomb-stair-block 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 32 0 58) + ) + +(defbehavior lift-pool tomb-stair-block ((arg0 int)) + (local-vars (sv-16 res-tag)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-1 (res-lump-data (-> self entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when (and v1-1 (< (the-as uint arg0) (-> sv-16 elt-count)) (-> v1-1 arg0) (> (-> v1-1 0 length) 0)) + (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) 'move-to) + (set! (-> a1-2 param 0) (the-as uint (-> v1-1 arg0 data 0 actor trans))) + (let ((t9-1 send-event-function) + (v1-5 (-> v1-1 arg0 data 0 actor)) + ) + (t9-1 + (if v1-5 + (-> v1-5 extra process) + ) + a1-2 + ) + ) + ) + ) + ) + ) + +(defbehavior drop-pool tomb-stair-block ((arg0 int)) + (local-vars (sv-16 res-tag)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-1 (res-lump-data (-> self entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when (and v1-1 (< (the-as uint arg0) (-> sv-16 elt-count)) (-> v1-1 arg0) (> (-> v1-1 0 length) 0)) + (let ((a0-12 (new 'stack-no-clear 'vector))) + (set! (-> a0-12 quad) (-> v1-1 arg0 data 0 actor trans quad)) + (set! (-> a0-12 y) (+ -163840.0 (-> a0-12 y))) + (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) 'move-to) + (set! (-> a1-4 param 0) (the-as uint a0-12)) + (let ((t9-1 send-event-function) + (v1-5 (-> v1-1 arg0 data 0 actor)) + ) + (t9-1 + (if v1-5 + (-> v1-5 extra process) + ) + a1-4 + ) + ) + ) + ) + ) + ) + ) + +(defbehavior position-spikes tomb-stair-block ((arg0 int)) + (let ((s5-0 (and (nonzero? arg0) (< (mod (-> self clock frame-counter) arg0) (/ arg0 2)))) + (s4-0 (and (nonzero? arg0) (< (mod (+ (-> self clock frame-counter) (seconds 0.75)) arg0) (/ arg0 2)))) + ) + (dotimes (s3-0 4) + (let ((f0-1 (seek + (-> self spike-info s3-0 y-offset) + (if s5-0 + 30720.0 + 16384.0 + ) + 1228.8 + ) + ) + ) + (set! (-> self spike-info s3-0 y-offset) f0-1) + (set! (-> self spike-info s3-0 y-offset) f0-1) + ) + (if (and s4-0 (not (-> self spike-info s3-0 sounded))) + (send-event (handle->process (-> self spike-info s3-0 spike)) 'sound) + ) + (if (and s5-0 (not (-> self spike-info s3-0 up))) + (send-event (handle->process (-> self spike-info s3-0 spike)) 'enable-collision) + ) + (set! (-> self spike-info s3-0 up) (the-as basic s5-0)) + (set! (-> self spike-info s3-0 sounded) (the-as basic s4-0)) + (set! s5-0 (and (nonzero? arg0) (not s5-0))) + (set! s4-0 (and (nonzero? arg0) (not s4-0))) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (dotimes (s5-1 4) + (vector<-cspace! gp-1 (-> self node-list data (-> self spike-info s5-1 joint))) + (+! (-> gp-1 y) (-> self spike-info s5-1 y-offset)) + (send-event (handle->process (-> self spike-info s5-1 spike)) 'set-position gp-1) + ) + ) + #f + ) + +(defstate sunk (tomb-stair-block) + :virtual #t + :enter (behavior () + (set! (-> self root-override trans y) (-> self initial-y)) + (ja :group! (-> self draw art-group data 4) + :num! (identity (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + ) + (transform-post) + (none) + ) + :trans (behavior () + (lift-pool 1) + (drop-pool 0) + (position-spikes 1200) + (none) + ) + :code (behavior () + (suspend) + (suspend) + (transform-post) + (sleep-code) + (none) + ) + ) + +(defstate sink (tomb-stair-block) + :virtual #t + :enter (behavior () + (set! (-> self camera-state) 0) + (set! (-> self state-time) (-> self clock frame-counter)) + (task-node-close! (game-task-node tomb-poles-block)) + (none) + ) + :exit (behavior () + (remove-setting! 'entity-name) + (remove-setting! 'interp-time) + (remove-setting! 'string-startup-vector) + (none) + ) + :trans (behavior () + (rider-trans) + (position-spikes 1200) + (cond + ((>= (-> self camera-state) 3) + ) + ((= (-> self camera-state) 2) + (remove-setting! 'interp-time) + (remove-setting! 'string-startup-vector) + (set! (-> self camera-state) 3) + ) + ((and (= (-> self camera-state) 1) (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 8))) + (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) + (remove-setting! 'entity-name) + (set! (-> self camera-state) 2) + (process-release? *target*) + ) + ) + (none) + ) + :code (behavior () + (local-vars (v1-5 symbol) (v1-51 symbol)) + (until v1-5 + (ja :num! (loop!)) + (lift-pool 0) + (drop-pool 1) + (suspend) + (set! v1-5 (or (not *target*) (process-grab? *target* #f))) + ) + (set-setting! 'entity-name "camera-171" 0 0) + (set! (-> self camera-state) 1) + (ja-channel-push! 1 (seconds 2)) + (ja :group! (-> self draw art-group data 3) :num! min) + (set! (-> self state-time) (-> self clock frame-counter)) + (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (lift-pool 0) + (drop-pool 1) + (suspend) + ) + (while (< (-> self root-override trans y) (-> self initial-y)) + (let ((f0-4 (seek (-> self root-override trans y) (-> self initial-y) 204.8))) + (set! (-> self root-override trans y) f0-4) + (set! (-> self root-override trans y) f0-4) + ) + (lift-pool 0) + (drop-pool 1) + (suspend) + ) + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (lift-pool 1) + (drop-pool 0) + (suspend) + (ja :num! (seek!)) + ) + (until v1-51 + (lift-pool 1) + (drop-pool 0) + (suspend) + (set! v1-51 (or (not *target*) (process-release? *target*))) + ) + (go-virtual sunk) + (none) + ) + :post (the-as (function none :behavior tomb-stair-block) rider-post) + ) + +(defstate moving (tomb-stair-block) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('cue-chase) + (set-action! + *gui-control* + (gui-action play) + (the-as sound-id (-> self sink-sound)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set-falloff! *gui-control* (the-as sound-id (-> self sink-sound)) #t -1 200 2) + (go-virtual sink) + ) + ) + ) + :enter (behavior () + (set! (-> self sink-sound) + (the-as uint (add-process *gui-control* self (gui-channel jak) (gui-action queue) "tombpltb" -99.0 0)) + ) + (set! (-> self camera-state) 0) + 0 + (none) + ) + :exit (behavior () + (remove-setting! 'entity-name) + (remove-setting! 'interp-time) + (remove-setting! 'string-startup-vector) + (none) + ) + :trans (behavior () + (rider-trans) + (let ((f0-3 (seek (-> self root-override trans y) (+ -28672.0 (-> self initial-y)) 409.6))) + (set! (-> self root-override trans y) f0-3) + (set! (-> self root-override trans y) f0-3) + ) + (position-spikes 0) + (cond + ((>= (-> self camera-state) 3) + ) + ((= (-> self camera-state) 2) + (remove-setting! 'interp-time) + (remove-setting! 'string-startup-vector) + (if (or (not *target*) (process-release? *target*)) + (set! (-> self camera-state) 3) + ) + ) + ((and (= (-> self camera-state) 1) (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 4))) + (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) + (remove-setting! 'entity-name) + (set! (-> self camera-state) 2) + ) + ) + (when (and *target* (< (-> (target-pos 0) y) -294912.0)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id (-> self sink-sound)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (go-virtual idle) + ) + (lift-pool 0) + (drop-pool 1) + (none) + ) + :code (behavior () + (local-vars (v1-1 symbol)) + (until v1-1 + (suspend) + (set! v1-1 (or (not *target*) (process-grab? *target* #f))) + ) + (set-setting! 'entity-name "camera-170" 0 0) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self camera-state) 1) + (ja-channel-push! 1 (seconds 2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data 2) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) frames num-frames) -1)) + 0.125 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.125)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior tomb-stair-block) rider-post) + ) + +(defstate idle (tomb-stair-block) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('cue-chase) + (set-action! + *gui-control* + (gui-action play) + (the-as sound-id (-> self rise-sound)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set-falloff! *gui-control* (the-as sound-id (-> self rise-sound)) #t -1 200 2) + (go-virtual moving) + ) + ) + ) + :enter (behavior () + (local-vars (sv-16 res-tag)) + (ja-channel-push! 1 (seconds 2)) + (ja :group! (-> self draw art-group data 3) :num! min) + (set! (-> self rise-sound) + (the-as uint (add-process *gui-control* self (gui-channel jak) (gui-action queue) "tombplta" -99.0 0)) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((gp-1 (res-lump-data (-> self entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when (and gp-1 (< (the-as uint 2) (-> sv-16 elt-count)) (-> gp-1 2)) + (dotimes (s5-0 (-> gp-1 2 length)) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer self)) + (set! (-> a1-4 num-params) 0) + (set! (-> a1-4 message) 'untrigger) + (let ((t9-4 send-event-function) + (v1-15 (-> gp-1 2 data s5-0 actor)) + ) + (t9-4 + (if v1-15 + (-> v1-15 extra process) + ) + a1-4 + ) + ) + ) + ) + ) + ) + (none) + ) + :trans (behavior () + (let ((f0-3 (seek (-> self root-override trans y) (+ -104448.0 (-> self initial-y)) 409.6))) + (set! (-> self root-override trans y) f0-3) + (set! (-> self root-override trans y) f0-3) + ) + (lift-pool 0) + (drop-pool 1) + (position-spikes 1500) + (none) + ) + :code (the-as (function none :behavior tomb-stair-block) sleep-code) + :post (the-as (function none :behavior tomb-stair-block) transform-post) + ) + +(defstate wait-for-pools (tomb-stair-block) + :virtual #t + :trans (behavior () + (local-vars (sv-16 res-tag)) + (let ((gp-0 #t)) + (set! sv-16 (new 'static 'res-tag)) + (let ((s5-0 (res-lump-data (-> self entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when s5-0 + (dotimes (s4-0 (min 2 (the-as int (-> sv-16 elt-count)))) + (dotimes (s3-0 (-> s5-0 s4-0 length)) + (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) 'visible) + (set! (-> a1-1 param 0) (the-as uint #t)) + (let ((t9-1 send-event-function) + (v1-9 (-> s5-0 s4-0 data s3-0 actor)) + ) + (if (not (t9-1 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + (set! gp-0 #f) + ) + ) + ) + ) + ) + ) + ) + (when gp-0 + (if (task-node-closed? (game-task-node tomb-poles-block)) + (go-virtual sunk) + (go-virtual idle) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior tomb-stair-block) sleep-code) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-stair-block ((obj tomb-stair-block) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape obj (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 8) 0))) + (set! (-> s4-0 total-prims) (the-as uint 9)) + (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s3-0 local-sphere) 0.0 131072.0 0.0 237568.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-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 rideable)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 81920.0 0.0 204800.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s4-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 rideable)) + (set! (-> v1-12 transform-index) 4) + (set-vector! (-> v1-12 local-sphere) 0.0 -63488.0 0.0 102400.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid rideable)) + (set! (-> v1-14 transform-index) 5) + (set-vector! (-> v1-14 local-sphere) 0.0 -16384.0 0.0 77824.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid rideable)) + (set! (-> v1-16 transform-index) 6) + (set-vector! (-> v1-16 local-sphere) 0.0 -75776.0 0.0 114688.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid rideable)) + (set! (-> v1-18 transform-index) 7) + (set-vector! (-> v1-18 local-sphere) 0.0 -16384.0 0.0 77824.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 5) (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid rideable)) + (set! (-> v1-20 transform-index) 8) + (set-vector! (-> v1-20 local-sphere) 0.0 -75776.0 0.0 114688.0) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 6) (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid rideable)) + (set! (-> v1-22 transform-index) 9) + (set-vector! (-> v1-22 local-sphere) 0.0 -16384.0 0.0 77824.0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 7) (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-24 prim-core action) (collide-action solid rideable)) + (set! (-> v1-24 transform-index) 10) + (set-vector! (-> v1-24 local-sphere) 0.0 -92160.0 0.0 131072.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-27 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-27 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-27 prim-core collide-with)) + ) + (set! (-> obj root-override) (the-as collide-shape-moving s4-0)) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-stair-block" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj draw light-index) (the-as uint 1)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj initial-y) (-> obj root-override trans y)) + (ja-post) + (set! (-> obj spike-info 0 joint) 4) + (set! (-> obj spike-info 1 joint) 6) + (set! (-> obj spike-info 2 joint) 8) + (set! (-> obj spike-info 3 joint) 10) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (dotimes (s4-2 4) + (set! (-> obj spike-info s4-2 y-offset) 0.0) + (vector<-cspace! s5-2 (-> obj node-list data (-> obj spike-info s4-2 joint))) + (set! (-> obj spike-info s4-2 spike) (ppointer->handle (process-spawn tomb-stair-block-spikes s5-2 :to obj))) + (set! (-> obj spike-info s4-2 up) #f) + (set! (-> obj spike-info s4-2 sounded) #f) + ) + ) + (set! (-> obj root-override trans y) (+ -104448.0 (-> obj initial-y))) + (let ((s5-3 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-3 + (the-as art-joint-anim (-> obj draw art-group data 3)) + num-func-identity + ) + (set! (-> s5-3 frame-num) 0.0) + ) + (set! (-> obj rise-sound) (the-as uint (new-sound-id))) + (set! (-> obj sink-sound) (the-as uint (new-sound-id))) + (go (method-of-object obj wait-for-pools)) + (none) + ) + +(defskelgroup skel-tomb-bounce-web tomb-bounce-web 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 4)) + +(deftype tomb-bounce-web (bouncer) + () + :heap-base #x60 + :method-count-assert 25 + :size-assert #xd4 + :flag-assert #x19006000d4 + ) + + +(defmethod init-skeleton! tomb-bounce-web ((obj tomb-bounce-web)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-bounce-web" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj mods) *indax-bounce-mods*) + 0 + (none) + ) + +(defmethod bouncer-method-24 tomb-bounce-web ((obj tomb-bounce-web)) + "TODO - collision stuff" + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum 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 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 3072.0 0.0 11059.2) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 1)))) + (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 3072.0 0.0 11059.2) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 3)))) + (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 solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 3072.0 0.0 11059.2) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 3)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak 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 3072.0 0.0 11059.2) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-14 prim-core action) (collide-action)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 3072.0 0.0 8192.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! (-> obj root) s5-0) + ) + 0 + (none) + ) + +(deftype tomb-plat-pillar (plat) + () + :heap-base #xd0 + :method-count-assert 37 + :size-assert #x144 + :flag-assert #x2500d00144 + ) + + +(defskelgroup skel-tomb-plat-pillar tomb-plat-pillar 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 -7 0 8) + ) + +(defmethod get-art-group tomb-plat-pillar ((obj tomb-plat-pillar)) + "@returns The associated [[art-group]]" + (art-group-get-by-name *level* "skel-tomb-plat-pillar" (the-as (pointer uint32) #f)) + ) + +(defmethod base-plat-method-32 tomb-plat-pillar ((obj tomb-plat-pillar)) + 0 + (none) + ) + +;; WARN: Return type mismatch collide-shape vs none. +(defmethod base-plat-method-31 tomb-plat-pillar ((obj tomb-plat-pillar)) + "TODO - collision stuff" + (let ((s5-0 (new 'process 'collide-shape obj (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 36864.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-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! (-> obj root-override) s5-0) + ) + (none) + ) + +(deftype tomb-elevator (elevator) + ((last-pos vector :inline :offset-assert 368) + (speed float :offset-assert 384) + ) + :heap-base #x110 + :method-count-assert 49 + :size-assert #x184 + :flag-assert #x3101100184 + ) + + +(defskelgroup skel-tomb-elevator tomb-elevator 0 3 ((1 (meters 999999))) :bounds (static-spherem 4 0 4 7)) + +(defstate running (tomb-elevator) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type elevator running) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self speed) 0.0) + (none) + ) + :code (behavior () + (logior! (-> self elevator-status) (elevator-status elevator-status-1)) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (loop! 0.0)) + (until #f + (when (= (-> self path-pos) 1.0) + (logclear! (-> self elevator-status) (elevator-status elevator-status-1)) + (sound-play "t-elevator-hit") + ) + (suspend) + (ja :num! (loop! (* 0.00007771238 (-> self speed)))) + ) + #f + (none) + ) + :post (behavior () + (set! (-> self last-pos quad) (-> self basetrans quad)) + (let ((t9-0 (-> (method-of-type elevator running) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + (set! (-> self speed) (* (- (-> self last-pos y) (-> self basetrans y)) (-> self clock frames-per-second))) + (none) + ) + ) + +(defmethod init-defaults! tomb-elevator ((obj tomb-elevator)) + "Initializes default settings related to the [[elevator]]: + - `elevator-xz-threshold` + - `elevator-y-threshold` + - `elevator-start-pos` + - `elevator-move-rate` + - `elevator-flags`" + (let ((t9-0 (method-of-type elevator init-defaults!))) + (t9-0 obj) + ) + (set! (-> obj params flags) (elevator-flags elevator-flags-2)) + (set! (-> obj draw light-index) (the-as uint 1)) + (none) + ) + +(defmethod get-art-group tomb-elevator ((obj tomb-elevator)) + "@returns The associated [[art-group]]" + (art-group-get-by-name *level* "skel-tomb-elevator" (the-as (pointer uint32) #f)) + ) + +;; WARN: Return type mismatch collide-shape vs none. +(defmethod base-plat-method-31 tomb-elevator ((obj tomb-elevator)) + "TODO - collision stuff" + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (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) 16384.0 0.0 16384.0 28672.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! (-> obj root-override) s5-0) + ) + (none) + ) + +(defmethod clear-ambient-sound! tomb-elevator ((obj tomb-elevator)) + "Might be a virtual function, but clears the object's [[ambient-sound]]" + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "tomb-elevator" :fo-max 70) (-> obj root-override trans)) + ) + 0 + (none) + ) + +(defskelgroup skel-tomb-boss-door tomb-boss-door 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 21 0 60) + :origin-joint-index 3 + ) + +(deftype tomb-boss-door (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-boss-door ((obj tomb-boss-door) (arg0 entity-actor)) + (stack-size-set! (-> obj main-thread) 1024) ;; added + (let ((s5-0 (new 'process 'collide-shape obj (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 86016.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 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) 5) + (set-vector! (-> v1-8 local-sphere) 0.0 86016.0 0.0 122880.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 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 86016.0 0.0 122880.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! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj door-radius) 61440.0) + (go (method-of-object obj close) #t) + (none) + ) + +(deftype water-anim-tomb (water-anim) + () + :heap-base #x80 + :method-count-assert 29 + :size-assert #x100 + :flag-assert #x1d00800100 + ) + + +(define ripple-for-water-anim-tomb (new 'static 'ripple-wave-set + :count 3 + :converted #f + :normal-scale 1.0 + :wave (new 'static 'inline-array ripple-wave 4 + (new 'static 'ripple-wave :scale 40.0 :xdiv 1 :speed 1.5) + (new 'static 'ripple-wave :scale 40.0 :xdiv -1 :zdiv 1 :speed 1.5) + (new 'static 'ripple-wave :scale 20.0 :xdiv 5 :zdiv 3 :speed 0.75) + (new 'static 'ripple-wave) + ) + ) + ) + +;; WARN: Return type mismatch ripple-wave-set vs none. +(defmethod art-init! water-anim-tomb ((obj water-anim-tomb)) + "Initialize a [[water-anim]]'s [[skeleton-group]], joints and ambience." + (let ((t9-0 (method-of-type water-anim art-init!))) + (t9-0 obj) + ) + (let ((v1-2 (new 'process 'ripple-control))) + (set! (-> obj draw ripple) v1-2) + (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> v1-2 global-scale) 3072.0) + (set! (-> v1-2 close-fade-dist) 163840.0) + (set! (-> v1-2 far-fade-dist) 245760.0) + (set! (-> v1-2 waveform) ripple-for-water-anim-tomb) + ) + (none) + ) + +(defskelgroup skel-tomb-wing-door tomb-wing-door 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 -10 0 20) + ) + +(deftype tomb-wing-door (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-wing-door ((obj tomb-wing-door) (arg0 entity-actor)) + (stack-size-set! (-> obj main-thread) 1024) ;; added + (let ((s5-0 (new 'process 'collide-shape obj (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 2) (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) 5) + (set-vector! (-> v1-8 local-sphere) 0.0 40960.0 -16384.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) 4) + (set-vector! (-> v1-10 local-sphere) 0.0 40960.0 16384.0 61440.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 -12288.0 0.0 61440.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! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-wing-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (static-sound-spec "wing-door-open")) + (set! (-> obj sound-open-stop) (static-sound-spec "wing-open-hit")) + (set! (-> obj sound-close-loop) (static-sound-spec "wing-door-close")) + (set! (-> obj sound-close-stop) (static-sound-spec "wing-close-hit")) + (go (method-of-object obj close) #t) + (none) + ) + +(defskelgroup skel-tomb-boulder-door tomb-boulder-door 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 7 0 10) + :origin-joint-index 3 + ) + +(deftype tomb-boulder-door (process-drawable) + ((root-override collide-shape-moving :offset 128) + ) + :heap-base #x50 + :method-count-assert 22 + :size-assert #xc8 + :flag-assert #x16005000c8 + (:methods + (open () _type_ :state 20) + (close () _type_ :state 21) + ) + ) + + +(defstate close (tomb-boulder-door) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('reset) + (if (task-node-closed? (game-task-node tomb-poles-boulder)) + (go-virtual close) + (go-virtual open) + ) + ) + ) + ) + :code (behavior () + (ja :num-func num-func-identity :frame-num 0.0) + (transform-post) + (suspend) + (transform-post) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) + ) + +(defstate open (tomb-boulder-door) + :virtual #t + :event (-> (method-of-type tomb-boulder-door close) event) + :code (behavior () + (ja :num-func num-func-identity :frame-num (ja-aframe 5.0 0)) + (transform-post) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-boulder-door ((obj tomb-boulder-door) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape obj (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 camera-blocker)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot 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 24576.0 0.0 36864.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! (-> obj root-override) (the-as collide-shape-moving s4-0)) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boulder-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (if (task-node-closed? (game-task-node tomb-poles-boulder)) + (go (method-of-object obj close)) + (go (method-of-object obj open)) + ) + (none) + ) + +(deftype tomb-plat-return (base-plat) + ((intro-path path-control :offset-assert 272) + (ride-timer time-frame :offset-assert 280) + (flags uint16 :offset-assert 288) + (path-pos float :offset-assert 292) + (dest-pos float :offset-assert 296) + (path-speed float :offset-assert 300) + (sound-id uint32 :offset-assert 304) + ) + :heap-base #xc0 + :method-count-assert 39 + :size-assert #x134 + :flag-assert #x2700c00134 + (:methods + (hidden () _type_ :state 34) + (run-intro () _type_ :state 35) + (waiting () _type_ :state 36) + (running () _type_ :state 37) + (waiting-for-no-player () _type_ :state 38) + ) + ) + + +(defskelgroup skel-tomb-plat-return tomb-plat-return 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 4.8) + ) + +(defstate hidden (tomb-plat-return) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger 'cue-chase) + (go-virtual run-intro) + ) + ) + ) + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + (none) + ) + :code (the-as (function none :behavior tomb-plat-return) sleep-code) + ) + +(defstate run-intro (tomb-plat-return) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior tomb-plat-return) plat-event) + :enter (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (ja-channel-set! 1) + (ja-no-eval :group! (-> self draw art-group data 2) :num! zero) + (set! (-> self path-pos) 0.0) + (set-vector! (-> self root-override scale) 0.0 0.0 0.0 0.0) + (none) + ) + :exit (behavior () + (sound-stop (the-as sound-id (-> self sound-id))) + (none) + ) + :trans (behavior () + (when (= (-> self path-pos) 1.0) + (set! (-> self path-pos) 0.0) + (go-virtual waiting) + ) + (plat-trans) + (none) + ) + :code (the-as (function none :behavior tomb-plat-return) sleep-code) + :post (behavior () + (sound-play "tomb-plat-ret" :id (the-as sound-id (-> self sound-id)) :position (-> self root-override trans)) + (seek! (-> self path-pos) 1.0 (* 2.0 (-> self clock seconds-per-frame) (-> self path-speed))) + (let ((f30-0 (-> self path-pos))) + (get-point-at-percent-along-path! + (-> self intro-path) + (-> self basetrans) + (ease-value-in-out f30-0 0.1) + 'interp + ) + (set-vector! (-> self root-override scale) f30-0 f30-0 f30-0 f30-0) + ) + (plat-post) + (none) + ) + ) + +(defstate waiting (tomb-plat-return) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('ridden) + (let ((v0-0 (the-as object (logior (-> self flags) 1)))) + (set! (-> self flags) (the-as uint v0-0)) + v0-0 + ) + ) + (else + (plat-event proc arg1 event-type event) + ) + ) + ) + :enter (behavior () + (set! (-> self ride-timer) (-> self clock frame-counter)) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (none) + ) + :trans (behavior () + (set! (-> self flags) (logand -2 (-> self flags))) + (plat-trans) + (if (not (logtest? (-> self flags) 1)) + (set! (-> self ride-timer) (-> self clock frame-counter)) + ) + (when (>= (- (-> self clock frame-counter) (-> self ride-timer)) (seconds 0.5)) + (if (= (-> self path-pos) 0.0) + (set! (-> self dest-pos) 1.0) + (set! (-> self dest-pos) 0.0) + ) + (go-virtual running) + ) + (none) + ) + :code (the-as (function none :behavior tomb-plat-return) sleep-code) + :post (the-as (function none :behavior tomb-plat-return) plat-post) + ) + +(defstate running (tomb-plat-return) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('ridden) + (let ((v0-0 (the-as object (logior (-> self flags) 1)))) + (set! (-> self flags) (the-as uint v0-0)) + v0-0 + ) + ) + (else + (plat-event proc arg1 event-type event) + ) + ) + ) + :exit (behavior () + (sound-stop (the-as sound-id (-> self sound-id))) + (none) + ) + :trans (behavior () + (if (= (-> self path-pos) (-> self dest-pos)) + (go-virtual waiting-for-no-player) + ) + (plat-trans) + (none) + ) + :code (the-as (function none :behavior tomb-plat-return) sleep-code) + :post (behavior () + (sound-play "tomb-plat-ret" :id (the-as sound-id (-> self sound-id)) :position (-> self root-override trans)) + (seek! (-> self path-pos) (-> self dest-pos) (* (-> self path-speed) (-> self clock seconds-per-frame))) + (get-point-at-percent-along-path! + (-> self path) + (-> self basetrans) + (ease-value-in-out (-> self path-pos) 0.1) + 'interp + ) + (plat-post) + (none) + ) + ) + +(defstate waiting-for-no-player (tomb-plat-return) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('ridden) + (let ((v0-0 (the-as object (-> self clock frame-counter)))) + (set! (-> self ride-timer) (the-as time-frame v0-0)) + v0-0 + ) + ) + (else + (plat-event proc arg1 event-type event) + ) + ) + ) + :trans (behavior () + (plat-trans) + (when (>= (- (-> self clock frame-counter) (-> self ride-timer)) (seconds 1)) + (cond + ((= (-> self path-pos) 1.0) + (set! (-> self dest-pos) 0.0) + (go-virtual running) + ) + (else + (go-virtual waiting) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior tomb-plat-return) sleep-code) + :post (the-as (function none :behavior tomb-plat-return) plat-post) + ) + +;; WARN: Return type mismatch process-drawable vs tomb-plat-return. +(defmethod relocate tomb-plat-return ((obj tomb-plat-return) (arg0 int)) + (if (nonzero? (-> obj intro-path)) + (&+! (-> obj intro-path) arg0) + ) + (the-as tomb-plat-return ((method-of-type process-drawable relocate) obj arg0)) + ) + +(defmethod deactivate tomb-plat-return ((obj tomb-plat-return)) + (sound-stop (the-as sound-id (-> obj sound-id))) + ((the-as (function process-drawable none) (find-parent-method tomb-plat-return 10)) obj) + (none) + ) + +(defmethod base-plat-method-31 tomb-plat-return ((obj tomb-plat-return)) + "TODO - collision stuff" + (let ((s5-0 (new 'process 'collide-shape obj (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)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 19660.8) + (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! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-plat-return ((obj tomb-plat-return) (arg0 entity-actor)) + (base-plat-method-31 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-plat-return" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (stop-bouncing! obj) + (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj path-pos) 0.0) + (let ((s4-1 (new 'process 'curve-control obj 'path -1000000000.0))) + (if (logtest? (-> s4-1 flags) (path-control-flag not-found)) + (go process-drawable-art-error "error in path") + ) + (logior! (-> s4-1 flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> obj path) s4-1) + ) + (let ((s4-2 (new 'process 'curve-control obj 'intro -1000000000.0))) + (if (logtest? (-> s4-2 flags) (path-control-flag not-found)) + (go process-drawable-art-error "error in intro-path") + ) + (logior! (-> s4-2 flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> obj intro-path) s4-2) + ) + (let ((f30-0 (total-distance (-> obj path)))) + (set! (-> obj path-speed) (/ (res-lump-float arg0 'speed :default 40960.0) f30-0)) + (set! (-> obj root-override pause-adjust-distance) (+ 204800.0 f30-0)) + ) + (set! (-> obj sound-id) (the-as uint (new-sound-id))) + (base-plat-method-33 obj) + (if (or (task-closed? (the-as string ((method-of-type res-lump get-property-struct) + (-> obj entity) + 'task-name + 'interp + -1000000000.0 + "tomb-boss-resolution" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + ) + (go (method-of-object obj run-intro)) + (go (method-of-object obj hidden)) + ) + (none) + ) + +(defpart 3159 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x83 :page #xc)) + (sp-func spt-birth-func 'birth-func-set-quat) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 10) (meters 1) 1.0) + (sp-flt spt-scale-y (meters 40)) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat) + ) + ) + +(defpart 3160 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters -0.25)) + (sp-flt spt-z (meters 1.25)) + (sp-rnd-flt spt-scale-x (meters 5) (meters 0.5) 1.0) + (sp-flt spt-rot-x 409.6) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 96.0) + (sp-flt spt-g 96.0) + (sp-rnd-flt spt-b 196.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 1024.0) + ) + ) + +(defpart 3161 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbc :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters -0.15)) + (sp-flt spt-z (meters -1.25)) + (sp-rnd-flt spt-scale-x (meters 5) (meters 0.5) 1.0) + (sp-flt spt-rot-x 409.6) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 96.0) + (sp-flt spt-g 96.0) + (sp-rnd-flt spt-b 196.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 1024.0) + ) + ) + +(defun tomb-sphinx-draw-beam ((arg0 vector) (arg1 vector)) + (let ((a2-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0))) + (set! (-> *part-id-table* 3159 init-specs 4 initial-valuef) (vector-length a2-1)) + (draw-beam (-> *part-id-table* 3159) arg0 a2-1 #f #t) + ) + (let ((t9-1 sp-launch-particles-var) + (a0-3 *sp-particle-system-2d*) + (a1-2 (-> *part-id-table* 3160)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> arg0 quad)) + (t9-1 a0-3 a1-2 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-3 (-> *part-id-table* 3161)) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> arg1 quad)) + (t9-2 a0-4 a1-3 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (none) + ) + +(deftype tomb-sphinx (process-drawable) + ((root-override collide-shape-moving :offset 128) + (target-actor entity-actor :offset-assert 200) + (sound-id uint32 :offset-assert 204) + (move-dir float :offset 216) + ) + :heap-base #x60 + :method-count-assert 23 + :size-assert #xdc + :flag-assert #x17006000dc + (:methods + (idle () _type_ :state 20) + (active () _type_ :state 21) + (doors-open () _type_ :state 22) + ) + ) + + +(defstate idle (tomb-sphinx) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger 'cue-chase) + (go-virtual active) + ) + ) + ) + :code (the-as (function none :behavior tomb-sphinx) sleep-code) + ) + +(defstate active (tomb-sphinx) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('door-left) + (set! (-> self move-dir) -1.0) + (go-virtual doors-open) + ) + (('door-right) + (set! (-> self move-dir) 1.0) + (go-virtual doors-open) + ) + ) + ) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :code (behavior () + (local-vars (sv-96 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (logclear! (-> self mask) (process-mask actor-pause)) + (sound-play "tomb-lasr-start") + (let ((gp-2 (vector+! + (new 'stack-no-clear 'vector) + (-> self target-actor extra trans) + (new 'static 'vector :y 101580.8 :w 1.0) + ) + ) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> self root-override trans quad)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (until #f + (let ((s3-0 tomb-sphinx-draw-beam) + (s2-0 s5-1) + ) + (set! sv-96 s4-0) + (let ((s1-0 s5-1)) + (let ((s0-1 (vector-! (new 'stack-no-clear 'vector) gp-2 s5-1))) + (let ((v1-13 (lerp-scale 0.0 1.0 (the float (- (-> self clock frame-counter) (-> self state-time))) 0.0 300.0))) + (.mov vf7 v1-13) + ) + (.lvf vf5 (&-> s0-1 quad)) + ) + (.lvf vf4 (&-> s1-0 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 (&-> sv-96 quad) vf6) + (s3-0 s2-0 sv-96) + ) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (vector-segment-distance-point! (ear-trans 0) s5-1 s4-0 s3-1) + (sound-play "tomb-lasr-loop" :id (the-as sound-id (-> self sound-id)) :position s3-1) + ) + (suspend) + ) + ) + ) + #f + (none) + ) + ) + ) + +(defstate doors-open (tomb-sphinx) + :virtual #t + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :code (behavior () + (local-vars (sv-96 vector) (sv-112 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((gp-1 (vector+! + (new 'stack-no-clear 'vector) + (-> self target-actor extra trans) + (new 'static 'vector :y 101580.8 :w 1.0) + ) + ) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> self root-override trans quad)) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (let ((a1-0 s4-0)) + (let ((v1-8 gp-1)) + (let ((a0-2 (new 'static 'vector :x 4096.0 :w 1.0))) + (let ((a2-1 (* 14.0 (-> self move-dir)))) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 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-0 quad) vf6) + ) + (until #f + (let ((s2-0 tomb-sphinx-draw-beam) + (s1-0 s5-0) + ) + (set! sv-112 s3-0) + (let ((s0-0 gp-1)) + (set! sv-96 (new 'stack-no-clear 'vector)) + (let ((v1-10 gp-1) + (a0-3 s4-0) + ) + (.lvf vf4 (&-> v1-10 quad)) + (.lvf vf5 (&-> a0-3 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-96 quad) vf6) + (let ((v1-15 (lerp-scale 0.0 1.0 (the float (- (-> self clock frame-counter) (-> self state-time))) 0.0 930.0))) + (.mov vf7 v1-15) + ) + (.lvf vf5 (&-> sv-96 quad)) + (.lvf vf4 (&-> s0-0 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 (&-> sv-112 quad) vf6) + (s2-0 s1-0 sv-112) + ) + (suspend) + ) + ) + ) + #f + (none) + ) + ) + ) + +;; WARN: Return type mismatch process-drawable vs tomb-sphinx. +(defmethod relocate tomb-sphinx ((obj tomb-sphinx) (arg0 int)) + (the-as tomb-sphinx ((method-of-type process-drawable relocate) obj arg0)) + ) + +(defmethod deactivate tomb-sphinx ((obj tomb-sphinx)) + (sound-stop (the-as sound-id (-> obj sound-id))) + ((the-as (function process-drawable none) (find-parent-method tomb-sphinx 10)) obj) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-sphinx ((obj tomb-sphinx) (arg0 entity-actor)) + (set! (-> obj root-override) (the-as collide-shape-moving (new 'process 'trsqv))) + (process-drawable-from-entity! obj arg0) + (set! (-> obj target-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> obj sound-id) (the-as uint (new-sound-id))) + (set! (-> obj move-dir) 0.0) + (if (and (task-complete? *game-info* (-> obj entity task)) + (not (task-node-closed? (game-task-node tomb-boss-door))) + ) + (go (method-of-object obj active)) + (go (method-of-object obj idle)) + ) + (none) + ) diff --git a/goal_src/jak2/levels/mars_tomb/tomb-water.gc b/goal_src/jak2/levels/mars_tomb/tomb-water.gc index 44d35c504f..dd305c39cb 100644 --- a/goal_src/jak2/levels/mars_tomb/tomb-water.gc +++ b/goal_src/jak2/levels/mars_tomb/tomb-water.gc @@ -5,5 +5,2799 @@ ;; name in dgo: tomb-water ;; dgos: TOA +;; +++tomb-water:simon-block-flags +(defenum simon-block-flags + :type uint16 + :bitfield #t + (sbf0) + (sbf1) + (sbf2) + (sbf3) + (sbf4) + (sbf5) + (sbf6) + (sbf7) + (sbf8) + (sbf9) + (sbf10) + (sbf11) + (sbf12) + (sbf13) + (sbf14) + (sbf15) + ) +;; ---tomb-water:simon-block-flags + +(declare-type tomb-simon-block base-plat) +(define-extern tomb-simon-block-init-by-other (function vector int int int int none :behavior tomb-simon-block)) + ;; DECOMP BEGINS +(deftype tomb-door (process-drawable) + ((notify-actor entity :offset-assert 200) + (round uint32 :offset-assert 204) + ) + :heap-base #x50 + :method-count-assert 22 + :size-assert #xd0 + :flag-assert #x16005000d0 + (:methods + (idle () _type_ :state 20) + (open (time-frame) _type_ :state 21) + ) + ) + + +(defskelgroup skel-tomb-door tomb-door 0 2 ((1 (meters 999999))) :bounds (static-spherem 4 4 0 7)) + +(defstate idle (tomb-door) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('simon-done) + (sound-play "simon-correct") + ) + (('trigger) + (go-virtual open (seconds 0.5)) + ) + ) + ) + :trans (behavior () + (when (logtest? (actor-option user17) (-> self fact options)) + (let* ((gp-0 *target*) + (a0-3 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + (s4-0 (-> self root trans)) + ) + (when a0-3 + (let* ((s3-0 (get-trans a0-3 0)) + (s5-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s3-0 s4-0) 1.0)) + (gp-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (if (and (< (vector-vector-xz-distance s4-0 s3-0) 61440.0) (< (vector-dot s5-0 gp-1) 0.0)) + (go-virtual open 0) + ) + ) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior tomb-door) sleep-code) + ) + +(defstate open (tomb-door) + :virtual #t + :enter (behavior ((arg0 time-frame)) + (let ((gp-0 (-> self notify-actor))) + (when gp-0 + (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) 'untrigger) + (let ((t9-0 send-event-function) + (v1-2 gp-0) + ) + (t9-0 + (if v1-2 + (-> v1-2 extra process) + ) + a1-0 + ) + ) + ) + (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) + (let ((v0-3 (-> *event-queue* data (-> *event-queue* length)))) + (+! (-> *event-queue* length) 1) + (set! (-> v0-3 form-handle) (process->handle self)) + (set! (-> v0-3 to-handle) (process->handle (if gp-0 + (-> gp-0 extra process) + ) + ) + ) + (set! (-> v0-3 num-params) 1) + (set! (-> v0-3 message) 'set-round) + (set! (-> v0-3 param 0) (-> self round)) + ) + ) + ) + ) + (none) + ) + :code (behavior ((arg0 time-frame)) + (let ((s5-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s5-0) arg0) + (suspend) + ) + ) + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (-> self root quat) + (transform-post) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-door ((obj tomb-door) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape obj (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 camera-blocker pusher)) + (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) 16384.0 16384.0 0.0 36864.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-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 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)) + (set! (-> v1-11 transform-index) 4) + (set-vector! (-> v1-11 local-sphere) 8192.0 16384.0 4096.0 22528.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec camera-blocker pusher)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 5) + (set-vector! (-> v1-13 local-sphere) -8192.0 16384.0 4096.0 22528.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! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj fact) + (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> obj round) (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0)) + (ja-channel-push! 1 0) + (let ((a0-27 (-> obj skel root-channel 0))) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> a0-27 frame-num) 0.0) + (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +(deftype tomb-beetle-door (process-drawable) + ((offset vector 3 :inline :offset-assert 208) + (offset-index int32 :offset-assert 256) + (key-index int32 :offset-assert 260) + (beetle handle 3 :offset-assert 264) + (actor-group (pointer actor-group) :offset-assert 288) + (actor-group-count int32 :offset-assert 292) + ) + :heap-base #xb0 + :method-count-assert 22 + :size-assert #x128 + :flag-assert #x1600b00128 + (:methods + (idle () _type_ :state 20) + (open () _type_ :state 21) + ) + ) + + +(defskelgroup skel-tomb-beetle-door tomb-beetle-door 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 4 4 0 7) + ) + +(defstate idle (tomb-beetle-door) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('add-beetle) + (set! (-> self beetle (-> self offset-index)) (process->handle proc)) + (+! (-> self offset-index) 1) + (-> self offset (+ (-> self offset-index) -1)) + ) + (('key) + (+! (-> self key-index) 1) + (if (= (-> self key-index) 3) + (go-virtual open) + ) + ) + (('trigger) + (go-virtual open) + ) + ) + ) + :code (the-as (function none :behavior tomb-beetle-door) sleep-code) + :post (behavior () + 0 + (none) + ) + ) + +(defstate open (tomb-beetle-door) + :virtual #t + :enter (behavior () + (let ((gp-0 (-> self actor-group 0))) + (dotimes (s5-0 (-> gp-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) 'die) + (let ((t9-0 send-event-function) + (v1-5 (-> gp-0 data s5-0 actor)) + ) + (t9-0 + (if v1-5 + (-> v1-5 extra process) + ) + a1-0 + ) + ) + ) + ) + ) + (let ((gp-1 (-> self actor-group 1))) + (dotimes (s5-1 (-> gp-1 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) 'door-open) + (let ((t9-1 send-event-function) + (v1-16 (-> gp-1 data s5-1 actor)) + ) + (t9-1 + (if v1-16 + (-> v1-16 extra process) + ) + a1-1 + ) + ) + ) + ) + ) + (none) + ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + (none) + ) + :post (the-as (function none :behavior tomb-beetle-door) ja-post) + ) + +(define tomb-beetle-door-offsets (new 'static 'inline-array vector 3 + (new 'static 'vector :x 8192.0 :y 20480.0 :z 819.2 :w 1.0) + (new 'static 'vector :x 16384.0 :y 20480.0 :z 819.2 :w 1.0) + (new 'static 'vector :x 24576.0 :y 20480.0 :z 819.2 :w 1.0) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-beetle-door ((obj tomb-beetle-door) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (let ((s4-0 (new 'process 'collide-shape obj (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 camera-blocker pusher)) + (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) 16384.0 16384.0 4096.0 49152.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-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 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)) + (set! (-> v1-11 transform-index) 4) + (set-vector! (-> v1-11 local-sphere) 8192.0 16384.0 4096.0 22528.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec camera-blocker pusher)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 5) + (set-vector! (-> v1-13 local-sphere) -8192.0 16384.0 4096.0 22528.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! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-beetle-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (countdown (s5-2 3) + (vector-orient-by-quat! (-> obj offset s5-2) (-> tomb-beetle-door-offsets s5-2) (-> obj root quat)) + (set! (-> obj offset s5-2 w) (quaternion-y-angle (-> obj root quat))) + (set! (-> obj beetle s5-2) (the-as handle #f)) + ) + (set! (-> obj offset-index) 0) + (set! (-> obj key-index) 0) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-33 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-33 (nonzero? (-> sv-16 elt-count))) + (set! (-> obj actor-group) (the-as (pointer actor-group) v1-33)) + (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> obj actor-group-count) 0) + 0 + ) + ) + ) + (ja-channel-push! 1 0) + (let ((a0-30 (-> obj skel root-channel 0))) + (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> a0-30 frame-num) 0.0) + (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +(defskelgroup skel-tomb-button tomb-button 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 2.5)) + +(deftype tomb-button (basebutton) + () + :heap-base #xa0 + :method-count-assert 39 + :size-assert #x120 + :flag-assert #x2700a00120 + ) + + +(defmethod basebutton-method-33 tomb-button ((obj tomb-button)) + "TODO - joint stuff" + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-button" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (cond + ((logtest? (-> obj button-status) (button-status pressed)) + (let ((s5-1 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-1 + (the-as art-joint-anim (-> obj draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-1 frame-num) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) frames num-frames) -1)) + ) + ) + ) + (else + (let ((s5-2 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-2 + (the-as art-joint-anim (-> obj draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-2 frame-num) 0.0) + ) + ) + ) + (transform-post) + (none) + ) + +;; WARN: Return type mismatch collide-shape vs none. +(defmethod basebutton-method-34 tomb-button ((obj tomb-button)) + "TODO - collision stuff" + (let ((s5-0 (new 'process 'collide-shape obj (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 9011.2) + (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! (-> obj root-override) s5-0) + ) + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod prepare-trigger-event! tomb-button ((obj tomb-button)) + "Sets `event-going-down` to `'trigger`" + (logior! (-> obj button-status) (button-status button-status-4)) + (set! (-> obj event-going-down) 'cue-chase) + (set! (-> obj root-override trans y) (+ 204.8 (-> obj root-override trans y))) + (none) + ) + +(deftype tomb-beetle-button (tomb-button) + ((round uint32 :offset-assert 288) + (speech-mask uint32 :offset-assert 292) + (speech-timer time-frame :offset-assert 296) + ) + :heap-base #xb0 + :method-count-assert 40 + :size-assert #x130 + :flag-assert #x2800b00130 + (:methods + (tomb-beetle-button-method-39 (_type_) none 39) + ) + ) + + +(defmethod tomb-beetle-button-method-39 tomb-beetle-button ((obj tomb-beetle-button)) + (with-pp + (when (>= (- (-> pp clock frame-counter) (-> obj speech-timer)) (seconds 6)) + (let ((s5-0 (rand-vu-int-count-excluding 4 (the-as int (-> obj speech-mask))))) + (let* ((v1-4 s5-0) + (t0-0 (cond + ((zero? v1-4) + "ora011" + ) + ((= v1-4 1) + "ora012" + ) + ((= v1-4 2) + "ora013" + ) + ((= v1-4 3) + "ora014" + ) + ) + ) + ) + (add-process *gui-control* obj (gui-channel alert) (gui-action play) t0-0 -99.0 0) + ) + (set! (-> obj speech-mask) (the-as uint (ash 1 s5-0))) + ) + (set! (-> obj speech-timer) (-> pp clock frame-counter)) + ) + 0 + (none) + ) + ) + +(defstate going-down (tomb-beetle-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('get-round) + (-> self round) + ) + (else + ((-> (method-of-type basebutton going-down) event) proc arg1 event-type event) + ) + ) + ) + :enter (behavior () + (let ((t9-0 (-> (method-of-type tomb-button going-down) enter))) + (if t9-0 + (t9-0) + ) + ) + (process-grab? *target* #f) + (none) + ) + ) + +(defstate down-idle (tomb-beetle-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) + (the-as object (cond + ((= v1-0 'set-round) + (let ((v0-0 (the-as object (-> event param 0)))) + (set! (-> self round) (the-as uint v0-0)) + v0-0 + ) + ) + ((= v1-0 'door-open) + (remove-setting! 'gun) + (the-as object (remove-setting! 'entity-name)) + ) + (else + ((-> (method-of-type basebutton down-idle) event) proc arg1 event-type event) + ) + ) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type tomb-button down-idle) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 4)) + (if (and *target* (logtest? (-> *target* focus-status) (focus-status grabbed))) + (process-release? *target*) + ) + (if (and *target* + (logtest? (state-flags prevent-gun) (-> *target* state-flags)) + (cpad-pressed? (-> *target* control cpad number) up right down left r1) + ) + (tomb-beetle-button-method-39 self) + ) + ) + (none) + ) + ) + +(defstate going-up (tomb-beetle-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('set-round) + (let ((v0-0 (the-as object (-> event param 0)))) + (set! (-> self round) (the-as uint v0-0)) + v0-0 + ) + ) + (else + ((-> (method-of-type basebutton going-up) event) proc arg1 event-type event) + ) + ) + ) + ) + +(defstate up-idle (tomb-beetle-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('get-round) + (-> self round) + ) + (('set-round) + (let ((v0-0 (the-as object (-> event param 0)))) + (set! (-> self round) (the-as uint v0-0)) + v0-0 + ) + ) + (else + ((-> (method-of-type basebutton up-idle) event) proc arg1 event-type event) + ) + ) + ) + :trans (behavior () + (let ((t9-1 (-> (the-as (state basebutton) (find-parent-method tomb-beetle-button 30)) trans))) + (if t9-1 + (t9-1) + ) + ) + (let ((v1-2 *target*)) + (cond + ((and v1-2 (< (vector-vector-xz-distance (-> v1-2 control trans) (-> self root-override trans)) 40960.0)) + (when (zero? (-> self entity extra perm user-uint8 1)) + (tomb-beetle-button-method-39 self) + (let ((v1-15 (-> self entity extra perm))) + (logior! (-> v1-15 status) (entity-perm-status bit-5)) + (set! (-> v1-15 user-int8 1) 1) + ) + ) + (set-setting! 'gun #f 0 0) + (set-setting! 'entity-name "camera-194" 0 0) + (if (and *target* + (logtest? (state-flags prevent-gun) (-> *target* state-flags)) + (cpad-pressed? (-> *target* control cpad number) up right down left r1) + ) + (tomb-beetle-button-method-39 self) + ) + ) + (else + (remove-setting! 'gun) + (remove-setting! 'entity-name) + ) + ) + ) + (none) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod send-event! tomb-beetle-button ((obj tomb-beetle-button) (arg0 symbol)) + "Prepares an [[event-message-block]] using the provided type to send an event to: + - the `notify-actor` + - every [[entity-actor]] in the `actor-group` array + @see [[entity-actor]]" + (when arg0 + (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) arg0) + (let ((t9-0 send-event-function) + (v1-1 (-> obj notify-actor)) + ) + (t9-0 + (if v1-1 + (-> v1-1 extra process) + ) + a1-1 + ) + ) + ) + (let ((s4-0 (-> obj actor-group (-> obj round)))) + (dotimes (s3-0 (-> s4-0 length)) + (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) arg0) + (set! (-> a1-2 param 0) (-> obj round)) + (let ((t9-1 send-event-function) + (v1-11 (-> s4-0 data s3-0 actor)) + ) + (t9-1 + (if v1-11 + (-> v1-11 extra process) + ) + a1-2 + ) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod prepare-trigger-event! tomb-beetle-button ((obj tomb-beetle-button)) + "Sets `event-going-down` to `'trigger`" + (let ((t9-0 (method-of-type tomb-button prepare-trigger-event!))) + (t9-0 obj) + ) + (set! (-> obj round) (-> obj entity extra perm user-uint8 0)) + (set! (-> obj speech-mask) (the-as uint 0)) + (set! (-> obj speech-timer) 0) + 0 + (none) + ) + +(defskelgroup skel-tomb-move-swing-pole tomb-move-swing-pole 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 3.5) + ) + +(deftype tomb-simon-block (base-plat) + ((sound-show uint128 :offset-assert 272) + (color vector :inline :offset-assert 288) + (my-idx int32 :offset-assert 304) + (next-idx int32 :offset-assert 308) + (flags simon-block-flags :offset-assert 312) + (blink-timer time-frame 2 :offset-assert 320) + (ride-timer time-frame :offset-assert 336) + (order int32 :offset-assert 344) + (base-height float :offset-assert 348) + (move-rate float :offset-assert 352) + ) + :heap-base #xf0 + :method-count-assert 42 + :size-assert #x164 + :flag-assert #x2a00f00164 + (:methods + (idle () _type_ :state 34) + (ready () _type_ :state 35) + (ridden () _type_ :state 36) + (temporary () _type_ :state 37) + (dangerous () _type_ :state 38) + (wobble-die () _type_ :state 39) + (die () _type_ :state 40) + (set-blink-timers! (_type_) none 41) + ) + ) + + +(deftype tomb-plat-simon (process-drawable) + ((plat (array handle) :offset-assert 200) + (plat-seq (pointer uint32) :offset-assert 204) + (plat-count int32 :offset-assert 208) + (plat-seq-count int32 :offset-assert 212) + (plat-idx int32 :offset-assert 216) + (button-handle handle :offset-assert 224) + (notify-actor entity :offset-assert 232) + (flags uint16 :offset-assert 236) + ) + :heap-base #x70 + :method-count-assert 25 + :size-assert #xee + :flag-assert #x19007000ee + (:methods + (dormant () _type_ :state 20) + (appear () _type_ :state 21) + (show-sequence () _type_ :state 22) + (idle () _type_ :state 23) + (tomb-plat-simon-method-24 (_type_ int) none 24) + ) + ) + + +(define *tomb-simon-sound-tbl* (new 'static 'array sound-name 4 + (static-sound-name "simon-red") + (static-sound-name "simon-green") + (static-sound-name "simon-blue") + (static-sound-name "simon-yellow") + ) + ) + +(define *tomb-simon-color-tbl* (new 'static 'inline-array vector 4 + (new 'static 'vector :x 0.8 :y 0.28 :z 0.28 :w 1.0) + (new 'static 'vector :x 0.39 :y 0.61 :z 0.28 :w 1.0) + (new 'static 'vector :x 0.28 :y 0.5 :z 0.61 :w 1.0) + (new 'static 'vector :x 0.8 :y 0.64 :z 0.28 :w 1.0) + ) + ) + +(defskelgroup skel-tomb-simon-block tomb-plat-simon 0 3 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; WARN: Return type mismatch none vs object. +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 135] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 199] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 280] +(defbehavior tomb-plat-simon-handler tomb-plat-simon ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (the-as object (case arg2 + (('ready-index) + (tomb-plat-simon-method-24 self (the-as int (-> arg3 param 0))) + ) + (('plat-ridden) + (logior! (-> self flags) 1) + (when (= (-> arg3 param 0) (-> self plat-seq (+ (-> self plat-seq-count) -1))) + (when (-> self notify-actor) + (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) 'simon-done) + (let ((t9-1 send-event-function) + (v1-11 (-> self notify-actor)) + ) + (t9-1 + (if v1-11 + (-> v1-11 extra process) + ) + a1-2 + ) + ) + ) + (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) + (let ((v1-20 (-> *event-queue* data (-> *event-queue* length)))) + (+! (-> *event-queue* length) 1) + (set! (-> v1-20 form-handle) (process->handle self)) + (let ((a0-23 (-> self notify-actor))) + (set! (-> v1-20 to-handle) (process->handle (if a0-23 + (-> a0-23 extra process) + ) + ) + ) + ) + (set! (-> v1-20 num-params) 0) + (set! (-> v1-20 message) 'trigger) + ) + ) + ) + (sound-play "tomb-simon-fall") + (dotimes (s5-1 (-> self plat-count)) + (if (!= s5-1 (-> arg3 param 0)) + (send-event (handle->process (-> self plat s5-1)) 'die-unmaskable) + ) + ) + #f + ) + ) + (('finished) + (if (-> self button-handle) + (send-event (handle->process (-> self button-handle)) 'trigger) + ) + (dotimes (gp-1 (-> self plat-count)) + (send-event (handle->process (-> self plat gp-1)) 'die-unmaskable) + ) + (go-virtual dormant) + ) + (('die-but) + (if (-> self button-handle) + (send-event (handle->process (-> self button-handle)) 'untrigger) + ) + (sound-play "tomb-simon-fall") + (dotimes (s5-3 (-> self plat-count)) + (if (!= s5-3 (-> arg3 param 0)) + (send-event (handle->process (-> self plat s5-3)) 'die) + ) + ) + (go-virtual dormant) + ) + ) + ) + ) + +(defstate dormant (tomb-plat-simon) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger 'cue-chase) + (set! (-> self button-handle) (process->handle proc)) + (go-virtual appear) + ) + ) + ) + :code (the-as (function none :behavior tomb-plat-simon) sleep-code) + ) + +(defstate appear (tomb-plat-simon) + :virtual #t + :event tomb-plat-simon-handler + :enter (behavior () + (local-vars + (sv-96 target) + (sv-128 vector) + (sv-136 int) + (sv-144 int) + (sv-160 int) + (sv-176 (function vector vector float)) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self plat-idx) 0) + (dotimes (gp-0 (-> self plat-count)) + (if (nonzero? (-> self plat gp-0)) + (send-event (handle->process (-> self plat gp-0)) 'die-unmaskable) + ) + ) + (let ((gp-1 *target*)) + (set! sv-96 (if (type? gp-1 process-focusable) + gp-1 + ) + ) + ) + (dotimes (gp-2 (-> self plat-count)) + (set! sv-128 (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (the float gp-2) 'exact)) + (set! sv-136 -1) + (dotimes (v1-20 (+ (-> self plat-seq-count) -1)) + (if (= gp-2 (-> self plat-seq v1-20)) + (set! sv-136 (the-as int (-> self plat-seq (+ v1-20 1)))) + ) + ) + (let ((v1-26 (the int (* 0.000061035156 (+ 40960000.0 (-> sv-128 x))))) + (a0-21 (the int (* 0.000061035156 (+ 40960000.0 (-> sv-128 z))))) + ) + (set! sv-144 (logand (logior (logand v1-26 1) (* a0-21 2)) 3)) + ) + (let* ((s5-0 (get-process *default-dead-pool* tomb-simon-block #x4000)) + (s4-0 (when s5-0 + (let ((t9-4 (method-of-type tomb-simon-block activate))) + (t9-4 + (the-as tomb-simon-block s5-0) + self + (symbol->string (-> tomb-simon-block symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((s4-1 run-function-in-process) + (s3-0 s5-0) + (s2-0 tomb-simon-block-init-by-other) + (s1-0 sv-128) + (s0-0 gp-2) + ) + (set! sv-160 sv-136) + (let ((f30-0 0.00012207031)) + (set! sv-176 vector-vector-xz-distance) + (let* ((a0-26 (get-trans sv-96 0)) + (a1-9 sv-128) + (t1-0 (the int (* f30-0 (sv-176 a0-26 a1-9)))) + (t2-0 sv-144) + ) + ((the-as (function object object object object object object object none) s4-1) + s3-0 + s2-0 + s1-0 + s0-0 + sv-160 + t1-0 + t2-0 + ) + ) + ) + ) + (-> s5-0 ppointer) + ) + ) + ) + (send-event (ppointer->process s4-0) 'reparent) + (set! (-> self plat gp-2) (ppointer->handle s4-0)) + ) + ) + (none) + ) + :code (behavior () + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 2)) + (suspend) + ) + ) + (go-virtual show-sequence) + (none) + ) + ) + +(defstate show-sequence (tomb-plat-simon) + :virtual #t + :event tomb-plat-simon-handler + :enter (behavior () + (set! (-> self state-time) (+ (-> self clock frame-counter) (seconds -1))) + (set! (-> self plat-idx) 0) + 0 + (none) + ) + :trans (behavior () + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (set! (-> self state-time) (-> self clock frame-counter)) + (if (< (-> self plat-idx) (-> self plat-seq-count)) + (send-event (handle->process (-> self plat (-> self plat-seq (-> self plat-idx)))) 'blink) + ) + (if (zero? (-> self plat-idx)) + (tomb-plat-simon-method-24 self (the-as int (-> self plat-seq 0))) + ) + (+! (-> self plat-idx) 1) + (if (= (-> self plat-idx) (+ (-> self plat-seq-count) 1)) + (go-virtual idle) + ) + ) + (none) + ) + :code (the-as (function none :behavior tomb-plat-simon) sleep-code) + ) + +(defstate idle (tomb-plat-simon) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger 'cue-chase) + (dotimes (gp-0 (-> self plat-count)) + (send-event (handle->process (-> self plat gp-0)) 'reset) + ) + (go-virtual show-sequence) + ) + (else + (tomb-plat-simon-handler proc arg1 event-type event) + ) + ) + ) + :enter (behavior () + (if (-> self button-handle) + (send-event (handle->process (-> self button-handle)) 'untrigger) + ) + (none) + ) + :code (the-as (function none :behavior tomb-plat-simon) sleep-code) + :post (behavior () + (debug-draw (-> self path)) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod tomb-plat-simon-method-24 tomb-plat-simon ((obj tomb-plat-simon) (arg0 int)) + (let ((a0-3 (handle->process (-> obj plat arg0)))) + (send-event a0-3 'ready) + ) + (none) + ) + +;; WARN: Return type mismatch process-drawable vs tomb-plat-simon. +(defmethod relocate tomb-plat-simon ((obj tomb-plat-simon) (arg0 int)) + (if (nonzero? (-> obj plat)) + (&+! (-> obj plat) arg0) + ) + (the-as tomb-plat-simon ((method-of-type process-drawable relocate) obj arg0)) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-plat-simon ((obj tomb-plat-simon) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (change-parent obj *pusher-pool*) + (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-2 (res-lump-data (-> obj entity) 'plat-seq pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-2 (nonzero? (-> sv-16 elt-count))) + (set! (-> obj plat-seq-count) (the-as int (-> sv-16 elt-count))) + (set! (-> obj plat-seq) (the-as (pointer uint32) v1-2)) + ) + (else + (set! (-> obj plat-seq-count) 0) + (set! (-> obj plat-seq) (the-as (pointer uint32) #f)) + ) + ) + ) + (let ((s4-0 arg0)) + (let ((v1-4 (entity-actor-lookup arg0 'path-actor 0))) + (if v1-4 + (set! s4-0 v1-4) + ) + ) + (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 s4-0 #f)) + ) + (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> obj plat-count) (-> obj path curve num-cverts)) + (set! (-> obj plat) (new 'process 'boxed-array handle (-> obj plat-count))) + (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj button-handle) (the-as handle #f)) + (go (method-of-object obj dormant)) + (none) + ) + +(defbehavior simon-block-handler tomb-simon-block ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (plat-event arg0 arg1 arg2 arg3) + ) + +(defbehavior tomb-simon-block-post tomb-simon-block () + (when (!= (-> self basetrans y) (-> self base-height)) + (seek! (-> self basetrans y) (-> self base-height) (* (-> self move-rate) (-> self clock seconds-per-frame))) + (when (and (< (- (-> self base-height) (-> self basetrans y)) 21504.0) + (zero? (logand (-> self flags) (simon-block-flags sbf5))) + ) + (sound-play "simon-up") + (logior! (-> self flags) (simon-block-flags sbf5)) + ) + (if (< (- (-> self base-height) (-> self basetrans y)) 81920.0) + (seek! (-> self move-rate) 0.0 (* 81920.0 (-> self clock seconds-per-frame))) + ) + (when (< (+ -409.6 (-> self base-height)) (-> self basetrans y)) + (sound-play "simon-hit") + (set! (-> self basetrans y) (-> self base-height)) + ) + ) + (plat-post) + (none) + ) + +(defbehavior tomb-simon-block-trans tomb-simon-block () + (when (logtest? (-> self flags) (simon-block-flags sbf0)) + (when (>= (-> self clock frame-counter) (-> self blink-timer 1)) + (cond + ((logtest? (-> self flags) (simon-block-flags sbf1)) + (set! (-> self draw color-mult quad) (-> self color quad)) + ) + (else + (sound-play-by-name (the-as sound-name (-> self sound-show)) (new-sound-id) 1024 0 0 (sound-group sfx) #t) + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + ) + (logxor! (-> self flags) (simon-block-flags sbf1)) + (set! (-> self blink-timer 1) (+ (-> self clock frame-counter) (seconds 0.2))) + ) + (when (>= (- (-> self clock frame-counter) (-> self blink-timer 0)) (seconds 1.2)) + (logclear! (-> self flags) (simon-block-flags sbf0)) + (set! (-> self draw color-mult quad) (-> self color quad)) + ) + ) + (plat-trans) + (none) + ) + +(defstate idle (tomb-simon-block) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as + object + (case event-type + (('reparent) + (change-parent self proc) + ) + (('blink) + (the-as object (set-blink-timers! self)) + ) + (('edge-grabbed) + (go-virtual dangerous) + ) + (('ridden 'bonk) + (let* ((gp-0 *target*) + (a0-12 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (when a0-12 + (let ((v1-6 (get-trans a0-12 0)) + (a0-14 (-> self root-override trans)) + ) + (if (and (>= 8192.0 (fabs (- (-> v1-6 x) (-> a0-14 x)))) (>= 8192.0 (fabs (- (-> v1-6 z) (-> a0-14 z))))) + (go-virtual dangerous) + ) + ) + ) + ) + ) + (('die 'die-unmaskable) + (go-virtual die) + ) + (('ready) + (go-virtual ready) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (logclear! (-> self flags) (simon-block-flags sbf0 sbf1 sbf2 sbf5)) + (set! (-> self move-rate) 122880.0) + (none) + ) + :trans tomb-simon-block-trans + :code (the-as (function none :behavior tomb-simon-block) sleep-code) + :post (behavior () + (if (>= (- (-> self clock frame-counter) (-> self state-time)) + (the int (* 300.0 (+ (* 0.1 (the float (-> self order))) (* 0.015 (the float (-> self my-idx)))))) + ) + (tomb-simon-block-post) + (plat-post) + ) + (none) + ) + ) + +(defstate dangerous (tomb-simon-block) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('die-unmaskable) + (go-virtual die) + ) + (('reset) + (go-virtual idle) + ) + (('touch 'ridden 'bonk 'edge-grabbed) + (set! (-> self ride-timer) (-> self clock frame-counter)) + (when (logtest? (-> self flags) (simon-block-flags sbf4)) + (let* ((gp-0 *target*) + (a0-10 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + (v1-10 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-10 x) 0.0) + (set! (-> v1-10 y) 0.0) + (set! (-> v1-10 z) 1.0) + (set! (-> v1-10 w) 0.0) + (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) 'attack) + (set! (-> a1-6 param 0) (the-as uint #f)) + (let ((a2-4 (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up control id)))) + (let* ((a3-2 *game-info*) + (t0-1 (+ (-> a3-2 attack-id) 1)) + ) + (set! (-> a3-2 attack-id) t0-1) + (set! (-> a2-4 id) t0-1) + ) + (set! (-> a2-4 vector quad) (-> v1-10 quad)) + (set! (-> a2-4 shove-back) 0.0) + (set! (-> a2-4 shove-up) 12288.0) + (set! (-> a2-4 control) (if (logtest? (focus-status board) (-> a0-10 focus-status)) + 1.0 + 0.0 + ) + ) + (set! (-> a1-6 param 1) (the-as uint a2-4)) + ) + (send-event-function a0-10 a1-6) + ) + ) + (let ((v0-0 (the-as object (logclear (-> self flags) (simon-block-flags sbf4))))) + (set! (-> self flags) (the-as simon-block-flags v0-0)) + v0-0 + ) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (logior! (-> self flags) (simon-block-flags sbf4)) + (set! (-> self ride-timer) (-> self clock frame-counter)) + (send-event (ppointer->process (-> self parent)) 'die-but (-> self my-idx)) + (none) + ) + :trans (behavior () + (when (>= (- (-> self clock frame-counter) (-> self ride-timer)) (seconds 1)) + (sound-play "tomb-simon-last") + (go-virtual die) + ) + (plat-trans) + (none) + ) + :code (the-as (function none :behavior tomb-simon-block) sleep-code) + :post tomb-simon-block-post + ) + +(defstate ready (tomb-simon-block) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk) + (the-as object (start-bouncing! self)) + ) + (('reset) + (go-virtual idle) + ) + (('blink) + (the-as object (set-blink-timers! self)) + ) + (('die 'die-unmaskable) + (go-virtual die) + ) + (('ridden) + (send-event (ppointer->process (-> self parent)) 'plat-ridden (-> self my-idx)) + (if (!= (-> self next-idx) -1) + (send-event (ppointer->process (-> self parent)) 'ready-index (-> self next-idx)) + ) + (go-virtual ridden) + ) + ) + ) + ) + :trans tomb-simon-block-trans + :code (the-as (function none :behavior tomb-simon-block) sleep-code) + :post tomb-simon-block-post + ) + +(defstate ridden (tomb-simon-block) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk) + (the-as object (start-bouncing! self)) + ) + (('reset) + (go-virtual idle) + ) + (('die-unmaskable) + (go-virtual die) + ) + (('die) + (go-virtual temporary) + ) + (('ridden) + (let ((v0-0 (the-as object (-> self clock frame-counter)))) + (set! (-> self ride-timer) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self ride-timer) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (let* ((gp-0 *target*) + (a0-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (when a0-1 + (let ((v1-2 (get-trans a0-1 0)) + (a0-3 (-> self root-override trans)) + ) + (when (and (or (< 16384.0 (fabs (- (-> a0-3 x) (-> v1-2 x)))) (< 16384.0 (fabs (- (-> a0-3 z) (-> v1-2 z))))) + (>= (- (-> self clock frame-counter) (-> self ride-timer)) (seconds 0.25)) + ) + (when (= (-> self next-idx) -1) + (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) + (let ((v1-17 (-> *event-queue* data (-> *event-queue* length)))) + (+! (-> *event-queue* length) 1) + (set! (-> v1-17 form-handle) (process->handle self)) + (set! (-> v1-17 to-handle) (process->handle (the-as process (ppointer->process (-> self parent))))) + (set! (-> v1-17 num-params) 0) + (set! (-> v1-17 message) 'finished) + ) + ) + (sound-play "tomb-simon-last") + ) + (go-virtual temporary) + ) + ) + ) + ) + (tomb-simon-block-trans) + (none) + ) + :code (the-as (function none :behavior tomb-simon-block) sleep-code) + :post tomb-simon-block-post + ) + +(defstate temporary (tomb-simon-block) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk) + (the-as object (start-bouncing! self)) + ) + (('reset) + (go-virtual idle) + ) + (('die-unmaskable) + (go-virtual die) + ) + (('ridden) + (when (not (logtest? (-> self flags) (simon-block-flags sbf2))) + (logior! (-> self flags) (simon-block-flags sbf2)) + (let ((v0-0 (the-as object (-> self clock frame-counter)))) + (set! (-> self ride-timer) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) + ) + ) + ) + :enter (behavior () + (logclear! (-> self flags) (simon-block-flags sbf0 sbf1 sbf2)) + (set! (-> self draw color-mult quad) (-> self color quad)) + (none) + ) + :trans (behavior () + (if (and (logtest? (-> self flags) (simon-block-flags sbf2)) + (>= (- (-> self clock frame-counter) (-> self ride-timer)) (seconds 0.5)) + ) + (go-virtual wobble-die) + ) + (plat-trans) + (none) + ) + :code (the-as (function none :behavior tomb-simon-block) sleep-code) + :post tomb-simon-block-post + ) + +(defstate wobble-die (tomb-simon-block) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('reset) + (go-virtual idle) + ) + (('die-unmaskable) + (go-virtual die) + ) + ) + ) + :trans (the-as (function none :behavior tomb-simon-block) plat-trans) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sound-play "tomb-simon-last") + (go-virtual die) + (none) + ) + :post tomb-simon-block-post + ) + +(defstate die (tomb-simon-block) + :virtual #t + :code (behavior () + (set! (-> self move-rate) (* 4096.0 (rand-vu-float-range 0.5 1.5))) + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.25)) + (suspend) + ) + ) + (logclear! (-> self root-override root-prim prim-core action) (collide-action rideable)) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) + (suspend) + ) + ) + (cleanup-for-death self) + (none) + ) + :post (behavior () + (set! (-> self root-override transv y) + (- (-> self root-override transv y) (* (-> self move-rate) (-> self clock seconds-per-frame))) + ) + (+! (-> self root-override trans y) (-> self root-override transv y)) + (transform-post) + (none) + ) + ) + +;; WARN: Return type mismatch time-frame vs none. +(defmethod set-blink-timers! tomb-simon-block ((obj tomb-simon-block)) + (with-pp + (logior! (-> obj flags) (simon-block-flags sbf0 sbf1)) + (set! (-> obj blink-timer 0) (-> pp clock frame-counter)) + (set! (-> obj blink-timer 1) (-> pp clock frame-counter)) + (none) + ) + ) + +(defmethod get-art-group tomb-simon-block ((obj tomb-simon-block)) + "@returns The associated [[art-group]]" + (art-group-get-by-name *level* "skel-tomb-simon-block" (the-as (pointer uint32) #f)) + ) + +;; WARN: Return type mismatch collide-shape vs none. +(defmethod base-plat-method-31 tomb-simon-block ((obj tomb-simon-block)) + "TODO - collision stuff" + (let ((s5-0 (new 'process 'collide-shape obj (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 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 -4096.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-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! (-> obj root-override) s5-0) + ) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior tomb-simon-block-init-by-other tomb-simon-block ((arg0 vector) (arg1 int) (arg2 int) (arg3 int) (arg4 int)) + (base-plat-method-31 self) + (set! (-> self mask) (logior (process-mask platform) (-> self mask))) + (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self base-height) (-> self root-override trans y)) + (set! (-> self root-override trans y) (+ -122880.0 (-> self root-override trans y))) + (quaternion-copy! (-> self root-override quat) *unity-quaternion*) + (vector-identity! (-> self root-override scale)) + (initialize-skeleton self (the-as skeleton-group (get-art-group self)) (the-as pair 0)) + (logclear! (-> self mask) (process-mask actor-pause)) + (update-transforms (-> self root-override)) + (stop-bouncing! self) + (set! (-> self my-idx) arg1) + (set! (-> self next-idx) arg2) + (set! (-> self flags) (simon-block-flags)) + (set! (-> self order) arg3) + (set! (-> self color quad) (-> *tomb-simon-color-tbl* arg4 quad)) + (set! (-> self sound-show) (-> *tomb-simon-sound-tbl* arg4)) + (set! (-> self draw color-mult quad) (-> self color quad)) + (set! (-> self event-hook) (-> (method-of-type tomb-simon-block idle) event)) + (go-virtual idle) + (none) + ) + +(deftype tomb-simon-button (process-drawable) + ((notify-actor entity :offset-assert 200) + (on-notice (function none) :offset-assert 204) + (on-activate (function none) :offset-assert 208) + ) + :heap-base #x60 + :method-count-assert 25 + :size-assert #xd4 + :flag-assert #x19006000d4 + (:methods + (idle () _type_ :state 20) + (open (symbol) _type_ :state 21) + (waiting () _type_ :state 22) + (pressed (symbol) _type_ :state 23) + (unpress () _type_ :state 24) + ) + ) + + +(defskelgroup skel-tomb-simon-button tomb-simon-button 0 3 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + ) + +(defstate idle (tomb-simon-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger) + (go-virtual open #f) + ) + ) + ) + :trans (behavior () + (let ((gp-0 (-> self on-notice))) + (when gp-0 + (if (eval! + (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) + (the-as pair gp-0) + ) + (go-virtual open #f) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior tomb-simon-button) sleep-code) + ) + +(defstate open (tomb-simon-button) + :virtual #t + :enter (behavior ((arg0 symbol)) + (let ((v1-2 (-> self entity extra perm))) + (set! (-> v1-2 user-int8 0) 1) + ) + (none) + ) + :trans (the-as (function none :behavior tomb-simon-button) rider-trans) + :code (behavior ((arg0 symbol)) + (cond + (arg0 + (ja :group! (-> self draw art-group data 3) + :num! (identity (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + ) + ) + (else + (sound-play "simon-btn-open") + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (go-virtual waiting) + (none) + ) + :post (the-as (function none :behavior tomb-simon-button) rider-post) + ) + +(defstate waiting (tomb-simon-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('bonk 'touch) + (when ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> event param 0)) + (the-as collide-shape (-> self root)) + (the-as uint 1) + ) + (let ((v1-3 (-> self notify-actor))) + (if v1-3 + (send-event + (if v1-3 + (-> v1-3 extra process) + ) + 'trigger + ) + ) + ) + (go-virtual pressed #f) + ) + ) + (('trigger) + (go-virtual pressed #f) + ) + ) + ) + :enter (behavior () + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + :frame-num 0.0 + ) + (transform-post) + (none) + ) + :code (the-as (function none :behavior tomb-simon-button) sleep-code) + ) + +(defstate pressed (tomb-simon-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('untrigger) + (go-virtual unpress) + ) + ) + ) + :code (behavior ((arg0 symbol)) + (let ((v1-2 (-> self entity extra perm))) + (set! (-> v1-2 user-int8 0) 2) + ) + (cond + (arg0 + (ja :group! (-> self draw art-group data 4) + :num! (identity (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + ) + (transform-post) + ) + (else + (sound-play "simon-btn-press") + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-2 (-> self on-activate))) + (if gp-2 + (eval! + (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) + (the-as pair gp-2) + ) + ) + ) + ) + ) + (sleep-code) + (none) + ) + ) + +(defstate unpress (tomb-simon-button) + :virtual #t + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 5) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek!)) + ) + (let ((v1-26 (-> self entity extra perm))) + (set! (-> v1-26 user-int8 0) 1) + ) + (go-virtual waiting) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-simon-button ((obj tomb-simon-button) (arg0 entity-actor)) + (with-pp + (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0))) + (set! (-> s4-0 total-prims) (the-as uint 6)) + (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable pull-rider-can-collide)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 122880.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (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 rideable)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 0.0 0.0 12288.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (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) 4) + (set-vector! (-> v1-12 local-sphere) 0.0 0.0 0.0 11059.2) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (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) 5) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 11059.2) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec obstacle)) + (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 11059.2) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec obstacle)) + (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) 7) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 11059.2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-21 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-simon-button" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> obj on-notice) (res-lump-struct (-> obj entity) 'on-notice (function none))) + (set! (-> obj on-activate) (res-lump-struct (-> obj entity) 'on-activate (function none))) + (let ((a0-42 (-> obj skel root-channel 0))) + (set! (-> a0-42 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> a0-42 param 0) 1.0) + (set! (-> a0-42 frame-num) 0.0) + (joint-control-channel-group! a0-42 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-loop!) + ) + (transform-post) + (let ((s5-1 (-> obj on-notice))) + (when s5-1 + (if (eval! + (new 'stack 'script-context (the-as basic (process->ppointer pp)) pp (the-as vector #f)) + (the-as pair s5-1) + ) + (go (method-of-object obj open) #t) + ) + ) + ) + (let ((v1-49 (-> obj entity extra perm user-uint8 0))) + (cond + ((zero? v1-49) + (go (method-of-object obj idle)) + ) + ((= v1-49 1) + (go (method-of-object obj open) #t) + ) + ((= v1-49 2) + (go (method-of-object obj pressed) #t) + ) + ) + ) + (none) + ) + ) + +(deftype tomb-vibe (process-drawable) + ((spawn-pos vector :inline :offset-assert 208) + (pat-tbl (array handle) :offset-assert 224) + (pat-count int32 :offset-assert 228) + (pat-index int32 :offset-assert 232) + (pat-entry-index int32 :offset-assert 236) + (pat-timer time-frame :offset-assert 240) + (pat-duration time-frame :offset-assert 248) + (actor-group (pointer actor-group) :offset-assert 256) + (actor-group-count int32 :offset-assert 260) + (flags uint16 :offset-assert 264) + (on-activate basic :offset-assert 268) + ) + :heap-base #x90 + :method-count-assert 24 + :size-assert #x110 + :flag-assert #x1800900110 + (:methods + (get-pattern () _type_ :state 20) + (idle () _type_ :state 21) + (vibrate () _type_ :state 22) + (die (symbol) _type_ :state 23) + ) + ) + + +(defskelgroup skel-tomb-vibe tomb-vibe 0 3 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 4)) + +(defstate get-pattern (tomb-vibe) + :virtual #t + :code (behavior () + (until #f + (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) 'ready?) + (let ((t9-0 send-event-function) + (v1-5 (-> self actor-group 0 data 0 actor)) + ) + (when (t9-0 + (if v1-5 + (-> v1-5 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) 0) + (set! (-> a1-1 message) 'get-pattern) + (let ((t9-1 send-event-function) + (v1-14 (-> self actor-group 0 data 0 actor)) + ) + (set! (-> self pat-index) (the-as int (t9-1 + (if v1-14 + (-> v1-14 extra process) + ) + a1-1 + ) + ) + ) + ) + ) + (go-virtual idle) + ) + ) + ) + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.45)) + (suspend) + ) + ) + ) + #f + (none) + ) + ) + +(defstate idle (tomb-vibe) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 (new 'static 'array int32 4 -1 0 0 0)) + (gp-0 (new 'static 'array handle 2 + (new 'static 'handle :process #xffffffff :pid #xffffffff :u64 #xffffffffffffffff) + (new 'static 'handle) + ) + ) + ) + (case event-type + (('attack) + (case (-> (the-as attack-info (-> event param 1)) mode) + (('flop 'spin 'punch) + (cond + ((and (= (-> v1-0 0) (-> (the-as (pointer int32) (+ (the-as uint (-> self pat-tbl)) (* (-> self pat-index) 4))))) + (!= (-> gp-0 0) (process->handle self)) + ) + (send-event (handle->process (-> gp-0 0)) 'interrupt) + (send-event (handle->process (-> gp-0 0)) 'die) + (logior! (-> self flags) 1) + (go-virtual vibrate) + ) + (else + (set! (-> v1-0 0) (-> (the-as (pointer int32) (+ (the-as uint (-> self pat-tbl)) (* (-> self pat-index) 4))))) + (set! (-> gp-0 0) (process->handle self)) + (go-virtual vibrate) + ) + ) + ) + ) + ) + (('set-pattern) + (set! (-> v1-0 0) -1) + (set! (-> gp-0 0) (the-as handle #f)) + (let ((v0-0 (the-as object (-> event param 0)))) + (set! (-> self pat-index) (the-as int v0-0)) + v0-0 + ) + ) + (('get-pattern) + (-> self pat-index) + ) + (('ready?) + (!= (-> self pat-index) -1) + ) + (('die) + (go-virtual die #f) + ) + ) + ) + ) + :trans (behavior () + 0 + (none) + ) + :code (the-as (function none :behavior tomb-vibe) sleep-code) + :post (behavior () + (let* ((s5-0 *target*) + (gp-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when gp-0 + (when (and (not (logtest? (-> self flags) 2)) + (< (vector-vector-distance (-> self root trans) (get-trans gp-0 0)) 102400.0) + ) + (set-setting! 'sound-mode #f 0 2) + (logior! (-> self flags) 2) + ) + (when (and (logtest? (-> self flags) 2) + (< 184320.0 (vector-vector-distance (-> self root trans) (get-trans gp-0 0))) + ) + (remove-setting! 'sound-mode) + (set! (-> self flags) (logand -3 (-> self flags))) + ) + ) + ) + (none) + ) + ) + +(defstate vibrate (tomb-vibe) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as + object + (case event-type + (('interrupt) + (the-as object (kill-persister *setting-control* (the-as engine-pers (process->ppointer self)) 'sound-tune)) + ) + (('die) + (go-virtual die #f) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self pat-entry-index) 0) + (set-vector! (-> self draw color-mult) 0.9 0.9 0.9 1.0) + (let ((gp-0 (-> self actor-group 0))) + (dotimes (s5-0 (-> gp-0 length)) + (let ((v1-8 (-> gp-0 data s5-0 actor))) + (when (!= (if v1-8 + (-> v1-8 extra process) + ) + self + ) + (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) 'interrupt) + (let ((t9-0 send-event-function) + (v1-16 (-> gp-0 data s5-0 actor)) + ) + (t9-0 + (if v1-16 + (-> v1-16 extra process) + ) + a1-0 + ) + ) + ) + ) + ) + ) + ) + (none) + ) + :exit (behavior () + (process-release? *target*) + (kill-persister *setting-control* (the-as engine-pers (process->ppointer self)) 'sound-tune) + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + (none) + ) + :trans (behavior () + 0 + (none) + ) + :code (behavior () + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.2)) + (suspend) + ) + ) + (persist-with-delay + *setting-control* + (the-as symbol (process->ppointer self)) + (seconds 1) + 'sound-tune + #f + 0.0 + (+ (-> (the-as (pointer int32) (+ (the-as uint (-> self pat-tbl)) (* (-> self pat-index) 4)))) 18) + ) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 0.2)) + (suspend) + ) + ) + (process-grab? *target* #f) + (let ((gp-2 (-> self clock frame-counter)) + (s5-0 540) + (f30-0 1.0) + ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (loop! f30-0) :frame-num 0.0) + (until (>= (- (-> self clock frame-counter) gp-2) s5-0) + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + (process-release? *target*) + (if (logtest? (-> self flags) 1) + (go-virtual die #f) + (go-virtual idle) + ) + (none) + ) + :post (the-as (function none :behavior tomb-vibe) transform-post) + ) + +(defstate die (tomb-vibe) + :virtual #t + :enter (behavior ((arg0 symbol)) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (none) + ) + :code (behavior ((arg0 symbol)) + (cond + (arg0 + (ja :group! (-> self draw art-group data 5) + :num! (identity (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + ) + (transform-post) + ) + (else + (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-1 + (let ((t9-3 (method-of-type part-tracker activate))) + (t9-3 (the-as part-tracker gp-1) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-4 run-function-in-process) + (a0-4 gp-1) + (a1-3 part-tracker-init) + (a2-5 (-> *part-group-id-table* 686)) + (a3-1 450) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> self spawn-pos quad)) + ((the-as (function object object object object object object object object none) t9-4) + a0-4 + a1-3 + a2-5 + a3-1 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> gp-1 ppointer) + ) + ) + (ja-no-eval :group! (-> self draw art-group data 5) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek!)) + ) + (let ((v1-45 (-> self actor-group 0))) + (dotimes (a0-8 (-> v1-45 length)) + (if (not (logtest? (-> v1-45 data a0-8 actor extra perm status) (entity-perm-status subtask-complete))) + (goto cfg-13) + ) + ) + ) + (task-node-close! (game-task-node tomb-water-vibe)) + ) + ) + (label cfg-13) + (sleep-code) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-vibe ((obj tomb-vibe) (arg0 entity-actor)) + (local-vars (sv-16 res-tag) (sv-32 res-tag)) + (with-pp + (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum 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 camera-blocker pusher)) + (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 4096.0 0.0 9011.2) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-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 bot 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 4096.0 0.0 8192.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak bot 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 8192.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! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-vibe" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj entity) arg0) + (set! (-> obj spawn-pos quad) (-> obj root trans quad)) + (set! (-> obj spawn-pos y) (+ 81.92 (-> obj spawn-pos y))) + (set! (-> obj fact) + (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-26 (res-lump-data (-> obj entity) 'vibe-pattern pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-26 (nonzero? (-> sv-16 elt-count))) + (set! (-> obj pat-tbl) (the-as (array handle) v1-26)) + (set! (-> obj pat-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> obj pat-tbl) #f) + (set! (-> obj pat-count) 0) + 0 + ) + ) + ) + (set! sv-32 (new 'static 'res-tag)) + (let ((v1-33 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-32)))) + (cond + ((and v1-33 (nonzero? (-> sv-32 elt-count))) + (set! (-> obj actor-group) (the-as (pointer actor-group) v1-33)) + (set! (-> obj actor-group-count) (the-as int (-> sv-32 elt-count))) + ) + (else + (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> obj actor-group-count) 0) + 0 + ) + ) + ) + (when (logtest? (actor-option user17) (-> obj fact options)) + (let ((s5-1 (-> obj entity extra perm))) + (when (not (logtest? (-> s5-1 status) (entity-perm-status bit-5))) + (set! (-> s5-1 user-object 0) (rand-vu-int-range 0 (+ (-> obj pat-count) -1))) + (logior! (-> s5-1 status) (entity-perm-status bit-5)) + ) + (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) + (let ((v1-56 (-> *event-queue* data (-> *event-queue* length)))) + (+! (-> *event-queue* length) 1) + (set! (-> v1-56 form-handle) (process->handle pp)) + (set! (-> v1-56 to-handle) (process->handle obj)) + (set! (-> v1-56 num-params) 1) + (set! (-> v1-56 message) 'set-pattern) + (set! (-> v1-56 param 0) (the-as uint (-> s5-1 user-object 0))) + ) + ) + ) + ) + (set! (-> obj pat-index) -1) + (ja-channel-push! 1 0) + (let ((a0-53 (-> obj skel root-channel 0))) + (set! (-> a0-53 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> a0-53 frame-num) 0.0) + (joint-control-channel-group! a0-53 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + ) + (transform-post) + (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj event-hook) (-> (method-of-type tomb-vibe idle) event)) + (cond + ((logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object obj die) #t) + ) + ((logtest? (actor-option user17) (-> obj fact options)) + (go (method-of-object obj idle)) + ) + (else + (go (method-of-object obj get-pattern)) + ) + ) + (none) + ) + ) + +(deftype tomb-water-trap (process-drawable) + ((bbox bounding-box :inline :offset-assert 208) + (run-bbox bounding-box :inline :offset-assert 240) + (sync sync-linear :inline :offset-assert 272) + (on-duration time-frame :offset-assert 288) + (harmless-time time-frame :offset-assert 296) + (l-spec lightning-spec :offset-assert 304) + (l-count uint32 :offset-assert 308) + (l-index (array uint32) :offset-assert 312) + (attack-id uint32 :offset-assert 316) + (volume float :offset-assert 320) + (can-exit-running? symbol :offset-assert 324) + ) + :heap-base #xd0 + :method-count-assert 25 + :size-assert #x148 + :flag-assert #x1900d00148 + (:methods + (idle () _type_ :state 20) + (running () _type_ :state 21) + (tomb-water-trap-method-22 (_type_) none 22) + (tomb-water-trap-method-23 (_type_ vector vector) none 23) + (tomb-water-trap-method-24 (_type_ vector vector int) none 24) + ) + ) + + +(defstate idle (tomb-water-trap) + :virtual #t + :trans (behavior () + (let* ((gp-0 *target*) + (a0-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (if (and a0-1 (box-vector-inside? (-> self run-bbox) (get-trans a0-1 0))) + (go-virtual running) + ) + ) + (cond + ((< 0.0 (-> self volume)) + (seek! (-> self volume) 0.0 (* 2.0 (-> self clock seconds-per-frame))) + (update-vol! (-> self sound) (-> self volume)) + (update! (-> self sound)) + ) + (else + (logior! (-> self mask) (process-mask actor-pause)) + ) + ) + (none) + ) + :code (the-as (function none :behavior tomb-water-trap) sleep-code) + ) + +(defstate running (tomb-water-trap) + :virtual #t + :enter (behavior () + (set! (-> self can-exit-running?) #f) + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((v1-3 (-> self path curve num-cverts))) + (dotimes (a0-1 (the-as int (-> self l-count))) + (set! (-> self l-index a0-1) + (the-as uint (the int (* (/ (the float a0-1) (the float (-> self l-count))) (the float v1-3)))) + ) + ) + ) + (none) + ) + :exit (behavior () + (set-tombc-electricity-scale! 0.0) + (none) + ) + :trans (behavior () + (when (-> self can-exit-running?) + (let ((a0-0 *target*)) + (if (not (and a0-0 (box-vector-inside? (-> self run-bbox) (get-trans a0-0 0)))) + (go-virtual idle) + ) + ) + ) + (none) + ) + :code (behavior () + (until #f + (set! (-> self can-exit-running?) #f) + (let ((gp-0 0) + (s5-0 (-> self clock frame-counter)) + ) + (until (>= (- (-> self clock frame-counter) s5-0) (-> self on-duration)) + (when (< (-> self harmless-time) (-> self clock frame-counter)) + (tomb-water-trap-method-22 self) + (dotimes (s4-0 (+ (-> self path curve num-cverts) -1)) + (let ((s3-0 (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (the float s4-0) 'interp)) + (a2-2 (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (the float (+ s4-0 1)) 'interp)) + ) + (tomb-water-trap-method-23 self s3-0 a2-2) + ) + ) + ) + (seek! (-> self volume) 1.0 (* 2.0 (-> self clock seconds-per-frame))) + (cond + ((logtest? gp-0 8) + (set! gp-0 0) + (set-tombc-electricity-scale! 1.0) + (dotimes (s4-1 (the-as int (-> self l-count))) + (let* ((v1-19 (-> self path curve num-cverts)) + (s1-0 (+ v1-19 -1)) + (s0-0 (mod (the-as int (-> self l-index s4-1)) v1-19)) + (s3-2 (max 0 (min (+ s0-0 (* (rand-vu-int-range -3 3) 2)) s1-0))) + (s2-1 (max 0 (min (+ (* (rand-vu-int-range -3 3) 2) 1 s0-0) s1-0))) + ) + (if (!= (logand s3-2 1) (logand s2-1 1)) + (tomb-water-trap-method-24 + self + (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (the float s3-2) 'interp) + (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (the float s2-1) 'interp) + (the int (* 9.0 (rand-vu-float-range 8.0 12.0))) + ) + ) + ) + ) + ) + (else + (+! gp-0 1) + ) + ) + (suspend) + ) + ) + (set! (-> self can-exit-running?) #t) + (let ((gp-1 90)) + (let ((s5-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s5-1) gp-1) + (suspend) + ) + ) + (let ((s5-2 #f) + (s4-2 (-> self clock frame-counter)) + ) + (until (>= (- (-> self clock frame-counter) s4-2) + (the-as time-frame (- (- (-> self sync period) (the-as uint (-> self on-duration))) (the-as uint gp-1))) + ) + (when (and (not s5-2) (>= (- (-> self clock frame-counter) s4-2) (seconds 0.3))) + (set! s5-2 #t) + (set-tombc-electricity-scale! 0.0) + ) + (seek! (-> self volume) 0.0 (* 2.0 (-> self clock seconds-per-frame))) + (suspend) + ) + ) + ) + ) + #f + (none) + ) + :post (behavior () + (update-vol! (-> self sound) (-> self volume)) + (update! (-> self sound)) + (none) + ) + ) + +(defmethod tomb-water-trap-method-22 tomb-water-trap ((obj tomb-water-trap)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (set! (-> gp-0 collide-with) (collide-spec jak bot player-list)) + (set! (-> gp-0 ignore-process0) obj) + (set! (-> gp-0 ignore-process1) #f) + (set! (-> gp-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> gp-0 action-mask) (collide-action solid)) + (mem-copy! (the-as pointer (-> gp-0 bbox)) (the-as pointer (-> obj bbox)) 32) + (fill-using-bounding-box *collide-cache* gp-0) + ) + (none) + ) + +;; WARN: Return type mismatch time-frame vs none. +(defmethod tomb-water-trap-method-23 tomb-water-trap ((obj tomb-water-trap) (arg0 vector) (arg1 vector)) + (with-pp + (let ((s4-0 (new 'stack-no-clear 'collide-query)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) + ) + (set! (-> s4-0 start-pos quad) (-> arg0 quad)) + (set! (-> s4-0 move-dist quad) (-> s3-1 quad)) + (let ((v1-3 s4-0)) + (set! (-> v1-3 radius) 2048.0) + (set! (-> v1-3 collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-3 ignore-process0) obj) + (set! (-> v1-3 ignore-process1) #f) + (set! (-> v1-3 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-3 action-mask) (collide-action solid semi-solid)) + ) + (let ((f30-0 (probe-using-line-sphere *collide-cache* s4-0))) + (when (>= f30-0 0.0) + (let* ((s2-0 (-> s4-0 best-other-tri collide-ptr)) + (s4-1 (if (type? s2-0 collide-shape-prim-sphere) + (the-as collide-shape-prim-sphere s2-0) + ) + ) + ) + (when s4-1 + (let ((s2-2 (vector+float*! (new 'stack-no-clear 'vector) arg0 s3-1 f30-0))) + (tomb-water-trap-method-24 obj arg0 s2-2 (the int (* 3.0 (rand-vu-float-range 5.0 11.0)))) + ) + (let ((v1-10 (vector-reset! (new 'stack-no-clear 'vector))) + (a1-5 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-5 from) (process->ppointer pp)) + (set! (-> a1-5 num-params) 2) + (set! (-> a1-5 message) 'attack) + (set! (-> a1-5 param 0) (the-as uint #f)) + (let ((a0-17 (new 'static 'attack-info :mask (attack-info-mask vector invinc-time mode shove-up id)))) + (set! (-> a0-17 id) (-> obj attack-id)) + (set! (-> a0-17 invinc-time) (seconds 3)) + (set! (-> a0-17 mode) 'shock) + (set! (-> a0-17 vector quad) (-> v1-10 quad)) + (set! (-> a0-17 shove-up) 12288.0) + (set! (-> a1-5 param 1) (the-as uint a0-17)) + ) + (if (send-event-function (-> s4-1 cshape process) a1-5) + (set! (-> obj harmless-time) (+ (-> pp clock frame-counter) (seconds 3))) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +(defmethod tomb-water-trap-method-24 tomb-water-trap ((obj tomb-water-trap) (arg0 vector) (arg1 vector) (arg2 int)) + (let ((v1-1 (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> obj l-spec) + (+ arg2 120) + #f + #f + arg0 + arg1 + :to *entity-pool* + ) + ) + ) + (if v1-1 + (-> v1-1 0 self) + ) + ) + (let* ((s3-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg1 arg0) 1.0)) + (s2-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 arg1) 1.0)) + (s3-2 (forward-up-nopitch->quaternion (the-as quaternion (new 'stack-no-clear 'vector)) s3-1 *up-vector*)) + (s1-0 (forward-up-nopitch->quaternion (the-as quaternion (new 'stack-no-clear 'vector)) s2-1 *up-vector*)) + (s2-2 (quaternion->matrix (new 'stack-no-clear 'matrix) s3-2)) + (s3-3 (quaternion->matrix (new 'stack-no-clear 'matrix) s1-0)) + ) + (set! (-> s2-2 trans quad) (-> arg0 quad)) + (set! (-> s3-3 trans quad) (-> arg1 quad)) + (spawn-with-matrix (-> obj part) s2-2) + (spawn-with-matrix (-> obj part) s3-3) + ) + (none) + ) + +;; WARN: Return type mismatch process-drawable vs tomb-water-trap. +(defmethod relocate tomb-water-trap ((obj tomb-water-trap) (arg0 int)) + (if (nonzero? (-> obj l-index)) + (&+! (-> obj l-index) arg0) + ) + (the-as tomb-water-trap ((method-of-type process-drawable relocate) obj arg0)) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-water-trap ((obj tomb-water-trap) (arg0 entity-actor)) + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (let ((a1-3 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-1 0)) + (if #t + (set! v1-1 (logior v1-1 1)) + ) + (set! (-> a1-3 sync-type) (the-as basic 'sync-linear)) + (set! (-> a1-3 sync-flags) (the-as sync-flags v1-1)) + ) + (set! (-> a1-3 entity) arg0) + (set! (-> a1-3 period) (the-as uint 2400)) + (set! (-> a1-3 percent) 0.75) + (initialize! (-> obj sync) a1-3) + ) + (set! (-> obj on-duration) (the-as time-frame (the int (-> obj sync offset)))) + (set! (-> obj harmless-time) 0) + (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 arg0 #f)) + (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((s5-1 (new 'stack-no-clear 'sphere))) + (get-point-in-path! (-> obj path) s5-1 0.0 'interp) + (set! (-> s5-1 r) 4096.0) + (set-from-sphere! (-> obj bbox) s5-1) + (countdown (s4-0 (+ (-> obj path curve num-cverts) -1)) + (add-point! + (-> obj bbox) + (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) (the float s4-0) 'interp) + ) + ) + (get-bounding-sphere (-> obj bbox) s5-1) + (set! (-> s5-1 r) (+ 81920.0 (-> s5-1 r))) + (set-from-sphere! (-> obj run-bbox) s5-1) + ) + (let* ((v1-29 *game-info*) + (a0-17 (+ (-> v1-29 attack-id) 1)) + ) + (set! (-> v1-29 attack-id) a0-17) + (set! (-> obj attack-id) a0-17) + ) + (set! (-> obj l-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 #x83 :page #xc) + :reduction 0.42 + :num-points 12 + :box-size 14336.0 + :merge-factor 0.5 + :merge-count 4 + :radius 3276.8 + :duration -1.0 + :sound #f + ) + ) + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 696) obj)) + (let ((a3-3 (new 'stack-no-clear 'vector))) + (set! (-> a3-3 x) (* 0.5 (+ (-> obj bbox min x) (-> obj bbox max x)))) + (set! (-> a3-3 y) (* 0.5 (+ (-> obj bbox min y) (-> obj bbox max y)))) + (set! (-> a3-3 z) (* 0.5 (+ (-> obj bbox min z) (-> obj bbox max z)))) + (set! (-> obj sound) (new 'process 'ambient-sound (static-sound-spec "water-trap-zap" :fo-max 55) a3-3)) + ) + (set! (-> obj volume) 0.0) + (let ((a0-20 (-> obj entity))) + (set! (-> obj l-count) (the-as uint ((method-of-object a0-20 get-property-value) + a0-20 + 'bolt-count + 'interp + -1000000000.0 + (the-as uint128 8) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (set! (-> obj l-index) (new 'process 'boxed-array uint32 (the-as int (-> obj l-count)))) + (go (method-of-object obj idle)) + (none) + ) + +(deftype tomb-smash-door (process-drawable) + ((timeout time-frame :offset-assert 200) + (button handle :offset-assert 208) + ) + :heap-base #x60 + :method-count-assert 23 + :size-assert #xd8 + :flag-assert #x17006000d8 + (:methods + (idle () _type_ :state 20) + (open () _type_ :state 21) + (close () _type_ :state 22) + ) + ) + + +(defskelgroup skel-tomb-smash-door tomb-smash-door 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 8 0 12) + ) + +(defstate idle (tomb-smash-door) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger 'cue-chase) + (set! (-> self button) (process->handle proc)) + (go-virtual open) + ) + ) + ) + :code (the-as (function none :behavior tomb-smash-door) sleep-code) + ) + +(defstate open (tomb-smash-door) + :virtual #t + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (-> self timeout)) + (let* ((s5-0 *target*) + (gp-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (cond + (gp-0 + (let* ((s5-1 (camera-pos)) + (s4-0 (get-trans gp-0 0)) + (gp-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (s5-2 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s5-1 (-> self root trans)) 1.0)) + ) + (if (or (>= (vector-dot (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 (-> self root trans)) 1.0) gp-1) + 0.0 + ) + (< (vector-dot s5-2 gp-1) 0.0) + ) + (go-virtual close) + ) + ) + ) + (else + (go-virtual close) + ) + ) + ) + ) + (none) + ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + (none) + ) + ) + +(defstate close (tomb-smash-door) + :virtual #t + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek!)) + ) + (send-event (handle->process (-> self button)) 'untrigger) + (go-virtual idle) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-smash-door ((obj tomb-smash-door) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape obj (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 camera-blocker pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 32768.0 0.0 49152.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec camera-blocker pusher)) + (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) 12288.0 32768.0 0.0 40960.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec camera-blocker pusher)) + (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) 5) + (set-vector! (-> v1-12 local-sphere) -12288.0 32768.0 0.0 40960.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! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-smash-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((f30-0 300.0) + (a0-22 (-> obj entity)) + ) + (set! (-> obj timeout) + (the-as time-frame (the int (* f30-0 ((method-of-object a0-22 get-property-value-float) + a0-22 + 'timeout + 'interp + -1000000000.0 + 14.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + ) + ) + (ja-channel-push! 1 0) + (let ((a0-24 (-> obj skel root-channel 0))) + (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> a0-24 frame-num) 0.0) + (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) diff --git a/goal_src/jak2/levels/ruins/breakable-wall.gc b/goal_src/jak2/levels/ruins/breakable-wall.gc index 3dfb531d47..e71b60a3be 100644 --- a/goal_src/jak2/levels/ruins/breakable-wall.gc +++ b/goal_src/jak2/levels/ruins/breakable-wall.gc @@ -7,3 +7,632 @@ ;; DECOMP BEGINS +(defskelgroup skel-ruins-breakable-wall-1 ruins-breakable-wall 0 4 + ((2 (meters 20)) (3 (meters 40)) (1 (meters 999999))) + :bounds (static-spherem 0.3 5 0 8.8) + ) + +(defskelgroup skel-ruins-breakable-wall-2 ruins-breakable-wall 9 13 + ((11 (meters 20)) (12 (meters 40)) (10 (meters 999999))) + :bounds (static-spherem 0.3 5 0 8.8) + ) + +(defskelgroup skel-ruins-breakable-wall-3 ruins-breakable-wall 18 22 + ((20 (meters 20)) (21 (meters 40)) (19 (meters 999999))) + :bounds (static-spherem 0.3 5 0 8.8) + ) + +(defskelgroup skel-ruins-breakable-wall-4 ruins-breakable-wall 27 29 + ((28 (meters 20)) (28 (meters 40)) (28 (meters 999999))) + :bounds (static-spherem 0 6 0 10) + ) + +(defskelgroup skel-ruins-breakable-wall-5 ruins-breakable-wall 32 34 + ((33 (meters 20)) (33 (meters 40)) (33 (meters 999999))) + :bounds (static-spherem 0 5 0 9.5) + ) + +(defskelgroup skel-ruins-breakable-wall-6 ruins-breakable-wall 37 39 + ((38 (meters 20)) (38 (meters 40)) (38 (meters 999999))) + :bounds (static-spherem 0 6 0 9.5) + ) + +(deftype rbw-side (basic) + ((break-anim string :offset-assert 4) + (end-anim string :offset-assert 8) + (break-prim-mask uint8 :offset-assert 12) + (break-root-prim-joint int16 :offset-assert 14) + (break-bounds-joint int16 :offset-assert 16) + (break-root-prim-sphere sphere :inline :offset-assert 32) + (break-bounds-sphere sphere :inline :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + + +(deftype rbw-info (basic) + ((skel-group string :offset-assert 4) + (anim spool-anim :offset-assert 8) + (sides (array rbw-side) :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +(define *rbw-infos* + (new 'static 'boxed-array :type rbw-info + (new 'static 'rbw-info + :skel-group "ruins-breakable-wall-1" + :anim (new 'static 'spool-anim :name "ruins-breakable-wall-1" :anim-name "1-break-front" :parts 2 :command-list '()) + :sides (new 'static 'boxed-array :type rbw-side + (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-1-break-front" + :end-anim "ruins-breakable-wall-1-end-front" + :break-prim-mask #xa + :break-root-prim-joint -1 + :break-bounds-joint -1 + :break-root-prim-sphere (new 'static 'sphere :y -17612.8 :z 49152.0 :r 106496.0) + :break-bounds-sphere (new 'static 'sphere :x 53248.0 :y -65536.0 :z 126976.0 :r 241664.0) + ) + (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-1-break-rear" + :end-anim "ruins-breakable-wall-1-end-rear" + :break-prim-mask #x6 + :break-root-prim-joint -1 + :break-bounds-joint -1 + :break-root-prim-sphere (new 'static 'sphere :x 16384.0 :y -17612.8 :z -40960.0 :r 90112.0) + :break-bounds-sphere (new 'static 'sphere :x -24576.0 :y -16384.0 :z -98304.0 :r 163840.0) + ) + ) + ) + (new 'static 'rbw-info + :skel-group "ruins-breakable-wall-2" + :anim (new 'static 'spool-anim :name "ruins-breakable-wall-2" :anim-name "2-break-front" :parts 2 :command-list '()) + :sides (new 'static 'boxed-array :type rbw-side + (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-2-break-front" + :end-anim "ruins-breakable-wall-2-end-front" + :break-prim-mask #x2 + :break-root-prim-joint 3 + :break-bounds-joint -1 + :break-root-prim-sphere (new 'static 'sphere :x -18432.0 :r 40960.0) + :break-bounds-sphere (new 'static 'sphere :z 36864.0 :r 98304.0) + ) + (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-2-break-rear" + :end-anim "ruins-breakable-wall-2-end-rear" + :break-prim-mask #x6 + :break-root-prim-joint 3 + :break-bounds-joint 3 + :break-root-prim-sphere (new 'static 'sphere :x -40960.0 :z -73728.0 :r 122880.0) + :break-bounds-sphere (new 'static 'sphere :x -40960.0 :y -16384.0 :z -61440.0 :r 114688.0) + ) + ) + ) + (new 'static 'rbw-info + :skel-group "ruins-breakable-wall-3" + :anim (new 'static 'spool-anim :name "ruins-breakable-wall-3" :anim-name "3-break-front" :parts 2 :command-list '()) + :sides (new 'static 'boxed-array :type rbw-side + (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-3-break-front" + :end-anim "ruins-breakable-wall-3-end-front" + :break-prim-mask #x2 + :break-root-prim-joint -1 + :break-bounds-joint -1 + :break-root-prim-sphere (new 'static 'sphere :r 36864.0) + :break-bounds-sphere (new 'static 'sphere :z 32768.0 :r 110592.0) + ) + (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-3-break-rear" + :end-anim "ruins-breakable-wall-3-end-rear" + :break-prim-mask #x6 + :break-root-prim-joint -1 + :break-bounds-joint -1 + :break-root-prim-sphere (new 'static 'sphere :x 16384.0 :y -18432.0 :z -65536.0 :r 126976.0) + :break-bounds-sphere (new 'static 'sphere :y -34816.0 :z -122880.0 :r 184320.0) + ) + ) + ) + (new 'static 'rbw-info + :skel-group "ruins-breakable-wall-4" + :anim (new 'static 'spool-anim :name "ruins-breakable-wall-4" :anim-name "4-break-front" :parts 2 :command-list '()) + :sides (new 'static 'boxed-array :type rbw-side + (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-4-break-front" + :end-anim "ruins-breakable-wall-4-end-front" + :break-prim-mask #x2 + :break-root-prim-joint 74 + :break-bounds-joint -1 + :break-root-prim-sphere (new 'static 'sphere :r 40960.0) + :break-bounds-sphere (new 'static 'sphere :x 20480.0 :z -61440.0 :r 102400.0) + ) + ) + ) + (new 'static 'rbw-info + :skel-group "ruins-breakable-wall-5" + :anim (new 'static 'spool-anim :name "ruins-breakable-wall-5" :anim-name "5-break-front" :parts 2 :command-list '()) + :sides (new 'static 'boxed-array :type rbw-side + (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-5-break-front" + :end-anim "ruins-breakable-wall-5-end-front" + :break-prim-mask #x6 + :break-root-prim-joint -1 + :break-bounds-joint -1 + :break-root-prim-sphere (new 'static 'sphere :z -73728.0 :r 126976.0) + :break-bounds-sphere (new 'static 'sphere :x -10240.0 :z -73728.0 :r 126976.0) + ) + ) + ) + (new 'static 'rbw-info + :skel-group "ruins-breakable-wall-6" + :anim (new 'static 'spool-anim :name "ruins-breakable-wall-6" :anim-name "6-break-front" :parts 3 :command-list '()) + :sides (new 'static 'boxed-array :type rbw-side (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-6-break-front" + :end-anim "ruins-breakable-wall-6-end-front" + :break-prim-mask #x2 + :break-root-prim-joint -1 + :break-bounds-joint -1 + :break-root-prim-sphere (new 'static 'sphere :r 40960.0) + :break-bounds-sphere (new 'static 'sphere :x -32768.0 :z -81920.0 :r 180224.0) + ) + ) + ) + ) + ) + +(deftype ruins-breakable-wall (process-focusable) + ((info rbw-info :offset-assert 204) + (side rbw-side :offset-assert 208) + (nav-mesh nav-mesh :offset-assert 212) + ) + :heap-base #x60 + :method-count-assert 31 + :size-assert #xd8 + :flag-assert #x1f006000d8 + (:methods + (unbroken () _type_ :state 27) + (hit () _type_ :state 28) + (broken () _type_ :state 29) + (ruins-breakable-wall-method-30 (_type_ symbol) none 30) + ) + ) + + +;; WARN: Return type mismatch float vs none. +(defmethod ruins-breakable-wall-method-30 ruins-breakable-wall ((obj ruins-breakable-wall) (arg0 symbol)) + (case arg0 + (('hit) + (-> obj draw bounds w) + (set! (-> obj draw lod-set max-lod) 2) + (set! (-> obj draw force-lod) 2) + (set! (-> obj draw bounds w) 573440.0) + ) + (('broken) + (-> obj draw bounds w) + (set! (-> obj draw lod-set max-lod) 2) + (set! (-> obj draw force-lod) 2) + (set! (-> obj draw bounds quad) (-> obj side break-bounds-sphere quad)) + (let ((v1-12 (-> obj side break-bounds-joint))) + (if (>= v1-12 0) + (set! (-> obj draw origin-joint-index) (the-as uint v1-12)) + ) + ) + (let ((v1-14 (-> obj root-override root-prim)) + (a1-15 (-> obj side break-prim-mask)) + ) + (set! (-> v1-14 local-sphere quad) (-> obj side break-root-prim-sphere quad)) + (let ((a0-2 (-> obj side break-root-prim-joint))) + (if (>= a0-2 0) + (set! (-> v1-14 transform-index) a0-2) + ) + ) + (dotimes (a0-3 (the-as int (-> v1-14 specific 0))) + (let ((a2-4 (-> (the-as collide-shape-prim-group v1-14) child a0-3))) + (cond + ((logtest? a1-15 1) + (set! (-> a2-4 prim-core collide-as) (collide-spec obstacle)) + ) + (else + (set! (-> a2-4 prim-core collide-as) (collide-spec)) + 0 + ) + ) + ) + (set! a1-15 (shr a1-15 1)) + ) + ) + ) + ) + (none) + ) + +(defstate unbroken (ruins-breakable-wall) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (when (task-node-closed? (game-task-node ruins-mech-introduction)) + (let ((s4-0 (the-as object (-> event param 1)))) + (case (-> (the-as attack-info s4-0) mode) + (('mech-punch 'crush) + (let ((s3-0 + (the-as object (mem-copy! (the-as pointer (new 'stack-no-clear 'attack-info)) (the-as pointer s4-0) 160)) + ) + ) + ((method-of-type attack-info compute-intersect-info) + (the-as attack-info s3-0) + (the-as uint s4-0) + self + (if (type? proc process-drawable) + proc + ) + (the-as touching-shapes-entry (-> event param 0)) + ) + (if (logtest? (-> (the-as attack-info s3-0) mask) (attack-info-mask intersection)) + (go-virtual hit) + ) + ) + ) + ) + ) + ) + ) + (('combo) + #t + ) + ) + ) + :enter (behavior () + (let ((gp-0 (matrix<-transformq! (new 'stack-no-clear 'matrix) (the-as transformq (-> self root-override trans))))) + (mech-target-spawn + (vector-matrix*! (new 'stack-no-clear 'vector) (new 'static 'vector :y 20480.0 :z 4096.0 :w 1.0) gp-0) + (the-as target self) + (-> self root-override quat) + (-> self entity) + ) + (mech-target-spawn + (vector-matrix*! (new 'stack-no-clear 'vector) (new 'static 'vector :y 20480.0 :z -4096.0 :w 1.0) gp-0) + (the-as target self) + (-> self root-override quat) + (-> self entity) + ) + ) + (set! (-> self nav-mesh) (nav-mesh-from-res-tag (-> self entity) 'nav-mesh-actor 0)) + (if (and (-> self nav-mesh) (not (nav-mesh-connect-from-ent self))) + (set! (-> self nav-mesh) #f) + ) + (none) + ) + :exit (behavior () + (while (-> self child) + (deactivate (-> self child 0)) + ) + (none) + ) + :code (behavior () + (if (task-node-closed? (game-task-node ruins-mech-introduction)) + (add-process *gui-control* self (gui-channel art-load) (gui-action queue) (-> self info anim name) -99.0 0) + ) + (until #f + (transform-post) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + ) + #f + (none) + ) + ) + +(defstate hit (ruins-breakable-wall) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (if (-> self nav-mesh) + (logclear! (-> self root-override nav-flags) (nav-flags has-root-sphere)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-z-quaternion! s4-0 (-> self root-override quat)) + (set! (-> s4-0 y) 0.0) + (vector-! s5-0 (target-pos 0) (-> self root-override trans)) + (set! (-> s5-0 y) 0.0) + (let ((gp-2 0)) + (when (>= (vector-dot s4-0 s5-0) 0.0) + (if (>= (-> self info sides length) 2) + (set! gp-2 1) + ) + ) + (set! (-> self side) (-> self info sides gp-2)) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((v1-21 (-> self entity extra perm))) + (logior! (-> v1-21 status) (entity-perm-status bit-5)) + (set! (-> v1-21 user-int8 0) (+ gp-2 1)) + ) + ) + ) + (ruins-breakable-wall-method-30 self 'hit) + (none) + ) + :exit (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self root-override backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self root-override backup-collide-with)) + ) + (none) + ) + :code (behavior () + (let ((a2-1 (get-art-by-name (-> self draw art-group) (-> self side end-anim) art-joint-anim))) + (set! (-> self info anim anim-name) (-> self side break-anim)) + (ja-play-spooled-anim + (-> self info anim) + (ja-group) + a2-1 + (the-as (function process-drawable symbol) false-func) + ) + ) + (go-virtual broken) + (none) + ) + :post (the-as (function none :behavior ruins-breakable-wall) ja-post) + ) + +(defstate broken (ruins-breakable-wall) + :virtual #t + :code (behavior () + (ruins-breakable-wall-method-30 self 'broken) + (let ((gp-0 (get-art-by-name (-> self draw art-group) (-> self side end-anim) art-joint-anim))) + (ja-channel-set! 1) + (set! (-> self skel root-channel 0 frame-group) gp-0) + ) + (logior! (-> self skel status) (joint-control-status sync-math)) + (transform-post) + (logclear! (-> self skel status) (joint-control-status sync-math)) + (suspend) + (transform-post) + (sleep-code) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! ruins-breakable-wall ((obj ruins-breakable-wall) (arg0 entity-actor)) + (stack-size-set! (-> obj main-thread) 512) + (set! (-> obj mask) (logior (process-mask collectable) (-> obj mask))) + (set! (-> obj side) #f) + (set! (-> obj nav-mesh) #f) + (let ((v1-5 (res-lump-value (-> obj entity) 'extra-id uint128 :time -1000000000.0))) + (set! (-> obj info) (-> *rbw-infos* v1-5)) + (cond + ((zero? v1-5) + (let ((s4-0 (new 'process 'collide-shape obj (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 4) 0))) + (set! (-> s4-0 total-prims) (the-as uint 5)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (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 36864.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint -1)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 36864.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (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 36864.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 3) + (set-vector! (-> v1-18 local-sphere) 21504.0 -24576.0 -49152.0 69632.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-20 prim-core action) (collide-action solid)) + (set! (-> v1-20 transform-index) 3) + (set-vector! (-> v1-20 local-sphere) 0.0 -17612.8 65536.0 81920.0) + ) + (set! (-> s4-0 nav-radius) 20480.0) + (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! (-> obj root-override) s4-0) + ) + ) + ((= (the-as uint v1-5) 1) + (let ((s4-1 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-1 penetrated-by) (penetrate)) + (let ((s3-1 (new 'process 'collide-shape-prim-group s4-1 (the-as uint 3) 0))) + (set! (-> s4-1 total-prims) (the-as uint 4)) + (set! (-> s3-1 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-1 prim-core action) (collide-action solid)) + (set! (-> s3-1 transform-index) 4) + (set-vector! (-> s3-1 local-sphere) 0.0 0.0 0.0 36864.0) + (set! (-> s4-1 root-prim) s3-1) + ) + (let ((v1-32 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 0) (the-as uint -1)))) + (set! (-> v1-32 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-32 prim-core action) (collide-action solid)) + (set! (-> v1-32 transform-index) 4) + (set-vector! (-> v1-32 local-sphere) 0.0 0.0 0.0 36864.0) + ) + (let ((v1-34 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-34 prim-core action) (collide-action solid)) + (set! (-> v1-34 transform-index) 3) + (set-vector! (-> v1-34 local-sphere) -18432.0 0.0 0.0 40960.0) + ) + (let ((v1-36 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-36 prim-core action) (collide-action solid)) + (set! (-> v1-36 transform-index) 3) + (set-vector! (-> v1-36 local-sphere) -40960.0 -20480.0 -98304.0 90112.0) + ) + (set! (-> s4-1 nav-radius) 20480.0) + (let ((v1-38 (-> s4-1 root-prim))) + (set! (-> s4-1 backup-collide-as) (-> v1-38 prim-core collide-as)) + (set! (-> s4-1 backup-collide-with) (-> v1-38 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-1) + ) + ) + ((= (the-as uint v1-5) 2) + (let ((s4-2 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-2 penetrated-by) (penetrate)) + (let ((s3-2 (new 'process 'collide-shape-prim-group s4-2 (the-as uint 3) 0))) + (set! (-> s4-2 total-prims) (the-as uint 4)) + (set! (-> s3-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-2 prim-core action) (collide-action solid)) + (set! (-> s3-2 transform-index) 3) + (set-vector! (-> s3-2 local-sphere) 0.0 0.0 0.0 36864.0) + (set! (-> s4-2 root-prim) s3-2) + ) + (let ((v1-48 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 0) (the-as uint -1)))) + (set! (-> v1-48 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-48 prim-core action) (collide-action solid)) + (set! (-> v1-48 transform-index) 3) + (set-vector! (-> v1-48 local-sphere) 0.0 0.0 0.0 36864.0) + ) + (let ((v1-50 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-50 prim-core action) (collide-action solid)) + (set! (-> v1-50 transform-index) 3) + (set-vector! (-> v1-50 local-sphere) -12288.0 0.0 0.0 49152.0) + ) + (let ((v1-52 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-52 prim-core action) (collide-action solid)) + (set! (-> v1-52 transform-index) 3) + (set-vector! (-> v1-52 local-sphere) 45056.0 -14336.0 -114688.0 40960.0) + ) + (set! (-> s4-2 nav-radius) 20480.0) + (let ((v1-54 (-> s4-2 root-prim))) + (set! (-> s4-2 backup-collide-as) (-> v1-54 prim-core collide-as)) + (set! (-> s4-2 backup-collide-with) (-> v1-54 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-2) + ) + ) + ((= (the-as uint v1-5) 3) + (let ((s4-3 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-3 penetrated-by) (penetrate)) + (let ((s3-3 (new 'process 'collide-shape-prim-group s4-3 (the-as uint 2) 0))) + (set! (-> s4-3 total-prims) (the-as uint 3)) + (set! (-> s3-3 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-3 prim-core action) (collide-action solid)) + (set! (-> s3-3 transform-index) 73) + (set-vector! (-> s3-3 local-sphere) 0.0 -24576.0 0.0 45056.0) + (set! (-> s4-3 root-prim) s3-3) + ) + (let ((v1-64 (new 'process 'collide-shape-prim-mesh s4-3 (the-as uint 0) (the-as uint -1)))) + (set! (-> v1-64 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-64 prim-core action) (collide-action solid)) + (set! (-> v1-64 transform-index) 73) + (set-vector! (-> v1-64 local-sphere) 0.0 -24576.0 0.0 45056.0) + ) + (let ((v1-66 (new 'process 'collide-shape-prim-mesh s4-3 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-66 prim-core action) (collide-action solid)) + (set! (-> v1-66 transform-index) 74) + (set-vector! (-> v1-66 local-sphere) 0.0 0.0 0.0 40960.0) + ) + (set! (-> s4-3 nav-radius) 20480.0) + (let ((v1-68 (-> s4-3 root-prim))) + (set! (-> s4-3 backup-collide-as) (-> v1-68 prim-core collide-as)) + (set! (-> s4-3 backup-collide-with) (-> v1-68 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-3) + ) + ) + ((= (the-as uint v1-5) 4) + (let ((s4-4 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-4 penetrated-by) (penetrate)) + (let ((s3-4 (new 'process 'collide-shape-prim-group s4-4 (the-as uint 3) 0))) + (set! (-> s4-4 total-prims) (the-as uint 4)) + (set! (-> s3-4 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-4 prim-core action) (collide-action solid)) + (set! (-> s3-4 transform-index) 78) + (set-vector! (-> s3-4 local-sphere) 0.0 0.0 0.0 36864.0) + (set! (-> s4-4 root-prim) s3-4) + ) + (let ((v1-78 (new 'process 'collide-shape-prim-mesh s4-4 (the-as uint 0) (the-as uint -1)))) + (set! (-> v1-78 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-78 prim-core action) (collide-action solid)) + (set! (-> v1-78 transform-index) 78) + (set-vector! (-> v1-78 local-sphere) 0.0 0.0 0.0 36864.0) + ) + (let ((v1-80 (new 'process 'collide-shape-prim-mesh s4-4 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-80 prim-core action) (collide-action solid)) + (set! (-> v1-80 transform-index) 78) + (set-vector! (-> v1-80 local-sphere) 0.0 0.0 0.0 36864.0) + ) + (let ((v1-82 (new 'process 'collide-shape-prim-mesh s4-4 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-82 prim-core action) (collide-action solid)) + (set! (-> v1-82 transform-index) 78) + (set-vector! (-> v1-82 local-sphere) 12288.0 -24576.0 -122880.0 69632.0) + ) + (set! (-> s4-4 nav-radius) 20480.0) + (let ((v1-84 (-> s4-4 root-prim))) + (set! (-> s4-4 backup-collide-as) (-> v1-84 prim-core collide-as)) + (set! (-> s4-4 backup-collide-with) (-> v1-84 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-4) + ) + ) + (else + (let ((s4-5 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-5 penetrated-by) (penetrate)) + (let ((s3-5 (new 'process 'collide-shape-prim-group s4-5 (the-as uint 2) 0))) + (set! (-> s4-5 total-prims) (the-as uint 3)) + (set! (-> s3-5 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-5 prim-core action) (collide-action solid)) + (set! (-> s3-5 transform-index) 74) + (set-vector! (-> s3-5 local-sphere) 0.0 0.0 0.0 40960.0) + (set! (-> s4-5 root-prim) s3-5) + ) + (let ((v1-94 (new 'process 'collide-shape-prim-mesh s4-5 (the-as uint 0) (the-as uint -1)))) + (set! (-> v1-94 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-94 prim-core action) (collide-action solid)) + (set! (-> v1-94 transform-index) 74) + (set-vector! (-> v1-94 local-sphere) 0.0 0.0 0.0 40960.0) + ) + (let ((v1-96 (new 'process 'collide-shape-prim-mesh s4-5 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-96 prim-core action) (collide-action solid)) + (set! (-> v1-96 transform-index) 74) + (set-vector! (-> v1-96 local-sphere) 0.0 0.0 0.0 40960.0) + ) + (set! (-> s4-5 nav-radius) 20480.0) + (let ((v1-98 (-> s4-5 root-prim))) + (set! (-> s4-5 backup-collide-as) (-> v1-98 prim-core collide-as)) + (set! (-> s4-5 backup-collide-with) (-> v1-98 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-5) + ) + ) + ) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton-by-name obj (-> obj info skel-group)) + (case (-> obj entity extra perm user-uint8 0) + ((1) + (set! (-> obj side) (-> obj info sides 0)) + (go (method-of-object obj broken)) + ) + ((2) + (set! (-> obj side) (-> obj info sides 1)) + (go (method-of-object obj broken)) + ) + (else + (go (method-of-object obj unbroken)) + ) + ) + (none) + ) diff --git a/goal_src/jak2/levels/ruins/mechtest-obs.gc b/goal_src/jak2/levels/ruins/mechtest-obs.gc index fc86efdbc6..dca8248cda 100644 --- a/goal_src/jak2/levels/ruins/mechtest-obs.gc +++ b/goal_src/jak2/levels/ruins/mechtest-obs.gc @@ -7,3 +7,592 @@ ;; DECOMP BEGINS +(deftype mechblock (process-drawable) + ((root-override collide-shape-moving :offset 128) + (origin vector :inline :offset-assert 208) + (drop-point vector :inline :offset 256) + (allow-drag? symbol :offset-assert 272) + (reset-on-land? symbol :offset-assert 276) + (hit-something? symbol :offset-assert 280) + (attack-id uint32 :offset-assert 284) + (next-entity entity :offset-assert 288) + ) + :heap-base #xb0 + :method-count-assert 25 + :size-assert #x124 + :flag-assert #x1900b00124 + (:methods + (idle () _type_ :state 20) + (carry () _type_ :state 21) + (drag () _type_ :state 22) + (fall () _type_ :state 23) + (wait () _type_ :state 24) + ) + ) + + +(defstate idle (mechblock) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('carry? 'carry-info) + (-> self carry) + ) + (('pickup) + (cond + ((-> self allow-drag?) + (carry! + (the-as carry-info (-> event param 0)) + (-> self carry) + (the-as vector (-> event param 1)) + (the-as vector (-> event param 2)) + ) + (go-virtual drag) + ) + (else + (drag! (the-as carry-info (-> event param 0)) (-> self carry)) + (go-virtual carry) + ) + ) + ) + ) + ) + :code (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (dotimes (gp-0 2) + (transform-post) + (carry-info-method-9 (-> self carry)) + (suspend) + ) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) + ) + +(defstate wait (mechblock) + :virtual #t + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-3 (-> self root-override root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root-override backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root-override backup-collide-with)) + ) + (none) + ) + :trans (behavior () + (when (or (not *target*) (< 40960.0 (vector-vector-distance (-> self origin) (-> *target* control trans)))) + (move-to-point! + (-> self root-override) + (vector+! (new 'stack-no-clear 'vector) (-> self origin) (new 'static 'vector :y 81920.0 :w 1.0)) + ) + (quaternion-copy! (-> self root-override quat) (the-as quaternion (&-> self stack 96))) + (set-vector! (-> self root-override transv) 0.0 -4096.0 0.0 1.0) + (set! (-> self drop-point quad) (-> self origin quad)) + (go-virtual fall) + ) + (none) + ) + :code (behavior () + (let ((v1-1 (-> self root-override 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)) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + (none) + ) + ) + +(defstate carry (mechblock) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('carry? 'carry-info) + (-> self carry) + ) + (('drop) + (set! (-> self root-override transv quad) (-> (the-as vector (-> event param 1)) quad)) + (set! (-> self drop-point quad) (-> self root-override trans quad)) + (go-virtual fall) + ) + ) + ) + :code (the-as (function none :behavior mechblock) sleep-code) + :post (behavior () + (ja-post) + (carry-info-method-9 (-> self carry)) + (carry-info-method-13 (-> self carry)) + (update-transforms (-> self root-override)) + (none) + ) + ) + +(defstate drag (mechblock) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (local-vars (at-0 int)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (case event-type + (('carry? 'carry-info) + (-> self carry) + ) + (('drop) + (if (handle->process (-> self carry other)) + (drop! (the-as carry-info (send-event (handle->process (-> self carry other)) 'carry-info)) (-> self carry)) + ) + (set! (-> self root-override transv quad) (-> (the-as vector (-> event param 1)) quad)) + (set! (-> self drop-point quad) (-> self root-override trans quad)) + (go-virtual fall) + ) + (('move) + (let ((s4-0 (-> self root-override)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> s4-0 trans quad)) + (set! (-> s4-0 transv quad) (-> (the-as vector (-> event param 0)) quad)) + (let ((s2-0 (-> self nav)) + (s1-0 (-> s4-0 root-prim prim-core)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> (-> s4-0 transv) quad)) + (let ((f0-0 (-> self clock 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 (&-> s3-0 quad) vf1) + (set! (-> s3-0 y) 0.0) + (vector-float*! s3-0 s3-0 10.0) + (when (nonzero? s2-0) + (let ((v1-28 s2-0) + (a0-26 s1-0) + (a1-6 (new 'stack-no-clear 'nav-find-poly-parms)) + ) + (vector-! (-> a1-6 point) (the-as vector a0-26) (-> v1-28 state mesh bounds)) + (set! (-> a1-6 y-threshold) (-> v1-28 nearest-y-threshold)) + (set! (-> a1-6 ignore) (the-as uint 2)) + (let ((a2-4 (find-poly-containing-point-local (-> v1-28 state mesh) a1-6))) + (cond + (a2-4 + (clamp-vector-to-mesh-cross-gaps + s2-0 + (the-as vector s1-0) + a2-4 + s3-0 + 204.8 + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + ) + (else + ) + ) + ) + ) + ) + (vector-float*! (-> s4-0 transv) s3-0 (* 0.1 (-> self clock frames-per-second))) + ) + (let ((v1-35 (-> s4-0 root-prim))) + (set! (-> v1-35 prim-core collide-as) (-> s4-0 backup-collide-as)) + (set! (-> v1-35 prim-core collide-with) (-> s4-0 backup-collide-with)) + ) + (set! (-> s4-0 root-prim type) collide-shape-prim-sphere) + (let ((a2-5 (new 'stack-no-clear 'collide-query))) + (set! (-> a2-5 collide-with) + (logclear (-> s4-0 root-prim prim-core collide-with) (collide-spec backgnd jak player-list tobot)) + ) + (set! (-> a2-5 ignore-process0) self) + (set! (-> a2-5 ignore-process1) #f) + (set! (-> a2-5 ignore-pat) (-> s4-0 pat-ignore-mask)) + (set! (-> a2-5 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide s4-0 (-> s4-0 transv) a2-5 (meters 0)) + ) + (when (nonzero? (-> self nav)) + (let ((v1-44 (-> self nav)) + (a0-41 (-> self root-override root-prim prim-core)) + (a1-9 (new 'stack-no-clear 'nav-find-poly-parms)) + ) + (vector-! (-> a1-9 point) (the-as vector a0-41) (-> v1-44 state mesh bounds)) + (set! (-> a1-9 y-threshold) (-> v1-44 nearest-y-threshold)) + (set! (-> a1-9 ignore) (the-as uint 2)) + (let ((v1-46 (find-poly-containing-point-local (-> v1-44 state mesh) a1-9))) + (when v1-46 + (when (< (-> self root-override trans y) (-> v1-46 vertex0 y)) + (let* ((a0-47 (-> self root-override)) + (t9-7 (method-of-object a0-47 move-by-vector!)) + (a1-11 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-11 x) 0.0) + (set! (-> a1-11 y) (- (-> v1-46 vertex0 y) (-> self root-override trans y))) + (set! (-> a1-11 z) 0.0) + (set! (-> a1-11 w) 1.0) + (t9-7 a0-47 a1-11) + ) + ) + ) + ) + ) + ) + (set! (-> s4-0 root-prim type) collide-shape-prim-mesh) + (let ((v1-50 (-> s4-0 root-prim))) + (set! (-> v1-50 prim-core collide-as) (collide-spec)) + (set! (-> v1-50 prim-core collide-with) (collide-spec)) + ) + 0 + (vector-! (the-as vector (-> event param 1)) (-> s4-0 trans) s5-0) + ) + ) + ) + ) + ) + :code (the-as (function none :behavior mechblock) sleep-code) + :post (behavior () + (ja-post) + (carry-info-method-9 (-> self carry)) + (translate! (-> self carry)) + (update-transforms (-> self root-override)) + (none) + ) + ) + +(defstate fall (mechblock) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as + object + (case event-type + (('carry-info) + (-> self carry) + ) + (('carry? 'pickup) + (the-as basic #f) + ) + (('touched) + (when (and (!= (-> proc type) target) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 2) + (set! (-> a1-2 message) 'attack) + (set! (-> a1-2 param 0) (-> event param 0)) + (let ((v1-7 (new 'static 'attack-info :mask (attack-info-mask mode id)))) + (set! (-> v1-7 id) (-> self attack-id)) + (set! (-> v1-7 mode) 'crush) + (set! (-> a1-2 param 1) (the-as uint v1-7)) + ) + (send-event-function proc a1-2) + ) + ) + (sound-play "block-hit") + (let ((v0-0 (the-as basic (-> proc entity)))) + (set! (-> self hit-something?) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + ) + ) + :enter (behavior () + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self state-time) (-> self clock frame-counter)) + (if (handle->process (-> self carry other)) + (drop-impl! + (the-as carry-info (send-event (handle->process (-> self carry other)) 'carry-info)) + (-> self carry) + ) + ) + (set! (-> self root-override status) (collide-status)) + (set! (-> self root-override root-prim local-sphere w) (-> self carry carry-radius)) + (none) + ) + :trans (behavior () + (when (or (and (logtest? (-> self root-override status) (collide-status on-surface)) + (< 0.8 (-> self root-override surface-angle)) + ) + (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + ) + (vector-reset! (-> self root-override transv)) + (set! (-> self root-override root-prim local-sphere w) (-> self carry backup-radius)) + (cond + ((and (-> self reset-on-land?) + (and (or (< 12288.0 (vector-vector-distance (-> self drop-point) (-> self root-override trans))) + (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + ) + (and (-> self next-entity) + (zero? (logand (-> self next-entity extra perm status) (entity-perm-status subtask-complete))) + ) + ) + ) + (sound-play "block-break") + (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-1 + (let ((t9-4 (method-of-type part-tracker activate))) + (t9-4 (the-as part-tracker gp-1) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-5 run-function-in-process) + (a0-11 gp-1) + (a1-4 part-tracker-init) + (a2-5 (-> *part-group-id-table* 124)) + (a3-2 0) + (t0-1 #f) + (t1-1 #f) + (t2-1 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> self root-override trans quad)) + ((the-as (function object object object object object object object object none) t9-5) + a0-11 + a1-4 + a2-5 + a3-2 + t0-1 + t1-1 + t2-1 + t3-0 + ) + ) + (-> gp-1 ppointer) + ) + ) + (go-virtual wait) + ) + ((or (< 12288.0 (vector-vector-distance (-> self drop-point) (-> self root-override trans))) + (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + ) + (sound-play "block-break") + (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-3 + (let ((t9-11 (method-of-type part-tracker activate))) + (t9-11 (the-as part-tracker gp-3) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-12 run-function-in-process) + (a0-18 gp-3) + (a1-9 part-tracker-init) + (a2-11 (-> *part-group-id-table* 124)) + (a3-5 0) + (t0-3 #f) + (t1-3 #f) + (t2-3 #f) + (t3-1 *launch-matrix*) + ) + (set! (-> t3-1 trans quad) (-> self root-override trans quad)) + ((the-as (function object object object object object object object object none) t9-12) + a0-18 + a1-9 + a2-11 + a3-5 + t0-3 + t1-3 + t2-3 + t3-1 + ) + ) + (-> gp-3 ppointer) + ) + ) + (go-virtual wait) + ) + (else + (go-virtual idle) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior mechblock) sleep-code) + :post (behavior () + (vector-v++! + (-> self root-override transv) + (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 0.0) + ) + (let ((v1-2 (new-stack-vector0)) + (f0-1 (vector-dot (-> self root-override dynam gravity-normal) (-> self root-override transv))) + ) + 0.0 + (vector-! + v1-2 + (-> self root-override transv) + (vector-float*! v1-2 (-> self root-override dynam gravity-normal) f0-1) + ) + (let* ((f1-2 (vector-length v1-2)) + (f2-0 f1-2) + ) + (if (< f0-1 (- (-> self root-override dynam gravity-max))) + (set! f0-1 (- (-> self root-override dynam gravity-max))) + ) + (vector+! + (-> self root-override transv) + (vector-float*! (-> self root-override transv) (-> self root-override dynam gravity-normal) f0-1) + (vector-float*! v1-2 v1-2 (/ f1-2 f2-0)) + ) + ) + ) + (let ((a2-8 (new 'stack-no-clear 'collide-query)) + (gp-1 (-> self root-override)) + ) + (set! (-> gp-1 root-prim type) collide-shape-prim-sphere) + (set! (-> a2-8 collide-with) + (logclear (-> gp-1 root-prim prim-core collide-with) (collide-spec jak player-list tobot)) + ) + (set! (-> a2-8 ignore-process0) self) + (set! (-> a2-8 ignore-process1) #f) + (set! (-> a2-8 ignore-pat) (-> gp-1 pat-ignore-mask)) + (set! (-> a2-8 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide gp-1 (-> gp-1 transv) a2-8 (meters 0)) + (set! (-> gp-1 root-prim type) collide-shape-prim-mesh) + ) + (transform-post) + (carry-info-method-9 (-> self carry)) + (none) + ) + ) + +(deftype throwblock (mechblock) + () + :heap-base #xb0 + :method-count-assert 25 + :size-assert #x124 + :flag-assert #x1900b00124 + ) + + +(defskelgroup skel-throwblock throwblock 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 1.5 0 2.7)) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! throwblock ((obj throwblock) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving obj (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 penetrated-by) (penetrate)) + (let ((v1-6 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-6 prim-core collide-with) + (collide-spec backgnd jak crate obstacle hit-by-others-list player-list tobot) + ) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 6144.0 0.0 11059.2) + (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 max-iteration-count) (the-as uint 4)) + (set! (-> s4-0 event-self) 'touched) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-throwblock" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (mem-copy! (the-as pointer (-> obj origin)) (the-as pointer (-> obj root-override trans)) 48) + (set! (-> obj allow-drag?) #f) + (set! (-> obj reset-on-land?) #t) + (let* ((v1-18 *game-info*) + (a0-16 (+ (-> v1-18 attack-id) 1)) + ) + (set! (-> v1-18 attack-id) a0-16) + (set! (-> obj attack-id) a0-16) + ) + (set! (-> obj hit-something?) #f) + (set! (-> obj next-entity) (entity-actor-lookup (-> obj entity) 'next-actor 0)) + (let ((v1-20 (new 'process 'carry-info obj 3 (new 'static 'vector :w 1.0) (new 'static 'vector :y 1.0 :w 1.0) 0.0)) + ) + (set! (-> v1-20 max-distance) 16384.0) + (set! (-> v1-20 min-pull) 2048.0) + (set! (-> v1-20 max-pull) 6963.2) + (set! (-> v1-20 carry-radius) 6144.0) + (set! (-> v1-20 mode) (carry-mode mech-carry)) + (set! (-> obj carry) v1-20) + ) + (go (method-of-object obj idle)) + (none) + ) + +(deftype pushblock (mechblock) + () + :heap-base #xb0 + :method-count-assert 25 + :size-assert #x124 + :flag-assert #x1900b00124 + ) + + +(defskelgroup skel-pushblock pushblock 0 3 ((1 (meters 999999))) :bounds (static-spherem 0 2 0 4)) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pushblock ((obj pushblock) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving obj (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 penetrated-by) (penetrate)) + (let ((v1-6 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-6 prim-core collide-with) + (collide-spec backgnd jak crate obstacle hit-by-others-list player-list tobot) + ) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 0) + (set-vector! (-> v1-6 local-sphere) 0.0 11264.0 0.0 22528.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 max-iteration-count) (the-as uint 4)) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-pushblock" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (mem-copy! (the-as pointer (-> obj origin)) (the-as pointer (-> obj root-override trans)) 48) + (set! (-> obj reset-on-land?) #f) + (set! (-> obj allow-drag?) #t) + (let* ((v1-17 *game-info*) + (a0-15 (+ (-> v1-17 attack-id) 1)) + ) + (set! (-> v1-17 attack-id) a0-15) + (set! (-> obj attack-id) a0-15) + ) + (set! (-> obj next-entity) #f) + (get-nav-control obj (the-as nav-mesh #f)) + (let ((v1-19 + (new 'process 'carry-info obj 3 (new 'static 'vector :y 819.2 :w 1.0) (new 'static 'vector :y 1.0 :w 1.0) 0.0) + ) + ) + (set! (-> v1-19 max-distance) 22528.0) + (set! (-> v1-19 min-pull) 10240.0) + (set! (-> v1-19 max-pull) 14336.0) + (set! (-> v1-19 carry-radius) 11264.0) + (set! (-> v1-19 mode) (carry-mode mech-drag)) + (set! (-> obj carry) v1-19) + ) + (go (method-of-object obj idle)) + (none) + ) diff --git a/goal_src/jak2/levels/ruins/pillar-collapse.gc b/goal_src/jak2/levels/ruins/pillar-collapse.gc index c845aa35c9..6d06d5bb0c 100644 --- a/goal_src/jak2/levels/ruins/pillar-collapse.gc +++ b/goal_src/jak2/levels/ruins/pillar-collapse.gc @@ -7,3 +7,401 @@ ;; DECOMP BEGINS +(deftype ruins-pillar-collapse (process-drawable) + ((root-override collide-shape-moving :offset 128) + (player-attack-id int32 :offset-assert 200) + (fall-anim-index int32 :offset-assert 204) + (hit-points int8 :offset-assert 208) + (mesh-trans uint8 3 :offset-assert 209) + (mesh-joint joint 2 :offset-assert 212) + (deadly? symbol :offset 216) + (art-name string :offset 220) + (anim spool-anim :offset 224) + ) + :heap-base #x70 + :method-count-assert 24 + :size-assert #xe4 + :flag-assert #x18007000e4 + (:methods + (idle () _type_ :state 20) + (bump () _type_ :state 21) + (hit () _type_ :state 22) + (fall (symbol) _type_ :state 23) + ) + ) + + +(defskelgroup skel-ruins-pillar-collapse-1 ruins-pillar-collapse 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 12 16 30) + ) + +(defskelgroup skel-ruins-pillar-collapse-2 ruins-pillar-collapse 0 5 + ((1 (meters 999999))) + :bounds (static-spherem 0 12 0 17) + ) + +(defskelgroup skel-ruins-pillar-collapse-3 ruins-pillar-collapse 0 8 + ((1 (meters 999999))) + :bounds (static-spherem 0 12 0 17) + ) + +(defstate idle (ruins-pillar-collapse) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (when (task-node-closed? (game-task-node ruins-mech-introduction)) + (let* ((gp-1 (the-as attack-info (-> event param 1))) + (s4-0 (-> gp-1 id)) + (s5-0 (vector-x-quaternion! (new-stack-vector0) (-> self root-override quat))) + (a0-6 (vector-z-quaternion! (new-stack-vector0) (-> self root-override quat))) + (v1-4 + (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root-override trans)) + ) + ) + 0.0 + 0.0 + (when (!= s4-0 (-> self player-attack-id)) + (set! (-> self player-attack-id) (the-as int s4-0)) + (let* ((f0-3 (vector-dot s5-0 v1-4)) + (f1-1 (vector-dot a0-6 v1-4)) + (a0-8 (-> gp-1 mode)) + (v1-6 (cond + ((= a0-8 'mech-punch) + (and (< f1-1 0.0) (< (fabs (* 0.5 f0-3)) (fabs f1-1))) + ) + ((= a0-8 'crush) + (< (sqrtf (+ (* (-> v1-4 x) (-> v1-4 x)) (* (-> v1-4 z) (-> v1-4 z)))) 40960.0) + ) + ((= a0-8 'debug) + #t + ) + ) + ) + ) + (cond + (v1-6 + (go-virtual hit) + ) + (else + (go-virtual bump) + #f + ) + ) + ) + ) + ) + ) + ) + (('look-at-point) + (send-event (ppointer->process (-> self child)) 'look-at-point) + ) + (('combo) + #t + ) + ) + ) + :enter (behavior () + (let ((s5-0 (matrix<-transformq! (new 'stack-no-clear 'matrix) (the-as transformq (-> self root-override trans))))) + (if (string= (-> self name) "ruins-pillar-collapse-9") + (mech-target-spawn + (vector-matrix*! (new 'stack-no-clear 'vector) (new 'static 'vector :y 18432.0 :z 8192.0 :w 1.0) s5-0) + (the-as target self) + (-> self root-override quat) + (-> self entity) + ) + (mech-target-spawn + (vector-matrix*! (new 'stack-no-clear 'vector) (new 'static 'vector :y 18432.0 :z -8192.0 :w 1.0) s5-0) + (the-as target self) + (-> self root-override quat) + (-> self entity) + ) + ) + ) + (none) + ) + :exit (behavior () + (while (-> self child) + (deactivate (-> self child 0)) + ) + (none) + ) + :code (behavior () + (if (task-node-closed? (game-task-node ruins-mech-introduction)) + (add-process *gui-control* self (gui-channel art-load) (gui-action queue) (-> self anim name) -99.0 0) + ) + (ja :num-func num-func-identity :frame-num 0.0) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) + :post (the-as (function none :behavior ruins-pillar-collapse) transform-post) + ) + +(defstate bump (ruins-pillar-collapse) + :virtual #t + :event (-> (method-of-type ruins-pillar-collapse idle) event) + :trans (the-as (function none :behavior ruins-pillar-collapse) rider-trans) + :code (behavior () + (go-virtual idle) + (none) + ) + :post (the-as (function none :behavior ruins-pillar-collapse) rider-post) + ) + +(defstate hit (ruins-pillar-collapse) + :virtual #t + :event (-> (method-of-type ruins-pillar-collapse idle) event) + :trans (the-as (function none :behavior ruins-pillar-collapse) rider-trans) + :code (behavior () + (+! (-> self hit-points) -1) + (if (zero? (-> self hit-points)) + (go-virtual fall #f) + ) + (go-virtual idle) + (none) + ) + :post (the-as (function none :behavior ruins-pillar-collapse) rider-post) + ) + +(defstate fall (ruins-pillar-collapse) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('touch 'attack) + (let* ((s5-0 (-> event param 0)) + (s4-0 proc) + (gp-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + (a1-4 (if s5-0 + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry s5-0) + (-> self root-override) + (the-as uint 2) + ) + ) + ) + ) + (when (and gp-0 a1-4) + (let ((s4-1 (get-intersect-point + (new 'stack-no-clear 'vector) + a1-4 + (-> self root-override) + (the-as touching-shapes-entry s5-0) + ) + ) + ) + (when (and (< (-> (get-trans (the-as process-focusable gp-0) 3) y) (-> s4-1 y)) + (< 40960.0 (vector-vector-distance s4-1 (-> self root-override trans))) + ) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) (process->ppointer self)) + (set! (-> a1-8 num-params) 2) + (set! (-> a1-8 message) 'attack) + (set! (-> a1-8 param 0) s5-0) + (let ((v1-13 (new 'static 'attack-info :mask (attack-info-mask mode id)))) + (let* ((a0-7 *game-info*) + (a2-5 (+ (-> a0-7 attack-id) 1)) + ) + (set! (-> a0-7 attack-id) a2-5) + (set! (-> v1-13 id) a2-5) + ) + (set! (-> v1-13 mode) 'crush) + (set! (-> a1-8 param 1) (the-as uint v1-13)) + ) + (send-event-function gp-0 a1-8) + ) + ) + ) + ) + ) + ) + ) + ) + :trans (the-as (function none :behavior ruins-pillar-collapse) rider-trans) + :code (behavior ((arg0 symbol)) + (set! (-> self draw bounds z) 61440.0) + (set! (-> self draw bounds w) 217088.0) + (set! (-> self root-override root-prim local-sphere w) 217088.0) + (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) child 0 prim-core collide-with) + (collide-spec) + ) + (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) child 0 prim-core collide-as) + (collide-spec) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let* ((s5-0 (-> self draw art-group)) + (s4-0 (method-of-object s5-0 get-art-by-name-method)) + ) + (format (clear *temp-string*) "~S-end" (-> self art-name)) + (let ((s5-1 (s4-0 s5-0 *temp-string* art-joint-anim))) + (when (not arg0) + (talker-spawn-func (-> *talker-speech* 456) *entity-pool* (target-pos 0) (the-as region #f)) + (ja-play-spooled-anim (-> self anim) (ja-group) (the-as art-joint-anim s5-1) (the-as (function process-drawable symbol) false-func)) + ) + (set! (-> self event-hook) #f) + (ja-channel-set! 1) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim s5-1)) + ) + ) + (suspend) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) + :post (the-as (function none :behavior ruins-pillar-collapse) rider-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! ruins-pillar-collapse ((obj ruins-pillar-collapse) (arg0 entity-actor)) + (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape-moving)) + (stack-size-set! (-> obj main-thread) 512) + (set! (-> obj mask) (logior (process-mask collectable) (-> obj mask))) + (dotimes (v1-3 3) + (set! (-> obj mesh-trans v1-3) (the-as uint v1-3)) + ) + (let ((s4-0 (new 'process 'collide-shape-moving obj (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 penetrated-by) (penetrate)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 33) 0))) + (set! (-> s4-0 total-prims) (the-as uint 34)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable)) + (set! (-> s3-0 transform-index) 0) + (set-vector! (-> s3-0 local-sphere) 0.0 49152.0 0.0 69632.0) + (set! (-> s4-0 root-prim) s3-0) + (let* ((s2-0 (the-as object '((5 22 61440) + (3 21 18432) + (4 22 61440) + (6 46 8192) + (7 47 6144) + (8 48 6963) + (9 49 6963) + (10 53 6963) + (11 54 6144) + (12 61 8192) + (13 62 10240) + (14 63 6963) + (15 64 6963) + (17 66 9011) + (18 67 16384) + (19 68 8192) + (20 69 6144) + (21 70 6553) + (22 71 9420) + (23 72 5734) + (24 73 7782) + (25 74 5734) + (26 75 8192) + (27 76 5734) + (28 77 5734) + (29 78 10240) + (30 79 6144) + (31 80 6144) + (32 81 6144) + (33 82 6963) + (34 83 9830) + (35 84 8192) + (16 65 8192) + ) + ) + ) + (s1-0 (-> (the-as pair s2-0) car)) + ) + (while (not (null? s2-0)) + (let ((s0-0 (method-of-type collide-shape-prim-mesh new))) + (set! sv-32 'process) + (set! sv-48 collide-shape-prim-mesh) + (set! sv-64 s4-0) + (let ((a3-2 (command-get-int (-> (the-as pair s1-0) car) 0)) + (t0-1 0) + ) + (set! sv-16 (s0-0 sv-32 sv-48 sv-64 (the-as uint a3-2) (the-as uint t0-1))) + ) + ) + (let ((s0-1 sv-16)) + (set! (-> s0-1 prim-core collide-as) (-> s3-0 prim-core collide-as)) + (set! (-> s0-1 prim-core collide-with) (-> s3-0 prim-core collide-with)) + (set! (-> s0-1 prim-core action) (-> s3-0 prim-core action)) + (set! (-> s0-1 transform-index) (command-get-int (-> (the-as pair (-> (the-as pair s1-0) cdr)) car) 0)) + ) + (set-vector! + (-> sv-16 local-sphere) + 0.0 + 0.0 + 0.0 + (command-get-float (-> (the-as pair (-> (the-as pair (-> (the-as pair s1-0) cdr)) cdr)) car) 0.0) + ) + (set! s2-0 (-> (the-as pair s2-0) cdr)) + (set! s1-0 (-> (the-as pair s2-0) car)) + ) + ) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-30 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-30 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-30 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (set! (-> obj mesh-trans 0) (the-as uint 1)) + (set! (-> obj mesh-trans 1) (the-as uint 2)) + (set! (-> obj mesh-trans 2) (the-as uint 0)) + (let ((s5-1 (res-lump-struct (-> obj entity) 'art-name structure))) + (set! (-> obj art-name) (the-as string s5-1)) + (cond + ((string= (the-as string s5-1) "ruins-pillar-collapse-1") + (let ((v1-38 (-> obj root-override root-prim local-sphere))) + (set! (-> v1-38 y) 49152.0) + (set! (-> v1-38 z) 65536.0) + (set! (-> v1-38 w) 122880.0) + ) + (set! (-> obj anim) (new 'static 'spool-anim + :name "ruins-pillar-collapse-1" + :anim-name "1-break-center" + :parts 2 + :command-list '() + ) + ) + ) + ((string= (the-as string s5-1) "ruins-pillar-collapse-2") + (set! (-> obj anim) (new 'static 'spool-anim + :name "ruins-pillar-collapse-2" + :anim-name "2-break-center" + :parts 2 + :command-list '() + ) + ) + (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (+ 32768.0 (y-angle (-> obj root-override)))) + ) + ((string= (the-as string s5-1) "ruins-pillar-collapse-3") + (set! (-> obj anim) (new 'static 'spool-anim + :name "ruins-pillar-collapse-3" + :anim-name "3-break-center" + :parts 2 + :command-list '() + ) + ) + (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (+ 32768.0 (y-angle (-> obj root-override)))) + ) + ) + (initialize-skeleton-by-name obj (the-as string s5-1)) + ) + (set! (-> obj hit-points) 1) + (set! (-> obj deadly?) #f) + (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object obj fall) #t) + (go (method-of-object obj idle)) + ) + (none) + ) diff --git a/goal_src/jak2/levels/ruins/rapid-gunner.gc b/goal_src/jak2/levels/ruins/rapid-gunner.gc index 3eb03095f1..dd57da73b2 100644 --- a/goal_src/jak2/levels/ruins/rapid-gunner.gc +++ b/goal_src/jak2/levels/ruins/rapid-gunner.gc @@ -46,10 +46,10 @@ ) -(defskelgroup skel-rapid-gunner rapid-gunner 0 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) +(defskelgroup skel-rapid-gunner rapid-gunner rapid-gunner-lod0-jg rapid-gunner-idle-ja + ((rapid-gunner-lod0-mg (meters 20)) (rapid-gunner-lod1-mg (meters 40)) (rapid-gunner-lod2-mg (meters 999999))) :bounds (static-spherem 0 1.5 0 7) - :shadow 4 + :shadow rapid-gunner-shadow-mg ) (define *rapid-gunner-nav-enemy-info* @@ -61,7 +61,12 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1010501 #x0 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 5 :notice-anim 6 :hostile-anim -1 @@ -724,7 +729,7 @@ ) 0 (ja-channel-push! 1 (seconds 0.2)) - (ja :group! (-> self draw art-group data 17)) + (ja :group! rapid-gunner-shoot-track-ja) (ja :num-func num-func-identity :frame-num 0.0) (until (enemy-method-96 self 910.2222 #t) (ja-blend-eval) @@ -737,7 +742,7 @@ 0 ) (let ((v1-23 (ja-group))) - (if (not (and v1-23 (or (= v1-23 (-> self draw art-group data 14)) (= v1-23 (-> self draw art-group data 15))))) + (if (not (and v1-23 (or (= v1-23 rapid-gunner-shoot-ja) (= v1-23 rapid-gunner-shoot1-ja)))) (ja-channel-push! 1 (seconds 0.2)) ) ) @@ -884,8 +889,8 @@ ) 0 (ja-channel-push! 2 (seconds 0.1)) - (ja-no-eval :group! (-> self draw art-group data 5) - :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + (ja-no-eval :group! rapid-gunner-idle-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim rapid-gunner-idle-ja) frames num-frames) -1))) :frame-num 0.0 ) (let ((a0-17 (-> self skel root-channel 1))) @@ -893,13 +898,13 @@ (set! (-> a0-17 frame-interp 1) f0-7) (set! (-> a0-17 frame-interp 0) f0-7) ) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) + (set! (-> a0-17 frame-group) (the-as art-joint-anim rapid-gunner-idle-ja)) (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim rapid-gunner-idle-ja) frames num-frames) -1)) ) (set! (-> a0-17 param 1) 1.0) (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!) + (joint-control-channel-group! a0-17 (the-as art-joint-anim rapid-gunner-idle-ja) num-func-seek!) ) (until (ja-done? 0) (let ((s5-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) gp-0 (-> self root-override2 quat)))) @@ -972,8 +977,8 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.2)) (until #f - (ja-no-eval :group! (-> self draw art-group data 7) - :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) frames num-frames) -1))) + (ja-no-eval :group! rapid-gunner-turn-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim rapid-gunner-turn-ja) frames num-frames) -1))) :frame-num 0.0 ) (until (ja-done? 0) @@ -1023,8 +1028,8 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.2)) (until #f - (ja-no-eval :group! (-> self draw art-group data 12) - :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) frames num-frames) -1))) + (ja-no-eval :group! rapid-gunner-aim-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim rapid-gunner-aim-ja) frames num-frames) -1))) :frame-num 0.0 ) (until (ja-done? 0) @@ -1061,8 +1066,8 @@ ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) - (ja-no-eval :group! (-> self draw art-group data 19) - :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 19)) frames num-frames) -1)) 0.5) + (ja-no-eval :group! rapid-gunner-reload-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim rapid-gunner-reload-ja) frames num-frames) -1)) 0.5) :frame-num 0.0 ) (until (ja-done? 0) @@ -1158,7 +1163,7 @@ ) 0 (ja-channel-push! 1 (seconds 0.2)) - (ja :group! (-> self draw art-group data 17)) + (ja :group! rapid-gunner-shoot-track-ja) (ja :num-func num-func-identity :frame-num 0.0) (until (enemy-method-96 self 910.2222 #t) (ja-blend-eval) @@ -1171,9 +1176,9 @@ 0 ) (let ((v1-23 (ja-group))) - (when (not (and v1-23 (= v1-23 (-> self draw art-group data 12)))) + (when (not (and v1-23 (= v1-23 rapid-gunner-aim-ja))) (let ((v1-29 (ja-group))) - (if (and v1-29 (= v1-29 (-> self draw art-group data 17))) + (if (and v1-29 (= v1-29 rapid-gunner-shoot-track-ja)) (ja-channel-push! 1 (seconds 0.067)) (ja-channel-push! 1 (seconds 0.2)) ) @@ -1182,11 +1187,8 @@ ) (let ((f30-0 (get-rand-float-range self 0.9 1.1))) (until #f - (ja-no-eval :group! (-> self draw art-group data 12) - :num! (seek! - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) frames num-frames) -1)) - f30-0 - ) + (ja-no-eval :group! rapid-gunner-aim-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim rapid-gunner-aim-ja) frames num-frames) -1)) f30-0) :frame-num 0.0 ) (until (ja-done? 0) @@ -1246,8 +1248,8 @@ ) :code (behavior () (ja-channel-push! 1 (seconds 0.135)) - (ja-no-eval :group! (-> self draw art-group data 18) - :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 18)) frames num-frames) -1))) + (ja-no-eval :group! rapid-gunner-spin-attack-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim rapid-gunner-spin-attack-ja) frames num-frames) -1))) :frame-num 0.0 ) (until (ja-done? 0) diff --git a/goal_src/jak2/levels/ruins/ruins-obs.gc b/goal_src/jak2/levels/ruins/ruins-obs.gc index 07d7a5e7ff..747da18073 100644 --- a/goal_src/jak2/levels/ruins/ruins-obs.gc +++ b/goal_src/jak2/levels/ruins/ruins-obs.gc @@ -7,3 +7,1033 @@ ;; DECOMP BEGINS +(deftype sinking-plat (rigid-body-platform) + ((anchor-point vector :inline :offset-assert 384) + ) + :heap-base #x110 + :method-count-assert 57 + :size-assert #x190 + :flag-assert #x3901100190 + ) + + +(defskelgroup skel-sinking-plat sinking-plat 0 3 + ((1 (meters 20)) (2 (meters 999999))) + :bounds (static-spherem 0 1 0 4) + ) + +(defmethod rigid-body-object-method-29 sinking-plat ((obj sinking-plat) (arg0 float)) + ((the-as (function rigid-body-platform float none) (find-parent-method sinking-plat 29)) obj arg0) + (rigid-body-platform-method-56 obj (-> obj anchor-point)) + 0 + (none) + ) + +(defmethod rigid-body-object-method-32 sinking-plat ((obj sinking-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) 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 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 4096.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-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! (-> obj root-override-2) s5-0) + ) + 0 + (none) + ) + +(define *ruins-sinking-platform-constants* (new 'static 'rigid-body-platform-constants + :mass 1.48 + :inv-mass 0.6756757 + :cm-joint (new 'static 'vector :w 1.0) + :linear-damping 0.8 + :angular-damping 1.0 + :friction-factor 0.1 + :inertial-tensor-x (meters 2) + :inertial-tensor-y (meters 1) + :inertial-tensor-z (meters 2) + :max-time-step 0.02 + :gravity (meters 80) + :idle-distance (meters 50) + :attack-force-scale 1.0 + :name '*ruins-sinking-platform-constants* + :drag-factor 2.0 + :buoyancy-factor 1.5 + :max-buoyancy-depth (meters 2) + :player-weight (meters 60) + :player-bonk-factor 0.5 + :player-dive-factor 1.0 + :player-force-distance (meters 2) + :player-force-clamp (meters 1000000) + :player-force-timeout #x1e + :explosion-force (meters 1000) + :control-point-count 5 + :platform #t + :sound-name "ruins-plat" + ) + ) + +(defmethod rigid-body-object-method-33 sinking-plat ((obj sinking-plat)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-sinking-plat" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj float-height-offset) 4096.0) + (rigid-body-object-method-31 obj *ruins-sinking-platform-constants*) + (set! (-> obj anchor-point quad) (-> obj root-override-2 trans quad)) + (let ((s5-1 (-> obj info-override control-point-count))) + (dotimes (s4-1 s5-1) + (let ((s3-0 (-> obj control-point-array data s4-1))) + (let ((f30-0 (* 65536.0 (/ (the float s4-1) (the float s5-1))))) + (set! (-> s3-0 local-pos x) (* 12288.0 (sin f30-0))) + (set! (-> s3-0 local-pos y) 4096.0) + (set! (-> s3-0 local-pos z) (* 12288.0 (cos f30-0))) + ) + (set! (-> s3-0 local-pos w) 1.0) + ) + ) + ) + 0 + (none) + ) + +(defstate idle (sinking-plat) + :virtual #t + :event (the-as + (function process int symbol event-message-block object :behavior sinking-plat) + rigid-body-object-event-handler + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) + :num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (behavior () + (set! (-> self info-override) *ruins-sinking-platform-constants*) + (set! (-> self rbody state info) (the-as rigid-body-info (&-> (-> self info-override) mass))) + (rigid-body-object-method-37 self) + (none) + ) + ) + +(deftype beam (process-drawable) + () + :heap-base #x50 + :method-count-assert 22 + :size-assert #xc8 + :flag-assert #x16005000c8 + (:methods + (idle () _type_ :state 20) + (collapse () _type_ :state 21) + ) + ) + + +(defskelgroup skel-beam beam 0 -1 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 5)) + +(defstate idle (beam) + :virtual #t + :trans (behavior () + (let ((f0-0 (vector-vector-distance-squared (-> self root trans) (camera-pos))) + (f1-0 102400.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (go-virtual collapse) + ) + ) + (none) + ) + :code (the-as (function none :behavior beam) sleep-code) + ) + +(defstate collapse (beam) + :virtual #t + :code (behavior () + (sound-play "beam-slip") + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) + :post (the-as (function none :behavior beam) ja-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! beam ((obj beam) (arg0 entity-actor)) + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-beam" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (ja-channel-push! 1 0) + (let ((s5-2 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-2 + (the-as art-joint-anim (-> obj draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-2 frame-num) 0.0) + ) + (ja-post) + (go (method-of-object obj idle)) + (none) + ) + +(deftype ruins-bridge (drop-plat) + () + :heap-base #xc0 + :method-count-assert 36 + :size-assert #x140 + :flag-assert #x2400c00140 + ) + + +(defskelgroup skel-ruins-bridge-1 ruins-bridge 0 3 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 7)) + +(defmethod start-bouncing! ruins-bridge ((obj ruins-bridge)) + "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce + and translate the platform via the `smush` + @see [[smush-control]]" + (logclear! (-> obj mask) (process-mask sleep)) + (logclear! (-> obj mask) (process-mask sleep-code)) + 0 + (none) + ) + +(defstate fall (ruins-bridge) + :virtual #t + :trans (the-as (function none :behavior ruins-bridge) rider-trans) + :code (behavior ((arg0 symbol)) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (set! (-> self draw bounds y) -102400.0) + (set! (-> self draw bounds w) 163840.0) + (let ((v1-7 (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) child 0))) + (set! (-> v1-7 prim-core collide-with) (collide-spec)) + (set! (-> v1-7 prim-core collide-as) (collide-spec)) + ) + 0 + (let ((v1-12 (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) child 1))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak player-list)) + ) + (let ((v1-16 (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) child 2))) + (set! (-> v1-16 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak player-list)) + ) + (let ((v1-20 (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) child 3))) + (set! (-> v1-20 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak player-list)) + ) + (let* ((s5-0 (-> self draw art-group)) + (s4-0 (method-of-object s5-0 get-art-by-name-method)) + ) + (format (clear *temp-string*) "~S-end" (-> self art-name)) + (let ((s5-1 (s4-0 s5-0 *temp-string* art-joint-anim))) + (if (not arg0) + ;; added cast + (ja-play-spooled-anim (-> self anim) (ja-group) (the-as art-joint-anim s5-1) (the-as (function process-drawable symbol) false-func)) + ) + (ja-channel-set! 1) + ;; added cast + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim s5-1)) + ) + ) + (suspend) + (let ((v1-33 (-> self root-override root-prim))) + (set! (-> v1-33 prim-core collide-as) (collide-spec)) + (set! (-> v1-33 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! ruins-bridge ((obj ruins-bridge) (arg0 entity-actor)) + (stack-size-set! (-> obj main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum 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 4) 0))) + (set! (-> s4-0 total-prims) (the-as uint 5)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 49152.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak 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 26624.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec)) + (set! (-> v1-18 prim-core collide-with) (collide-spec)) + (set! (-> v1-18 prim-core action) (collide-action solid rideable)) + (set! (-> v1-18 transform-index) 69) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 26624.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec)) + (set! (-> v1-20 prim-core collide-with) (collide-spec)) + (set! (-> v1-20 prim-core action) (collide-action solid rideable)) + (set! (-> v1-20 transform-index) 70) + (set-vector! (-> v1-20 local-sphere) 0.0 0.0 0.0 18432.0) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec)) + (set! (-> v1-22 prim-core collide-with) (collide-spec)) + (set! (-> v1-22 prim-core action) (collide-action solid rideable)) + (set! (-> v1-22 transform-index) 71) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 14336.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-25 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-bridge-1" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-bridge-1") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-bridge-1" :anim-name "1-crumble" :parts 2 :command-list '()) + ) + (set! (-> obj basetrans quad) (-> obj root-override trans quad)) + (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object obj fall) #t) + (go (method-of-object obj idle)) + ) + (none) + ) + +(deftype ruins-drop-plat (drop-plat) + () + :heap-base #xc0 + :method-count-assert 36 + :size-assert #x140 + :flag-assert #x2400c00140 + ) + + +(defskelgroup skel-ruins-drop-plat-a-1 ruins-drop-plat 0 3 + ((1 (meters 20)) (2 (meters 999999))) + :bounds (static-spherem 2.5 -10 2.5 12) + :origin-joint-index 3 + ) + +(defskelgroup skel-ruins-drop-plat-a-2 ruins-drop-plat 0 6 + ((1 (meters 20)) (2 (meters 999999))) + :bounds (static-spherem 2.5 -10 2.5 12) + :origin-joint-index 3 + ) + +(defskelgroup skel-ruins-drop-plat-a-3 ruins-drop-plat 0 9 + ((1 (meters 20)) (2 (meters 999999))) + :bounds (static-spherem 2.5 -10 2.5 12) + :origin-joint-index 3 + ) + +(defskelgroup skel-ruins-drop-plat-b-1 ruins-drop-plat 12 15 + ((13 (meters 20)) (14 (meters 999999))) + :bounds (static-spherem 2.5 -10 2.5 12) + :origin-joint-index 3 + ) + +(defskelgroup skel-ruins-drop-plat-b-2 ruins-drop-plat 12 18 + ((13 (meters 20)) (14 (meters 999999))) + :bounds (static-spherem 2.5 -10 2.5 12) + :origin-joint-index 3 + ) + +(defskelgroup skel-ruins-drop-plat-c-1 ruins-drop-plat 21 24 + ((22 (meters 20)) (23 (meters 999999))) + :bounds (static-spherem 2.5 -10 2.5 12) + :origin-joint-index 3 + ) + +(defskelgroup skel-ruins-drop-plat-c-2 ruins-drop-plat 21 27 + ((22 (meters 20)) (23 (meters 999999))) + :bounds (static-spherem 2.5 -10 2.5 12) + :origin-joint-index 3 + ) + +(defskelgroup skel-ruins-drop-plat-c-3 ruins-drop-plat 21 30 + ((22 (meters 20)) (23 (meters 999999))) + :bounds (static-spherem 2.5 -10 2.5 12) + :origin-joint-index 3 + ) + +(defmethod start-bouncing! ruins-drop-plat ((obj ruins-drop-plat)) + "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce + and translate the platform via the `smush` + @see [[smush-control]]" + (activate! (-> obj smush) -1.0 60 150 1.0 1.0 (-> self clock)) + (set! (-> obj bounce-time) (-> self clock frame-counter)) + (set! (-> obj bouncing) #t) + (logclear! (-> obj mask) (process-mask sleep)) + (logclear! (-> obj mask) (process-mask sleep-code)) + 0 + (none) + ) + +(defstate fall (ruins-drop-plat) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('collide-shape) + (let ((v1-2 (-> self root-override root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v1-7 (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) child 1))) + (set! (-> v1-7 prim-core collide-with) (collide-spec)) + (set! (-> v1-7 prim-core collide-as) (collide-spec)) + ) + 0 + ) + (else + ((-> (method-of-type drop-plat fall) event) proc arg1 event-type event) + ) + ) + ) + :code (behavior ((arg0 symbol)) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (set! (-> self draw force-lod) 0) + (set! (-> self draw bounds w) 327680.0) + (let* ((gp-0 (-> self draw art-group)) + (s4-0 (method-of-object gp-0 get-art-by-name-method)) + ) + (format (clear *temp-string*) "~S-end" (-> self art-name)) + (let ((gp-1 (s4-0 gp-0 *temp-string* art-joint-anim))) + (when (not arg0) + (let ((s5-1 (new 'static 'boxed-array :type string "center" "lr" "rr" "rf" "lf"))) + (new 'static 'boxed-array :type vector + (new 'static 'vector :x 10240.0 :z 10240.0 :w 1.0) + (new 'static 'vector :w 1.0) + (new 'static 'vector :z 20480.0 :w 1.0) + (new 'static 'vector :x 20480.0 :z 20480.0 :w 1.0) + (new 'static 'vector :x 20480.0 :w 1.0) + ) + (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) (-> self hit-point) (-> self root-override trans)))) + (set! (-> s4-2 y) 0.0) + (vector-rotate-y! s4-2 s4-2 (- (y-angle (-> self root-override)))) + ) + (let ((s3-2 0)) + (format (clear (-> self break-anim-name)) "~S-break-~S" (-> self art-name) (-> s5-1 s3-2)) + ) + ) + (set! (-> self anim anim-name) (-> self break-anim-name)) + (sound-play "tower-plat-fall") + ;; added cast + (ja-play-spooled-anim (-> self anim) (ja-group) (the-as art-joint-anim gp-1) (the-as (function process-drawable symbol) false-func)) + ) + (ja-channel-set! 1) + ;; added cast + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + ) + (suspend) + (cleanup-for-death self) + (none) + ) + :post (behavior () + (when (and (nonzero? (-> self root-override root-prim prim-core collide-as)) + (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.25)) + ) + (let ((v1-9 (-> self root-override root-prim))) + (set! (-> v1-9 prim-core collide-as) (collide-spec)) + (set! (-> v1-9 prim-core collide-with) (collide-spec)) + ) + 0 + ) + (let ((t9-0 (-> (method-of-type drop-plat fall) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! ruins-drop-plat ((obj ruins-drop-plat) (arg0 entity-actor)) + (stack-size-set! (-> obj main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum 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 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s3-0 local-sphere) 0.0 -40960.0 0.0 40960.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid)) + (set! (-> v1-16 transform-index) 3) + (set-vector! (-> v1-16 local-sphere) 10240.0 -40960.0 10240.0 49152.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid rideable)) + (set! (-> v1-18 transform-index) 3) + (set-vector! (-> v1-18 local-sphere) 10240.0 -16384.0 10240.0 28672.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-21 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (let ((s5-1 ((method-of-type res-lump get-property-struct) + (-> obj entity) + 'art-name + 'interp + -1000000000.0 + "ruins-drop-plat-a-1" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (set! (-> obj art-name) (the-as string s5-1)) + (cond + ((string= (the-as string s5-1) "ruins-drop-plat-a-1") + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ruins-drop-plat-a-1" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-drop-plat-a-1") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-drop-plat-a-1" :anim-name "a-1-break-center" :parts 1 :command-list '()) + ) + ) + ((string= (the-as string s5-1) "ruins-drop-plat-a-2") + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ruins-drop-plat-a-2" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-drop-plat-a-2") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-drop-plat-a-1" :anim-name "a-2-break-center" :parts 1 :command-list '()) + ) + ) + ((string= (the-as string s5-1) "ruins-drop-plat-a-3") + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ruins-drop-plat-a-3" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-drop-plat-a-3") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-drop-plat-a-1" :anim-name "a-3-break-center" :parts 1 :command-list '()) + ) + ) + ((string= (the-as string s5-1) "ruins-drop-plat-b-1") + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ruins-drop-plat-b-1" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-drop-plat-b-1") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-drop-plat-b-1" :anim-name "b-1-break-center" :parts 1 :command-list '()) + ) + ) + ((string= (the-as string s5-1) "ruins-drop-plat-b-2") + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ruins-drop-plat-b-2" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-drop-plat-b-2") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-drop-plat-b-1" :anim-name "b-2-break-center" :parts 1 :command-list '()) + ) + ) + ((string= (the-as string s5-1) "ruins-drop-plat-c-1") + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ruins-drop-plat-c-1" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-drop-plat-c-1") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-drop-plat-c-1" :anim-name "c-1-break-center" :parts 1 :command-list '()) + ) + ) + ((string= (the-as string s5-1) "ruins-drop-plat-c-2") + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ruins-drop-plat-c-2" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-drop-plat-c-2") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-drop-plat-c-1" :anim-name "c-2-break-center" :parts 1 :command-list '()) + ) + ) + ((string= (the-as string s5-1) "ruins-drop-plat-c-3") + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ruins-drop-plat-c-3" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-drop-plat-c-3") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-drop-plat-c-1" :anim-name "c-3-break-center" :parts 1 :command-list '()) + ) + ) + (else + (go process-drawable-art-error (the-as string s5-1)) + ) + ) + ) + (set! (-> obj draw force-lod) 1) + (set! (-> obj break-anim-name) (new 'process 'string 128 (the-as string #f))) + (set! (-> obj basetrans quad) (-> obj root-override trans quad)) + (set! (-> obj bounce-scale) 0.0) + (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object obj fall) #t) + (go (method-of-object obj idle)) + ) + (none) + ) + +(defun ruins-activate () + (setup-user-array (-> *part-id-table* 1309) "grenadier-grenade-part") + (setup-user-array (-> *part-id-table* 638) "grenadier-grenade-part") + (setup-user-array (-> *part-id-table* 639) "grenadier-grenade-part") + 0 + (none) + ) + +(set-subtask-hook! + *game-info* + 13 + 3 + (lambda :behavior task-manager + () + (set! (-> self data-int32 0) 0) + (set! (-> self beep-time) (+ (-> self clock frame-counter) (seconds -30))) + (until #f + (when (>= (- (-> self clock frame-counter) (-> self beep-time)) (seconds 40)) + (let ((v1-8 (mod (-> self data-int32 0) (if (= (-> self node-info task) (game-task ruins-tower)) + 4 + 2 + ) + ) + ) + ) + (cond + ((zero? v1-8) + (talker-spawn-func (-> *talker-speech* 68) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-8 1) + (talker-spawn-func (-> *talker-speech* 69) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-8 2) + (talker-spawn-func (-> *talker-speech* 70) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-8 3) + (talker-spawn-func (-> *talker-speech* 71) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (set! (-> self beep-time) (-> self clock frame-counter)) + (+! (-> self data-int32 0) 1) + ) + (b! + (>= (vector-vector-distance (target-pos 0) (-> self info end-sphere)) (-> self info end-sphere r)) + cfg-23 + :delay #f + ) + (send-event (handle->process (-> self arrow)) 'leave) + (b! #t cfg-39 :delay (nop!)) + (label cfg-23) + (when (and (>= (-> self data-int32 0) 4) (not (handle->process (-> self arrow)))) + (let ((gp-5 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-5 pos quad) (-> self info end-sphere quad)) + (quaternion-identity! (-> gp-5 quat)) + (set! (-> gp-5 flags) (task-arrow-flags)) + (set! (-> gp-5 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn gp-5 (the-as task-arrow self)))) + ) + ) + (label cfg-39) + (suspend) + ) + #f + ) + ) + +(copy-hooks! (-> *game-info* sub-task-list 99) (-> *game-info* sub-task-list 13)) + +(set-subtask-hook! + *game-info* + 194 + 3 + (lambda :behavior task-manager + () + (let ((s4-0 (entity-by-type mech)) + (gp-0 (entity-by-name "ruins-breakable-wall-1")) + ) + (when s4-0 + (let ((s5-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> self begin-pos quad) (-> s4-0 extra trans quad)) + (set! (-> s5-0 pos quad) (-> self begin-pos quad)) + (quaternion-identity! (-> s5-0 quat)) + (set! (-> s5-0 flags) (task-arrow-flags)) + (set! (-> s5-0 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn s5-0 (the-as task-arrow self)))) + ) + ) + (b! #t cfg-17 :delay (nop!)) + (label cfg-8) + (when (and (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) + gp-0 + (< (vector-vector-xz-distance (target-pos 0) (-> gp-0 extra trans)) 40960.0) + ) + (talker-spawn-func (-> *talker-speech* 452) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self time-limit) (-> self clock frame-counter)) + ) + (suspend) + (label cfg-17) + (b! + (or (not *target*) + (and (handle->process (-> self arrow)) + (let ((f0-1 (vector-vector-xz-distance (-> self begin-pos) (-> *target* control trans)))) + (< 32768.0 f0-1) + ) + ) + ) + cfg-8 + :delay (nop!) + ) + (send-event (handle->process (-> self arrow)) 'leave) + (until (not (or (not *target*) (zero? (logand (focus-status mech) (-> *target* focus-status))))) + (b! #t cfg-47 :delay (nop!)) + (label cfg-38) + (when (and (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) + gp-0 + (< (vector-vector-xz-distance (target-pos 0) (-> gp-0 extra trans)) 40960.0) + ) + (talker-spawn-func (-> *talker-speech* 452) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self time-limit) (-> self clock frame-counter)) + ) + (suspend) + (label cfg-47) + (b! (or (not *target*) (zero? (logand (focus-status mech) (-> *target* focus-status)))) cfg-38 :delay (nop!)) + (talker-spawn-func (-> *talker-speech* 457) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self time-limit) (-> self clock frame-counter)) + (b! #t cfg-66 :delay (nop!)) + (label cfg-52) + ) + (when (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) + (b! + (not (and gp-0 (< (vector-vector-xz-distance (target-pos 0) (-> gp-0 extra trans)) 61440.0))) + cfg-63 + :delay (nop!) + ) + (talker-spawn-func (-> *talker-speech* 453) *entity-pool* (target-pos 0) (the-as region #f)) + (b! #t cfg-64 :delay (nop!)) + (label cfg-63) + (talker-spawn-func (-> *talker-speech* 454) *entity-pool* (target-pos 0) (the-as region #f)) + (label cfg-64) + (set! (-> self time-limit) (-> self clock frame-counter)) + ) + (suspend) + (label cfg-66) + (b! + (or (not *target*) + (not gp-0) + (zero? (logand (-> gp-0 extra perm status) (entity-perm-status subtask-complete))) + ) + cfg-52 + :delay (nop!) + ) + ) + (go-virtual complete) + ) + ) + +(set-subtask-hook! + *game-info* + 195 + 3 + (lambda :behavior task-manager + () + (local-vars (v1-3 object) (v1-14 symbol) (v1-18 symbol) (v1-25 object) (v1-31 symbol) (v1-32 symbol)) + (let ((gp-0 (entity-by-name "pushblock-6"))) + (label cfg-1) + (b! #t cfg-14 :delay (nop!)) + (label cfg-2) + (let ((a0-2 (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)))) + (b! (not a0-2) cfg-11 :likely-delay (set! v1-3 a0-2)) + ) + (b! (not gp-0) cfg-11 :likely-delay (set! v1-3 gp-0)) + (let ((v1-5 (-> gp-0 extra process))) + (b! (not v1-5) cfg-8 :delay (nop!)) + (let ((s4-0 (-> (the-as process-drawable v1-5) root trans))) + (b! #t cfg-9 :delay (nop!)) + (label cfg-8) + (set! s4-0 (-> gp-0 extra trans)) + (label cfg-9) + (set! v1-3 (< (vector-vector-xz-distance (target-pos 0) s4-0) 40960.0)) + ) + ) + (label cfg-11) + (when v1-3 + (talker-spawn-func (-> *talker-speech* 452) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self time-limit) (-> self clock frame-counter)) + ) + (suspend) + (label cfg-14) + (b! (not *target*) cfg-17 :likely-delay (set! v1-14 #t)) + (set! v1-14 (zero? (logand (focus-status mech) (-> *target* focus-status)))) + (label cfg-17) + (b! v1-14 cfg-2 :delay (nop!)) + (until #f + (b! (not *target*) cfg-22 :likely-delay (set! v1-18 #t)) + (set! v1-18 (zero? (logand (focus-status mech) (-> *target* focus-status)))) + (label cfg-22) + (b! v1-18 cfg-1 :delay (nop!)) + (when (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) + (b! (not gp-0) cfg-38 :likely-delay (set! v1-25 gp-0)) + (let ((v1-27 (-> gp-0 extra process))) + (b! (not v1-27) cfg-28 :delay (nop!)) + (let ((s5-2 (-> (the-as process-drawable v1-27) root trans))) + (b! #t cfg-29 :delay (nop!)) + (label cfg-28) + (set! s5-2 (-> gp-0 extra trans)) + (label cfg-29) + (let ((s4-2 (target-pos 0))) + (b! (< (vector-vector-xz-distance s4-2 s5-2) 40960.0) cfg-31 :delay (set! v1-31 #t)) + (set! v1-31 #f) + (label cfg-31) + (b! (not v1-31) cfg-35 :likely-delay (set! v1-32 v1-31)) + (b! (< (-> s4-2 y) (+ 16384.0 (-> s5-2 y))) cfg-35 :delay (set! v1-32 #t)) + ) + ) + ) + (set! v1-32 #f) + (label cfg-35) + (b! (not v1-32) cfg-38 :likely-delay (set! v1-25 v1-32)) + (set! v1-25 (zero? (logand (focus-status carry) (-> *target* focus-status)))) + (label cfg-38) + (when v1-25 + (talker-spawn-func (-> *talker-speech* 458) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self time-limit) (-> self clock frame-counter)) + ) + ) + (suspend) + ) + ) + #f + ) + ) + +(set-subtask-hook! + *game-info* + 196 + 3 + (lambda :behavior task-manager + () + (local-vars (v1-6 object) (v1-58 symbol)) + (let ((gp-0 (entity-by-name "throwblock-3")) + (s4-0 (entity-by-name "ruins-pillar-collapse-7")) + (s5-0 (entity-by-name "ruins-pillar-collapse-9")) + ) + (b! #t cfg-2 :delay (nop!)) + (label cfg-1) + (suspend) + (label cfg-2) + (b! + (or (not s4-0) (zero? (logand (-> s4-0 extra perm status) (entity-perm-status subtask-complete)))) + cfg-1 + :delay (nop!) + ) + (until (not (or (not *target*) (zero? (logand (focus-status mech) (-> *target* focus-status))))) + (b! #t cfg-20 :delay (nop!)) + (label cfg-8) + (set! v1-6 + (and (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) + (and gp-0 (begin + (let ((v1-8 (-> gp-0 extra process))) + (b! (not v1-8) cfg-14 :delay (nop!)) + (let ((s3-0 (-> (the-as process-drawable v1-8) root trans))) + (b! #t cfg-15 :delay (nop!)) + (label cfg-14) + (set! s3-0 (-> gp-0 extra trans)) + (label cfg-15) + (b! (< (vector-vector-xz-distance (target-pos 0) s3-0) 40960.0) cfg-17 :delay (set! v1-6 #t)) + ) + ) + #f + ) + ) + ) + ) + (label cfg-17) + (b! (not v1-6) cfg-19 :delay (empty-form)) + (talker-spawn-func (-> *talker-speech* 452) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self time-limit) (-> self clock frame-counter)) + (label cfg-19) + (suspend) + (label cfg-20) + (b! (or (not *target*) (zero? (logand (focus-status mech) (-> *target* focus-status)))) cfg-8 :delay (nop!)) + (b! #t cfg-53 :delay (nop!)) + (label cfg-25) + ) + (when (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) + (b! + (not (and *target* (logtest? (focus-status carry) (-> *target* focus-status)))) + cfg-43 + :delay (empty-form) + ) + (when (< (vector-vector-xz-distance + (target-pos 0) + (new 'static 'vector :x 3881326.5 :y 148090.88 :z -2125870.8 :w 1.0) + ) + 32768.0 + ) + (when (zero? (-> self count)) + (persist-with-delay *setting-control* #f (seconds 3) 'entity-name (the-as symbol "camera-270") 0.0 0) + (set! (-> self count) 1) + ) + (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) 'look-at-point) + (let ((t9-10 send-event-function) + (v1-41 s5-0) + ) + (t9-10 + (if v1-41 + (-> v1-41 extra process) + ) + a1-10 + ) + ) + ) + (talker-spawn-func (-> *talker-speech* 459) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self time-limit) (-> self clock frame-counter)) + ) + (b! #t cfg-52 :delay (nop!)) + (label cfg-43) + (when (and gp-0 (let ((v1-49 (-> gp-0 extra process))) + (b! (not v1-49) cfg-47 :delay (nop!)) + (let ((s3-3 (-> (the-as process-drawable v1-49) root trans))) + (b! #t cfg-48 :delay (nop!)) + (label cfg-47) + (set! s3-3 (-> gp-0 extra trans)) + (label cfg-48) + (< (vector-vector-xz-distance (target-pos 0) s3-3) 40960.0) + ) + ) + ) + (talker-spawn-func (-> *talker-speech* 458) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self time-limit) (-> self clock frame-counter)) + ) + ) + (label cfg-52) + (suspend) + (label cfg-53) + (b! (not *target*) cfg-58 :likely-delay (set! v1-58 #t)) + (set! v1-58 + (or (not s5-0) (zero? (logand (-> s5-0 extra perm status) (entity-perm-status subtask-complete)))) + ) + ) + (label cfg-58) + (b! v1-58 cfg-25 :delay (nop!)) + (go-virtual complete) + ) + ) diff --git a/goal_src/jak2/levels/sewer/gator.gc b/goal_src/jak2/levels/sewer/gator.gc index a444e93ea8..85f28fb69e 100644 --- a/goal_src/jak2/levels/sewer/gator.gc +++ b/goal_src/jak2/levels/sewer/gator.gc @@ -32,108 +32,114 @@ ) -(define *gator-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 'array uint32 4 #x1e0002 #x64640d01 #x0 #x0) - :idle-anim 13 - :notice-anim 13 - :hostile-anim 14 - :hit-anim 6 - :knocked-anim 6 - :knocked-land-anim 7 - :die-anim 12 - :die-falling-anim 21 - :victory-anim -1 - :jump-wind-up-anim 13 - :jump-in-air-anim 13 - :jump-land-anim 13 - :neck-joint -1 - :look-at-joint 12 - :bullseye-joint 4 - :sound-hit (static-sound-name "gator-hit") - :sound-die (static-sound-name "gator-die") - :notice-distance (meters 80) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 40) - :default-hit-points 1 - :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.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) - :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 - :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) - :callback-info #f - :use-momentum #f - :use-frustration #t - :use-stop-chase #f - :use-circling #t - :use-pacing #t - :walk-anim 13 - :turn-anim -1 - :run-anim 14 - :taunt-anim -1 - :run-travel-speed (meters 16) - :run-acceleration (meters 8) - :run-turning-acceleration (meters 40) - :walk-travel-speed (meters 4) - :walk-acceleration (meters 8) - :walk-turning-acceleration (meters 10) - :maximum-rotation-rate (degrees 200.00002) - :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 - ) - ) +(define *gator-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #xd :param0 #x64 :param1 #x64) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 13 + :notice-anim 13 + :hostile-anim 14 + :hit-anim 6 + :knocked-anim 6 + :knocked-land-anim 7 + :die-anim 12 + :die-falling-anim 21 + :victory-anim -1 + :jump-wind-up-anim 13 + :jump-in-air-anim 13 + :jump-land-anim 13 + :neck-joint -1 + :look-at-joint 12 + :bullseye-joint 4 + :sound-hit (static-sound-name "gator-hit") + :sound-die (static-sound-name "gator-die") + :notice-distance (meters 80) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 40) + :default-hit-points 1 + :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.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) + :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 + :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) + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 13 + :turn-anim -1 + :run-anim 14 + :taunt-anim -1 + :run-travel-speed (meters 16) + :run-acceleration (meters 8) + :run-turning-acceleration (meters 40) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 8) + :walk-turning-acceleration (meters 10) + :maximum-rotation-rate (degrees 200.00002) + :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! (-> *gator-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/goal_src/jak2/levels/sewer/sewer-obs2.gc b/goal_src/jak2/levels/sewer/sewer-obs2.gc index e11e38a07c..334f86ce87 100644 --- a/goal_src/jak2/levels/sewer/sewer-obs2.gc +++ b/goal_src/jak2/levels/sewer/sewer-obs2.gc @@ -1401,7 +1401,12 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1e0002 #x3010501 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 5 :notice-anim 13 :hostile-anim -1 diff --git a/goal_src/jak2/levels/strip/strip-drop.gc b/goal_src/jak2/levels/strip/strip-drop.gc index c22660806d..13fed008c1 100644 --- a/goal_src/jak2/levels/strip/strip-drop.gc +++ b/goal_src/jak2/levels/strip/strip-drop.gc @@ -724,7 +724,7 @@ ) (let ((a1-8 (grunt-egg-method-23 obj))) (if a1-8 - (idle-control-method-9 (-> obj idle-anim-player) (the-as (pointer uint32) a1-8)) + (idle-control-method-9 (-> obj idle-anim-player) (the-as (pointer idle-control-frame) a1-8)) ) ) (if (>= (res-lump-value arg0 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) diff --git a/goal_src/jak2/levels/temple/rhino.gc b/goal_src/jak2/levels/temple/rhino.gc index f86eb0a2c8..673e162f11 100644 --- a/goal_src/jak2/levels/temple/rhino.gc +++ b/goal_src/jak2/levels/temple/rhino.gc @@ -151,7 +151,16 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 8 #x1e0002 #x4010301 #x1e0002 #x4010401 #x0 #x0 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 8 + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x3 :param0 #x1 :param1 #x4) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x4) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 3 :notice-anim 7 :hostile-anim 10 diff --git a/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc b/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc index e9ec83fe8a..5899179b4f 100644 --- a/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc @@ -32,87 +32,87 @@ ;; definition of type enemy-info (deftype enemy-info (basic) - ((fact-defaults fact-info-enemy-defaults :offset-assert 4) - (use-die-falling symbol :offset-assert 8) - (use-victory symbol :offset-assert 12) - (use-jump-blocked symbol :offset-assert 16) - (debug-draw-neck symbol :offset-assert 20) - (jump-debug-draw symbol :offset-assert 24) - (move-to-ground symbol :offset-assert 28) - (hover-if-no-ground symbol :offset-assert 32) - (idle-anim-script (pointer uint32) :offset-assert 36) - (idle-anim int32 :offset-assert 40) - (notice-anim int32 :offset-assert 44) - (hostile-anim int32 :offset-assert 48) - (hit-anim int32 :offset-assert 52) - (knocked-anim int32 :offset-assert 56) - (knocked-land-anim int32 :offset-assert 60) - (die-anim int32 :offset-assert 64) - (die-falling-anim int32 :offset-assert 68) - (victory-anim int32 :offset-assert 72) - (jump-wind-up-anim int32 :offset-assert 76) - (jump-in-air-anim int32 :offset-assert 80) - (jump-land-anim int32 :offset-assert 84) - (neck-joint int32 :offset-assert 88) - (look-at-joint int32 :offset-assert 92) - (bullseye-joint int32 :offset-assert 96) - (sound-hit sound-name :offset-assert 112) - (sound-die sound-name :offset-assert 128) - (notice-distance meters :offset-assert 144) - (notice-distance-delta meters :offset-assert 148) - (proximity-notice-distance meters :offset-assert 152) - (default-hit-points int32 :offset-assert 156) - (gnd-collide-with collide-spec :offset-assert 160) - (overlaps-others-collide-with-filter collide-spec :offset-assert 164) - (penetrate-flinch uint64 :offset-assert 168) - (penetrate-knocked uint64 :offset-assert 176) - (movement-gravity meters :offset-assert 184) - (friction float :offset-assert 188) - (slip-factor float :offset-assert 192) - (attack-shove-back meters :offset-assert 196) - (attack-shove-up meters :offset-assert 200) - (attack-mode symbol :offset-assert 204) - (attack-damage int32 :offset-assert 208) - (recover-gnd-collide-with collide-spec :offset-assert 212) - (jump-height-min meters :offset-assert 216) - (jump-height-factor float :offset-assert 220) - (knocked-seek-ry-clamp float :offset-assert 224) - (knocked-soft-vxz-lo float :offset-assert 228) - (knocked-soft-vxz-hi float :offset-assert 232) - (knocked-soft-vy-lo float :offset-assert 236) - (knocked-soft-vy-hi float :offset-assert 240) - (knocked-medium-vxz-lo float :offset-assert 244) - (knocked-medium-vxz-hi float :offset-assert 248) - (knocked-medium-vy-lo float :offset-assert 252) - (knocked-medium-vy-hi float :offset-assert 256) - (knocked-hard-vxz-lo float :offset-assert 260) - (knocked-hard-vxz-hi float :offset-assert 264) - (knocked-hard-vy-lo float :offset-assert 268) - (knocked-hard-vy-hi float :offset-assert 272) - (knocked-huge-vxz-lo float :offset-assert 276) - (knocked-huge-vxz-hi float :offset-assert 280) - (knocked-huge-vy-lo float :offset-assert 284) - (knocked-huge-vy-hi float :offset-assert 288) - (knocked-yellow-vxz-lo float :offset-assert 292) - (knocked-yellow-vxz-hi float :offset-assert 296) - (knocked-yellow-vy-lo float :offset-assert 300) - (knocked-yellow-vy-hi float :offset-assert 304) - (knocked-red-vxz-lo float :offset-assert 308) - (knocked-red-vxz-hi float :offset-assert 312) - (knocked-red-vy-lo float :offset-assert 316) - (knocked-red-vy-hi float :offset-assert 320) - (knocked-blue-vxz-lo float :offset-assert 324) - (knocked-blue-vxz-hi float :offset-assert 328) - (knocked-blue-vy-lo float :offset-assert 332) - (knocked-blue-vy-hi float :offset-assert 336) - (shadow-size meters :offset-assert 340) - (shadow-max-y meters :offset-assert 344) - (shadow-min-y meters :offset-assert 348) - (shadow-locus-dist meters :offset-assert 352) - (gem-joint int32 :offset-assert 356) - (gem-seg uint32 :offset-assert 360) - (gem-no-seg uint32 :offset-assert 364) - (gem-offset sphere :inline :offset-assert 368) + ((fact-defaults fact-info-enemy-defaults :offset-assert 4) + (use-die-falling symbol :offset-assert 8) + (use-victory symbol :offset-assert 12) + (use-jump-blocked symbol :offset-assert 16) + (debug-draw-neck symbol :offset-assert 20) + (jump-debug-draw symbol :offset-assert 24) + (move-to-ground symbol :offset-assert 28) + (hover-if-no-ground symbol :offset-assert 32) + (idle-anim-script (pointer idle-control-frame) :offset-assert 36) + (idle-anim int32 :offset-assert 40) + (notice-anim int32 :offset-assert 44) + (hostile-anim int32 :offset-assert 48) + (hit-anim int32 :offset-assert 52) + (knocked-anim int32 :offset-assert 56) + (knocked-land-anim int32 :offset-assert 60) + (die-anim int32 :offset-assert 64) + (die-falling-anim int32 :offset-assert 68) + (victory-anim int32 :offset-assert 72) + (jump-wind-up-anim int32 :offset-assert 76) + (jump-in-air-anim int32 :offset-assert 80) + (jump-land-anim int32 :offset-assert 84) + (neck-joint int32 :offset-assert 88) + (look-at-joint int32 :offset-assert 92) + (bullseye-joint int32 :offset-assert 96) + (sound-hit sound-name :offset-assert 112) + (sound-die sound-name :offset-assert 128) + (notice-distance meters :offset-assert 144) + (notice-distance-delta meters :offset-assert 148) + (proximity-notice-distance meters :offset-assert 152) + (default-hit-points int32 :offset-assert 156) + (gnd-collide-with collide-spec :offset-assert 160) + (overlaps-others-collide-with-filter collide-spec :offset-assert 164) + (penetrate-flinch uint64 :offset-assert 168) + (penetrate-knocked uint64 :offset-assert 176) + (movement-gravity meters :offset-assert 184) + (friction float :offset-assert 188) + (slip-factor float :offset-assert 192) + (attack-shove-back meters :offset-assert 196) + (attack-shove-up meters :offset-assert 200) + (attack-mode symbol :offset-assert 204) + (attack-damage int32 :offset-assert 208) + (recover-gnd-collide-with collide-spec :offset-assert 212) + (jump-height-min meters :offset-assert 216) + (jump-height-factor float :offset-assert 220) + (knocked-seek-ry-clamp float :offset-assert 224) + (knocked-soft-vxz-lo float :offset-assert 228) + (knocked-soft-vxz-hi float :offset-assert 232) + (knocked-soft-vy-lo float :offset-assert 236) + (knocked-soft-vy-hi float :offset-assert 240) + (knocked-medium-vxz-lo float :offset-assert 244) + (knocked-medium-vxz-hi float :offset-assert 248) + (knocked-medium-vy-lo float :offset-assert 252) + (knocked-medium-vy-hi float :offset-assert 256) + (knocked-hard-vxz-lo float :offset-assert 260) + (knocked-hard-vxz-hi float :offset-assert 264) + (knocked-hard-vy-lo float :offset-assert 268) + (knocked-hard-vy-hi float :offset-assert 272) + (knocked-huge-vxz-lo float :offset-assert 276) + (knocked-huge-vxz-hi float :offset-assert 280) + (knocked-huge-vy-lo float :offset-assert 284) + (knocked-huge-vy-hi float :offset-assert 288) + (knocked-yellow-vxz-lo float :offset-assert 292) + (knocked-yellow-vxz-hi float :offset-assert 296) + (knocked-yellow-vy-lo float :offset-assert 300) + (knocked-yellow-vy-hi float :offset-assert 304) + (knocked-red-vxz-lo float :offset-assert 308) + (knocked-red-vxz-hi float :offset-assert 312) + (knocked-red-vy-lo float :offset-assert 316) + (knocked-red-vy-hi float :offset-assert 320) + (knocked-blue-vxz-lo float :offset-assert 324) + (knocked-blue-vxz-hi float :offset-assert 328) + (knocked-blue-vy-lo float :offset-assert 332) + (knocked-blue-vy-hi float :offset-assert 336) + (shadow-size meters :offset-assert 340) + (shadow-max-y meters :offset-assert 344) + (shadow-min-y meters :offset-assert 348) + (shadow-locus-dist meters :offset-assert 352) + (gem-joint int32 :offset-assert 356) + (gem-seg uint32 :offset-assert 360) + (gem-no-seg uint32 :offset-assert 364) + (gem-offset sphere :inline :offset-assert 368) ) :method-count-assert 10 :size-assert #x180 diff --git a/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc index b4235c18a1..27590b3448 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc @@ -773,33 +773,36 @@ (s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self draw shadow-joint-index))) ) + (f30-0 1638400.0) + (s3-0 (new 'stack-no-clear 'collide-query)) + (f28-0 122880.0) ) - 1638400.0 - (let ((s3-0 (new 'stack-no-clear 'collide-query)) - (f28-0 122880.0) - ) - (set! (-> s3-0 start-pos quad) (-> s4-1 quad)) - (vector-normalize-copy! (-> s3-0 move-dist) s5-2 f28-0) - (let ((v1-64 s3-0)) - (set! (-> v1-64 radius) 1638.4) - (set! (-> v1-64 collide-with) (collide-spec obstacle hit-by-others-list)) - (set! (-> v1-64 ignore-process0) self) - (set! (-> v1-64 ignore-process1) #f) - (set! (-> v1-64 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) - (set! (-> v1-64 action-mask) (collide-action solid)) - ) - (let* ((f0-13 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) - (f28-1 (if (< 0.0 f0-13) - (* f0-13 f28-0) - 122880.0 - ) - ) - (s2-0 (method-of-object (-> self draw shadow-ctrl) shadow-control-method-14)) - ) - (- f28-1 (command-get-float (-> event param 0) 0.0)) - (+ f28-1 (command-get-float (-> event param 1) 0.0)) - (the-as object (s2-0)) - ) + (set! (-> s3-0 start-pos quad) (-> s4-1 quad)) + (vector-normalize-copy! (-> s3-0 move-dist) s5-2 f28-0) + (let ((v1-64 s3-0)) + (set! (-> v1-64 radius) 1638.4) + (set! (-> v1-64 collide-with) (collide-spec obstacle hit-by-others-list)) + (set! (-> v1-64 ignore-process0) self) + (set! (-> v1-64 ignore-process1) #f) + (set! (-> v1-64 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-64 action-mask) (collide-action solid)) + ) + (let* ((f0-13 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) + (f28-1 (if (< 0.0 f0-13) + (* f0-13 f28-0) + 122880.0 + ) + ) + ) + (the-as object (shadow-control-method-14 + (-> self draw shadow-ctrl) + s4-1 + s5-2 + f30-0 + (- f28-1 (command-get-float (-> event param 0) 0.0)) + (+ f28-1 (command-get-float (-> event param 1) 0.0)) + ) + ) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/game/idle-control_REF.gc b/test/decompiler/reference/jak2/engine/game/idle-control_REF.gc index 0dfbf8e8db..e1fa49b7d9 100644 --- a/test/decompiler/reference/jak2/engine/game/idle-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/idle-control_REF.gc @@ -58,16 +58,16 @@ ;; definition of type idle-control (deftype idle-control (structure) - ((anim (pointer uint32) :offset-assert 0) - (current (pointer uint32) :offset-assert 4) - (counter int32 :offset-assert 8) - (target int32 :offset-assert 12) + ((anim (pointer idle-control-frame) :offset-assert 0) + (current (pointer idle-control-frame) :offset-assert 4) + (counter int32 :offset-assert 8) + (target int32 :offset-assert 12) ) :method-count-assert 11 :size-assert #x10 :flag-assert #xb00000010 (:methods - (idle-control-method-9 (_type_ (pointer uint32)) none 9) + (idle-control-method-9 (_type_ (pointer idle-control-frame)) none 9) (idle-control-method-10 (_type_ process-drawable) none :behavior process-drawable 10) ) ) @@ -89,7 +89,7 @@ ;; definition for method 9 of type idle-control ;; WARN: Return type mismatch idle-control vs none. -(defmethod idle-control-method-9 idle-control ((obj idle-control) (arg0 (pointer uint32))) +(defmethod idle-control-method-9 idle-control ((obj idle-control) (arg0 (pointer idle-control-frame))) (set! (-> obj anim) arg0) (set! (-> obj current) arg0) (set! (-> obj counter) 0) @@ -107,27 +107,27 @@ (set! self arg0) (loop (let* ((s4-0 (-> obj current 0)) - (v1-4 (shr (shl s4-0 56) 56)) + (v1-4 (-> s4-0 command)) ) (cond ((= v1-4 1) - (if (< (shr (shl s4-0 48) 56) 0) + (if (< (-> s4-0 anim) 0) (return #f) ) (when (zero? (-> obj target)) (let ((t9-0 rand-vu-int-range) - (a0-3 (sar (shl s4-0 40) 56)) + (a0-3 (-> s4-0 param0)) ) (shift-arith-right-32 a1-1 s4-0 24) (set! (-> obj target) (t9-0 (the-as int a0-3) a1-1)) ) - (ja :group! (-> (the-as process-drawable self) draw art-group data (shr (shl s4-0 48) 56)) :num! min) + (ja :group! (-> (the-as process-drawable self) draw art-group data (-> s4-0 anim)) :num! min) (return #f) ) - (ja :group! (-> (the-as process-drawable self) draw art-group data (shr (shl s4-0 48) 56)) + (ja :group! (-> (the-as process-drawable self) draw art-group data (-> s4-0 anim)) :num! (seek! (the float - (+ (-> (the-as art-joint-anim (-> (the-as process-drawable self) draw art-group data (shr (shl s4-0 48) 56))) + (+ (-> (the-as art-joint-anim (-> (the-as process-drawable self) draw art-group data (-> s4-0 anim))) frames num-frames ) @@ -158,7 +158,7 @@ ) ) ((= v1-4 2) - (ja-channel-push! 1 (the-as time-frame (sar (shl s4-0 40) 56))) + (ja-channel-push! 1 (the-as time-frame (-> s4-0 param0))) (set! (-> obj current) (&-> (-> obj current) 1)) (set! (-> obj counter) 0) (set! (-> obj target) 0) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc index 83cf12a3f1..4281482b29 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc @@ -3,17 +3,17 @@ ;; definition of type sprite-glow-data (deftype sprite-glow-data (structure) - ((position vector :inline :offset-assert 0) - (size-x float :offset 12) - (size-probe float :offset-assert 16) - (z-offset float :offset-assert 20) - (rot-angle float :offset-assert 24) - (size-y float :offset-assert 28) - (color rgbaf :inline :offset-assert 32) - (fade-a float :offset-assert 48) - (fade-b float :offset-assert 52) - (tex-id uint32 :offset-assert 56) - (dummy uint32 :offset-assert 60) + ((position vector :inline :offset-assert 0) + (size-x float :offset 12) + (size-probe float :offset-assert 16) + (z-offset float :offset-assert 20) + (rot-angle float :offset-assert 24) + (size-y float :offset-assert 28) + (color rgbaf :inline :offset-assert 32) + (fade-a float :offset-assert 48) + (fade-b float :offset-assert 52) + (tex-id texture-id :offset-assert 56) + (dummy uint32 :offset-assert 60) ) :method-count-assert 10 :size-assert #x40 @@ -59,15 +59,15 @@ ;; definition of type simple-sprite-system (deftype simple-sprite-system (structure) - ((count int16 :offset-assert 0) - (max-count int16 :offset-assert 2) - (data uint32 :offset-assert 4) + ((count int16 :offset-assert 0) + (max-count int16 :offset-assert 2) + (data sprite-glow-data :offset-assert 4) ) :method-count-assert 12 :size-assert #x8 :flag-assert #xc00000008 (:methods - (add! () none 9) + (add! (_type_ dma-buffer) none 9) (simple-sprite-system-method-10 (_type_ dma-buffer) none 10) (clear! (_type_) none 11) ) diff --git a/test/decompiler/reference/jak2/engine/target/mech_suit/grunt-mech_REF.gc b/test/decompiler/reference/jak2/engine/target/mech_suit/grunt-mech_REF.gc new file mode 100644 index 0000000000..8db4a2ee1a --- /dev/null +++ b/test/decompiler/reference/jak2/engine/target/mech_suit/grunt-mech_REF.gc @@ -0,0 +1,951 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type grunt-mech-hold +(deftype grunt-mech-hold (structure) + ((reserve-mask uint8 :offset-assert 0) + (lower-hold int8 :offset-assert 1) + (grunt-handle handle :offset-assert 8) + (timeout uint64 :offset-assert 16) + (local-pos vector :inline :offset-assert 32) + (local-rot vector :inline :offset-assert 48) + (local-mat matrix :inline :offset-assert 64) + (world-mat matrix :inline :offset-assert 128) + ) + :method-count-assert 9 + :size-assert #xc0 + :flag-assert #x9000000c0 + ) + +;; definition for method 3 of type grunt-mech-hold +(defmethod inspect grunt-mech-hold ((obj grunt-mech-hold)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'grunt-mech-hold) + (format #t "~1Treserve-mask: ~D~%" (-> obj reserve-mask)) + (format #t "~1Tlower-hold: ~D~%" (-> obj lower-hold)) + (format #t "~1Tgrunt-handle: ~D~%" (-> obj grunt-handle)) + (format #t "~1Ttimeout: ~D~%" (-> obj timeout)) + (format #t "~1Tlocal-pos: #~%" (-> obj local-pos)) + (format #t "~1Tlocal-rot: #~%" (-> obj local-rot)) + (format #t "~1Tlocal-mat: #~%" (-> obj local-mat)) + (format #t "~1Tworld-mat: #~%" (-> obj world-mat)) + (label cfg-4) + obj + ) + +;; definition of type grunt-mech-info +(deftype grunt-mech-info (basic) + ((reserved-mask uint8 :offset-assert 4) + (last-update-time time-frame :offset-assert 8) + (holds grunt-mech-hold 6 :inline :offset-assert 16) + ) + :method-count-assert 11 + :size-assert #x490 + :flag-assert #xb00000490 + (:methods + (grunt-mech-info-method-9 (_type_ int process symbol) symbol 9) + (grunt-mech-info-method-10 (_type_) none 10) + ) + ) + +;; definition for method 3 of type grunt-mech-info +(defmethod inspect grunt-mech-info ((obj grunt-mech-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Treserved-mask: ~D~%" (-> obj reserved-mask)) + (format #t "~1Tlast-update-time: ~D~%" (-> obj last-update-time)) + (format #t "~1Tholds[6] @ #x~X~%" (-> obj holds)) + (label cfg-4) + obj + ) + +;; definition for symbol *grunt-mech-info*, type grunt-mech-info +(define *grunt-mech-info* + (new 'static 'grunt-mech-info :holds (new 'static 'inline-array grunt-mech-hold 6 + (new 'static 'grunt-mech-hold + :reserve-mask #x11 + :lower-hold 4 + :local-pos (new 'static 'vector :x 163.84 :y 4874.24 :z 3522.56 :w 1.0) + :local-rot (new 'static 'vector :y 32768.0 :w 1.0) + ) + (new 'static 'grunt-mech-hold + :reserve-mask #x22 + :lower-hold 5 + :local-pos (new 'static 'vector :x 958.464 :y 4874.24 :z -2678.784 :w 1.0) + :local-rot (new 'static 'vector :w 1.0) + ) + (new 'static 'grunt-mech-hold + :reserve-mask #x4 + :lower-hold -1 + :local-pos (new 'static 'vector :x 3223.552 :y 4874.24 :z 217.088 :w 1.0) + :local-rot (new 'static 'vector :y 49152.0 :w 1.0) + ) + (new 'static 'grunt-mech-hold + :reserve-mask #x8 + :lower-hold -1 + :local-pos (new 'static 'vector :x -3170.304 :y 4874.24 :z 520.192 :w 1.0) + :local-rot (new 'static 'vector :y 16384.0 :w 1.0) + ) + (new 'static 'grunt-mech-hold + :reserve-mask #x11 + :lower-hold -1 + :local-pos (new 'static 'vector :x 516.096 :y 1929.216 :z 2449.408 :w 1.0) + :local-rot (new 'static 'vector :x -9975.308 :y 34955.266 :z -205.34613 :w 1.0) + ) + (new 'static 'grunt-mech-hold + :reserve-mask #x22 + :lower-hold -1 + :local-pos (new 'static 'vector :x 413.696 :y 1929.216 :z -1785.856 :w 1.0) + :local-rot (new 'static 'vector :x -10709.129 :y 1107.0122 :z 54.795376 :w 1.0) + ) + ) + ) + ) + +;; failed to figure out what this is: +(let ((gp-0 *grunt-mech-info*)) + (set! (-> gp-0 last-update-time) 0) + (set! (-> gp-0 reserved-mask) (the-as uint 0)) + (countdown (s5-0 6) + (let ((s4-0 (-> gp-0 holds s5-0))) + (set! (-> s4-0 grunt-handle) (the-as handle #f)) + (set! (-> s4-0 timeout) (the-as uint 0)) + (matrix-rotate-xyz! (-> s4-0 local-mat) (-> s4-0 local-rot)) + (set! (-> s4-0 local-mat trans quad) (-> s4-0 local-pos quad)) + ) + ) + ) + +;; definition for method 10 of type grunt-mech-info +;; WARN: Return type mismatch int vs none. +(defmethod grunt-mech-info-method-10 grunt-mech-info ((obj grunt-mech-info)) + (with-pp + (let ((s5-0 (-> pp clock frame-counter))) + (when (!= (-> obj last-update-time) s5-0) + (when (< s5-0 (-> obj last-update-time)) + (countdown (v1-4 6) + (let ((a0-4 (-> obj holds v1-4))) + (set! (-> a0-4 grunt-handle) (the-as handle #f)) + (set! (-> a0-4 timeout) (the-as uint 0)) + ) + 0 + ) + (set! (-> obj reserved-mask) (the-as uint 0)) + 0 + ) + (set! (-> obj last-update-time) s5-0) + (let ((v1-8 *target*)) + (cond + ((and v1-8 (logtest? (focus-status mech) (-> v1-8 focus-status))) + (let ((s4-0 (-> v1-8 manipy 0 node-list data 3))) + (dotimes (s3-0 6) + (let ((s2-0 (-> obj holds s3-0))) + (matrix*! (-> s2-0 world-mat) (-> s2-0 local-mat) (-> s4-0 bone transform)) + (vector-float*! (-> s2-0 world-mat trans) (-> s2-0 world-mat trans) (/ 1.0 (-> s2-0 world-mat trans w))) + (when (and (!= (-> s2-0 grunt-handle) #f) (>= s5-0 (the-as time-frame (-> s2-0 timeout)))) + (set! (-> s2-0 grunt-handle) (the-as handle #f)) + (logclear! (-> obj reserved-mask) (-> s2-0 reserve-mask)) + ) + ) + ) + ) + ) + (else + (countdown (v1-25 6) + (let ((a0-16 (-> obj holds v1-25))) + (set! (-> a0-16 grunt-handle) (the-as handle #f)) + (set! (-> a0-16 timeout) (the-as uint 0)) + ) + 0 + ) + (set! (-> obj reserved-mask) (the-as uint 0)) + 0 + ) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 9 of type grunt-mech-info +(defmethod grunt-mech-info-method-9 grunt-mech-info ((obj grunt-mech-info) (arg0 int) (arg1 process) (arg2 symbol)) + (with-pp + (grunt-mech-info-method-10 obj) + (let ((v1-2 *target*)) + (when (and v1-2 + (logtest? (focus-status mech) (-> v1-2 focus-status)) + (zero? (logand (-> v1-2 focus-status) (focus-status dead ignore))) + ) + (let ((v1-8 (-> obj holds arg0))) + (when (and (!= (-> v1-8 grunt-handle) #f) (= (handle->process (-> v1-8 grunt-handle)) arg1)) + (set! (-> v1-8 timeout) (the-as uint (+ (-> pp clock frame-counter) (seconds 0.5)))) + (return #t) + ) + (when (not (logtest? (-> obj reserved-mask) (-> v1-8 reserve-mask))) + (when (not arg2) + (logior! (-> obj reserved-mask) (-> v1-8 reserve-mask)) + (set! (-> v1-8 grunt-handle) (process->handle arg1)) + (set! (-> v1-8 timeout) (the-as uint (+ (-> pp clock frame-counter) (seconds 0.5)))) + ) + #t + ) + ) + ) + ) + ) + ) + +;; definition of type grunt-mech +(deftype grunt-mech (grunt) + ((hold-id int8 :offset-assert 692) + (dismount-dest vector :inline :offset-assert 704) + ) + :heap-base #x250 + :method-count-assert 196 + :size-assert #x2d0 + :flag-assert #xc4025002d0 + (:methods + (mech-lunge () _type_ :state 186) + (mech-hold () _type_ :state 187) + (mech-dismount () _type_ :state 188) + (mech-post-circling () _type_ :state 189) + (mech-pre-circling () _type_ :state 190) + (grunt-mech-method-191 (_type_) none 191) + (grunt-mech-method-192 (_type_) symbol 192) + (grunt-mech-method-193 (_type_) int 193) + (grunt-mech-method-194 (_type_) none 194) + (grunt-mech-method-195 (_type_ vector vector vector) symbol 195) + ) + ) + +;; definition for method 3 of type grunt-mech +(defmethod inspect grunt-mech ((obj grunt-mech)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type grunt inspect))) + (t9-0 obj) + ) + (format #t "~2Thold-id: ~D~%" (-> obj hold-id)) + (format #t "~2Tdismount-dest: #~%" (-> obj dismount-dest)) + (label cfg-4) + obj + ) + +;; definition for method 55 of type grunt-mech +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-55 grunt-mech ((obj grunt-mech)) + ((method-of-type grunt enemy-method-55) obj) + 0 + (none) + ) + +;; definition for method 193 of type grunt-mech +;; INFO: Used lq/sq +;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] +;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] +;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] +(defmethod grunt-mech-method-193 grunt-mech ((obj grunt-mech)) + (local-vars (f0-3 float) (sv-592 vector)) + (let ((s4-0 *grunt-mech-info*)) + (grunt-mech-info-method-10 s4-0) + (let ((gp-0 -1)) + (let ((f30-0 0.0) + (s3-0 (-> obj root-override2 trans)) + ) + (countdown (s2-0 4) + (let ((s1-0 (-> s4-0 holds s2-0))) + (when (grunt-mech-info-method-9 s4-0 s2-0 obj #t) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (set! sv-592 (new 'stack-no-clear 'vector)) + (set! (-> s0-0 quad) (-> s1-0 world-mat vector 2 quad)) + (set! (-> s0-0 y) 0.0) + (vector-normalize! s0-0 1.0) + (vector-! sv-592 (-> s1-0 world-mat trans) (-> obj root-override2 trans)) + (set! (-> sv-592 y) 0.0) + (vector-normalize! sv-592 1.0) + (let ((f0-2 (-> sv-592 x)) + (f1-0 (-> sv-592 y)) + (f2-0 (-> sv-592 z)) + (f3-0 (-> s0-0 x)) + (f4-0 (-> s0-0 y)) + (f5-0 (-> s0-0 z)) + ) + (.mula.s f0-2 f3-0) + (.madda.s f1-0 f4-0) + (.madd.s f0-3 f2-0 f5-0) + ) + ) + (when (>= f0-3 0.0) + (let ((f0-5 (vector-vector-distance-squared (-> s1-0 world-mat trans) s3-0))) + (when (or (= gp-0 -1) (< f0-5 f30-0)) + (set! f30-0 f0-5) + (set! gp-0 s2-0) + ) + ) + ) + ) + ) + ) + ) + (when (!= gp-0 -1) + (let ((s3-1 (-> s4-0 holds gp-0 lower-hold))) + (when (!= s3-1 -1) + (if (and (or (zero? (get-rand-int obj 2)) + (>= 14336.0 (vector-vector-xz-distance-squared (-> obj root-override2 trans) (target-pos 0))) + ) + (grunt-mech-info-method-9 s4-0 s3-1 obj #t) + ) + (set! gp-0 s3-1) + ) + ) + ) + (let ((a1-9 (new 'stack-no-clear 'collide-query))) + (set! (-> a1-9 start-pos quad) (-> obj root-override2 trans quad)) + (set! (-> a1-9 start-pos y) (+ 6144.0 (-> a1-9 start-pos y))) + (vector-! + (-> a1-9 move-dist) + (the-as vector (+ (the-as uint (-> s4-0 holds 0 world-mat trans)) (* 192 gp-0))) + (-> a1-9 start-pos) + ) + (let ((v1-41 a1-9)) + (set! (-> v1-41 radius) 2048.0) + (set! (-> v1-41 collide-with) (collide-spec backgnd obstacle hit-by-others-list pusher)) + (set! (-> v1-41 ignore-process0) obj) + (set! (-> v1-41 ignore-process1) #f) + (set! (-> v1-41 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-41 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* a1-9) 0.0) + (set! gp-0 -1) + ) + ) + ) + gp-0 + ) + ) + ) + +;; definition for method 184 of type grunt-mech +(defmethod grunt-method-184 grunt-mech ((obj grunt-mech) (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 (enemy-method-107 obj))) + (when gp-0 + (cond + ((logtest? (focus-status mech) (-> gp-0 focus-status)) + (let ((v1-4 (get-trans gp-0 0)) + (a1-2 (new 'stack-no-clear 'vector)) + ) + (vector-! a1-2 v1-4 (-> obj root-override2 trans)) + (.lvf vf1 (&-> a1-2 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 ((f0-0 v1-5) + (f1-0 28672.0) + ) + (when (>= (* f1-0 f1-0) f0-0) + (let ((a1-3 (grunt-mech-method-193 obj))) + (cond + ((= a1-3 -1) + (go (method-of-object obj mech-pre-circling)) + ) + (else + (set! (-> obj hold-id) a1-3) + (grunt-mech-info-method-9 *grunt-mech-info* a1-3 obj #f) + (go (method-of-object obj mech-lunge)) + ) + ) + ) + ) + ) + gp-0 + ) + (else + ((method-of-type grunt grunt-method-184) obj arg0) + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate mech-lunge (grunt-mech) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior grunt-mech) enemy-event-handler) + :enter (behavior () + (set! (-> self enemy-flags) (logior (enemy-flag actor-pause-backup) (-> self enemy-flags))) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-4 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (set! (-> self dismount-dest quad) (-> self root-override2 trans quad)) + (logclear! (-> self root-override2 nav-flags) (nav-flags has-root-sphere)) + (none) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (logior! (-> self root-override2 nav-flags) (nav-flags has-root-sphere)) + (none) + ) + :trans (behavior () + (grunt-mech-info-method-9 *grunt-mech-info* (-> self hold-id) self #f) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.07)) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (quaternion-copy! (the-as quaternion (-> gp-0 vector)) (-> self root-override2 quat)) + (set! (-> gp-0 vector 1 quad) (-> self root-override2 trans quad)) + (ja-no-eval :group! (-> self draw art-group data 48) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 48)) frames num-frames) -1)) + 0.769 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (let ((s5-0 *grunt-mech-info*)) + (grunt-mech-info-method-10 s5-0) + (let ((s5-1 (-> s5-0 holds (-> self hold-id)))) + (matrix->quaternion (the-as quaternion (-> gp-0 vector 2)) (-> s5-1 world-mat)) + (let ((f30-0 (lerp-scale 0.0 1.0 (ja-aframe-num 0) 0.0 6.0))) + (quaternion-slerp! + (-> self root-override2 quat) + (the-as quaternion (-> gp-0 vector)) + (the-as quaternion (-> gp-0 vector 2)) + f30-0 + ) + (vector-lerp! (-> self root-override2 trans) (-> gp-0 vector 1) (-> s5-1 world-mat trans) f30-0) + ) + ) + ) + (suspend) + (ja :num! (seek! max 0.769)) + ) + ) + (go-virtual mech-hold) + (none) + ) + :post (the-as (function none :behavior grunt-mech) nav-enemy-simple-post) + ) + +;; definition for function grunt-mech-hold-post +;; INFO: Used lq/sq +(defbehavior grunt-mech-hold-post grunt-mech () + (let ((gp-0 *grunt-mech-info*)) + (grunt-mech-info-method-10 gp-0) + (let ((v1-5 (-> gp-0 holds (-> self hold-id))) + (a0-2 (-> self root-override2)) + ) + (set! (-> a0-2 trans quad) (-> v1-5 world-mat trans quad)) + (matrix->quaternion (-> a0-2 quat) (-> v1-5 world-mat)) + ) + ) + (nav-enemy-simple-post) + (none) + ) + +;; definition for method 195 of type grunt-mech +;; INFO: Used lq/sq +(defmethod grunt-mech-method-195 grunt-mech ((obj grunt-mech) (arg0 vector) (arg1 vector) (arg2 vector)) + (local-vars (v1-13 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-avoid-spheres-params))) + (vector-! (-> s5-0 current-pos) (-> obj root-override2 trans) (-> obj nav state mesh bounds)) + (vector-normalize-copy! (-> s5-0 travel) arg0 (the-as float arg1)) + (set! (-> s5-0 pref-dir quad) (-> s5-0 travel quad)) + (avoid-spheres-1! (-> obj nav) s5-0) + (when (>= (fabs (vector-dot (the-as vector (-> s5-0 out-travel)) arg2)) 0.0) + (let ((t0-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-no-gaps + (-> obj nav) + (-> obj root-override2 trans) + (-> obj nav state current-poly) + (the-as vector (-> s5-0 out-travel)) + t0-0 + ) + ) + (.lvf vf1 (&-> (-> s5-0 out-travel) 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-13 vf1) + (let ((f0-3 v1-13) + (f1-1 14336.0) + ) + (when (>= f0-3 (* f1-1 f1-1)) + (let ((a1-3 (new 'stack-no-clear 'vector))) + (set! (-> a1-3 quad) (-> s5-0 out-travel 0 quad)) + (set! (-> a1-3 w) (-> obj nav-radius-backup)) + (when (not (add-root-sphere-to-hash! (-> obj nav) a1-3 #x80068)) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (vector+! s4-1 (-> obj root-override2 trans) (the-as vector (-> s5-0 out-travel))) + (let ((s5-1 (new 'stack-no-clear 'collide-query))) + (when (enemy-method-126 obj s5-1 s4-1 (the-as collide-spec (-> obj gnd-collide)) 4096.0 122880.0 1024.0) + (set! (-> s4-1 y) (-> s5-1 best-other-tri intersect y)) + (set! (-> obj dismount-dest quad) (-> s4-1 quad)) + #t + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 192 of type grunt-mech +(defmethod grunt-mech-method-192 grunt-mech ((obj grunt-mech)) + (do-navigation-to-destination (-> obj nav state) (-> obj root-override2 trans)) + (let ((a1-1 *target*)) + (if (or (not a1-1) (zero? (logand (focus-status mech) (-> a1-1 focus-status)))) + (return #t) + ) + ) + (when (logtest? (-> obj nav state flags) (nav-state-flag in-mesh)) + (let ((s5-0 *grunt-mech-info*)) + (grunt-mech-info-method-10 s5-0) + (let* ((v1-15 (-> obj nav)) + (a0-7 (-> v1-15 state mesh sphere-hash sphere-array)) + (a1-3 (-> v1-15 sphere-id-array)) + (a2-1 (-> v1-15 state mesh bounds)) + (a3-0 (-> v1-15 root-nav-sphere)) + (t0-0 (-> v1-15 sphere-count)) + ) + (dotimes (t1-0 t0-0) + (let ((t3-0 (-> a0-7 (-> a1-3 t1-0))) + (t2-4 (-> v1-15 sphere-array t1-0)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) a2-1) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-0 w))) + ) + ) + ) + 0 + (let ((v1-22 (-> s5-0 holds (-> obj hold-id))) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (vector-negate! s5-1 (-> v1-22 world-mat vector 2)) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (countdown (s4-0 3) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-rotate-around-y! s3-0 s5-1 (get-rand-float-range obj -10922.667 10922.667)) + (when (grunt-mech-method-195 obj s3-0 (the-as vector (get-rand-float-range obj 16384.0 24576.0)) s5-1) + #t + (goto cfg-16) + ) + ) + ) + ) + ) + ) + (label cfg-16) + (let ((a0-15 (-> obj root-override2 trans))) + (if (or (>= 0.0 (- (-> a0-15 y) (-> obj dismount-dest y))) + (let ((f0-4 40960.0)) + (< (* f0-4 f0-4) (vector-vector-xz-distance-squared a0-15 (-> obj dismount-dest))) + ) + ) + (return #t) + ) + ) + #f + ) + +;; definition for method 194 of type grunt-mech +;; WARN: Return type mismatch object vs none. +(defmethod grunt-mech-method-194 grunt-mech ((obj grunt-mech)) + (with-pp + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer pp)) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'attack) + (set! (-> a1-0 param 0) (the-as uint #f)) + (let ((v1-3 (new 'static 'attack-info :mask (attack-info-mask mode id)))) + (let* ((a0-2 *game-info*) + (a2-1 (+ (-> a0-2 attack-id) 1)) + ) + (set! (-> a0-2 attack-id) a2-1) + (set! (-> v1-3 id) a2-1) + ) + (set! (-> v1-3 mode) 'grunt) + (set! (-> a1-0 param 1) (the-as uint v1-3)) + ) + (send-event-function *target* a1-0) + ) + (none) + ) + ) + +;; definition for method 191 of type grunt-mech +;; WARN: Return type mismatch object vs none. +(defmethod grunt-mech-method-191 grunt-mech ((obj grunt-mech)) + (with-pp + (if (>= (-> pp clock frame-counter) (the-as time-frame (-> obj state-timeout))) + (go (method-of-object obj mech-dismount)) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate mech-hold (grunt-mech) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior grunt-mech) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self enemy-flags) (logior (enemy-flag actor-pause-backup) (-> self enemy-flags))) + (set! (-> self root-override2 root-prim prim-core collide-as) (collide-spec)) + (enemy-method-110 self) + (set! (-> self state-timeout) + (the-as uint (+ (-> self clock frame-counter) (get-rand-int-range self 450 900))) + ) + (logclear! (-> self root-override2 nav-flags) (nav-flags has-root-sphere)) + (none) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (let ((v1-3 (-> self root-override2 root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root-override2 backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root-override2 backup-collide-with)) + ) + (logior! (-> self root-override2 nav-flags) (nav-flags has-root-sphere)) + (none) + ) + :trans (behavior () + (if (or (not (grunt-mech-info-method-9 *grunt-mech-info* (-> self hold-id) self #f)) (grunt-mech-method-192 self)) + (go-virtual mech-dismount) + ) + (none) + ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 49) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 49)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (grunt-mech-method-191 self) + (let ((gp-0 0)) + 0 + (until #f + (set! gp-0 (enemy-method-120 self 3 (ash 1 gp-0))) + (let ((v1-30 gp-0)) + (cond + ((zero? v1-30) + (ja-channel-push! 1 (seconds 0.13)) + (countdown (s5-0 (get-rand-int-range self 1 2)) + (let ((s4-0 #t)) + (ja-no-eval :group! (-> self draw art-group data 51) :num! (seek! (ja-aframe 17.0 0) 0.222) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 17.0 0) 0.222)) + ) + (ja-no-eval :group! (-> self draw art-group data 51) + :num! (seek! (ja-aframe 20.0 0)) + :frame-num (ja-aframe 17.0 0) + ) + (until (ja-done? 0) + (when (and s4-0 (>= (ja-aframe-num 0) 18.5)) + (grunt-mech-method-194 self) + (set! s4-0 #f) + ) + (suspend) + (ja :num! (seek! (ja-aframe 20.0 0))) + ) + ) + (grunt-mech-method-191 self) + ) + ) + ((= v1-30 1) + (ja-channel-push! 1 (seconds 0.13)) + (countdown (s5-1 (get-rand-int-range self 1 3)) + (let ((s4-1 #t)) + (ja-no-eval :group! (-> self draw art-group data 52) :num! (seek! (ja-aframe 24.0 0) 0.568) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 24.0 0) 0.568)) + ) + (ja-no-eval :group! (-> self draw art-group data 52) + :num! (seek! (ja-aframe 28.0 0) 2.0) + :frame-num (ja-aframe 24.0 0) + ) + (until (ja-done? 0) + (when (and s4-1 (>= (ja-aframe-num 0) 27.0)) + (grunt-mech-method-194 self) + (set! s4-1 #f) + ) + (suspend) + (ja :num! (seek! (ja-aframe 28.0 0) 2.0)) + ) + ) + (grunt-mech-method-191 self) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.13)) + (countdown (s5-2 (get-rand-int-range self 1 3)) + (let ((s4-2 #t)) + (ja-no-eval :group! (-> self draw art-group data 53) :num! (seek! (ja-aframe 30.0 0) 0.111) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 30.0 0) 0.111)) + ) + (ja-no-eval :group! (-> self draw art-group data 53) + :num! (seek! (ja-aframe 32.0 0) 0.5) + :frame-num (ja-aframe 30.0 0) + ) + (until (ja-done? 0) + (when (and s4-2 (>= (ja-aframe-num 0) 31.0)) + (grunt-mech-method-194 self) + (set! s4-2 #f) + ) + (suspend) + (ja :num! (seek! (ja-aframe 32.0 0) 0.5)) + ) + ) + (grunt-mech-method-191 self) + ) + ) + ) + ) + (when (= (get-rand-int self 4) 3) + (ja-channel-push! 1 (seconds 0.13)) + (ja-no-eval :group! (-> self draw art-group data 50) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 50)) frames num-frames) -1)) + 0.090909 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.090909)) + ) + (grunt-mech-method-191 self) + ) + ) + ) + #f + (none) + ) + :post grunt-mech-hold-post + ) + +;; failed to figure out what this is: +(defstate mech-dismount (grunt-mech) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior grunt-mech) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self root-override2 root-prim prim-core collide-as) (collide-spec)) + (let* ((v1-4 (-> self nav)) + (a1-0 (-> self dismount-dest)) + (f0-0 (-> v1-4 extra-nav-sphere w)) + ) + (set! (-> v1-4 extra-nav-sphere quad) (-> a1-0 quad)) + (set! (-> v1-4 extra-nav-sphere w) f0-0) + ) + 0 + (let ((v1-7 (-> self nav))) + (set! (-> v1-7 extra-nav-sphere w) (-> self nav-radius-backup)) + ) + 0 + (let ((v1-9 (-> self nav))) + (logior! (-> v1-9 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (logclear! (-> self root-override2 nav-flags) (nav-flags has-root-sphere)) + (none) + ) + :exit (behavior () + (let ((v1-1 (-> self root-override2 root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self root-override2 backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self root-override2 backup-collide-with)) + ) + (let ((v1-2 (-> self nav))) + (logclear! (-> v1-2 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (logior! (-> self root-override2 nav-flags) (nav-flags has-root-sphere)) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.07)) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (vector-! (-> gp-0 vector 1) (-> self root-override2 trans) (-> self dismount-dest)) + (set! (-> gp-0 vector 1 y) 0.0) + (vector-normalize! (-> gp-0 vector 1) 1.0) + (quaternion-look-at! (the-as quaternion (-> gp-0 vector 2)) (-> gp-0 vector 1) *up-vector*) + (quaternion-copy! (the-as quaternion (-> gp-0 vector)) (-> self root-override2 quat)) + (set! (-> gp-0 vector 1 quad) (-> self root-override2 trans quad)) + (ja-no-eval :group! (-> self draw art-group data 54) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 54)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (let ((f30-0 (lerp-scale 0.0 1.0 (ja-aframe-num 0) 33.0 41.0))) + (quaternion-slerp! + (-> self root-override2 quat) + (the-as quaternion (-> gp-0 vector)) + (the-as quaternion (-> gp-0 vector 2)) + f30-0 + ) + (vector-lerp! (-> self root-override2 trans) (-> gp-0 vector 1) (-> self dismount-dest) f30-0) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((v1-32 (-> self root-override2 root-prim))) + (set! (-> v1-32 prim-core collide-as) (-> self root-override2 backup-collide-as)) + (set! (-> v1-32 prim-core collide-with) (-> self root-override2 backup-collide-with)) + ) + (let ((v1-33 (-> self nav))) + (logclear! (-> v1-33 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (let ((v1-37 (-> self nav state))) + (set! (-> v1-37 current-poly) (the-as nav-poly #f)) + ) + 0 + (logclear! (-> self nav state flags) (nav-state-flag at-target)) + (ja-no-eval :group! (-> self draw art-group data 55) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 55)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.13)) + (go-virtual mech-post-circling) + (none) + ) + :post (the-as (function none :behavior grunt-mech) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate mech-post-circling (grunt-mech) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior grunt-mech) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type grunt circling) enter)) + (set! (-> self state-timeout) + (the-as uint (+ (-> self clock frame-counter) (get-rand-int-range self 750 1200))) + ) + (none) + ) + :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 (enemy-method-107 self))) + (set! (-> self starting-time) (the-as uint (-> self clock frame-counter))) + ) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self reaction-time))) + (when (>= 1 (the-as int gp-1)) + (nav-enemy-method-161 self) + (if (-> self enemy-info-override use-stop-chase) + (go-virtual stop-chase) + (go-virtual active) + ) + ) + (when (= gp-1 (enemy-aware enemy-aware-3)) + (let ((v1-33 (enemy-method-107 self))) + (when v1-33 + (cond + ((logtest? (focus-status mech) (-> v1-33 focus-status)) + (when (>= (-> self clock frame-counter) (the-as time-frame (-> self state-timeout))) + (nav-enemy-method-161 self) + (go-hostile self) + ) + ) + (else + (when (>= (- (-> self clock frame-counter) (the-as int (-> self starting-time))) + (the-as time-frame (-> self reaction-time)) + ) + (nav-enemy-method-161 self) + (go-hostile self) + ) + ) + ) + ) + ) + ) + (if (= gp-1 (enemy-aware enemy-aware-2)) + (go-stare self) + ) + (if (or (nav-enemy-method-163 self) (logtest? (enemy-flag enemy-flag41) (-> self enemy-flags))) + (go-stare2 self) + ) + ) + ) + (none) + ) + :code (-> (method-of-type grunt circling) code) + :post (-> (method-of-type grunt circling) post) + ) + +;; failed to figure out what this is: +(defstate mech-pre-circling (grunt-mech) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior grunt-mech) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type grunt-mech mech-post-circling) enter)) + (set! (-> self state-timeout) + (the-as uint (+ (-> self clock frame-counter) (get-rand-int-range self 900 1800))) + ) + (none) + ) + :trans (-> (method-of-type grunt-mech mech-post-circling) trans) + :code (-> (method-of-type grunt-mech mech-post-circling) code) + :post (-> (method-of-type grunt-mech mech-post-circling) post) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/city/common/vehicle-effects_REF.gc b/test/decompiler/reference/jak2/levels/city/common/vehicle-effects_REF.gc index 5d7f5f32e6..9056fd62ba 100644 --- a/test/decompiler/reference/jak2/levels/city/common/vehicle-effects_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/vehicle-effects_REF.gc @@ -193,7 +193,7 @@ :color (new 'static 'rgbaf :x 255.0 :y 128.0 :w 16.0) :fade-a -0.0000122044 :fade-b 8.997864 - :tex-id #xc0bb00 + :tex-id (new 'static 'texture-id :index #xbb :page #xc) ) ) @@ -206,7 +206,7 @@ :color (new 'static 'rgbaf :x 255.0 :y 64.0 :w 16.0) :fade-a -0.0000122044 :fade-b 8.997864 - :tex-id #xc0bc00 + :tex-id (new 'static 'texture-id :index #xbc :page #xc) ) ) @@ -218,7 +218,7 @@ :color (new 'static 'rgbaf :x 255.0 :y 64.0 :w 16.0) :fade-a -0.0000122044 :fade-b 8.997864 - :tex-id #xc0ca00 + :tex-id (new 'static 'texture-id :index #xca :page #xc) ) ) @@ -273,11 +273,7 @@ (set! (-> s3-1 1 normal w) f0-14) (set! (-> s3-1 1 normal x) (* 0.025 f0-14)) ) - *simple-sprite-system* - (let ((t9-4 (method-of-type simple-sprite-system add!))) - (-> s3-1 1) - (t9-4) - ) + (add! *simple-sprite-system* (the-as dma-buffer (-> s3-1 1))) (forward-up->quaternion (the-as quaternion (-> s3-1 0)) arg1 (the-as vector (-> obj rbody state matrix))) (quaternion-rotate-local-x! (the-as quaternion (-> s3-1 0)) (the-as quaternion (-> s3-1 0)) 32768.0) (let ((v1-16 (-> s3-1 0 normal))) @@ -394,8 +390,7 @@ (set! (-> s4-0 color x) 255.0) (set! (-> s4-0 color y) (rand-vu-float-range 192.0 255.0)) (set! (-> s4-0 color w) (* f30-1 (rand-vu-float-range 16.0 18.0))) - *simple-sprite-system* - ((method-of-type simple-sprite-system add!)) + (add! *simple-sprite-system* (the-as dma-buffer s4-0)) (let ((f0-21 (-> obj camera-dist2)) (f1-6 245760.0) ) @@ -408,8 +403,7 @@ (set! (-> s4-0 fade-b) 2.3332994) (set! (-> s4-0 color z) (rand-vu-float-range 128.0 160.0)) (set! (-> s4-0 color w) (* f30-1 (rand-vu-float-range 32.0 36.0))) - *simple-sprite-system* - ((method-of-type simple-sprite-system add!)) + (add! *simple-sprite-system* (the-as dma-buffer s4-0)) ) ) ) @@ -429,8 +423,7 @@ (set! (-> s4-1 rot-angle) (* 182.04445 (rand-vu-float-range -4.0 4.0))) (set! (-> s4-1 color y) (* 64.0 (rand-vu))) (set! (-> s4-1 color w) (* f30-1 (rand-vu-float-range 16.0 21.0))) - *simple-sprite-system* - ((method-of-type simple-sprite-system add!)) + (add! *simple-sprite-system* (the-as dma-buffer s4-1)) ) ) ) @@ -602,7 +595,3 @@ (none) ) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc index 53a8e5e823..204b88ff2c 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc @@ -206,109 +206,115 @@ ) ;; definition for symbol *amphibian-nav-enemy-info*, type nav-enemy-info -(define *amphibian-nav-enemy-info* (new 'static 'nav-enemy-info - :use-die-falling #t - :use-victory #f - :use-jump-blocked #t - :debug-draw-neck #f - :jump-debug-draw #f - :move-to-ground #t - :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1010401 #x0 #x0 #x0) - :idle-anim 4 - :notice-anim 28 - :hostile-anim 26 - :hit-anim 6 - :knocked-anim 6 - :knocked-land-anim 7 - :die-anim 12 - :die-falling-anim 21 - :victory-anim -1 - :jump-wind-up-anim 30 - :jump-in-air-anim 31 - :jump-land-anim 32 - :neck-joint 11 - :look-at-joint 12 - :bullseye-joint 4 - :sound-hit (static-sound-name "amphibian-hit") - :sound-die (static-sound-name "amphibian-die") - :notice-distance (meters 40) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 20) - :default-hit-points 4 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #x11fffdffa - :movement-gravity (meters -100) - :friction 0.8 - :attack-shove-back (meters 3.5) - :attack-shove-up (meters 2) - :attack-mode 'generic - :attack-damage 1 - :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) - :jump-height-min (meters 3) - :jump-height-factor 0.5 - :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 106496.0 - :knocked-soft-vxz-hi 94208.0 - :knocked-soft-vy-lo 122880.0 - :knocked-soft-vy-hi 139264.0 - :knocked-medium-vxz-lo 106496.0 - :knocked-medium-vxz-hi 94208.0 - :knocked-medium-vy-lo 122880.0 - :knocked-medium-vy-hi 139264.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 - :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) - :callback-info #f - :use-momentum #t - :use-frustration #t - :use-stop-chase #t - :use-circling #t - :use-pacing #t - :walk-anim 16 - :turn-anim -1 - :run-anim 26 - :taunt-anim -1 - :run-travel-speed (meters 6) - :run-acceleration (meters 8) - :run-turning-acceleration (meters 10) - :walk-travel-speed (meters 3) - :walk-acceleration (meters 4) - :walk-turning-acceleration (meters 3) - :maximum-rotation-rate (degrees 180.0) - :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 - ) - ) +(define *amphibian-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #t + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 28 + :hostile-anim 26 + :hit-anim 6 + :knocked-anim 6 + :knocked-land-anim 7 + :die-anim 12 + :die-falling-anim 21 + :victory-anim -1 + :jump-wind-up-anim 30 + :jump-in-air-anim 31 + :jump-land-anim 32 + :neck-joint 11 + :look-at-joint 12 + :bullseye-joint 4 + :sound-hit (static-sound-name "amphibian-hit") + :sound-die (static-sound-name "amphibian-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 4 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #x11fffdffa + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 1 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 106496.0 + :knocked-soft-vxz-hi 94208.0 + :knocked-soft-vy-lo 122880.0 + :knocked-soft-vy-hi 139264.0 + :knocked-medium-vxz-lo 106496.0 + :knocked-medium-vxz-hi 94208.0 + :knocked-medium-vy-lo 122880.0 + :knocked-medium-vy-hi 139264.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 + :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) + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #t + :use-circling #t + :use-pacing #t + :walk-anim 16 + :turn-anim -1 + :run-anim 26 + :taunt-anim -1 + :run-travel-speed (meters 6) + :run-acceleration (meters 8) + :run-turning-acceleration (meters 10) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 4) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 180.0) + :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! (-> *amphibian-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/baby_spider/tomb-baby-spider_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/baby_spider/tomb-baby-spider_REF.gc index 9999c508de..06a2cf9b2f 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/baby_spider/tomb-baby-spider_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/baby_spider/tomb-baby-spider_REF.gc @@ -44,7 +44,12 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1e0002 #x64640401 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x64 :param1 #x64) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 4 :notice-anim 5 :hostile-anim 8 diff --git a/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc index cd98b584bf..97bcb726a5 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc @@ -114,109 +114,115 @@ ) ;; definition for symbol *fodder-nav-enemy-info*, type nav-enemy-info -(define *fodder-nav-enemy-info* (new 'static 'nav-enemy-info - :use-die-falling #t - :use-victory #f - :use-jump-blocked #t - :debug-draw-neck #f - :jump-debug-draw #f - :move-to-ground #t - :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1010401 #x0 #x0 #x0) - :idle-anim 6 - :notice-anim 13 - :hostile-anim 7 - :hit-anim 13 - :knocked-anim 16 - :knocked-land-anim 17 - :die-anim 14 - :die-falling-anim 21 - :victory-anim 6 - :jump-wind-up-anim 7 - :jump-in-air-anim 7 - :jump-land-anim 7 - :neck-joint 5 - :look-at-joint 5 - :bullseye-joint 4 - :sound-hit (static-sound-name "fodder-hit") - :sound-die (static-sound-name "fodder-die") - :notice-distance (meters 40) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 40) - :default-hit-points 1 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #x11fffdffa - :movement-gravity (meters -100) - :friction 0.8 - :attack-shove-back (meters 3) - :attack-shove-up (meters 2) - :attack-mode 'generic - :attack-damage 1 - :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) - :jump-height-min (meters 3) - :jump-height-factor 0.5 - :knocked-seek-ry-clamp 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 - :shadow-size (meters 2) - :shadow-max-y (meters 1) - :shadow-min-y (meters -1) - :shadow-locus-dist (meters 150) - :gem-joint -1 - :gem-offset (new 'static 'sphere :r 163840.0) - :callback-info #f - :use-momentum #f - :use-frustration #t - :use-stop-chase #f - :use-circling #t - :use-pacing #t - :walk-anim 12 - :turn-anim 7 - :run-anim 7 - :taunt-anim -1 - :run-travel-speed (meters 7.5) - :run-acceleration (meters 1) - :run-turning-acceleration (meters 100) - :walk-travel-speed (meters 4) - :walk-acceleration (meters 1) - :walk-turning-acceleration (meters 3) - :maximum-rotation-rate (degrees 360.0) - :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 - ) - ) +(define *fodder-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #t + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 6 + :notice-anim 13 + :hostile-anim 7 + :hit-anim 13 + :knocked-anim 16 + :knocked-land-anim 17 + :die-anim 14 + :die-falling-anim 21 + :victory-anim 6 + :jump-wind-up-anim 7 + :jump-in-air-anim 7 + :jump-land-anim 7 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :sound-hit (static-sound-name "fodder-hit") + :sound-die (static-sound-name "fodder-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 40) + :default-hit-points 1 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #x11fffdffa + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 1 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 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 + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 12 + :turn-anim 7 + :run-anim 7 + :taunt-anim -1 + :run-travel-speed (meters 7.5) + :run-acceleration (meters 1) + :run-turning-acceleration (meters 100) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 360.0) + :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! (-> *fodder-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc index 6d6ac78a3b..9b387aa59e 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc @@ -127,109 +127,115 @@ ) ;; definition for symbol *crimson-guard-level-info*, type nav-enemy-info -(define *crimson-guard-level-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 'array uint32 4 #x1010401 #x0 #x0 #x0) - :idle-anim 4 - :notice-anim 7 - :hostile-anim 6 - :hit-anim 4 - :knocked-anim 8 - :knocked-land-anim 9 - :die-anim 17 - :die-falling-anim 39 - :victory-anim 4 - :jump-wind-up-anim 5 - :jump-in-air-anim 5 - :jump-land-anim 5 - :neck-joint 6 - :look-at-joint 6 - :bullseye-joint 5 - :sound-hit (static-sound-name "guard-hit") - :sound-die (static-sound-name "guard-die") - :notice-distance (meters 150) - :notice-distance-delta (meters 40) - :proximity-notice-distance (meters 4) - :default-hit-points 4 - :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list pusher) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #xffffffffffffffff - :movement-gravity (meters -100) - :friction 0.5 - :attack-shove-back (meters 3) - :attack-shove-up (meters 2) - :attack-mode 'generic - :attack-damage 2 - :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) - :jump-height-min (meters 3) - :jump-height-factor 0.5 - :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 53248.0 - :knocked-soft-vy-lo 61440.0 - :knocked-soft-vy-hi 61440.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 40960.0 - :knocked-hard-vxz-hi 61440.0 - :knocked-hard-vy-lo 98304.0 - :knocked-hard-vy-hi 106496.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 32768.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 32768.0 - :knocked-yellow-vy-hi 49152.0 - :knocked-red-vxz-lo 65536.0 - :knocked-red-vxz-hi 81920.0 - :knocked-red-vy-lo 61440.0 - :knocked-red-vy-hi 61440.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 - :shadow-size (meters 2) - :shadow-max-y (meters 1) - :shadow-min-y (meters -1) - :shadow-locus-dist (meters 150) - :gem-joint -1 - :gem-offset (new 'static 'sphere :r 163840.0) - :callback-info #f - :use-momentum #f - :use-frustration #t - :use-stop-chase #f - :use-circling #f - :use-pacing #f - :walk-anim 5 - :turn-anim 5 - :run-anim 6 - :taunt-anim -1 - :run-travel-speed (meters 12) - :run-acceleration (meters 2) - :run-turning-acceleration (meters 50) - :walk-travel-speed (meters 3) - :walk-acceleration (meters 1) - :walk-turning-acceleration (meters 8) - :maximum-rotation-rate (degrees 720.0) - :notice-nav-radius (meters 5) - :frustration-distance (meters 8) - :frustration-time (seconds 2) - :blocked-time (seconds 0.3) - :circle-dist-lo 20480.0 - :circle-dist-hi 61440.0 - :nav-mesh #f - ) - ) +(define *crimson-guard-level-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 7 + :hostile-anim 6 + :hit-anim 4 + :knocked-anim 8 + :knocked-land-anim 9 + :die-anim 17 + :die-falling-anim 39 + :victory-anim 4 + :jump-wind-up-anim 5 + :jump-in-air-anim 5 + :jump-land-anim 5 + :neck-joint 6 + :look-at-joint 6 + :bullseye-joint 5 + :sound-hit (static-sound-name "guard-hit") + :sound-die (static-sound-name "guard-die") + :notice-distance (meters 150) + :notice-distance-delta (meters 40) + :proximity-notice-distance (meters 4) + :default-hit-points 4 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list pusher) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #xffffffffffffffff + :movement-gravity (meters -100) + :friction 0.5 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 53248.0 + :knocked-soft-vy-lo 61440.0 + :knocked-soft-vy-hi 61440.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 40960.0 + :knocked-hard-vxz-hi 61440.0 + :knocked-hard-vy-lo 98304.0 + :knocked-hard-vy-hi 106496.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 32768.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 32768.0 + :knocked-yellow-vy-hi 49152.0 + :knocked-red-vxz-lo 65536.0 + :knocked-red-vxz-hi 81920.0 + :knocked-red-vy-lo 61440.0 + :knocked-red-vy-hi 61440.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 65536.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 5 + :turn-anim 5 + :run-anim 6 + :taunt-anim -1 + :run-travel-speed (meters 12) + :run-acceleration (meters 2) + :run-turning-acceleration (meters 50) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 720.0) + :notice-nav-radius (meters 5) + :frustration-distance (meters 8) + :frustration-time (seconds 2) + :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! (-> *crimson-guard-level-info* fact-defaults) *crimson-guard-fact*) @@ -244,7 +250,12 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1010401 #x0 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 4 :notice-anim 7 :hostile-anim 6 @@ -353,7 +364,12 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1010401 #x0 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 4 :notice-anim 7 :hostile-anim 6 @@ -462,7 +478,12 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1010401 #x0 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 4 :notice-anim 7 :hostile-anim 6 @@ -571,7 +592,12 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1010401 #x0 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 4 :notice-anim 7 :hostile-anim 6 diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc index 94f3db14af..6aeb3c8f4b 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc @@ -228,7 +228,16 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 8 #x5010401 #x1010501 #x5010401 #x1010601 #x0 #x0 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 8 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x5) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x5) + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 4 :notice-anim 7 :hostile-anim 4 diff --git a/test/decompiler/reference/jak2/levels/common/enemy/metalhead_bearer/centurion_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/metalhead_bearer/centurion_REF.gc index abd876a450..cecef09d19 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/metalhead_bearer/centurion_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/metalhead_bearer/centurion_REF.gc @@ -321,111 +321,117 @@ ) ;; definition for symbol *centurion-nav-enemy-info*, type nav-enemy-info -(define *centurion-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 'array uint32 4 #x1010601 #x0 #x0 #x0) - :idle-anim 6 - :notice-anim 8 - :hostile-anim 13 - :hit-anim 16 - :knocked-anim 21 - :knocked-land-anim 22 - :die-anim 34 - :die-falling-anim 23 - :victory-anim 4 - :jump-wind-up-anim -1 - :jump-in-air-anim -1 - :jump-land-anim -1 - :neck-joint 8 - :look-at-joint 8 - :bullseye-joint 5 - :sound-hit (static-sound-name "centurion-hit") - :sound-die (static-sound-name "centurion-die") - :notice-distance (meters 100) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 100) - :default-hit-points 3 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #xffffffffffffffff - :movement-gravity (meters -100) - :friction 0.1 - :attack-shove-back (meters 3) - :attack-shove-up (meters 2) - :attack-mode 'generic - :attack-damage 2 - :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) - :jump-height-min (meters 3) - :jump-height-factor 0.5 - :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 65536.0 - :knocked-soft-vy-lo 32768.0 - :knocked-soft-vy-hi 49152.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 16384.0 - :knocked-yellow-vxz-hi 32768.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 20480.0 - :knocked-blue-vy-hi 40960.0 - :shadow-size (meters 1) - :shadow-max-y (meters 1) - :shadow-min-y (meters -1) - :shadow-locus-dist (meters 150) - :gem-joint 8 - :gem-seg #x2 - :gem-no-seg #x4 - :gem-offset (new 'static 'sphere :y 1843.2 :z 1146.88 :r 163840.0) - :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 -1 - :taunt-anim -1 - :run-travel-speed (meters 6) - :run-acceleration (meters 1) - :run-turning-acceleration (meters 2) - :walk-travel-speed (meters 1.8) - :walk-acceleration (meters 1) - :walk-turning-acceleration (meters 16) - :maximum-rotation-rate (degrees 720.0) - :notice-nav-radius (meters 100) - :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 - ) - ) +(define *centurion-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 6 + :notice-anim 8 + :hostile-anim 13 + :hit-anim 16 + :knocked-anim 21 + :knocked-land-anim 22 + :die-anim 34 + :die-falling-anim 23 + :victory-anim 4 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 8 + :look-at-joint 8 + :bullseye-joint 5 + :sound-hit (static-sound-name "centurion-hit") + :sound-die (static-sound-name "centurion-die") + :notice-distance (meters 100) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 100) + :default-hit-points 3 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #xffffffffffffffff + :movement-gravity (meters -100) + :friction 0.1 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 65536.0 + :knocked-soft-vy-lo 32768.0 + :knocked-soft-vy-hi 49152.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 16384.0 + :knocked-yellow-vxz-hi 32768.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 20480.0 + :knocked-blue-vy-hi 40960.0 + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 8 + :gem-seg #x2 + :gem-no-seg #x4 + :gem-offset (new 'static 'sphere :y 1843.2 :z 1146.88 :r 163840.0) + :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 -1 + :taunt-anim -1 + :run-travel-speed (meters 6) + :run-acceleration (meters 1) + :run-turning-acceleration (meters 2) + :walk-travel-speed (meters 1.8) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 16) + :maximum-rotation-rate (degrees 720.0) + :notice-nav-radius (meters 100) + :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! (-> *centurion-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/metalhead_brown/metalmonk_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/metalhead_brown/metalmonk_REF.gc index 463bdd864e..5845b1b48f 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/metalhead_brown/metalmonk_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/metalhead_brown/metalmonk_REF.gc @@ -125,109 +125,115 @@ ) ;; definition for symbol *metalmonk-nav-enemy-info*, type nav-enemy-info -(define *metalmonk-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 'array uint32 4 #x1010501 #x0 #x0 #x0) - :idle-anim 5 - :notice-anim 10 - :hostile-anim 12 - :hit-anim -1 - :knocked-anim 16 - :knocked-land-anim 17 - :die-anim 32 - :die-falling-anim 33 - :victory-anim 22 - :jump-wind-up-anim 12 - :jump-in-air-anim 12 - :jump-land-anim 12 - :neck-joint 7 - :look-at-joint 7 - :bullseye-joint 4 - :sound-hit (static-sound-name "metalmonk-hit") - :sound-die (static-sound-name "metalmonk-die") - :notice-distance (meters 40) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 40) - :default-hit-points 4 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #xffffffffffffffff - :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) - :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 - :shadow-size (meters 2) - :shadow-max-y (meters 1) - :shadow-min-y (meters -1) - :shadow-locus-dist (meters 150) - :gem-joint 7 - :gem-offset (new 'static 'sphere :r 163840.0) - :callback-info #f - :use-momentum #t - :use-frustration #t - :use-stop-chase #f - :use-circling #t - :use-pacing #t - :walk-anim 8 - :turn-anim -1 - :run-anim 12 - :taunt-anim 22 - :run-travel-speed (meters 7) - :run-acceleration (meters 7) - :run-turning-acceleration (meters 20) - :walk-travel-speed (meters 2) - :walk-acceleration (meters 3) - :walk-turning-acceleration (meters 3) - :maximum-rotation-rate (degrees 360.0) - :notice-nav-radius (meters 1) - :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 - ) - ) +(define *metalmonk-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 10 + :hostile-anim 12 + :hit-anim -1 + :knocked-anim 16 + :knocked-land-anim 17 + :die-anim 32 + :die-falling-anim 33 + :victory-anim 22 + :jump-wind-up-anim 12 + :jump-in-air-anim 12 + :jump-land-anim 12 + :neck-joint 7 + :look-at-joint 7 + :bullseye-joint 4 + :sound-hit (static-sound-name "metalmonk-hit") + :sound-die (static-sound-name "metalmonk-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 40) + :default-hit-points 4 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #xffffffffffffffff + :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) + :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 + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 7 + :gem-offset (new 'static 'sphere :r 163840.0) + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 8 + :turn-anim -1 + :run-anim 12 + :taunt-anim 22 + :run-travel-speed (meters 7) + :run-acceleration (meters 7) + :run-turning-acceleration (meters 20) + :walk-travel-speed (meters 2) + :walk-acceleration (meters 3) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 360.0) + :notice-nav-radius (meters 1) + :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! (-> *metalmonk-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/metalhead_slinger/grenadier_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/metalhead_slinger/grenadier_REF.gc index fad6a7ec0b..4545ab41b5 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/metalhead_slinger/grenadier_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/metalhead_slinger/grenadier_REF.gc @@ -120,132 +120,133 @@ ) ;; definition for symbol *grenadier-nav-enemy-info*, type nav-enemy-info -(define *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 'array uint32 20 - #x270002 - #x6040501 - #x270002 - #x1010701 - #x1010601 - #x270002 - #x6040501 - #x1010801 - #x1010701 - #x1010601 - #x270002 - #x8040501 - #x270002 - #x1010801 - #x270002 - #x1010601 - #x0 - #x0 - #x0 - #x0 - ) - :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 -1 - :jump-in-air-anim -1 - :jump-land-anim -1 - :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 50) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 12.5) - :default-hit-points 14 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #xffffffffffffffff - :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) - :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 - :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) - :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.0) - :notice-nav-radius (meters 50) - :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 - ) - ) +(define *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 'array idle-control-frame 20 + (new 'static 'idle-control-frame :command #x2 :param0 #x27) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x4 :param1 #x6) + (new 'static 'idle-control-frame :command #x2 :param0 #x27) + (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x2 :param0 #x27) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x4 :param1 #x6) + (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x2 :param0 #x27) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x4 :param1 #x8) + (new 'static 'idle-control-frame :command #x2 :param0 #x27) + (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x2 :param0 #x27) + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (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 -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :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 50) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 12.5) + :default-hit-points 14 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #xffffffffffffffff + :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) + :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 + :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) + :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.0) + :notice-nav-radius (meters 50) + :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! (-> *grenadier-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/test/decompiler/reference/jak2/levels/common/entities/sew-gunturret_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/sew-gunturret_REF.gc index e6641aa9f1..8048acde59 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/sew-gunturret_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/sew-gunturret_REF.gc @@ -544,79 +544,85 @@ ) ;; definition for symbol *sew-gunturret-enemy-info*, type enemy-info -(define *sew-gunturret-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 'array uint32 4 #x1010201 #x0 #x0 #x0) - :idle-anim 2 - :notice-anim 2 - :hostile-anim 2 - :hit-anim 2 - :knocked-anim -1 - :knocked-land-anim -1 - :die-anim 2 - :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 - :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 - :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 - :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) - ) - ) +(define *sew-gunturret-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x2 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 2 + :notice-anim 2 + :hostile-anim 2 + :hit-anim 2 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim 2 + :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 + :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 + :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 + :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) + ) + ) ;; failed to figure out what this is: (set! (-> *sew-gunturret-enemy-info* fact-defaults) *fact-info-enemy-defaults*) @@ -1193,79 +1199,85 @@ ) ;; definition for symbol *pal-gun-turret-enemy-info*, type enemy-info -(define *pal-gun-turret-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 'array uint32 4 #x2020201 #x0 #x0 #x0) - :idle-anim 2 - :notice-anim 2 - :hostile-anim 2 - :hit-anim 2 - :knocked-anim -1 - :knocked-land-anim -1 - :die-anim 2 - :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 - :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 - :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 - :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) - ) - ) +(define *pal-gun-turret-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x2 :param0 #x2 :param1 #x2) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 2 + :notice-anim 2 + :hostile-anim 2 + :hit-anim 2 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim 2 + :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 + :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 + :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 + :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) + ) + ) ;; failed to figure out what this is: (set! (-> *pal-gun-turret-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/test/decompiler/reference/jak2/levels/common/flitter_REF.gc b/test/decompiler/reference/jak2/levels/common/flitter_REF.gc index 50810c4a46..6c06753226 100644 --- a/test/decompiler/reference/jak2/levels/common/flitter_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/flitter_REF.gc @@ -440,128 +440,129 @@ ) ;; definition for symbol *flitter-nav-enemy-info*, type nav-enemy-info -(define *flitter-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 'array uint32 16 - #x1e0002 - #x6030501 - #x1e0002 - #x1010601 - #x1e0f0701 - #x1e0002 - #x4020501 - #x1e0002 - #x1010801 - #x140a0901 - #x1e0002 - #x2010501 - #x1e0002 - #x1010801 - #x1e0f0901 - #x0 - ) - :idle-anim 5 - :notice-anim 12 - :hostile-anim 14 - :hit-anim 5 - :knocked-anim 20 - :knocked-land-anim 21 - :die-anim 19 - :die-falling-anim 18 - :victory-anim 5 - :jump-wind-up-anim 5 - :jump-in-air-anim 5 - :jump-land-anim 5 - :neck-joint -1 - :look-at-joint 28 - :bullseye-joint 3 - :sound-hit (static-sound-name "flitter-hit") - :sound-die (static-sound-name "flitter-die") - :notice-distance (meters 40) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 20) - :default-hit-points 1 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #x11fffdffa - :movement-gravity (meters -100) - :friction 0.8 - :attack-shove-back (meters 6) - :attack-shove-up (meters 3) - :attack-mode 'generic - :attack-damage 1 - :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) - :jump-height-min (meters 3) - :jump-height-factor 0.5 - :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 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 275251.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 - :shadow-size (meters 2) - :shadow-max-y (meters 1) - :shadow-min-y (meters -1) - :shadow-locus-dist (meters 150) - :gem-joint 28 - :gem-seg #x2 - :gem-no-seg #x4 - :gem-offset (new 'static 'sphere :y 696.32 :z 1843.2 :r 163840.0) - :callback-info #f - :use-momentum #f - :use-frustration #t - :use-stop-chase #f - :use-circling #t - :use-pacing #t - :walk-anim 13 - :turn-anim 15 - :run-anim 14 - :taunt-anim -1 - :run-travel-speed (meters 12) - :run-acceleration (meters 8) - :run-turning-acceleration (meters 120) - :walk-travel-speed (meters 4) - :walk-acceleration (meters 1) - :walk-turning-acceleration (meters 5) - :maximum-rotation-rate (degrees 720.0) - :notice-nav-radius (meters 5) - :frustration-distance (meters 12) - :frustration-time (seconds 4) - :blocked-time (seconds 0.3) - :circle-dist-lo 20480.0 - :circle-dist-hi 61440.0 - :nav-mesh #f - ) - ) +(define *flitter-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 'array idle-control-frame 16 + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x3 :param1 #x6) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #xf :param1 #x1e) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x2 :param1 #x4) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #xa :param1 #x14) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x2) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #xf :param1 #x1e) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 12 + :hostile-anim 14 + :hit-anim 5 + :knocked-anim 20 + :knocked-land-anim 21 + :die-anim 19 + :die-falling-anim 18 + :victory-anim 5 + :jump-wind-up-anim 5 + :jump-in-air-anim 5 + :jump-land-anim 5 + :neck-joint -1 + :look-at-joint 28 + :bullseye-joint 3 + :sound-hit (static-sound-name "flitter-hit") + :sound-die (static-sound-name "flitter-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 1 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #x11fffdffa + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 6) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 1 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 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 275251.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 + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 28 + :gem-seg #x2 + :gem-no-seg #x4 + :gem-offset (new 'static 'sphere :y 696.32 :z 1843.2 :r 163840.0) + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 13 + :turn-anim 15 + :run-anim 14 + :taunt-anim -1 + :run-travel-speed (meters 12) + :run-acceleration (meters 8) + :run-turning-acceleration (meters 120) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 5) + :maximum-rotation-rate (degrees 720.0) + :notice-nav-radius (meters 5) + :frustration-distance (meters 12) + :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! (-> *flitter-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/test/decompiler/reference/jak2/levels/common/grunt_REF.gc b/test/decompiler/reference/jak2/levels/common/grunt_REF.gc index 36e161e258..0db34ab267 100644 --- a/test/decompiler/reference/jak2/levels/common/grunt_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/grunt_REF.gc @@ -187,148 +187,149 @@ ) ;; 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 'array uint32 36 - #x1e0002 - #x3010501 - #x1e0002 - #x1010601 - #x691e0701 - #x3c0002 - #x3010501 - #x1e0002 - #x1010601 - #x691e0701 - #x1e0002 - #x1010801 - #x691e0901 - #x1010a01 - #x1e0002 - #x3010501 - #x1e0002 - #x1010801 - #x691e0901 - #x1010a01 - #x1e0002 - #x3010501 - #x1e0002 - #x1010601 - #x691e0701 - #x1e0002 - #x1010801 - #x691e0901 - #x1010a01 - #x1e0002 - #x3010501 - #x1e0002 - #x1011e01 - #x3c0002 - #x1010501 - #x0 - ) - :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 "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 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #xffffffffffffffff - :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) - :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 - :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) - :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.0) - :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 - ) - ) +(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 'array idle-control-frame 36 + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command #x2 :param0 #x3c) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command #x1 :anim #xa :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command #x1 :anim #xa :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x6 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x7 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x8 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x1 :anim #x9 :param0 #x1e :param1 #x69) + (new 'static 'idle-control-frame :command #x1 :anim #xa :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x1e :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame :command #x2 :param0 #x3c) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (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 "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 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #xffffffffffffffff + :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) + :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 + :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) + :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.0) + :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*) diff --git a/test/decompiler/reference/jak2/levels/drill_platform/ginsu_REF.gc b/test/decompiler/reference/jak2/levels/drill_platform/ginsu_REF.gc index 3a567c2b69..4e46bd6296 100644 --- a/test/decompiler/reference/jak2/levels/drill_platform/ginsu_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill_platform/ginsu_REF.gc @@ -223,108 +223,114 @@ ) ;; definition for symbol *ginsu-nav-enemy-info*, type nav-enemy-info -(define *ginsu-nav-enemy-info* (new 'static 'nav-enemy-info - :use-die-falling #t - :use-victory #f - :use-jump-blocked #t - :debug-draw-neck #f - :jump-debug-draw #f - :move-to-ground #t - :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1010501 #x0 #x0 #x0) - :idle-anim 5 - :notice-anim 10 - :hostile-anim 5 - :hit-anim 5 - :knocked-anim 11 - :knocked-land-anim 12 - :die-anim 11 - :die-falling-anim 5 - :victory-anim 5 - :jump-wind-up-anim 5 - :jump-in-air-anim 5 - :jump-land-anim 5 - :neck-joint 7 - :look-at-joint 7 - :bullseye-joint 4 - :sound-die (static-sound-name "ginsu-die") - :notice-distance (meters 40) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 40) - :default-hit-points 1 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot enemy hit-by-others-list player-list) - :penetrate-knocked #x11fffdffa - :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) - :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 - :shadow-size (meters 2) - :shadow-max-y (meters 1) - :shadow-min-y (meters -1) - :shadow-locus-dist (meters 150) - :gem-joint 7 - :gem-offset (new 'static 'sphere :r 163840.0) - :callback-info #f - :use-momentum #f - :use-frustration #t - :use-stop-chase #f - :use-circling #t - :use-pacing #t - :walk-anim 5 - :turn-anim 5 - :run-anim 5 - :taunt-anim -1 - :run-travel-speed (meters 16) - :run-acceleration (meters 1) - :run-turning-acceleration (meters 100) - :walk-travel-speed (meters 16) - :walk-acceleration (meters 1) - :walk-turning-acceleration (meters 3) - :maximum-rotation-rate (degrees 360.0) - :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 - ) - ) +(define *ginsu-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #t + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 10 + :hostile-anim 5 + :hit-anim 5 + :knocked-anim 11 + :knocked-land-anim 12 + :die-anim 11 + :die-falling-anim 5 + :victory-anim 5 + :jump-wind-up-anim 5 + :jump-in-air-anim 5 + :jump-land-anim 5 + :neck-joint 7 + :look-at-joint 7 + :bullseye-joint 4 + :sound-die (static-sound-name "ginsu-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 40) + :default-hit-points 1 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot enemy hit-by-others-list player-list) + :penetrate-knocked #x11fffdffa + :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) + :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 + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 7 + :gem-offset (new 'static 'sphere :r 163840.0) + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 5 + :turn-anim 5 + :run-anim 5 + :taunt-anim -1 + :run-travel-speed (meters 16) + :run-acceleration (meters 1) + :run-turning-acceleration (meters 100) + :walk-travel-speed (meters 16) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 360.0) + :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! (-> *ginsu-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc index 5d8913222c..8444ed6c99 100644 --- a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc @@ -112,82 +112,88 @@ ) ;; definition for symbol *pegasus-enemy-info*, type enemy-info -(define *pegasus-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 'array uint32 4 #x1010501 #x0 #x0 #x0) - :idle-anim 5 - :notice-anim 6 - :hostile-anim 8 - :hit-anim 5 - :knocked-anim -1 - :knocked-land-anim -1 - :die-anim 15 - :die-falling-anim -1 - :victory-anim -1 - :jump-wind-up-anim -1 - :jump-in-air-anim -1 - :jump-land-anim -1 - :neck-joint -1 - :sound-die (static-sound-name "pegasus-die") - :notice-distance (meters 45) - :notice-distance-delta (meters 30) - :proximity-notice-distance (meters 55) - :default-hit-points 6 - :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 - :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 - :shadow-size (meters 1) - :shadow-max-y (meters 1) - :shadow-min-y (meters -1) - :shadow-locus-dist (meters 150) - :gem-joint 9 - :gem-seg #x2 - :gem-no-seg #x4 - :gem-offset (new 'static 'sphere :y 942.08 :z 40.96 :r 163840.0) - ) - ) +(define *pegasus-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 6 + :hostile-anim 8 + :hit-anim 5 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim 15 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint -1 + :sound-die (static-sound-name "pegasus-die") + :notice-distance (meters 45) + :notice-distance-delta (meters 30) + :proximity-notice-distance (meters 55) + :default-hit-points 6 + :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 + :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 + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 9 + :gem-seg #x2 + :gem-no-seg #x4 + :gem-offset (new 'static 'sphere :y 942.08 :z 40.96 :r 163840.0) + ) + ) ;; failed to figure out what this is: (set! (-> *pegasus-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/test/decompiler/reference/jak2/levels/forest/predator_REF.gc b/test/decompiler/reference/jak2/levels/forest/predator_REF.gc index 23cb97ab9f..0929f66af3 100644 --- a/test/decompiler/reference/jak2/levels/forest/predator_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/predator_REF.gc @@ -285,109 +285,115 @@ ) ;; definition for symbol *predator-nav-enemy-info*, type nav-enemy-info -(define *predator-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 'array uint32 4 #x1010501 #x0 #x0 #x0) - :idle-anim 5 - :notice-anim 5 - :hostile-anim 7 - :hit-anim 5 - :knocked-anim 12 - :knocked-land-anim 13 - :die-anim 11 - :die-falling-anim 11 - :victory-anim 5 - :jump-wind-up-anim -1 - :jump-in-air-anim -1 - :jump-land-anim -1 - :neck-joint 7 - :look-at-joint 8 - :bullseye-joint 6 - :sound-hit (static-sound-name "predator-hit") - :sound-die (static-sound-name "predator-die") - :notice-distance (meters 150) - :notice-distance-delta (meters 150) - :proximity-notice-distance (meters 4) - :default-hit-points 5 - :gnd-collide-with (collide-spec backgnd) - :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #xffffffffffffffff - :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) - :jump-height-min (meters 3) - :jump-height-factor 0.5 - :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 81920.0 - :knocked-soft-vxz-hi 81920.0 - :knocked-soft-vy-lo 69632.0 - :knocked-soft-vy-hi 69632.0 - :knocked-medium-vxz-lo 81920.0 - :knocked-medium-vxz-hi 81920.0 - :knocked-medium-vy-lo 69632.0 - :knocked-medium-vy-hi 69632.0 - :knocked-hard-vxz-lo 81920.0 - :knocked-hard-vxz-hi 81920.0 - :knocked-hard-vy-lo 69632.0 - :knocked-hard-vy-hi 69632.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 53248.0 - :knocked-yellow-vy-lo 40960.0 - :knocked-yellow-vy-hi 53248.0 - :knocked-red-vxz-lo 102400.0 - :knocked-red-vxz-hi 102400.0 - :knocked-red-vy-lo 81920.0 - :knocked-red-vy-hi 81920.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 32768.0 - :knocked-blue-vy-hi 49152.0 - :shadow-size (meters 1) - :shadow-max-y (meters 1) - :shadow-min-y (meters -1) - :shadow-locus-dist (meters 150) - :gem-joint 6 - :gem-offset (new 'static 'sphere :y -2252.8 :z -2170.88 :r 163840.0) - :callback-info #f - :use-momentum #t - :use-frustration #t - :use-stop-chase #f - :use-circling #f - :use-pacing #f - :walk-anim 6 - :turn-anim -1 - :run-anim 7 - :taunt-anim -1 - :run-travel-speed (meters 8) - :run-acceleration (meters 6) - :run-turning-acceleration (meters 30) - :walk-travel-speed (meters 4) - :walk-acceleration (meters 3) - :walk-turning-acceleration (meters 8) - :maximum-rotation-rate (degrees 720.0) - :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 - ) - ) +(define *predator-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 5 + :hostile-anim 7 + :hit-anim 5 + :knocked-anim 12 + :knocked-land-anim 13 + :die-anim 11 + :die-falling-anim 11 + :victory-anim 5 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 7 + :look-at-joint 8 + :bullseye-joint 6 + :sound-hit (static-sound-name "predator-hit") + :sound-die (static-sound-name "predator-die") + :notice-distance (meters 150) + :notice-distance-delta (meters 150) + :proximity-notice-distance (meters 4) + :default-hit-points 5 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked #xffffffffffffffff + :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) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 81920.0 + :knocked-soft-vxz-hi 81920.0 + :knocked-soft-vy-lo 69632.0 + :knocked-soft-vy-hi 69632.0 + :knocked-medium-vxz-lo 81920.0 + :knocked-medium-vxz-hi 81920.0 + :knocked-medium-vy-lo 69632.0 + :knocked-medium-vy-hi 69632.0 + :knocked-hard-vxz-lo 81920.0 + :knocked-hard-vxz-hi 81920.0 + :knocked-hard-vy-lo 69632.0 + :knocked-hard-vy-hi 69632.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 53248.0 + :knocked-yellow-vy-lo 40960.0 + :knocked-yellow-vy-hi 53248.0 + :knocked-red-vxz-lo 102400.0 + :knocked-red-vxz-hi 102400.0 + :knocked-red-vy-lo 81920.0 + :knocked-red-vy-hi 81920.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 65536.0 + :knocked-blue-vy-lo 32768.0 + :knocked-blue-vy-hi 49152.0 + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 6 + :gem-offset (new 'static 'sphere :y -2252.8 :z -2170.88 :r 163840.0) + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 6 + :turn-anim -1 + :run-anim 7 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 30) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 3) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 720.0) + :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! (-> *predator-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc b/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc index 5c2212be42..239898df9d 100644 --- a/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc @@ -511,79 +511,85 @@ ) ;; definition for symbol *fort-turret-enemy-info*, type enemy-info -(define *fort-turret-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 'array uint32 4 #x1010401 #x0 #x0 #x0) - :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 - :notice-distance (meters 150) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 150) - :default-hit-points 1 - :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 - :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 - :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) - ) - ) +(define *fort-turret-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim 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 + :notice-distance (meters 150) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 150) + :default-hit-points 1 + :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 + :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 + :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) + ) + ) ;; failed to figure out what this is: (set! (-> *fort-turret-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/test/decompiler/reference/jak2/levels/mars_tomb/left/chase/target-indax_REF.gc b/test/decompiler/reference/jak2/levels/mars_tomb/left/chase/target-indax_REF.gc new file mode 100644 index 0000000000..623562215b --- /dev/null +++ b/test/decompiler/reference/jak2/levels/mars_tomb/left/chase/target-indax_REF.gc @@ -0,0 +1,1583 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type indax-info +(deftype indax-info (basic) + ((indax-start-time time-frame :offset-assert 8) + (indax-time time-frame :offset-assert 16) + (art-group-backup art-group :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +;; definition for method 3 of type indax-info +(defmethod inspect indax-info ((obj indax-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tindax-start-time: ~D~%" (-> obj indax-start-time)) + (format #t "~1Tindax-time: ~D~%" (-> obj indax-time)) + (format #t "~1Tart-group-backup: ~A~%" (-> obj art-group-backup)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(let ((v1-2 (copy *walk-mods* 'loading-level))) + (set! (-> v1-2 flags) (surface-flag gun-off gun-fast-exit)) + (set! (-> v1-2 target-speed) 32768.0) + (set! (-> v1-2 transv-max) 32768.0) + (set! *indax-walk-mods* v1-2) + ) + +;; failed to figure out what this is: +(let ((v1-4 (copy *jump-mods* 'loading-level))) + (set! (-> v1-4 target-speed) 32768.0) + (set! (-> v1-4 transv-max) 32768.0) + (set! *indax-jump-mods* v1-4) + ) + +;; failed to figure out what this is: +(let ((v1-6 (copy *double-jump-mods* 'loading-level))) + (set! (-> v1-6 target-speed) 32768.0) + (set! (-> v1-6 transv-max) 32768.0) + (set! *indax-double-jump-mods* v1-6) + ) + +;; failed to figure out what this is: +(let ((v1-8 (copy *jump-mods* 'loading-level))) + (set! (-> v1-8 target-speed) 49152.0) + (set! (-> v1-8 transv-max) 49152.0) + (set! (-> v1-8 seek0) 0.7) + (set! (-> v1-8 seek90) 0.7) + (set! (-> v1-8 seek180) 0.7) + (set! *indax-bounce-mods* v1-8) + ) + +;; definition for function target-indax-handler +(defbehavior target-indax-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (a0-10 symbol)) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + 'indax + ) + (else + (case arg2 + (('end-mode) + (go target-stance) + ) + (('change-mode) + (let ((v1-5 (-> arg3 param 0))) + (cond + ((= v1-5 'grab) + (when (not (logtest? (-> self focus-status) (focus-status dead))) + (if (not (-> arg3 param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + ((= v1-5 'normal) + (go target-stance) + ) + ((begin (set! a0-10 'falling) (= v1-5 a0-10)) + (go target-indax-falling a0-10) + ) + ) + ) + ) + (('trip) + (if (not (or (logtest? (-> self focus-status) (focus-status dead hit grabbed)) + (and (-> self next-state) (= (-> self next-state name) 'target-indax-trip)) + ) + ) + (go target-indax-trip) + ) + ) + (('swim 'slide 'edge-grab) + #f + ) + (('clone-anim) + (go target-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + target-indax-hit + ) + ) + (('shove) + (when (not (and (-> self next-state) (let ((v1-25 (-> self next-state name))) + (or (= v1-25 'target-indax-hit) (= v1-25 'target-hit)) + ) + ) + ) + (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 160) + (when (not (logtest? (-> self attack-info-rec mask) (attack-info-mask attacker))) + (set! (-> self attack-info-rec attacker) (process->handle arg0)) + (logior! (-> self attack-info-rec mask) (attack-info-mask attacker)) + ) + (go target-indax-hit 'shove (-> self attack-info-rec)) + ) + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + +;; definition for function target-indax-dangerous-event-handler +(defbehavior target-indax-dangerous-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('touched) + (cond + ((< 0.0 (-> self fact-override shield-level)) + (let ((s4-1 (-> self control penetrate-using))) + (set! (-> self control penetrate-using) (penetrate touch shield)) + (let ((v0-0 (the-as object (target-send-attack + arg0 + 'shield + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self fact-override shield-attack-id)) + 0 + (-> self control penetrate-using) + ) + ) + ) + ) + (set! (-> self control penetrate-using) s4-1) + v0-0 + ) + ) + ) + (((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 1920) + ) + (target-send-attack + arg0 + (-> self control danger-mode) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) + ) + ) + (else + (target-indax-handler arg0 arg1 arg2 arg3) + ) + ) + ) + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + target-indax-hit + ) + ) + (else + (target-indax-handler arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for function target-indax-jump-event-handler +(defbehavior target-indax-jump-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (cond + ((and (= arg2 'touched) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 6) + ) + (< (* 16384.0 (-> self clock time-adjust-ratio)) + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control transv) (-> self control last-transv)) + ) + ) + (begin + (vector-normalize! + (vector-! + s2-0 + (the-as vector (-> self control collision-spheres 0 prim-core)) + (-> self control actor-contact-pt) + ) + 1.0 + ) + (< 0.01 (-> s2-0 y)) + ) + ) + (if (< 0.75 (-> s2-0 y)) + (send-event + arg0 + 'bonk + (-> arg3 param 0) + (fmax + (-> self control ground-impact-vel) + (- (vector-dot (-> self control transv) (-> self control dynam gravity-normal))) + ) + ) + ) + (target-indax-handler arg0 arg1 arg2 arg3) + ) + ((= arg2 'jump) + (sound-play "jump-long") + (go + target-indax-jump + (the-as float (-> arg3 param 0)) + (the-as float (-> arg3 param 1)) + (the-as surface (-> arg3 param 2)) + ) + ) + (else + (target-indax-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + +;; definition for function target-indax-init +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior target-indax-init target () + (set! (-> self control current-surface flags) + (logior (surface-flag gun-fast-exit) (-> self control current-surface flags)) + ) + (target-gun-end-mode #t) + (target-exit) + (logior! (-> self game features) (game-feature sidekick)) + (target-sidekick-setup #t) + (if (zero? (-> self indax)) + (set! (-> self indax) (new 'process 'indax-info)) + ) + (set! (-> self control reaction) target-collision-reaction) + (set! (-> self control transv quad) (the-as uint128 0)) + (set! (-> self control ctrl-xz-vel) 0.0) + (set! (-> self focus-status) (logior (focus-status indax) (-> self focus-status))) + (set! (-> self control bend-target) 0.0) + (target-collide-set! 'indax 0.0) + (set! (-> self fact-override health) (-> self fact-override health-max)) + (set! (-> self indax indax-start-time) (-> self clock frame-counter)) + (set! (-> self indax 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) + (remove-exit) + (go target-indax-stance) + (none) + ) + +;; definition for function target-indax-exit +(defbehavior target-indax-exit target () + (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-indax-stance) + (= v1-3 'target-indax-walk) + (= v1-3 'target-indax-jump) + (= v1-3 'target-indax-double-jump) + (= v1-3 'target-indax-falling) + (= v1-3 'target-indax-hit-ground) + (= v1-3 'target-indax-attack) + (= v1-3 'target-indax-attack-air) + (= v1-3 'target-indax-running-attack) + (= v1-3 'target-indax-trip) + (= v1-3 'target-indax-hit) + (= v1-3 'target-indax-death) + ) + ) + ) + ) + (logclear! (-> self focus-status) (focus-status indax)) + (logclear! (-> self control root-prim prim-core action) (collide-action stuck-wall-escape)) + (set! (-> self control mod-surface) *walk-mods*) + (logclear! (-> self state-flags) (state-flags sf6)) + (target-collide-set! 'normal 0.0) + (set! (-> self draw art-group) (-> self indax art-group-backup)) + (logclear! (-> self draw status) (draw-control-status no-draw-bounds2)) + (send-event (ppointer->process (-> self sidekick)) 'matrix #f) + (if (not (logtest? (-> self focus-status) (focus-status dead))) + (set! (-> self fact-override health) (-> self fact-override health-max)) + ) + (target-exit) + ) + (none) + ) + +;; definition for function target-indax-real-post +;; INFO: Used lq/sq +(defbehavior target-indax-real-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (if (< (-> self control force-turn-to-strength) 0.0) + (set! (-> self control force-turn-to-strength) (- 1.0 (-> self control cpad stick0-speed))) + ) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s5-0 (new-stack-vector0))) + (read-pad s5-0) + (let ((f28-0 (debounce-speed + (-> self control pad-magnitude) + (-> self control last-pad-magnitude) + (-> self control pad-xz-dir) + (-> self control last-pad-xz-dir) + ) + ) + ) + (when (!= (-> self control force-turn-to-strength) 0.0) + (let ((f0-12 (fmin 1.0 (-> self control force-turn-to-strength)))) + (set! (-> self control force-turn-to-strength) f0-12) + (let ((a1-3 (vector-float*! + (new 'stack-no-clear 'vector) + (if (= f28-0 0.0) + *zero-vector* + s5-0 + ) + f28-0 + ) + ) + (a2-2 (vector-float*! + (new 'stack-no-clear 'vector) + (-> self control force-turn-to-direction) + (-> self control force-turn-to-speed) + ) + ) + ) + (vector-lerp! s5-0 a1-3 a2-2 f0-12) + ) + ) + (set! f28-0 (vector-length s5-0)) + (vector-normalize! s5-0 1.0) + ) + (turn-to-vector s5-0 f28-0) + ) + ) + (add-thrust) + (add-gravity) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (pre-collide-setup) + (when *debug-segment* + (let ((s5-1 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-38 'target) + (s4-0 *profile-target-color*) + ) + (when (and *dproc* *debug-segment*) + (let ((s3-0 (-> s5-1 data (-> s5-1 count)))) + (let ((s2-0 (-> s5-1 base-time))) + (set! (-> s3-0 name) v1-38) + (set! (-> s3-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s2-0)))) + ) + (set! (-> s3-0 depth) (the-as uint (-> s5-1 depth))) + (set! (-> s3-0 color) s4-0) + (set! (-> s5-1 segment (-> s5-1 depth)) s3-0) + ) + (+! (-> s5-1 count) 1) + (+! (-> s5-1 depth) 1) + (set! (-> s5-1 max-depth) (max (-> s5-1 max-depth) (-> s5-1 depth))) + ) + ) + 0 + ) + (let ((a2-3 (new 'stack-no-clear 'collide-query))) + (let ((v1-51 (-> self control))) + (set! (-> a2-3 collide-with) (-> v1-51 root-prim prim-core collide-with)) + (set! (-> a2-3 ignore-process0) self) + (set! (-> a2-3 ignore-process1) #f) + (set! (-> a2-3 ignore-pat) (-> v1-51 pat-ignore-mask)) + ) + (set! (-> a2-3 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide (-> self control) (-> self control transv) a2-3 (meters 1)) + ) + (when *debug-segment* + (let ((s5-2 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-68 (+ (-> s5-2 depth) -1)) + (s4-1 (-> s5-2 segment v1-68)) + (s3-1 (-> s5-2 base-time)) + ) + (when (>= v1-68 0) + (set! (-> s4-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-1)))) + (+! (-> s5-2 depth) -1) + ) + ) + ) + ) + 0 + ) + (bend-gravity) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (logclear! (-> self draw status) (draw-control-status no-draw-temp uninited)) + (evaluate-joint-control self) + (joint-points) + (do-target-gspot) + (target-powerup-process) + (none) + ) + +;; definition for function target-indax-post +(defbehavior target-indax-post target () + (target-indax-real-post) + (none) + ) + +;; failed to figure out what this is: +(defstate target-indax-start (target) + :event target-standard-event-handler + :code (behavior () + (target-indax-init) + (go target-indax-stance) + (none) + ) + :post target-indax-post + ) + +;; failed to figure out what this is: +(defstate target-indax-stance (target) + :event target-indax-handler + :enter (behavior () + ((-> target-stance enter)) + (set! (-> self control mod-surface) *indax-walk-mods*) + (none) + ) + :exit (behavior () + ((-> target-stance exit)) + (target-indax-exit) + (none) + ) + :trans (behavior () + ((-> self state-hook)) + (when (move-legs?) + (set! (-> self control bend-target) 0.0) + (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) + (remove-exit) + (go target-indax-walk) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (go + target-indax-jump + (-> *TARGET-bank* indax-jump-height-min) + (-> *TARGET-bank* indax-jump-height-max) + (the-as surface #f) + ) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-indax-running-attack) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-indax-attack) + ) + (fall-test target-indax-falling -4096000.0) + (none) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 (-> self draw art-group data 421))) + (ja-no-eval :group! (-> self draw art-group data 422) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 422)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.05)) + ) + ((let ((v1-32 (ja-group))) + (and v1-32 (= v1-32 (-> self draw art-group data 437))) + ) + (ja-no-eval :group! (-> self draw art-group data 442) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 442)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.05)) + ) + ((let ((v1-62 (ja-group))) + (and (and v1-62 (= v1-62 (-> self draw art-group data 417))) + (< (-> self skel root-channel 2 frame-interp (-> self skel active-frame-interp)) 0.5) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 429) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 429)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.05)) + ) + ) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 415) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 415)) frames num-frames) -1)) + 1.5 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + #f + (none) + ) + :post target-indax-post + ) + +;; failed to figure out what this is: +(defstate target-indax-walk (target) + :event target-indax-handler + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self control mod-surface) *indax-walk-mods*) + (none) + ) + :exit (behavior () + (target-effect-exit) + (target-state-hook-exit) + (target-indax-exit) + (none) + ) + :trans (behavior () + ((-> self state-hook)) + (when (not (move-legs?)) + (target-effect-exit) + (remove-exit) + (go target-indax-stance) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (go + target-indax-jump + (-> *TARGET-bank* indax-jump-height-min) + (-> *TARGET-bank* indax-jump-height-max) + (the-as surface #f) + ) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-indax-running-attack) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-indax-attack) + ) + (fall-test target-indax-falling -4096000.0) + (none) + ) + :code (behavior () + (let ((f26-0 0.0) + (f30-0 0.0) + (f28-0 0.0) + (gp-0 (-> self clock frame-counter)) + ) + (let ((v1-3 (ja-group))) + (cond + ((and v1-3 (or (= v1-3 (-> self draw art-group data 416)) (= v1-3 (-> self draw art-group data 417)))) + (set! f26-0 (ja-frame-num 0)) + ) + ((let ((v1-9 (ja-group))) + (and (or (and v1-9 (= v1-9 (-> self draw art-group data 419))) + (let ((v1-15 (ja-group))) + (and (and v1-15 (= v1-15 (-> self draw art-group data 418))) (< 15.0 (ja-aframe-num 0))) + ) + ) + (< 12288.0 (-> self control ctrl-xz-vel)) + ) + ) + (ja-channel-push! 1 (seconds 0.01)) + (ja-no-eval :group! (-> self draw art-group data 427) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 427)) frames num-frames) -1)) + 2.0 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 2.0)) + ) + (ja-channel-push! 3 (seconds 0.05)) + ) + (else + (ja-channel-push! 3 (seconds 0.05)) + ) + ) + ) + (ja-no-eval :group! (-> self draw art-group data 417) :num! (identity f26-0) :dist 13107.2) + (ja-no-eval :chan 1 :group! (-> self draw art-group data 423) :num! (identity f26-0) :dist 12697.6) + (let ((a0-25 (-> self skel root-channel 2))) + (let ((f0-12 (- 1.0 f30-0))) + (set! (-> a0-25 frame-interp 1) f0-12) + (set! (-> a0-25 frame-interp 0) f0-12) + ) + (set! (-> a0-25 dist) 5939.2) + (set! (-> a0-25 frame-group) (the-as art-joint-anim (-> self draw art-group data 416))) + (set! (-> a0-25 param 0) 1.0) + (set! (-> a0-25 frame-num) f26-0) + (joint-control-channel-group! a0-25 (the-as art-joint-anim (-> self draw art-group data 416)) num-func-loop!) + ) + (until #f + (suspend) + (let ((f26-1 (lerp-scale 0.0 1.0 (-> self control ctrl-xz-vel) 16384.0 32768.0))) + (cond + ((>= (- (-> self clock frame-counter) gp-0) (seconds 5)) + (set! gp-0 (-> self clock frame-counter)) + ) + ((>= (- (-> self clock frame-counter) gp-0) (seconds 2.5)) + ) + ((>= (- (-> self clock frame-counter) gp-0) (seconds 1)) + (set! f28-0 (seek f28-0 1.0 (* 2.0 (-> self clock seconds-per-frame)))) + ) + (else + (set! f28-0 (seek f28-0 0.0 (* 2.0 (-> self clock seconds-per-frame)))) + ) + ) + (set! f30-0 (seek f30-0 f26-1 (* 4.0 (-> self clock seconds-per-frame)))) + ) + (let ((v1-94 (-> self skel root-channel 1))) + (set! (-> v1-94 frame-interp 1) f28-0) + (set! (-> v1-94 frame-interp 0) f28-0) + ) + (let ((v1-98 (-> self skel root-channel 2)) + (f0-23 (- 1.0 f30-0)) + ) + (set! (-> v1-98 frame-interp 1) f0-23) + (set! (-> v1-98 frame-interp 0) f0-23) + ) + (let ((v1-101 (-> self skel effect)) + (a0-33 (cond + ((< 0.5 f30-0) + (if (< 0.5 f28-0) + 1 + 0 + ) + ) + (else + 2 + ) + ) + ) + ) + (set! (-> v1-101 channel-offset) a0-33) + ) + 0 + (let* ((f0-27 (* (current-cycle-distance (-> self skel)) (-> self control scale x))) + (f0-29 (/ (* 60.0 (-> self control ctrl-xz-vel)) (* 60.0 f0-27))) + ) + (ja :num! (loop! f0-29)) + ) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) + ) + ) + #f + (none) + ) + :post target-indax-post + ) + +;; failed to figure out what this is: +(defstate target-indax-falling (target) + :event target-indax-jump-event-handler + :enter (behavior ((arg0 symbol)) + ((-> target-falling enter) arg0) + (set! (-> self control mod-surface) *indax-jump-mods*) + (none) + ) + :exit target-indax-exit + :trans (behavior () + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control cpad number) abutton 6))) + ) + ) + (if (logtest? (-> self control status) (collide-status on-surface)) + (go target-indax-hit-ground #f) + ) + (if (and (cpad-pressed? (-> self control cpad number) circle) (can-feet? #f)) + (go target-indax-attack-air #f) + ) + (let ((f0-3 (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel))))))) + (if (< (-> self control unknown-float35) f0-3) + (seek! (-> self control unknown-float35) f0-3 (* 4.0 (-> self clock seconds-per-frame))) + ) + ) + (none) + ) + :code (behavior ((arg0 symbol)) + (let ((a1-0 75)) + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (or (= v1-2 (-> self draw art-group data 418)) (= v1-2 (-> self draw art-group data 419)))) + ) + (else + (let ((v1-8 (ja-group))) + (cond + ((and v1-8 (= v1-8 (-> self draw art-group data 428))) + (set! a1-0 15) + (set! (-> self control unknown-float35) 0.0) + ) + (else + (set! (-> self control unknown-float35) 0.0) + ) + ) + ) + ) + ) + ) + (ja-channel-push! 1 (the-as time-frame a1-0)) + ) + (ja-no-eval :group! (-> self draw art-group data 419) :num! (loop!) :frame-num 0.0) + (until #f + (seek! (-> self control unknown-float35) 0.0 (* 10.0 (-> self clock seconds-per-frame))) + (suspend) + (ja-blend-eval) + (ja :num! (loop!)) + ) + #f + (none) + ) + :post target-indax-post + ) + +;; failed to figure out what this is: +(defstate target-indax-jump (target) + :event target-indax-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 surface)) + (let ((t9-0 (-> target-jump enter))) + (set! arg2 (cond + (arg2 + (empty) + arg2 + ) + (else + *indax-jump-mods* + ) + ) + ) + (t9-0 arg0 arg1 arg2) + ) + (set! (-> self control unknown-float35) 0.0) + (none) + ) + :exit (behavior () + (target-exit) + (target-indax-exit) + (none) + ) + :trans (behavior () + ((-> target-indax-falling trans)) + (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + (if (and (cpad-pressed? (-> self control cpad number) x) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 12288.0) + (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (not (logtest? (water-flags touch-water) (-> self water flags))) + (zero? (logand (state-flags prevent-jump prevent-double-jump) (-> self state-flags))) + ) + ) + (go + target-indax-double-jump + (-> *TARGET-bank* indax-double-jump-height-min) + (-> *TARGET-bank* indax-double-jump-height-max) + ) + ) + (none) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) + (ja-channel-push! 2 (seconds 0.02)) + (ja :group! (-> self draw art-group data 418) :num! min) + (ja :chan 1 :group! (-> self draw art-group data 424) :num! (chan 0)) + (suspend) + (until (ja-done? 0) + (let ((f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f0-4 (- 10.0 (ja-aframe-num 0))) + (gp-1 (-> self skel root-channel 0)) + ) + (set! (-> gp-1 param 0) (the float (+ (-> gp-1 frame-group frames num-frames) -1))) + (let ((v1-26 (and (< 0.0 f30-0) (< 0.0 f0-4)))) + (set! (-> gp-1 param 1) + (if v1-26 + (fmin (fmin 3.0 f0-4) (/ (* 10.0 f0-4) (the float (time-to-apex f30-0 -245760.0)))) + 1.0 + ) + ) + ) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) + ) + (let ((a0-8 (-> self skel root-channel 1))) + (let ((f0-10 (-> self control unknown-float35))) + (set! (-> a0-8 frame-interp 1) f0-10) + (set! (-> a0-8 frame-interp 0) f0-10) + ) + (set! (-> a0-8 param 0) 0.0) + (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-chan) + ) + (suspend) + ) + (go target-indax-falling #f) + (none) + ) + :post target-indax-post + ) + +;; failed to figure out what this is: +(defstate target-indax-double-jump (target) + :event target-indax-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float)) + (set! (-> self state-time) (-> self clock frame-counter)) + (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (if (!= (-> self control mod-surface) *slide-jump-mods*) + (set! (-> self control mod-surface) *indax-double-jump-mods*) + ) + (let ((v1-10 (ja-group))) + (cond + ((and v1-10 (or (= v1-10 (-> self draw art-group data 418)) (= v1-10 (-> self draw art-group data 419)))) + ) + (else + (set! (-> self control unknown-float35) 0.0) + ) + ) + ) + (none) + ) + :exit (-> target-indax-jump exit) + :trans (behavior () + ((-> target-indax-falling trans)) + (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + (none) + ) + :code (behavior ((arg0 float) (arg1 float)) + (sound-play "jump-double") + (let ((v1-3 (ja-group))) + (cond + ((and (and v1-3 (= v1-3 (-> self draw art-group data 418))) (< 0.6 (-> self control unknown-float35))) + (ja-channel-push! 2 (seconds 0.04)) + (ja-no-eval :group! (-> self draw art-group data 418) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 418)) frames num-frames) -1))) + :frame-num (ja-aframe 1.0 0) + ) + (ja :chan 1 :group! (-> self draw art-group data 424) :num! (chan 0)) + ) + (else + (ja-channel-push! 2 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 418) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 418)) frames num-frames) -1))) + :frame-num (ja-aframe 5.0 0) + ) + (ja :chan 1 :group! (-> self draw art-group data 424) :num! (chan 0)) + ) + ) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + (let ((a0-16 (-> self skel root-channel 1))) + (let ((f0-14 (-> self control unknown-float35))) + (set! (-> a0-16 frame-interp 1) f0-14) + (set! (-> a0-16 frame-interp 0) f0-14) + ) + (set! (-> a0-16 param 0) 0.0) + (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (go target-indax-falling #f) + (none) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-indax-hit-ground (target) + :event target-indax-handler + :enter (behavior ((arg0 symbol)) + ((-> target-hit-ground enter) arg0) + (set! (-> self control mod-surface) *indax-walk-mods*) + (none) + ) + :exit target-indax-exit + :trans (behavior () + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (go + target-indax-jump + (-> *TARGET-bank* indax-jump-height-min) + (-> *TARGET-bank* indax-jump-height-max) + (the-as surface #f) + ) + ) + (if (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (go target-indax-walk) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-indax-running-attack) + ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-indax-attack) + ) + (fall-test target-falling -4096000.0) + (none) + ) + :code (behavior ((arg0 symbol)) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 420) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 420)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go target-indax-stance) + (none) + ) + :post target-indax-post + ) + +;; failed to figure out what this is: +(defstate target-indax-trip (target) + :event target-indax-jump-event-handler + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (sound-play "jump" :vol 70) + (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (none) + ) + :exit (behavior () + (target-exit) + (target-indax-exit) + (none) + ) + :code (behavior () + (set! (-> self control mod-surface) *indax-bounce-mods*) + (ja-channel-push! 1 (seconds 0.02)) + (ja-no-eval :group! (-> self draw art-group data 443) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 443)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-y-vel adjust-xz-vel) 1.0 1.0 2.0) + (suspend) + (ja :num! (seek!)) + ) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (suspend) + ) + (ja-no-eval :group! (-> self draw art-group data 444) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 444)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + (none) + ) + :post target-no-stick-post + ) + +;; failed to figure out what this is: +(defstate target-indax-attack (target) + :event target-indax-dangerous-event-handler + :enter (-> target-attack enter) + :exit (behavior () + ((-> target-attack exit)) + (target-indax-exit) + (none) + ) + :code (behavior () + (let ((gp-0 (-> self draw art-group data 421))) + (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! gp-0 + :num! (seek! + (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1)) + (-> self control current-surface align-speed) + ) + :frame-num 0.0 + ) + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (go + target-indax-jump + (-> *TARGET-bank* indax-jump-height-min) + (-> *TARGET-bank* indax-jump-height-max) + (the-as surface #f) + ) + ) + (suspend) + (ja :num! (seek! max (-> self control current-surface align-speed))) + ) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (if (< 11.4 (ja-aframe-num 0)) + (ja :num-func num-func-identity :frame-num max) + ) + (go target-indax-stance) + (none) + ) + :post target-indax-post + ) + +;; failed to figure out what this is: +(defstate target-indax-attack-air (target) + :event target-indax-dangerous-event-handler + :enter (-> target-attack-air enter) + :exit (behavior () + ((-> target-attack-air exit)) + (target-indax-exit) + (none) + ) + :code (behavior ((arg0 symbol)) + (let ((gp-0 (-> self draw art-group data 428))) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! gp-0 + :num! (seek! + (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1)) + (-> self control current-surface align-speed) + ) + :frame-num 0.0 + ) + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (go + target-indax-jump + (-> *TARGET-bank* indax-jump-height-min) + (-> *TARGET-bank* indax-jump-height-max) + (the-as surface #f) + ) + ) + (suspend) + (ja :num! (seek! max (-> self control current-surface align-speed))) + ) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (go target-indax-falling #f) + (none) + ) + :post target-indax-post + ) + +;; failed to figure out what this is: +(defstate target-indax-running-attack (target) + :event target-indax-dangerous-event-handler + :enter (-> target-running-attack enter) + :exit (behavior () + ((-> target-running-attack enter)) + (target-indax-exit) + (none) + ) + :code (behavior () + (if (logtest? (water-flags touch-water) (-> self water flags)) + (sound-play "swim-stroke") + ) + (set! (-> self control dynam gravity-max) 368640.0) + (set! (-> self control dynam gravity-length) 368640.0) + (let ((gp-1 (-> self draw art-group data 437))) + (ja-channel-push! 1 (seconds 0.02)) + (ja-no-eval :group! gp-1 :num! (seek! (the float (+ (-> (the-as art-joint-anim gp-1) frames num-frames) -1)))) + ) + (target-start-attack) + (target-danger-set! 'punch #f) + (let ((f26-0 (the-as number 0.0)) + (f30-0 1.0) + (gp-2 0) + (f28-0 1.0) + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (when (not (ja-min? 0)) + (cond + ((and (>= (ja-aframe-num 0) 20.0) + (and (and (not (logtest? (-> self control status) (collide-status on-surface))) + (>= (- (-> self clock frame-counter) (-> self control last-time-on-surface)) + (the-as time-frame (-> *TARGET-bank* ground-timeout)) + ) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (>= (- (-> self clock frame-counter) (-> self control sliding-start-time)) (seconds 0.04)) + ) + ) + (go target-indax-falling #f) + ) + ((< (the-as float f26-0) 0.0) + (set! f26-0 (seek (the-as float f26-0) -0.04096 (* 491520.0 (-> self clock seconds-per-frame)))) + (set-forward-vel (the-as float f26-0)) + ) + ((and (nonzero? (-> self control unknown-time-frame18)) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame18)) (seconds 0.04)) + ) + (set-forward-vel 0.0) + ) + ((and (not (cpad-hold? (-> self control cpad number) square)) + (>= (- (-> self clock frame-counter) (-> self control unknown-combo-tracker00 move-start-time)) + (seconds 0.05) + ) + ) + (if (= (-> self control ground-pat material) (pat-material ice)) + (set-forward-vel (fmax 32768.0 (* 0.8 (-> self control ctrl-xz-vel)))) + (set-forward-vel (* 0.8 (-> self control ctrl-xz-vel))) + ) + ) + ((ja-done? 0) + (set-forward-vel (the-as float f26-0)) + ) + (else + (set! f26-0 + (* (target-align-vel-z-adjust (-> self align delta trans z)) (-> self clock frames-per-second) f30-0) + ) + (set-forward-vel (the-as float f26-0)) + ) + ) + ) + (let ((s5-1 (new-stack-vector0))) + (vector-matrix*! s5-1 (-> self control transv) (-> self control w-R-c)) + (set! (-> s5-1 y) 0.0) + (vector-matrix*! (-> self control align-xz-vel) s5-1 (-> self control c-R-w)) + ) + (when (!= (the-as float (-> self control unknown-word04)) 0.0) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! f26-0 (-> self control unknown-word04)) + (set! (-> self control unknown-word04) (the-as uint 0.0)) + ) + (suspend) + (ja :num! (seek! max (* (-> self control current-surface align-speed) f28-0))) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1)) + (set! (-> *run-attack-mods* turnvv) 0.0) + ) + (if (< 2 gp-2) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control zx-vel-frac)))) + ) + (+! gp-2 1) + ) + ) + (if (and (not (logtest? (-> self control status) (collide-status on-surface))) + (>= (- (-> self clock frame-counter) (-> self control last-time-on-surface)) + (the-as time-frame (-> *TARGET-bank* ground-timeout)) + ) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (go target-indax-falling #f) + ) + (go target-indax-stance) + (none) + ) + :post target-post + ) + +;; definition for function target-indax-hit-setup-anim +;; WARN: Return type mismatch float vs none. +(defbehavior target-indax-hit-setup-anim target ((arg0 attack-info)) + (case (-> arg0 angle) + (('back) + (let ((v1-3 (ja-group))) + (when (not (and v1-3 (= v1-3 (-> self draw art-group data 431)))) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! (-> self draw art-group data 431) :num! min) + ) + ) + ) + (else + (let ((v1-12 (ja-group))) + (when (not (and v1-12 (= v1-12 (-> self draw art-group data 430)))) + (ja-channel-push! 1 (seconds 0.075)) + (ja :group! (-> self draw art-group data 430) :num! min) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate target-indax-hit (target) + :event target-indax-handler + :exit (behavior () + ((-> target-hit exit)) + (target-indax-exit) + (none) + ) + :trans (behavior () + (when (= *cheat-mode* 'debug) + (when (and (not *pause-lock*) (cpad-hold? (-> self control cpad number) r2)) + (pickup-collectable! (-> self fact-override) (pickup-type health) 100.0 (the-as handle #f)) + (go target-indax-stance) + ) + ) + (none) + ) + :code (behavior ((arg0 symbol) (arg1 attack-info)) + (logclear! (-> self water flags) (water-flags jump-out)) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self neck flex-blend) 0.0) + (let ((gp-0 (-> self attack-info))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((v1-5 gp-0)) + (set! (-> v1-5 attacker) (the-as handle #f)) + (set! (-> v1-5 mode) 'generic) + (set! (-> v1-5 shove-back) 6144.0) + (set! (-> v1-5 shove-up) 4915.2) + (set! (-> v1-5 angle) #f) + (set! (-> v1-5 trans quad) (-> self control trans quad)) + (set! (-> v1-5 control) 0.0) + (set! (-> v1-5 invinc-time) (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout))) + (set! (-> v1-5 damage) (-> *FACT-bank* health-default-inc)) + ) + (case arg0 + (('shove) + (let ((v1-8 gp-0)) + (set! (-> v1-8 shove-back) (-> *TARGET-bank* smack-surface-dist)) + (set! (-> v1-8 shove-up) (-> *TARGET-bank* smack-surface-height)) + (set! (-> v1-8 angle) 'shove) + ) + ) + ) + (combine! gp-0 arg1 self) + (when (not (logtest? (-> gp-0 mask) (attack-info-mask vector))) + (vector-z-quaternion! (-> gp-0 vector) (-> self control quat-for-control)) + (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) + (set! (-> gp-0 vector y) (-> gp-0 shove-up)) + ) + (set! (-> s5-0 quad) (-> gp-0 vector quad)) + (let ((f0-12 (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-0 1.0) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) + ) + ) + ) + (if (not (-> self attack-info angle)) + (set! (-> self attack-info angle) (if (>= 0.0 f0-12) + 'front + 'back + ) + ) + ) + ) + (cond + ((= arg0 'attack) + (logior! (-> self focus-status) (focus-status hit)) + (set! (-> self game hit-time) (-> self clock frame-counter)) + (case (-> gp-0 mode) + (('endlessfall) + (cond + ((= (-> self game mode) 'debug) + (let ((s4-1 (new-stack-vector0))) + (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) + (ja-channel-set! 0) + (let ((s3-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s3-1) (seconds 1)) + (suspend) + ) + ) + (move-to-point! (-> self control) s4-1) + ) + (set! (-> self control camera-pos quad) (-> self control trans quad)) + (send-event *camera* 'teleport) + (go target-indax-stance) + ) + (else + (pickup-collectable! (-> self fact-override) (pickup-type health) -1000.0 (the-as handle #f)) + (go target-indax-death (-> gp-0 mode)) + ) + ) + ) + (('instant-death 'smush 'tomb-spider 'bot) + (pickup-collectable! (-> self fact-override) (pickup-type health) -1000.0 (the-as handle #f)) + (if (= (-> self game mode) 'play) + (go target-indax-death (-> gp-0 mode)) + ) + ) + (else + (pickup-collectable! (-> self fact-override) (pickup-type health) (- (-> gp-0 damage)) (the-as handle #f)) + ) + ) + (target-hit-effect gp-0) + ) + (else + (case (-> gp-0 mode) + (('burn 'burnup) + (sound-play "get-burned") + ) + ) + ) + ) + (set! (-> self control mod-surface) *smack-mods*) + (target-indax-hit-setup-anim gp-0) + (target-hit-move gp-0 (target-hit-orient gp-0 s5-0) target-falling-anim-trans 1.0) + ) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-override health))) + (go target-indax-death (-> gp-0 mode)) + ) + ) + (go target-indax-hit-ground #f) + (none) + ) + :post target-indax-post + ) + +;; failed to figure out what this is: +(defstate target-indax-death (target) + :event (-> target-death event) + :exit (behavior () + ((-> target-death exit)) + (target-indax-exit) + (none) + ) + :trans (-> target-indax-hit trans) + :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) + (set-setting! 'process-mask 'set 0 (process-mask enemy platform projectile death)) + (apply-settings *setting-control*) + (set! (-> self control transv quad) (the-as uint128 0)) + (logior! (-> self focus-status) (focus-status dead)) + (cond + ((or (= arg0 'none) (= arg0 'instant-death) (= arg0 'bot)) + ) + ((= arg0 'endlessfall) + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "ds175" -99.0 0) + ) + (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) + (set! (-> self control pat-ignore-mask) + (logior (new 'static 'pat-surface :noendlessfall #x1) (-> self control pat-ignore-mask)) + ) + (logclear! (-> self water flags) (water-flags swim-ground)) + (set! (-> self post-hook) target-no-move-post) + (let ((f30-0 (if (rand-vu-percent? 0.2) + 0.0 + 55.0 + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 434) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 434)) frames num-frames) -1))) + :frame-num (ja-aframe f30-0 0) + ) + ) + (until (ja-done? 0) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (let ((v1-50 (process->ppointer self))) + (set! (-> a1-8 from) v1-50) + ) + (set! (-> a1-8 num-params) 2) + (set! (-> a1-8 message) 'joystick) + (set! (-> a1-8 param 0) (the-as uint 0)) + (set! (-> a1-8 param 1) (the-as uint -1082130432)) + (send-event-function *camera* a1-8) + ) + (vector-reset! (-> self control transv)) + (suspend) + (ja :num! (seek!)) + ) + (remove-setting! 'mode-name) + ) + ((= arg0 'smush) + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "ds173" -99.0 0) + ) + (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) + (set! (-> self control mod-surface) *neutral-mods*) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 433) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 433)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((= arg0 'tomb-spider) + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "ds173" -99.0 0) + ) + (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) + (set! (-> self control mod-surface) *neutral-mods*) + (ja-channel-push! 1 (seconds 0.1)) + (cond + ((rand-vu-percent? 0.5) + (ja-no-eval :group! (-> self draw art-group data 436) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 436)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 435) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 435)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (else + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "ds173" -99.0 0) + ) + (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) + (set! (-> self control mod-surface) *neutral-mods*) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 435) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 435)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (set! (-> self control transv quad) (the-as uint128 0)) + (initialize! (-> self game) 'life (the-as game-save #f) (the-as string #f)) + (set! (-> self state-time) (-> self clock frame-counter)) + (sleep-code) + (none) + ) + :post target-no-stick-post + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/mars_tomb/monster-frog_REF.gc b/test/decompiler/reference/jak2/levels/mars_tomb/monster-frog_REF.gc index 1507f75608..83043cf76c 100644 --- a/test/decompiler/reference/jak2/levels/mars_tomb/monster-frog_REF.gc +++ b/test/decompiler/reference/jak2/levels/mars_tomb/monster-frog_REF.gc @@ -46,7 +46,16 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 8 #x1e0002 #x3020401 #x1e0002 #x2010501 #x0 #x0 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 8 + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x2 :param1 #x3) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x2) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 4 :notice-anim 8 :hostile-anim 18 diff --git a/test/decompiler/reference/jak2/levels/mars_tomb/tomb-obs_REF.gc b/test/decompiler/reference/jak2/levels/mars_tomb/tomb-obs_REF.gc new file mode 100644 index 0000000000..2cb117ec30 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/mars_tomb/tomb-obs_REF.gc @@ -0,0 +1,2226 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type tomb-plat-wall +(deftype tomb-plat-wall (plat) + ((position vector :inline :offset-assert 336) + (last-pos float :offset-assert 352) + ) + :heap-base #xf0 + :method-count-assert 37 + :size-assert #x164 + :flag-assert #x2500f00164 + ) + +;; definition for method 3 of type tomb-plat-wall +(defmethod inspect tomb-plat-wall ((obj tomb-plat-wall)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type plat inspect))) + (t9-0 obj) + ) + (format #t "~2Tposition: #~%" (-> obj position)) + (format #t "~2Tlast-pos: ~f~%" (-> obj last-pos)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-plat-wall tomb-plat-wall tomb-plat-wall-lod0-jg tomb-plat-wall-idle-ja + ((tomb-plat-wall-lod0-mg (meters 20)) (tomb-plat-wall-lod1-mg (meters 999999))) + :bounds (static-spherem 0 -5 4 8.5) + :origin-joint-index 3 + ) + +;; definition for method 30 of type tomb-plat-wall +(defmethod get-art-group tomb-plat-wall ((obj tomb-plat-wall)) + "@returns The associated [[art-group]]" + (art-group-get-by-name *level* "skel-tomb-plat-wall" (the-as (pointer uint32) #f)) + ) + +;; failed to figure out what this is: +(defstate plat-idle (tomb-plat-wall) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior tomb-plat-wall) plat-event) + :exit (behavior () + (when (nonzero? (-> self sound-id)) + (sound-stop (-> self sound-id)) + (set! (-> self sound-id) (new 'static 'sound-id)) + 0 + ) + (none) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((f30-0 (get-norm! (-> self sync) 0))) + (let ((s5-0 (-> self basetrans))) + (let ((gp-0 (-> self position))) + (let ((v1-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override quat)))) + (let ((a0-3 (* -32768.0 f30-0))) + (.mov vf7 a0-3) + ) + (.lvf vf5 (&-> v1-3 quad)) + ) + (.lvf vf4 (&-> gp-0 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 (&-> s5-0 quad) vf6) + ) + (cond + ((and (!= f30-0 0.0) (!= f30-0 1.0)) + (if (zero? (-> self sound-id)) + (set! (-> self sound-id) (sound-play "tomb-plat-wall")) + ) + ) + (else + (when (nonzero? (-> self sound-id)) + (sound-stop (-> self sound-id)) + (set! (-> self sound-id) (new 'static 'sound-id)) + 0 + ) + ) + ) + (if (or (and (= f30-0 1.0) (!= (-> self last-pos) 1.0)) (and (= f30-0 0.0) (!= (-> self last-pos) 0.0))) + (sound-play "plat-wall-hit") + ) + (set! (-> self last-pos) f30-0) + ) + (plat-trans) + (none) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) + :num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior tomb-plat-wall) plat-post) + ) + +;; definition for method 32 of type tomb-plat-wall +;; WARN: Return type mismatch int vs none. +(defmethod base-plat-method-32 tomb-plat-wall ((obj tomb-plat-wall)) + 0 + (none) + ) + +;; definition for method 31 of type tomb-plat-wall +;; WARN: Return type mismatch int vs none. +(defmethod base-plat-method-31 tomb-plat-wall ((obj tomb-plat-wall)) + "TODO - collision stuff" + (let ((s5-0 (new 'process 'collide-shape obj (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 bot player-list)) + (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 16384.0 0.0 30720.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! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type tomb-plat-wall +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-plat-wall ((obj tomb-plat-wall) (arg0 entity-actor)) + (set! (-> obj mask) (logior (process-mask platform) (-> obj mask))) + (base-plat-method-31 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton obj (the-as skeleton-group (get-art-group obj)) (the-as pair 0)) + (set! (-> obj draw light-index) (the-as uint 1)) + (update-transforms (-> obj root-override)) + (stop-bouncing! obj) + (base-plat-method-32 obj) + (set! (-> obj fact) + (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (let ((a1-4 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-16 0)) + (if (not (logtest? (-> obj fact options) (actor-option loop))) + (set! v1-16 (logior v1-16 1)) + ) + (set! (-> a1-4 sync-type) (the-as basic 'sync-eased)) + (set! (-> a1-4 sync-flags) (the-as sync-flags v1-16)) + ) + (set! (-> a1-4 period) (the-as uint 1200)) + (set! (-> a1-4 entity) arg0) + (set! (-> a1-4 percent) 0.0) + (set! (-> a1-4 ease-in) 0.15) + (set! (-> a1-4 ease-out) 0.15) + (set! (-> a1-4 pause-in) 0.0) + (set! (-> a1-4 pause-out) 0.0) + (initialize! (-> obj sync) a1-4) + ) + (set! (-> obj sound-id) (new 'static 'sound-id)) + (set! (-> obj position quad) (-> obj root-override trans quad)) + (set! (-> obj last-pos) 0.0) + (go (method-of-object obj plat-idle)) + (none) + ) + +;; definition of type tomb-stair-block-spikes +(deftype tomb-stair-block-spikes (process-drawable) + ((root-override collide-shape-moving :offset 128) + ) + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + +;; definition for method 3 of type tomb-stair-block-spikes +(defmethod inspect tomb-stair-block-spikes ((obj tomb-stair-block-spikes)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-stair-block-spikes tomb-stair-block-spikes tomb-stair-block-spikes-lod0-jg tomb-stair-block-spikes-idle-ja + ((tomb-stair-block-spikes-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; definition for function tomb-stair-block-collision +;; WARN: Return type mismatch int vs object. +(defbehavior tomb-stair-block-collision tomb-stair-block-spikes ((arg0 symbol)) + (let ((v1-1 (-> self root-override root-prim))) + (the-as object (cond + (arg0 + (set! (-> v1-1 prim-core collide-with) (collide-spec jak bot player-list)) + (let ((v0-0 (the-as int (-> v1-1 specific 1)))) + (set! (-> v1-1 specific 0) (the-as uint v0-0)) + v0-0 + ) + ) + (else + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + (set! (-> v1-1 specific 0) (the-as uint 0)) + 0 + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (tomb-stair-block-spikes) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('sound) + (sound-play "tomb-spikes") + ) + (('set-position) + (let ((v0-1 (the-as object (-> self root-override trans)))) + (set! (-> (the-as vector v0-1) quad) (-> (the-as vector (-> event param 0)) quad)) + v0-1 + ) + ) + (('enable-collision) + (tomb-stair-block-collision #t) + ) + (('touch) + (when (= proc *target*) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer self)) + (set! (-> a1-9 num-params) 2) + (set! (-> a1-9 message) 'attack) + (set! (-> a1-9 param 0) (the-as uint #f)) + (let ((v1-9 (new 'static 'attack-info :mask (attack-info-mask shove-back shove-up id)))) + (let* ((a2-3 *game-info*) + (a3-3 (+ (-> a2-3 attack-id) 1)) + ) + (set! (-> a2-3 attack-id) a3-3) + (set! (-> v1-9 id) a3-3) + ) + (set! (-> v1-9 shove-up) 8192.0) + (set! (-> v1-9 shove-back) 0.0) + (set! (-> a1-9 param 1) (the-as uint v1-9)) + ) + (send-event-function proc a1-9) + ) + (tomb-stair-block-collision #f) + ) + ) + ) + ) + :code (the-as (function none :behavior tomb-stair-block-spikes) sleep-code) + :post (the-as (function none :behavior tomb-stair-block-spikes) transform-post) + ) + +;; definition for function tomb-stair-block-spikes-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior tomb-stair-block-spikes-init-by-other tomb-stair-block-spikes ((arg0 vector)) + (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 type) (sv-48 collide-shape)) + (let ((s5-0 (new 'process 'collide-shape self (collide-list-enum 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 pusher)) + (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) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 root-prim) s4-0) + (pusher-init s5-0) + (let* ((s3-0 (the-as object '((0 3 20480)))) + (s2-0 (-> (the-as pair s3-0) car)) + ) + (while (not (null? s3-0)) + (let ((s1-0 (method-of-type collide-shape-prim-mesh new)) + (s0-0 'process) + ) + (set! sv-32 collide-shape-prim-mesh) + (set! sv-48 s5-0) + (let ((a3-2 (command-get-int (-> (the-as pair s2-0) car) 0)) + (t0-1 0) + ) + (set! sv-16 (s1-0 s0-0 sv-32 sv-48 (the-as uint a3-2) (the-as uint t0-1))) + ) + ) + (let ((s1-1 sv-16)) + (set! (-> s1-1 prim-core collide-as) (-> s4-0 prim-core collide-as)) + (set! (-> s1-1 prim-core collide-with) (-> s4-0 prim-core collide-with)) + (set! (-> s1-1 prim-core action) (-> s4-0 prim-core action)) + (set! (-> s1-1 transform-index) (command-get-int (-> (the-as pair (-> (the-as pair s2-0) cdr)) car) 0)) + ) + (set-vector! + (-> sv-16 local-sphere) + 0.0 + 0.0 + 0.0 + (command-get-float (-> (the-as pair (-> (the-as pair (-> (the-as pair s2-0) cdr)) cdr)) car) 0.0) + ) + (set! s3-0 (-> (the-as pair s3-0) cdr)) + (set! s2-0 (-> (the-as pair s3-0) car)) + ) + ) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-23 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-23 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) + ) + (set! (-> self root-override) (the-as collide-shape-moving s5-0)) + ) + (set! (-> self root-override trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-tomb-stair-block-spikes" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> self draw light-index) (the-as uint 1)) + (quaternion-rotate-y! (-> self root-override quat) (-> self root-override quat) 16384.0) + (go-virtual idle) + (none) + ) + +;; definition of type tomb-stair-block-spike-info +(deftype tomb-stair-block-spike-info (structure) + ((spike handle :offset-assert 0) + (joint int32 :offset-assert 8) + (y-offset float :offset-assert 12) + (up basic :offset-assert 16) + (sounded basic :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +;; definition for method 3 of type tomb-stair-block-spike-info +(defmethod inspect tomb-stair-block-spike-info ((obj tomb-stair-block-spike-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tomb-stair-block-spike-info) + (format #t "~1Tspike: ~D~%" (-> obj spike)) + (format #t "~1Tjoint: ~D~%" (-> obj joint)) + (format #t "~1Ty-offset: ~f~%" (-> obj y-offset)) + (format #t "~1Tup: ~A~%" (-> obj up)) + (format #t "~1Tsounded: ~A~%" (-> obj sounded)) + (label cfg-4) + obj + ) + +;; definition of type tomb-stair-block +(deftype tomb-stair-block (process-drawable) + ((root-override collide-shape-moving :offset 128) + (initial-y float :offset-assert 200) + (spike-info tomb-stair-block-spike-info 4 :inline :offset 208) + (camera-state int32 :offset 336) + (sink-sound uint32 :offset 340) + (rise-sound uint32 :offset 344) + ) + :heap-base #xe0 + :method-count-assert 25 + :size-assert #x15c + :flag-assert #x1900e0015c + (:methods + (wait-for-pools () _type_ :state 20) + (idle () _type_ :state 21) + (moving () _type_ :state 22) + (sink () _type_ :state 23) + (sunk () _type_ :state 24) + ) + ) + +;; definition for method 3 of type tomb-stair-block +(defmethod inspect tomb-stair-block ((obj tomb-stair-block)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tinitial-y: ~f~%" (-> obj initial-y)) + (format #t "~2Tspike-info[4] @ #x~X~%" (-> obj spike-info)) + (format #t "~2Tcamera-state: ~D~%" (-> obj camera-state)) + (format #t "~2Tsink-sound: ~D~%" (-> obj sink-sound)) + (format #t "~2Trise-sound: ~D~%" (-> obj rise-sound)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-stair-block tomb-stair-block tomb-stair-block-lod0-jg tomb-stair-block-idle-ja + ((tomb-stair-block-lod0-mg (meters 999999))) + :bounds (static-spherem 0 32 0 58) + ) + +;; definition for function lift-pool +;; INFO: Used lq/sq +(defbehavior lift-pool tomb-stair-block ((arg0 int)) + (local-vars (sv-16 res-tag)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-1 (res-lump-data (-> self entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when (and v1-1 (< (the-as uint arg0) (-> sv-16 elt-count)) (-> v1-1 arg0) (> (-> v1-1 0 length) 0)) + (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) 'move-to) + (set! (-> a1-2 param 0) (the-as uint (-> v1-1 arg0 data 0 actor trans))) + (let ((t9-1 send-event-function) + (v1-5 (-> v1-1 arg0 data 0 actor)) + ) + (t9-1 + (if v1-5 + (-> v1-5 extra process) + ) + a1-2 + ) + ) + ) + ) + ) + ) + +;; definition for function drop-pool +;; INFO: Used lq/sq +(defbehavior drop-pool tomb-stair-block ((arg0 int)) + (local-vars (sv-16 res-tag)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-1 (res-lump-data (-> self entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when (and v1-1 (< (the-as uint arg0) (-> sv-16 elt-count)) (-> v1-1 arg0) (> (-> v1-1 0 length) 0)) + (let ((a0-12 (new 'stack-no-clear 'vector))) + (set! (-> a0-12 quad) (-> v1-1 arg0 data 0 actor trans quad)) + (set! (-> a0-12 y) (+ -163840.0 (-> a0-12 y))) + (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) 'move-to) + (set! (-> a1-4 param 0) (the-as uint a0-12)) + (let ((t9-1 send-event-function) + (v1-5 (-> v1-1 arg0 data 0 actor)) + ) + (t9-1 + (if v1-5 + (-> v1-5 extra process) + ) + a1-4 + ) + ) + ) + ) + ) + ) + ) + +;; definition for function position-spikes +(defbehavior position-spikes tomb-stair-block ((arg0 int)) + (let ((s5-0 (and (nonzero? arg0) (< (mod (-> self clock frame-counter) arg0) (/ arg0 2)))) + (s4-0 (and (nonzero? arg0) (< (mod (+ (-> self clock frame-counter) (seconds 0.75)) arg0) (/ arg0 2)))) + ) + (dotimes (s3-0 4) + (let ((f0-1 (seek + (-> self spike-info s3-0 y-offset) + (if s5-0 + 30720.0 + 16384.0 + ) + 1228.8 + ) + ) + ) + (set! (-> self spike-info s3-0 y-offset) f0-1) + (set! (-> self spike-info s3-0 y-offset) f0-1) + ) + (if (and s4-0 (not (-> self spike-info s3-0 sounded))) + (send-event (handle->process (-> self spike-info s3-0 spike)) 'sound) + ) + (if (and s5-0 (not (-> self spike-info s3-0 up))) + (send-event (handle->process (-> self spike-info s3-0 spike)) 'enable-collision) + ) + (set! (-> self spike-info s3-0 up) (the-as basic s5-0)) + (set! (-> self spike-info s3-0 sounded) (the-as basic s4-0)) + (set! s5-0 (and (nonzero? arg0) (not s5-0))) + (set! s4-0 (and (nonzero? arg0) (not s4-0))) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (dotimes (s5-1 4) + (vector<-cspace! gp-1 (-> self node-list data (-> self spike-info s5-1 joint))) + (+! (-> gp-1 y) (-> self spike-info s5-1 y-offset)) + (send-event (handle->process (-> self spike-info s5-1 spike)) 'set-position gp-1) + ) + ) + #f + ) + +;; failed to figure out what this is: +(defstate sunk (tomb-stair-block) + :virtual #t + :enter (behavior () + (set! (-> self root-override trans y) (-> self initial-y)) + (ja :group! (-> self draw art-group data 4) + :num! (identity (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + ) + (transform-post) + (none) + ) + :trans (behavior () + (lift-pool 1) + (drop-pool 0) + (position-spikes 1200) + (none) + ) + :code (behavior () + (suspend) + (suspend) + (transform-post) + (sleep-code) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate sink (tomb-stair-block) + :virtual #t + :enter (behavior () + (set! (-> self camera-state) 0) + (set! (-> self state-time) (-> self clock frame-counter)) + (task-node-close! (game-task-node tomb-poles-block)) + (none) + ) + :exit (behavior () + (remove-setting! 'entity-name) + (remove-setting! 'interp-time) + (remove-setting! 'string-startup-vector) + (none) + ) + :trans (behavior () + (rider-trans) + (position-spikes 1200) + (cond + ((>= (-> self camera-state) 3) + ) + ((= (-> self camera-state) 2) + (remove-setting! 'interp-time) + (remove-setting! 'string-startup-vector) + (set! (-> self camera-state) 3) + ) + ((and (= (-> self camera-state) 1) (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 8))) + (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) + (remove-setting! 'entity-name) + (set! (-> self camera-state) 2) + (process-release? *target*) + ) + ) + (none) + ) + :code (behavior () + (local-vars (v1-5 symbol) (v1-51 symbol)) + (until v1-5 + (ja :num! (loop!)) + (lift-pool 0) + (drop-pool 1) + (suspend) + (set! v1-5 (or (not *target*) (process-grab? *target* #f))) + ) + (set-setting! 'entity-name "camera-171" 0 0) + (set! (-> self camera-state) 1) + (ja-channel-push! 1 (seconds 2)) + (ja :group! (-> self draw art-group data 3) :num! min) + (set! (-> self state-time) (-> self clock frame-counter)) + (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (lift-pool 0) + (drop-pool 1) + (suspend) + ) + (while (< (-> self root-override trans y) (-> self initial-y)) + (let ((f0-4 (seek (-> self root-override trans y) (-> self initial-y) 204.8))) + (set! (-> self root-override trans y) f0-4) + (set! (-> self root-override trans y) f0-4) + ) + (lift-pool 0) + (drop-pool 1) + (suspend) + ) + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (lift-pool 1) + (drop-pool 0) + (suspend) + (ja :num! (seek!)) + ) + (until v1-51 + (lift-pool 1) + (drop-pool 0) + (suspend) + (set! v1-51 (or (not *target*) (process-release? *target*))) + ) + (go-virtual sunk) + (none) + ) + :post (the-as (function none :behavior tomb-stair-block) rider-post) + ) + +;; failed to figure out what this is: +(defstate moving (tomb-stair-block) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('cue-chase) + (set-action! + *gui-control* + (gui-action play) + (the-as sound-id (-> self sink-sound)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set-falloff! *gui-control* (the-as sound-id (-> self sink-sound)) #t -1 200 2) + (go-virtual sink) + ) + ) + ) + :enter (behavior () + (set! (-> self sink-sound) + (the-as uint (add-process *gui-control* self (gui-channel jak) (gui-action queue) "tombpltb" -99.0 0)) + ) + (set! (-> self camera-state) 0) + 0 + (none) + ) + :exit (behavior () + (remove-setting! 'entity-name) + (remove-setting! 'interp-time) + (remove-setting! 'string-startup-vector) + (none) + ) + :trans (behavior () + (rider-trans) + (let ((f0-3 (seek (-> self root-override trans y) (+ -28672.0 (-> self initial-y)) 409.6))) + (set! (-> self root-override trans y) f0-3) + (set! (-> self root-override trans y) f0-3) + ) + (position-spikes 0) + (cond + ((>= (-> self camera-state) 3) + ) + ((= (-> self camera-state) 2) + (remove-setting! 'interp-time) + (remove-setting! 'string-startup-vector) + (if (or (not *target*) (process-release? *target*)) + (set! (-> self camera-state) 3) + ) + ) + ((and (= (-> self camera-state) 1) (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 4))) + (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) + (remove-setting! 'entity-name) + (set! (-> self camera-state) 2) + ) + ) + (when (and *target* (< (-> (target-pos 0) y) -294912.0)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id (-> self sink-sound)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (go-virtual idle) + ) + (lift-pool 0) + (drop-pool 1) + (none) + ) + :code (behavior () + (local-vars (v1-1 symbol)) + (until v1-1 + (suspend) + (set! v1-1 (or (not *target*) (process-grab? *target* #f))) + ) + (set-setting! 'entity-name "camera-170" 0 0) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self camera-state) 1) + (ja-channel-push! 1 (seconds 2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data 2) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) frames num-frames) -1)) + 0.125 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.125)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior tomb-stair-block) rider-post) + ) + +;; failed to figure out what this is: +(defstate idle (tomb-stair-block) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('cue-chase) + (set-action! + *gui-control* + (gui-action play) + (the-as sound-id (-> self rise-sound)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set-falloff! *gui-control* (the-as sound-id (-> self rise-sound)) #t -1 200 2) + (go-virtual moving) + ) + ) + ) + :enter (behavior () + (local-vars (sv-16 res-tag)) + (ja-channel-push! 1 (seconds 2)) + (ja :group! (-> self draw art-group data 3) :num! min) + (set! (-> self rise-sound) + (the-as uint (add-process *gui-control* self (gui-channel jak) (gui-action queue) "tombplta" -99.0 0)) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((gp-1 (res-lump-data (-> self entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when (and gp-1 (< (the-as uint 2) (-> sv-16 elt-count)) (-> gp-1 2)) + (dotimes (s5-0 (-> gp-1 2 length)) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer self)) + (set! (-> a1-4 num-params) 0) + (set! (-> a1-4 message) 'untrigger) + (let ((t9-4 send-event-function) + (v1-15 (-> gp-1 2 data s5-0 actor)) + ) + (t9-4 + (if v1-15 + (-> v1-15 extra process) + ) + a1-4 + ) + ) + ) + ) + ) + ) + (none) + ) + :trans (behavior () + (let ((f0-3 (seek (-> self root-override trans y) (+ -104448.0 (-> self initial-y)) 409.6))) + (set! (-> self root-override trans y) f0-3) + (set! (-> self root-override trans y) f0-3) + ) + (lift-pool 0) + (drop-pool 1) + (position-spikes 1500) + (none) + ) + :code (the-as (function none :behavior tomb-stair-block) sleep-code) + :post (the-as (function none :behavior tomb-stair-block) transform-post) + ) + +;; failed to figure out what this is: +(defstate wait-for-pools (tomb-stair-block) + :virtual #t + :trans (behavior () + (local-vars (sv-16 res-tag)) + (let ((gp-0 #t)) + (set! sv-16 (new 'static 'res-tag)) + (let ((s5-0 (res-lump-data (-> self entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when s5-0 + (dotimes (s4-0 (min 2 (the-as int (-> sv-16 elt-count)))) + (dotimes (s3-0 (-> s5-0 s4-0 length)) + (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) 'visible) + (set! (-> a1-1 param 0) (the-as uint #t)) + (let ((t9-1 send-event-function) + (v1-9 (-> s5-0 s4-0 data s3-0 actor)) + ) + (if (not (t9-1 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + (set! gp-0 #f) + ) + ) + ) + ) + ) + ) + ) + (when gp-0 + (if (task-node-closed? (game-task-node tomb-poles-block)) + (go-virtual sunk) + (go-virtual idle) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior tomb-stair-block) sleep-code) + ) + +;; definition for method 11 of type tomb-stair-block +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-stair-block ((obj tomb-stair-block) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape obj (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 8) 0))) + (set! (-> s4-0 total-prims) (the-as uint 9)) + (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s3-0 local-sphere) 0.0 131072.0 0.0 237568.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-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 rideable)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 81920.0 0.0 204800.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s4-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 rideable)) + (set! (-> v1-12 transform-index) 4) + (set-vector! (-> v1-12 local-sphere) 0.0 -63488.0 0.0 102400.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid rideable)) + (set! (-> v1-14 transform-index) 5) + (set-vector! (-> v1-14 local-sphere) 0.0 -16384.0 0.0 77824.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid rideable)) + (set! (-> v1-16 transform-index) 6) + (set-vector! (-> v1-16 local-sphere) 0.0 -75776.0 0.0 114688.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid rideable)) + (set! (-> v1-18 transform-index) 7) + (set-vector! (-> v1-18 local-sphere) 0.0 -16384.0 0.0 77824.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 5) (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid rideable)) + (set! (-> v1-20 transform-index) 8) + (set-vector! (-> v1-20 local-sphere) 0.0 -75776.0 0.0 114688.0) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 6) (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid rideable)) + (set! (-> v1-22 transform-index) 9) + (set-vector! (-> v1-22 local-sphere) 0.0 -16384.0 0.0 77824.0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 7) (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-24 prim-core action) (collide-action solid rideable)) + (set! (-> v1-24 transform-index) 10) + (set-vector! (-> v1-24 local-sphere) 0.0 -92160.0 0.0 131072.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-27 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-27 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-27 prim-core collide-with)) + ) + (set! (-> obj root-override) (the-as collide-shape-moving s4-0)) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-stair-block" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj draw light-index) (the-as uint 1)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj initial-y) (-> obj root-override trans y)) + (ja-post) + (set! (-> obj spike-info 0 joint) 4) + (set! (-> obj spike-info 1 joint) 6) + (set! (-> obj spike-info 2 joint) 8) + (set! (-> obj spike-info 3 joint) 10) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (dotimes (s4-2 4) + (set! (-> obj spike-info s4-2 y-offset) 0.0) + (vector<-cspace! s5-2 (-> obj node-list data (-> obj spike-info s4-2 joint))) + (set! (-> obj spike-info s4-2 spike) (ppointer->handle (process-spawn tomb-stair-block-spikes s5-2 :to obj))) + (set! (-> obj spike-info s4-2 up) #f) + (set! (-> obj spike-info s4-2 sounded) #f) + ) + ) + (set! (-> obj root-override trans y) (+ -104448.0 (-> obj initial-y))) + (let ((s5-3 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-3 + (the-as art-joint-anim (-> obj draw art-group data 3)) + num-func-identity + ) + (set! (-> s5-3 frame-num) 0.0) + ) + (set! (-> obj rise-sound) (the-as uint (new-sound-id))) + (set! (-> obj sink-sound) (the-as uint (new-sound-id))) + (go (method-of-object obj wait-for-pools)) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-bounce-web tomb-bounce-web tomb-bounce-web-lod0-jg tomb-bounce-web-idle-ja + ((tomb-bounce-web-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; definition of type tomb-bounce-web +(deftype tomb-bounce-web (bouncer) + () + :heap-base #x60 + :method-count-assert 25 + :size-assert #xd4 + :flag-assert #x19006000d4 + ) + +;; definition for method 3 of type tomb-bounce-web +(defmethod inspect tomb-bounce-web ((obj tomb-bounce-web)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type bouncer inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 23 of type tomb-bounce-web +;; WARN: Return type mismatch int vs none. +(defmethod init-skeleton! tomb-bounce-web ((obj tomb-bounce-web)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-bounce-web" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj mods) *indax-bounce-mods*) + 0 + (none) + ) + +;; definition for method 24 of type tomb-bounce-web +;; WARN: Return type mismatch int vs none. +(defmethod bouncer-method-24 tomb-bounce-web ((obj tomb-bounce-web)) + "TODO - collision stuff" + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum 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 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 3072.0 0.0 11059.2) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 1)))) + (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 3072.0 0.0 11059.2) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 3)))) + (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 solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 3072.0 0.0 11059.2) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 3)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak 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 3072.0 0.0 11059.2) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-14 prim-core action) (collide-action)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 3072.0 0.0 8192.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! (-> obj root) s5-0) + ) + 0 + (none) + ) + +;; definition of type tomb-plat-pillar +(deftype tomb-plat-pillar (plat) + () + :heap-base #xd0 + :method-count-assert 37 + :size-assert #x144 + :flag-assert #x2500d00144 + ) + +;; definition for method 3 of type tomb-plat-pillar +(defmethod inspect tomb-plat-pillar ((obj tomb-plat-pillar)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type plat inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-plat-pillar tomb-plat-pillar tomb-plat-pillar-lod0-jg tomb-plat-pillar-idle-ja + ((tomb-plat-pillar-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -7 0 8) + ) + +;; definition for method 30 of type tomb-plat-pillar +(defmethod get-art-group tomb-plat-pillar ((obj tomb-plat-pillar)) + "@returns The associated [[art-group]]" + (art-group-get-by-name *level* "skel-tomb-plat-pillar" (the-as (pointer uint32) #f)) + ) + +;; definition for method 32 of type tomb-plat-pillar +;; WARN: Return type mismatch int vs none. +(defmethod base-plat-method-32 tomb-plat-pillar ((obj tomb-plat-pillar)) + 0 + (none) + ) + +;; definition for method 31 of type tomb-plat-pillar +;; WARN: Return type mismatch collide-shape vs none. +(defmethod base-plat-method-31 tomb-plat-pillar ((obj tomb-plat-pillar)) + "TODO - collision stuff" + (let ((s5-0 (new 'process 'collide-shape obj (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 36864.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-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! (-> obj root-override) s5-0) + ) + (none) + ) + +;; definition of type tomb-elevator +(deftype tomb-elevator (elevator) + ((last-pos vector :inline :offset-assert 368) + (speed float :offset-assert 384) + ) + :heap-base #x110 + :method-count-assert 49 + :size-assert #x184 + :flag-assert #x3101100184 + ) + +;; definition for method 3 of type tomb-elevator +(defmethod inspect tomb-elevator ((obj tomb-elevator)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type elevator inspect))) + (t9-0 obj) + ) + (format #t "~2Tlast-pos: #~%" (-> obj last-pos)) + (format #t "~2Tspeed: ~f~%" (-> obj speed)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-elevator tomb-elevator tomb-elevator-lod0-jg tomb-elevator-idle-ja + ((tomb-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 4 0 4 7) + ) + +;; failed to figure out what this is: +(defstate running (tomb-elevator) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type elevator running) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self speed) 0.0) + (none) + ) + :code (behavior () + (logior! (-> self elevator-status) (elevator-status elevator-status-1)) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (loop! 0.0)) + (until #f + (when (= (-> self path-pos) 1.0) + (logclear! (-> self elevator-status) (elevator-status elevator-status-1)) + (sound-play "t-elevator-hit") + ) + (suspend) + (ja :num! (loop! (* 0.00007771238 (-> self speed)))) + ) + #f + (none) + ) + :post (behavior () + (set! (-> self last-pos quad) (-> self basetrans quad)) + (let ((t9-0 (-> (method-of-type elevator running) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + (set! (-> self speed) (* (- (-> self last-pos y) (-> self basetrans y)) (-> self clock frames-per-second))) + (none) + ) + ) + +;; definition for method 41 of type tomb-elevator +;; WARN: Return type mismatch int vs none. +(defmethod init-defaults! tomb-elevator ((obj tomb-elevator)) + "Initializes default settings related to the [[elevator]]: + - `elevator-xz-threshold` + - `elevator-y-threshold` + - `elevator-start-pos` + - `elevator-move-rate` + - `elevator-flags`" + (let ((t9-0 (method-of-type elevator init-defaults!))) + (t9-0 obj) + ) + (set! (-> obj params flags) (elevator-flags elevator-flags-2)) + (set! (-> obj draw light-index) (the-as uint 1)) + (none) + ) + +;; definition for method 30 of type tomb-elevator +(defmethod get-art-group tomb-elevator ((obj tomb-elevator)) + "@returns The associated [[art-group]]" + (art-group-get-by-name *level* "skel-tomb-elevator" (the-as (pointer uint32) #f)) + ) + +;; definition for method 31 of type tomb-elevator +;; WARN: Return type mismatch collide-shape vs none. +(defmethod base-plat-method-31 tomb-elevator ((obj tomb-elevator)) + "TODO - collision stuff" + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (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) 16384.0 0.0 16384.0 28672.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! (-> obj root-override) s5-0) + ) + (none) + ) + +;; definition for method 42 of type tomb-elevator +;; WARN: Return type mismatch int vs none. +(defmethod clear-ambient-sound! tomb-elevator ((obj tomb-elevator)) + "Might be a virtual function, but clears the object's [[ambient-sound]]" + (set! (-> obj sound) + (new 'process 'ambient-sound (static-sound-spec "tomb-elevator" :fo-max 70) (-> obj root-override trans)) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-boss-door tomb-boss-door tomb-boss-door-lod0-jg tomb-boss-door-idle-ja + ((tomb-boss-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 21 0 60) + :origin-joint-index 3 + ) + +;; definition of type tomb-boss-door +(deftype tomb-boss-door (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + +;; definition for method 3 of type tomb-boss-door +(defmethod inspect tomb-boss-door ((obj tomb-boss-door)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type tomb-boss-door +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-boss-door ((obj tomb-boss-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (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 86016.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 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) 5) + (set-vector! (-> v1-8 local-sphere) 0.0 86016.0 0.0 122880.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 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 86016.0 0.0 122880.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! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj door-radius) 61440.0) + (go (method-of-object obj close) #t) + (none) + ) + +;; definition of type water-anim-tomb +(deftype water-anim-tomb (water-anim) + () + :heap-base #x80 + :method-count-assert 29 + :size-assert #x100 + :flag-assert #x1d00800100 + ) + +;; definition for method 3 of type water-anim-tomb +(defmethod inspect water-anim-tomb ((obj water-anim-tomb)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type water-anim inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for symbol ripple-for-water-anim-tomb, type ripple-wave-set +(define ripple-for-water-anim-tomb (new 'static 'ripple-wave-set + :count 3 + :converted #f + :normal-scale 1.0 + :wave (new 'static 'inline-array ripple-wave 4 + (new 'static 'ripple-wave :scale 40.0 :xdiv 1 :speed 1.5) + (new 'static 'ripple-wave :scale 40.0 :xdiv -1 :zdiv 1 :speed 1.5) + (new 'static 'ripple-wave :scale 20.0 :xdiv 5 :zdiv 3 :speed 0.75) + (new 'static 'ripple-wave) + ) + ) + ) + +;; definition for method 24 of type water-anim-tomb +;; WARN: Return type mismatch ripple-wave-set vs none. +(defmethod art-init! water-anim-tomb ((obj water-anim-tomb)) + "Initialize a [[water-anim]]'s [[skeleton-group]], joints and ambience." + (let ((t9-0 (method-of-type water-anim art-init!))) + (t9-0 obj) + ) + (let ((v1-2 (new 'process 'ripple-control))) + (set! (-> obj draw ripple) v1-2) + (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> v1-2 global-scale) 3072.0) + (set! (-> v1-2 close-fade-dist) 163840.0) + (set! (-> v1-2 far-fade-dist) 245760.0) + (set! (-> v1-2 waveform) ripple-for-water-anim-tomb) + ) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-wing-door tomb-wing-door tomb-wing-door-lod0-jg tomb-wing-door-idle-ja + ((tomb-wing-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -10 0 20) + ) + +;; definition of type tomb-wing-door +(deftype tomb-wing-door (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + +;; definition for method 3 of type tomb-wing-door +(defmethod inspect tomb-wing-door ((obj tomb-wing-door)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type tomb-wing-door +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-wing-door ((obj tomb-wing-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (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 2) (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) 5) + (set-vector! (-> v1-8 local-sphere) 0.0 40960.0 -16384.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) 4) + (set-vector! (-> v1-10 local-sphere) 0.0 40960.0 16384.0 61440.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 -12288.0 0.0 61440.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! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-wing-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (static-sound-spec "wing-door-open")) + (set! (-> obj sound-open-stop) (static-sound-spec "wing-open-hit")) + (set! (-> obj sound-close-loop) (static-sound-spec "wing-door-close")) + (set! (-> obj sound-close-stop) (static-sound-spec "wing-close-hit")) + (go (method-of-object obj close) #t) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-boulder-door tomb-boulder-door tomb-boulder-door-lod0-jg tomb-boulder-door-idle-ja + ((tomb-boulder-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 7 0 10) + :origin-joint-index 3 + ) + +;; definition of type tomb-boulder-door +(deftype tomb-boulder-door (process-drawable) + ((root-override collide-shape-moving :offset 128) + ) + :heap-base #x50 + :method-count-assert 22 + :size-assert #xc8 + :flag-assert #x16005000c8 + (:methods + (open () _type_ :state 20) + (close () _type_ :state 21) + ) + ) + +;; definition for method 3 of type tomb-boulder-door +(defmethod inspect tomb-boulder-door ((obj tomb-boulder-door)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defstate close (tomb-boulder-door) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('reset) + (if (task-node-closed? (game-task-node tomb-poles-boulder)) + (go-virtual close) + (go-virtual open) + ) + ) + ) + ) + :code (behavior () + (ja :num-func num-func-identity :frame-num 0.0) + (transform-post) + (suspend) + (transform-post) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate open (tomb-boulder-door) + :virtual #t + :event (-> (method-of-type tomb-boulder-door close) event) + :code (behavior () + (ja :num-func num-func-identity :frame-num (ja-aframe 5.0 0)) + (transform-post) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) + ) + +;; definition for method 11 of type tomb-boulder-door +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-boulder-door ((obj tomb-boulder-door) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape obj (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 camera-blocker)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot 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 24576.0 0.0 36864.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! (-> obj root-override) (the-as collide-shape-moving s4-0)) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boulder-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (if (task-node-closed? (game-task-node tomb-poles-boulder)) + (go (method-of-object obj close)) + (go (method-of-object obj open)) + ) + (none) + ) + +;; definition of type tomb-plat-return +(deftype tomb-plat-return (base-plat) + ((intro-path path-control :offset-assert 272) + (ride-timer time-frame :offset-assert 280) + (flags uint16 :offset-assert 288) + (path-pos float :offset-assert 292) + (dest-pos float :offset-assert 296) + (path-speed float :offset-assert 300) + (sound-id uint32 :offset-assert 304) + ) + :heap-base #xc0 + :method-count-assert 39 + :size-assert #x134 + :flag-assert #x2700c00134 + (:methods + (hidden () _type_ :state 34) + (run-intro () _type_ :state 35) + (waiting () _type_ :state 36) + (running () _type_ :state 37) + (waiting-for-no-player () _type_ :state 38) + ) + ) + +;; definition for method 3 of type tomb-plat-return +(defmethod inspect tomb-plat-return ((obj tomb-plat-return)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type base-plat inspect))) + (t9-0 obj) + ) + (format #t "~2Tintro-path: ~A~%" (-> obj intro-path)) + (format #t "~2Tride-timer: ~D~%" (-> obj ride-timer)) + (format #t "~2Tflags: ~D~%" (-> obj flags)) + (format #t "~2Tpath-pos: ~f~%" (-> obj path-pos)) + (format #t "~2Tdest-pos: ~f~%" (-> obj dest-pos)) + (format #t "~2Tpath-speed: ~f~%" (-> obj path-speed)) + (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-plat-return tomb-plat-return tomb-plat-return-lod0-jg tomb-plat-return-idle-ja + ((tomb-plat-return-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4.8) + ) + +;; failed to figure out what this is: +(defstate hidden (tomb-plat-return) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger 'cue-chase) + (go-virtual run-intro) + ) + ) + ) + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + (none) + ) + :code (the-as (function none :behavior tomb-plat-return) sleep-code) + ) + +;; failed to figure out what this is: +(defstate run-intro (tomb-plat-return) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior tomb-plat-return) plat-event) + :enter (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (ja-channel-set! 1) + (ja-no-eval :group! (-> self draw art-group data 2) :num! zero) + (set! (-> self path-pos) 0.0) + (set-vector! (-> self root-override scale) 0.0 0.0 0.0 0.0) + (none) + ) + :exit (behavior () + (sound-stop (the-as sound-id (-> self sound-id))) + (none) + ) + :trans (behavior () + (when (= (-> self path-pos) 1.0) + (set! (-> self path-pos) 0.0) + (go-virtual waiting) + ) + (plat-trans) + (none) + ) + :code (the-as (function none :behavior tomb-plat-return) sleep-code) + :post (behavior () + (sound-play "tomb-plat-ret" :id (the-as sound-id (-> self sound-id)) :position (-> self root-override trans)) + (seek! (-> self path-pos) 1.0 (* 2.0 (-> self clock seconds-per-frame) (-> self path-speed))) + (let ((f30-0 (-> self path-pos))) + (get-point-at-percent-along-path! + (-> self intro-path) + (-> self basetrans) + (ease-value-in-out f30-0 0.1) + 'interp + ) + (set-vector! (-> self root-override scale) f30-0 f30-0 f30-0 f30-0) + ) + (plat-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate waiting (tomb-plat-return) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('ridden) + (let ((v0-0 (the-as object (logior (-> self flags) 1)))) + (set! (-> self flags) (the-as uint v0-0)) + v0-0 + ) + ) + (else + (plat-event proc arg1 event-type event) + ) + ) + ) + :enter (behavior () + (set! (-> self ride-timer) (-> self clock frame-counter)) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (none) + ) + :trans (behavior () + (set! (-> self flags) (logand -2 (-> self flags))) + (plat-trans) + (if (not (logtest? (-> self flags) 1)) + (set! (-> self ride-timer) (-> self clock frame-counter)) + ) + (when (>= (- (-> self clock frame-counter) (-> self ride-timer)) (seconds 0.5)) + (if (= (-> self path-pos) 0.0) + (set! (-> self dest-pos) 1.0) + (set! (-> self dest-pos) 0.0) + ) + (go-virtual running) + ) + (none) + ) + :code (the-as (function none :behavior tomb-plat-return) sleep-code) + :post (the-as (function none :behavior tomb-plat-return) plat-post) + ) + +;; failed to figure out what this is: +(defstate running (tomb-plat-return) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('ridden) + (let ((v0-0 (the-as object (logior (-> self flags) 1)))) + (set! (-> self flags) (the-as uint v0-0)) + v0-0 + ) + ) + (else + (plat-event proc arg1 event-type event) + ) + ) + ) + :exit (behavior () + (sound-stop (the-as sound-id (-> self sound-id))) + (none) + ) + :trans (behavior () + (if (= (-> self path-pos) (-> self dest-pos)) + (go-virtual waiting-for-no-player) + ) + (plat-trans) + (none) + ) + :code (the-as (function none :behavior tomb-plat-return) sleep-code) + :post (behavior () + (sound-play "tomb-plat-ret" :id (the-as sound-id (-> self sound-id)) :position (-> self root-override trans)) + (seek! (-> self path-pos) (-> self dest-pos) (* (-> self path-speed) (-> self clock seconds-per-frame))) + (get-point-at-percent-along-path! + (-> self path) + (-> self basetrans) + (ease-value-in-out (-> self path-pos) 0.1) + 'interp + ) + (plat-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate waiting-for-no-player (tomb-plat-return) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('ridden) + (let ((v0-0 (the-as object (-> self clock frame-counter)))) + (set! (-> self ride-timer) (the-as time-frame v0-0)) + v0-0 + ) + ) + (else + (plat-event proc arg1 event-type event) + ) + ) + ) + :trans (behavior () + (plat-trans) + (when (>= (- (-> self clock frame-counter) (-> self ride-timer)) (seconds 1)) + (cond + ((= (-> self path-pos) 1.0) + (set! (-> self dest-pos) 0.0) + (go-virtual running) + ) + (else + (go-virtual waiting) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior tomb-plat-return) sleep-code) + :post (the-as (function none :behavior tomb-plat-return) plat-post) + ) + +;; definition for method 7 of type tomb-plat-return +;; WARN: Return type mismatch process-drawable vs tomb-plat-return. +(defmethod relocate tomb-plat-return ((obj tomb-plat-return) (arg0 int)) + (if (nonzero? (-> obj intro-path)) + (&+! (-> obj intro-path) arg0) + ) + (the-as tomb-plat-return ((method-of-type process-drawable relocate) obj arg0)) + ) + +;; definition for method 10 of type tomb-plat-return +(defmethod deactivate tomb-plat-return ((obj tomb-plat-return)) + (sound-stop (the-as sound-id (-> obj sound-id))) + ((the-as (function process-drawable none) (find-parent-method tomb-plat-return 10)) obj) + (none) + ) + +;; definition for method 31 of type tomb-plat-return +;; WARN: Return type mismatch int vs none. +(defmethod base-plat-method-31 tomb-plat-return ((obj tomb-plat-return)) + "TODO - collision stuff" + (let ((s5-0 (new 'process 'collide-shape obj (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)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 19660.8) + (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! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type tomb-plat-return +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-plat-return ((obj tomb-plat-return) (arg0 entity-actor)) + (base-plat-method-31 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-plat-return" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (stop-bouncing! obj) + (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj path-pos) 0.0) + (let ((s4-1 (new 'process 'curve-control obj 'path -1000000000.0))) + (if (logtest? (-> s4-1 flags) (path-control-flag not-found)) + (go process-drawable-art-error "error in path") + ) + (logior! (-> s4-1 flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> obj path) s4-1) + ) + (let ((s4-2 (new 'process 'curve-control obj 'intro -1000000000.0))) + (if (logtest? (-> s4-2 flags) (path-control-flag not-found)) + (go process-drawable-art-error "error in intro-path") + ) + (logior! (-> s4-2 flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> obj intro-path) s4-2) + ) + (let ((f30-0 (total-distance (-> obj path)))) + (set! (-> obj path-speed) (/ (res-lump-float arg0 'speed :default 40960.0) f30-0)) + (set! (-> obj root-override pause-adjust-distance) (+ 204800.0 f30-0)) + ) + (set! (-> obj sound-id) (the-as uint (new-sound-id))) + (base-plat-method-33 obj) + (if (or (task-closed? (the-as string ((method-of-type res-lump get-property-struct) + (-> obj entity) + 'task-name + 'interp + -1000000000.0 + "tomb-boss-resolution" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + ) + (go (method-of-object obj run-intro)) + (go (method-of-object obj hidden)) + ) + (none) + ) + +;; failed to figure out what this is: +(defpart 3159 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x83 :page #xc)) + (sp-func spt-birth-func 'birth-func-set-quat) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 10) (meters 1) 1.0) + (sp-flt spt-scale-y (meters 40)) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat) + ) + ) + +;; failed to figure out what this is: +(defpart 3160 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters -0.25)) + (sp-flt spt-z (meters 1.25)) + (sp-rnd-flt spt-scale-x (meters 5) (meters 0.5) 1.0) + (sp-flt spt-rot-x 409.6) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 96.0) + (sp-flt spt-g 96.0) + (sp-rnd-flt spt-b 196.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 3161 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbc :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters -0.15)) + (sp-flt spt-z (meters -1.25)) + (sp-rnd-flt spt-scale-x (meters 5) (meters 0.5) 1.0) + (sp-flt spt-rot-x 409.6) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 96.0) + (sp-flt spt-g 96.0) + (sp-rnd-flt spt-b 196.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 1024.0) + ) + ) + +;; definition for function tomb-sphinx-draw-beam +;; INFO: Used lq/sq +(defun tomb-sphinx-draw-beam ((arg0 vector) (arg1 vector)) + (let ((a2-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0))) + (set! (-> *part-id-table* 3159 init-specs 4 initial-valuef) (vector-length a2-1)) + (draw-beam (-> *part-id-table* 3159) arg0 a2-1 #f #t) + ) + (let ((t9-1 sp-launch-particles-var) + (a0-3 *sp-particle-system-2d*) + (a1-2 (-> *part-id-table* 3160)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> arg0 quad)) + (t9-1 a0-3 a1-2 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-3 (-> *part-id-table* 3161)) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> arg1 quad)) + (t9-2 a0-4 a1-3 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (none) + ) + +;; definition of type tomb-sphinx +(deftype tomb-sphinx (process-drawable) + ((root-override collide-shape-moving :offset 128) + (target-actor entity-actor :offset-assert 200) + (sound-id uint32 :offset-assert 204) + (move-dir float :offset 216) + ) + :heap-base #x60 + :method-count-assert 23 + :size-assert #xdc + :flag-assert #x17006000dc + (:methods + (idle () _type_ :state 20) + (active () _type_ :state 21) + (doors-open () _type_ :state 22) + ) + ) + +;; definition for method 3 of type tomb-sphinx +(defmethod inspect tomb-sphinx ((obj tomb-sphinx)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Ttarget-actor: ~A~%" (-> obj target-actor)) + (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) + (format #t "~2Tmove-dir: ~f~%" (-> obj move-dir)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defstate idle (tomb-sphinx) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger 'cue-chase) + (go-virtual active) + ) + ) + ) + :code (the-as (function none :behavior tomb-sphinx) sleep-code) + ) + +;; failed to figure out what this is: +(defstate active (tomb-sphinx) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('door-left) + (set! (-> self move-dir) -1.0) + (go-virtual doors-open) + ) + (('door-right) + (set! (-> self move-dir) 1.0) + (go-virtual doors-open) + ) + ) + ) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :code (behavior () + (local-vars (sv-96 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (logclear! (-> self mask) (process-mask actor-pause)) + (sound-play "tomb-lasr-start") + (let ((gp-2 (vector+! + (new 'stack-no-clear 'vector) + (-> self target-actor extra trans) + (new 'static 'vector :y 101580.8 :w 1.0) + ) + ) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> self root-override trans quad)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (until #f + (let ((s3-0 tomb-sphinx-draw-beam) + (s2-0 s5-1) + ) + (set! sv-96 s4-0) + (let ((s1-0 s5-1)) + (let ((s0-1 (vector-! (new 'stack-no-clear 'vector) gp-2 s5-1))) + (let ((v1-13 (lerp-scale 0.0 1.0 (the float (- (-> self clock frame-counter) (-> self state-time))) 0.0 300.0))) + (.mov vf7 v1-13) + ) + (.lvf vf5 (&-> s0-1 quad)) + ) + (.lvf vf4 (&-> s1-0 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 (&-> sv-96 quad) vf6) + (s3-0 s2-0 sv-96) + ) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (vector-segment-distance-point! (ear-trans 0) s5-1 s4-0 s3-1) + (sound-play "tomb-lasr-loop" :id (the-as sound-id (-> self sound-id)) :position s3-1) + ) + (suspend) + ) + ) + ) + #f + (none) + ) + ) + ) + +;; failed to figure out what this is: +(defstate doors-open (tomb-sphinx) + :virtual #t + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :code (behavior () + (local-vars (sv-96 vector) (sv-112 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((gp-1 (vector+! + (new 'stack-no-clear 'vector) + (-> self target-actor extra trans) + (new 'static 'vector :y 101580.8 :w 1.0) + ) + ) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> self root-override trans quad)) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (let ((a1-0 s4-0)) + (let ((v1-8 gp-1)) + (let ((a0-2 (new 'static 'vector :x 4096.0 :w 1.0))) + (let ((a2-1 (* 14.0 (-> self move-dir)))) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 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-0 quad) vf6) + ) + (until #f + (let ((s2-0 tomb-sphinx-draw-beam) + (s1-0 s5-0) + ) + (set! sv-112 s3-0) + (let ((s0-0 gp-1)) + (set! sv-96 (new 'stack-no-clear 'vector)) + (let ((v1-10 gp-1) + (a0-3 s4-0) + ) + (.lvf vf4 (&-> v1-10 quad)) + (.lvf vf5 (&-> a0-3 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-96 quad) vf6) + (let ((v1-15 (lerp-scale 0.0 1.0 (the float (- (-> self clock frame-counter) (-> self state-time))) 0.0 930.0))) + (.mov vf7 v1-15) + ) + (.lvf vf5 (&-> sv-96 quad)) + (.lvf vf4 (&-> s0-0 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 (&-> sv-112 quad) vf6) + (s2-0 s1-0 sv-112) + ) + (suspend) + ) + ) + ) + #f + (none) + ) + ) + ) + +;; definition for method 7 of type tomb-sphinx +;; WARN: Return type mismatch process-drawable vs tomb-sphinx. +(defmethod relocate tomb-sphinx ((obj tomb-sphinx) (arg0 int)) + (the-as tomb-sphinx ((method-of-type process-drawable relocate) obj arg0)) + ) + +;; definition for method 10 of type tomb-sphinx +(defmethod deactivate tomb-sphinx ((obj tomb-sphinx)) + (sound-stop (the-as sound-id (-> obj sound-id))) + ((the-as (function process-drawable none) (find-parent-method tomb-sphinx 10)) obj) + (none) + ) + +;; definition for method 11 of type tomb-sphinx +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-sphinx ((obj tomb-sphinx) (arg0 entity-actor)) + (set! (-> obj root-override) (the-as collide-shape-moving (new 'process 'trsqv))) + (process-drawable-from-entity! obj arg0) + (set! (-> obj target-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> obj sound-id) (the-as uint (new-sound-id))) + (set! (-> obj move-dir) 0.0) + (if (and (task-complete? *game-info* (-> obj entity task)) + (not (task-node-closed? (game-task-node tomb-boss-door))) + ) + (go (method-of-object obj active)) + (go (method-of-object obj idle)) + ) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/mars_tomb/tomb-water_REF.gc b/test/decompiler/reference/jak2/levels/mars_tomb/tomb-water_REF.gc new file mode 100644 index 0000000000..11871b332d --- /dev/null +++ b/test/decompiler/reference/jak2/levels/mars_tomb/tomb-water_REF.gc @@ -0,0 +1,3054 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type tomb-door +(deftype tomb-door (process-drawable) + ((notify-actor entity :offset-assert 200) + (round uint32 :offset-assert 204) + ) + :heap-base #x50 + :method-count-assert 22 + :size-assert #xd0 + :flag-assert #x16005000d0 + (:methods + (idle () _type_ :state 20) + (open (time-frame) _type_ :state 21) + ) + ) + +;; definition for method 3 of type tomb-door +(defmethod inspect tomb-door ((obj tomb-door)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tnotify-actor: ~A~%" (-> obj notify-actor)) + (format #t "~2Tround: ~D~%" (-> obj round)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-door tomb-door tomb-door-lod0-jg tomb-door-idle-ja + ((tomb-door-lod0-mg (meters 999999))) + :bounds (static-spherem 4 4 0 7) + ) + +;; failed to figure out what this is: +(defstate idle (tomb-door) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('simon-done) + (sound-play "simon-correct") + ) + (('trigger) + (go-virtual open (seconds 0.5)) + ) + ) + ) + :trans (behavior () + (when (logtest? (actor-option user17) (-> self fact options)) + (let* ((gp-0 *target*) + (a0-3 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + (s4-0 (-> self root trans)) + ) + (when a0-3 + (let* ((s3-0 (get-trans a0-3 0)) + (s5-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s3-0 s4-0) 1.0)) + (gp-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (if (and (< (vector-vector-xz-distance s4-0 s3-0) 61440.0) (< (vector-dot s5-0 gp-1) 0.0)) + (go-virtual open 0) + ) + ) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior tomb-door) sleep-code) + ) + +;; failed to figure out what this is: +(defstate open (tomb-door) + :virtual #t + :enter (behavior ((arg0 time-frame)) + (let ((gp-0 (-> self notify-actor))) + (when gp-0 + (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) 'untrigger) + (let ((t9-0 send-event-function) + (v1-2 gp-0) + ) + (t9-0 + (if v1-2 + (-> v1-2 extra process) + ) + a1-0 + ) + ) + ) + (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) + (let ((v0-3 (-> *event-queue* data (-> *event-queue* length)))) + (+! (-> *event-queue* length) 1) + (set! (-> v0-3 form-handle) (process->handle self)) + (set! (-> v0-3 to-handle) (process->handle (if gp-0 + (-> gp-0 extra process) + ) + ) + ) + (set! (-> v0-3 num-params) 1) + (set! (-> v0-3 message) 'set-round) + (set! (-> v0-3 param 0) (-> self round)) + ) + ) + ) + ) + (none) + ) + :code (behavior ((arg0 time-frame)) + (let ((s5-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s5-0) arg0) + (suspend) + ) + ) + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (-> self root quat) + (transform-post) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + (none) + ) + ) + +;; definition for method 11 of type tomb-door +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-door ((obj tomb-door) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape obj (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 camera-blocker pusher)) + (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) 16384.0 16384.0 0.0 36864.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-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 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)) + (set! (-> v1-11 transform-index) 4) + (set-vector! (-> v1-11 local-sphere) 8192.0 16384.0 4096.0 22528.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec camera-blocker pusher)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 5) + (set-vector! (-> v1-13 local-sphere) -8192.0 16384.0 4096.0 22528.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! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj fact) + (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> obj round) (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0)) + (ja-channel-push! 1 0) + (let ((a0-27 (-> obj skel root-channel 0))) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> a0-27 frame-num) 0.0) + (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type tomb-beetle-door +(deftype tomb-beetle-door (process-drawable) + ((offset vector 3 :inline :offset-assert 208) + (offset-index int32 :offset-assert 256) + (key-index int32 :offset-assert 260) + (beetle handle 3 :offset-assert 264) + (actor-group (pointer actor-group) :offset-assert 288) + (actor-group-count int32 :offset-assert 292) + ) + :heap-base #xb0 + :method-count-assert 22 + :size-assert #x128 + :flag-assert #x1600b00128 + (:methods + (idle () _type_ :state 20) + (open () _type_ :state 21) + ) + ) + +;; definition for method 3 of type tomb-beetle-door +(defmethod inspect tomb-beetle-door ((obj tomb-beetle-door)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Toffset[3] @ #x~X~%" (-> obj offset)) + (format #t "~2Toffset-index: ~D~%" (-> obj offset-index)) + (format #t "~2Tkey-index: ~D~%" (-> obj key-index)) + (format #t "~2Tbeetle[3] @ #x~X~%" (-> obj beetle)) + (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) + (dotimes (s5-0 (-> obj actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) + (label cfg-7) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-beetle-door tomb-beetle-door tomb-beetle-door-lod0-jg tomb-beetle-door-idle-ja + ((tomb-beetle-door-lod0-mg (meters 999999))) + :bounds (static-spherem 4 4 0 7) + ) + +;; failed to figure out what this is: +(defstate idle (tomb-beetle-door) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('add-beetle) + (set! (-> self beetle (-> self offset-index)) (process->handle proc)) + (+! (-> self offset-index) 1) + (-> self offset (+ (-> self offset-index) -1)) + ) + (('key) + (+! (-> self key-index) 1) + (if (= (-> self key-index) 3) + (go-virtual open) + ) + ) + (('trigger) + (go-virtual open) + ) + ) + ) + :code (the-as (function none :behavior tomb-beetle-door) sleep-code) + :post (behavior () + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate open (tomb-beetle-door) + :virtual #t + :enter (behavior () + (let ((gp-0 (-> self actor-group 0))) + (dotimes (s5-0 (-> gp-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) 'die) + (let ((t9-0 send-event-function) + (v1-5 (-> gp-0 data s5-0 actor)) + ) + (t9-0 + (if v1-5 + (-> v1-5 extra process) + ) + a1-0 + ) + ) + ) + ) + ) + (let ((gp-1 (-> self actor-group 1))) + (dotimes (s5-1 (-> gp-1 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) 'door-open) + (let ((t9-1 send-event-function) + (v1-16 (-> gp-1 data s5-1 actor)) + ) + (t9-1 + (if v1-16 + (-> v1-16 extra process) + ) + a1-1 + ) + ) + ) + ) + ) + (none) + ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + (none) + ) + :post (the-as (function none :behavior tomb-beetle-door) ja-post) + ) + +;; definition for symbol tomb-beetle-door-offsets, type (inline-array vector) +(define tomb-beetle-door-offsets (new 'static 'inline-array vector 3 + (new 'static 'vector :x 8192.0 :y 20480.0 :z 819.2 :w 1.0) + (new 'static 'vector :x 16384.0 :y 20480.0 :z 819.2 :w 1.0) + (new 'static 'vector :x 24576.0 :y 20480.0 :z 819.2 :w 1.0) + ) + ) + +;; definition for method 11 of type tomb-beetle-door +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-beetle-door ((obj tomb-beetle-door) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (let ((s4-0 (new 'process 'collide-shape obj (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 camera-blocker pusher)) + (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) 16384.0 16384.0 4096.0 49152.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-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 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)) + (set! (-> v1-11 transform-index) 4) + (set-vector! (-> v1-11 local-sphere) 8192.0 16384.0 4096.0 22528.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec camera-blocker pusher)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 5) + (set-vector! (-> v1-13 local-sphere) -8192.0 16384.0 4096.0 22528.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! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-beetle-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (countdown (s5-2 3) + (vector-orient-by-quat! (-> obj offset s5-2) (-> tomb-beetle-door-offsets s5-2) (-> obj root quat)) + (set! (-> obj offset s5-2 w) (quaternion-y-angle (-> obj root quat))) + (set! (-> obj beetle s5-2) (the-as handle #f)) + ) + (set! (-> obj offset-index) 0) + (set! (-> obj key-index) 0) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-33 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-33 (nonzero? (-> sv-16 elt-count))) + (set! (-> obj actor-group) (the-as (pointer actor-group) v1-33)) + (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> obj actor-group-count) 0) + 0 + ) + ) + ) + (ja-channel-push! 1 0) + (let ((a0-30 (-> obj skel root-channel 0))) + (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> a0-30 frame-num) 0.0) + (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-button tomb-button tomb-button-lod0-jg tomb-button-idle-ja + ((tomb-button-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + ) + +;; definition of type tomb-button +(deftype tomb-button (basebutton) + () + :heap-base #xa0 + :method-count-assert 39 + :size-assert #x120 + :flag-assert #x2700a00120 + ) + +;; definition for method 3 of type tomb-button +(defmethod inspect tomb-button ((obj tomb-button)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type basebutton inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 33 of type tomb-button +;; WARN: Return type mismatch int vs none. +(defmethod basebutton-method-33 tomb-button ((obj tomb-button)) + "TODO - joint stuff" + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-button" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (cond + ((logtest? (-> obj button-status) (button-status pressed)) + (let ((s5-1 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-1 + (the-as art-joint-anim (-> obj draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-1 frame-num) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) frames num-frames) -1)) + ) + ) + ) + (else + (let ((s5-2 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-2 + (the-as art-joint-anim (-> obj draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-2 frame-num) 0.0) + ) + ) + ) + (transform-post) + (none) + ) + +;; definition for method 34 of type tomb-button +;; WARN: Return type mismatch collide-shape vs none. +(defmethod basebutton-method-34 tomb-button ((obj tomb-button)) + "TODO - collision stuff" + (let ((s5-0 (new 'process 'collide-shape obj (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 9011.2) + (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! (-> obj root-override) s5-0) + ) + (none) + ) + +;; definition for method 35 of type tomb-button +;; WARN: Return type mismatch float vs none. +(defmethod prepare-trigger-event! tomb-button ((obj tomb-button)) + "Sets `event-going-down` to `'trigger`" + (logior! (-> obj button-status) (button-status button-status-4)) + (set! (-> obj event-going-down) 'cue-chase) + (set! (-> obj root-override trans y) (+ 204.8 (-> obj root-override trans y))) + (none) + ) + +;; definition of type tomb-beetle-button +(deftype tomb-beetle-button (tomb-button) + ((round uint32 :offset-assert 288) + (speech-mask uint32 :offset-assert 292) + (speech-timer time-frame :offset-assert 296) + ) + :heap-base #xb0 + :method-count-assert 40 + :size-assert #x130 + :flag-assert #x2800b00130 + (:methods + (tomb-beetle-button-method-39 (_type_) none 39) + ) + ) + +;; definition for method 3 of type tomb-beetle-button +(defmethod inspect tomb-beetle-button ((obj tomb-beetle-button)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type tomb-button inspect))) + (t9-0 obj) + ) + (format #t "~2Tround: ~D~%" (-> obj round)) + (format #t "~2Tspeech-mask: ~D~%" (-> obj speech-mask)) + (format #t "~2Tspeech-timer: ~D~%" (-> obj speech-timer)) + (label cfg-4) + obj + ) + +;; definition for method 39 of type tomb-beetle-button +;; WARN: Return type mismatch int vs none. +(defmethod tomb-beetle-button-method-39 tomb-beetle-button ((obj tomb-beetle-button)) + (with-pp + (when (>= (- (-> pp clock frame-counter) (-> obj speech-timer)) (seconds 6)) + (let ((s5-0 (rand-vu-int-count-excluding 4 (the-as int (-> obj speech-mask))))) + (let* ((v1-4 s5-0) + (t0-0 (cond + ((zero? v1-4) + "ora011" + ) + ((= v1-4 1) + "ora012" + ) + ((= v1-4 2) + "ora013" + ) + ((= v1-4 3) + "ora014" + ) + ) + ) + ) + (add-process *gui-control* obj (gui-channel alert) (gui-action play) t0-0 -99.0 0) + ) + (set! (-> obj speech-mask) (the-as uint (ash 1 s5-0))) + ) + (set! (-> obj speech-timer) (-> pp clock frame-counter)) + ) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate going-down (tomb-beetle-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('get-round) + (-> self round) + ) + (else + ((-> (method-of-type basebutton going-down) event) proc arg1 event-type event) + ) + ) + ) + :enter (behavior () + (let ((t9-0 (-> (method-of-type tomb-button going-down) enter))) + (if t9-0 + (t9-0) + ) + ) + (process-grab? *target* #f) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate down-idle (tomb-beetle-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) + (the-as object (cond + ((= v1-0 'set-round) + (let ((v0-0 (the-as object (-> event param 0)))) + (set! (-> self round) (the-as uint v0-0)) + v0-0 + ) + ) + ((= v1-0 'door-open) + (remove-setting! 'gun) + (the-as object (remove-setting! 'entity-name)) + ) + (else + ((-> (method-of-type basebutton down-idle) event) proc arg1 event-type event) + ) + ) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type tomb-button down-idle) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 4)) + (if (and *target* (logtest? (-> *target* focus-status) (focus-status grabbed))) + (process-release? *target*) + ) + (if (and *target* + (logtest? (state-flags prevent-gun) (-> *target* state-flags)) + (cpad-pressed? (-> *target* control cpad number) up right down left r1) + ) + (tomb-beetle-button-method-39 self) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate going-up (tomb-beetle-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('set-round) + (let ((v0-0 (the-as object (-> event param 0)))) + (set! (-> self round) (the-as uint v0-0)) + v0-0 + ) + ) + (else + ((-> (method-of-type basebutton going-up) event) proc arg1 event-type event) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate up-idle (tomb-beetle-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('get-round) + (-> self round) + ) + (('set-round) + (let ((v0-0 (the-as object (-> event param 0)))) + (set! (-> self round) (the-as uint v0-0)) + v0-0 + ) + ) + (else + ((-> (method-of-type basebutton up-idle) event) proc arg1 event-type event) + ) + ) + ) + :trans (behavior () + (let ((t9-1 (-> (the-as (state basebutton) (find-parent-method tomb-beetle-button 30)) trans))) + (if t9-1 + (t9-1) + ) + ) + (let ((v1-2 *target*)) + (cond + ((and v1-2 (< (vector-vector-xz-distance (-> v1-2 control trans) (-> self root-override trans)) 40960.0)) + (when (zero? (-> self entity extra perm user-uint8 1)) + (tomb-beetle-button-method-39 self) + (let ((v1-15 (-> self entity extra perm))) + (logior! (-> v1-15 status) (entity-perm-status bit-5)) + (set! (-> v1-15 user-int8 1) 1) + ) + ) + (set-setting! 'gun #f 0 0) + (set-setting! 'entity-name "camera-194" 0 0) + (if (and *target* + (logtest? (state-flags prevent-gun) (-> *target* state-flags)) + (cpad-pressed? (-> *target* control cpad number) up right down left r1) + ) + (tomb-beetle-button-method-39 self) + ) + ) + (else + (remove-setting! 'gun) + (remove-setting! 'entity-name) + ) + ) + ) + (none) + ) + ) + +;; definition for method 36 of type tomb-beetle-button +;; WARN: Return type mismatch symbol vs none. +(defmethod send-event! tomb-beetle-button ((obj tomb-beetle-button) (arg0 symbol)) + "Prepares an [[event-message-block]] using the provided type to send an event to: + - the `notify-actor` + - every [[entity-actor]] in the `actor-group` array + @see [[entity-actor]]" + (when arg0 + (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) arg0) + (let ((t9-0 send-event-function) + (v1-1 (-> obj notify-actor)) + ) + (t9-0 + (if v1-1 + (-> v1-1 extra process) + ) + a1-1 + ) + ) + ) + (let ((s4-0 (-> obj actor-group (-> obj round)))) + (dotimes (s3-0 (-> s4-0 length)) + (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) arg0) + (set! (-> a1-2 param 0) (-> obj round)) + (let ((t9-1 send-event-function) + (v1-11 (-> s4-0 data s3-0 actor)) + ) + (t9-1 + (if v1-11 + (-> v1-11 extra process) + ) + a1-2 + ) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 35 of type tomb-beetle-button +;; WARN: Return type mismatch int vs none. +(defmethod prepare-trigger-event! tomb-beetle-button ((obj tomb-beetle-button)) + "Sets `event-going-down` to `'trigger`" + (let ((t9-0 (method-of-type tomb-button prepare-trigger-event!))) + (t9-0 obj) + ) + (set! (-> obj round) (-> obj entity extra perm user-uint8 0)) + (set! (-> obj speech-mask) (the-as uint 0)) + (set! (-> obj speech-timer) 0) + 0 + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-move-swing-pole tomb-move-swing-pole tomb-move-swing-pole-lod0-jg tomb-move-swing-pole-idle-ja + ((tomb-move-swing-pole-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.5) + ) + +;; definition of type tomb-simon-block +(deftype tomb-simon-block (base-plat) + ((sound-show uint128 :offset-assert 272) + (color vector :inline :offset-assert 288) + (my-idx int32 :offset-assert 304) + (next-idx int32 :offset-assert 308) + (flags simon-block-flags :offset-assert 312) + (blink-timer time-frame 2 :offset-assert 320) + (ride-timer time-frame :offset-assert 336) + (order int32 :offset-assert 344) + (base-height float :offset-assert 348) + (move-rate float :offset-assert 352) + ) + :heap-base #xf0 + :method-count-assert 42 + :size-assert #x164 + :flag-assert #x2a00f00164 + (:methods + (idle () _type_ :state 34) + (ready () _type_ :state 35) + (ridden () _type_ :state 36) + (temporary () _type_ :state 37) + (dangerous () _type_ :state 38) + (wobble-die () _type_ :state 39) + (die () _type_ :state 40) + (set-blink-timers! (_type_) none 41) + ) + ) + +;; definition for method 3 of type tomb-simon-block +;; INFO: Used lq/sq +(defmethod inspect tomb-simon-block ((obj tomb-simon-block)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type base-plat inspect))) + (t9-0 obj) + ) + (format #t "~2Tsound-show: ~D~%" (-> obj sound-show)) + (format #t "~2Tcolor: #~%" (-> obj color)) + (format #t "~2Tmy-idx: ~D~%" (-> obj my-idx)) + (format #t "~2Tnext-idx: ~D~%" (-> obj next-idx)) + (format #t "~2Tflags: ~D~%" (-> obj flags)) + (format #t "~2Tblink-timer[2] @ #x~X~%" (-> obj blink-timer)) + (format #t "~2Tride-timer: ~D~%" (-> obj ride-timer)) + (format #t "~2Torder: ~D~%" (-> obj order)) + (format #t "~2Tbase-height: ~f~%" (-> obj base-height)) + (format #t "~2Tmove-rate: ~f~%" (-> obj move-rate)) + (label cfg-4) + obj + ) + +;; definition of type tomb-plat-simon +(deftype tomb-plat-simon (process-drawable) + ((plat (array handle) :offset-assert 200) + (plat-seq (pointer uint32) :offset-assert 204) + (plat-count int32 :offset-assert 208) + (plat-seq-count int32 :offset-assert 212) + (plat-idx int32 :offset-assert 216) + (button-handle handle :offset-assert 224) + (notify-actor entity :offset-assert 232) + (flags uint16 :offset-assert 236) + ) + :heap-base #x70 + :method-count-assert 25 + :size-assert #xee + :flag-assert #x19007000ee + (:methods + (dormant () _type_ :state 20) + (appear () _type_ :state 21) + (show-sequence () _type_ :state 22) + (idle () _type_ :state 23) + (tomb-plat-simon-method-24 (_type_ int) none 24) + ) + ) + +;; definition for method 3 of type tomb-plat-simon +(defmethod inspect tomb-plat-simon ((obj tomb-plat-simon)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tplat: ~A~%" (-> obj plat)) + (format #t "~2Tplat-seq: #x~X~%" (-> obj plat-seq)) + (format #t "~2Tplat-count: ~D~%" (-> obj plat-count)) + (format #t "~2Tplat-seq-count: ~D~%" (-> obj plat-seq-count)) + (format #t "~2Tplat-idx: ~D~%" (-> obj plat-idx)) + (format #t "~2Tbutton-handle: ~D~%" (-> obj button-handle)) + (format #t "~2Tnotify-actor: ~A~%" (-> obj notify-actor)) + (format #t "~2Tflags: ~D~%" (-> obj flags)) + (label cfg-4) + obj + ) + +;; definition for symbol *tomb-simon-sound-tbl*, type (pointer sound-name) +(define *tomb-simon-sound-tbl* (new 'static 'array sound-name 4 + (static-sound-name "simon-red") + (static-sound-name "simon-green") + (static-sound-name "simon-blue") + (static-sound-name "simon-yellow") + ) + ) + +;; definition for symbol *tomb-simon-color-tbl*, type (inline-array vector) +(define *tomb-simon-color-tbl* (new 'static 'inline-array vector 4 + (new 'static 'vector :x 0.8 :y 0.28 :z 0.28 :w 1.0) + (new 'static 'vector :x 0.39 :y 0.61 :z 0.28 :w 1.0) + (new 'static 'vector :x 0.28 :y 0.5 :z 0.61 :w 1.0) + (new 'static 'vector :x 0.8 :y 0.64 :z 0.28 :w 1.0) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-simon-block tomb-plat-simon tomb-plat-simon-lod0-jg tomb-plat-simon-idle-ja + ((tomb-plat-simon-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; definition for function tomb-plat-simon-handler +;; WARN: Return type mismatch none vs object. +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 135] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 199] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 280] +(defbehavior tomb-plat-simon-handler tomb-plat-simon ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (the-as object (case arg2 + (('ready-index) + (tomb-plat-simon-method-24 self (the-as int (-> arg3 param 0))) + ) + (('plat-ridden) + (logior! (-> self flags) 1) + (when (= (-> arg3 param 0) (-> self plat-seq (+ (-> self plat-seq-count) -1))) + (when (-> self notify-actor) + (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) 'simon-done) + (let ((t9-1 send-event-function) + (v1-11 (-> self notify-actor)) + ) + (t9-1 + (if v1-11 + (-> v1-11 extra process) + ) + a1-2 + ) + ) + ) + (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) + (let ((v1-20 (-> *event-queue* data (-> *event-queue* length)))) + (+! (-> *event-queue* length) 1) + (set! (-> v1-20 form-handle) (process->handle self)) + (let ((a0-23 (-> self notify-actor))) + (set! (-> v1-20 to-handle) (process->handle (if a0-23 + (-> a0-23 extra process) + ) + ) + ) + ) + (set! (-> v1-20 num-params) 0) + (set! (-> v1-20 message) 'trigger) + ) + ) + ) + (sound-play "tomb-simon-fall") + (dotimes (s5-1 (-> self plat-count)) + (if (!= s5-1 (-> arg3 param 0)) + (send-event (handle->process (-> self plat s5-1)) 'die-unmaskable) + ) + ) + #f + ) + ) + (('finished) + (if (-> self button-handle) + (send-event (handle->process (-> self button-handle)) 'trigger) + ) + (dotimes (gp-1 (-> self plat-count)) + (send-event (handle->process (-> self plat gp-1)) 'die-unmaskable) + ) + (go-virtual dormant) + ) + (('die-but) + (if (-> self button-handle) + (send-event (handle->process (-> self button-handle)) 'untrigger) + ) + (sound-play "tomb-simon-fall") + (dotimes (s5-3 (-> self plat-count)) + (if (!= s5-3 (-> arg3 param 0)) + (send-event (handle->process (-> self plat s5-3)) 'die) + ) + ) + (go-virtual dormant) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate dormant (tomb-plat-simon) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger 'cue-chase) + (set! (-> self button-handle) (process->handle proc)) + (go-virtual appear) + ) + ) + ) + :code (the-as (function none :behavior tomb-plat-simon) sleep-code) + ) + +;; failed to figure out what this is: +(defstate appear (tomb-plat-simon) + :virtual #t + :event tomb-plat-simon-handler + :enter (behavior () + (local-vars + (sv-96 target) + (sv-128 vector) + (sv-136 int) + (sv-144 int) + (sv-160 int) + (sv-176 (function vector vector float)) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self plat-idx) 0) + (dotimes (gp-0 (-> self plat-count)) + (if (nonzero? (-> self plat gp-0)) + (send-event (handle->process (-> self plat gp-0)) 'die-unmaskable) + ) + ) + (let ((gp-1 *target*)) + (set! sv-96 (if (type? gp-1 process-focusable) + gp-1 + ) + ) + ) + (dotimes (gp-2 (-> self plat-count)) + (set! sv-128 (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (the float gp-2) 'exact)) + (set! sv-136 -1) + (dotimes (v1-20 (+ (-> self plat-seq-count) -1)) + (if (= gp-2 (-> self plat-seq v1-20)) + (set! sv-136 (the-as int (-> self plat-seq (+ v1-20 1)))) + ) + ) + (let ((v1-26 (the int (* 0.000061035156 (+ 40960000.0 (-> sv-128 x))))) + (a0-21 (the int (* 0.000061035156 (+ 40960000.0 (-> sv-128 z))))) + ) + (set! sv-144 (logand (logior (logand v1-26 1) (* a0-21 2)) 3)) + ) + (let* ((s5-0 (get-process *default-dead-pool* tomb-simon-block #x4000)) + (s4-0 (when s5-0 + (let ((t9-4 (method-of-type tomb-simon-block activate))) + (t9-4 + (the-as tomb-simon-block s5-0) + self + (symbol->string (-> tomb-simon-block symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((s4-1 run-function-in-process) + (s3-0 s5-0) + (s2-0 tomb-simon-block-init-by-other) + (s1-0 sv-128) + (s0-0 gp-2) + ) + (set! sv-160 sv-136) + (let ((f30-0 0.00012207031)) + (set! sv-176 vector-vector-xz-distance) + (let* ((a0-26 (get-trans sv-96 0)) + (a1-9 sv-128) + (t1-0 (the int (* f30-0 (sv-176 a0-26 a1-9)))) + (t2-0 sv-144) + ) + ((the-as (function object object object object object object object none) s4-1) + s3-0 + s2-0 + s1-0 + s0-0 + sv-160 + t1-0 + t2-0 + ) + ) + ) + ) + (-> s5-0 ppointer) + ) + ) + ) + (send-event (ppointer->process s4-0) 'reparent) + (set! (-> self plat gp-2) (ppointer->handle s4-0)) + ) + ) + (none) + ) + :code (behavior () + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 2)) + (suspend) + ) + ) + (go-virtual show-sequence) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate show-sequence (tomb-plat-simon) + :virtual #t + :event tomb-plat-simon-handler + :enter (behavior () + (set! (-> self state-time) (+ (-> self clock frame-counter) (seconds -1))) + (set! (-> self plat-idx) 0) + 0 + (none) + ) + :trans (behavior () + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (set! (-> self state-time) (-> self clock frame-counter)) + (if (< (-> self plat-idx) (-> self plat-seq-count)) + (send-event (handle->process (-> self plat (-> self plat-seq (-> self plat-idx)))) 'blink) + ) + (if (zero? (-> self plat-idx)) + (tomb-plat-simon-method-24 self (the-as int (-> self plat-seq 0))) + ) + (+! (-> self plat-idx) 1) + (if (= (-> self plat-idx) (+ (-> self plat-seq-count) 1)) + (go-virtual idle) + ) + ) + (none) + ) + :code (the-as (function none :behavior tomb-plat-simon) sleep-code) + ) + +;; failed to figure out what this is: +(defstate idle (tomb-plat-simon) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger 'cue-chase) + (dotimes (gp-0 (-> self plat-count)) + (send-event (handle->process (-> self plat gp-0)) 'reset) + ) + (go-virtual show-sequence) + ) + (else + (tomb-plat-simon-handler proc arg1 event-type event) + ) + ) + ) + :enter (behavior () + (if (-> self button-handle) + (send-event (handle->process (-> self button-handle)) 'untrigger) + ) + (none) + ) + :code (the-as (function none :behavior tomb-plat-simon) sleep-code) + :post (behavior () + (debug-draw (-> self path)) + (none) + ) + ) + +;; definition for method 24 of type tomb-plat-simon +;; WARN: Return type mismatch object vs none. +(defmethod tomb-plat-simon-method-24 tomb-plat-simon ((obj tomb-plat-simon) (arg0 int)) + (let ((a0-3 (handle->process (-> obj plat arg0)))) + (send-event a0-3 'ready) + ) + (none) + ) + +;; definition for method 7 of type tomb-plat-simon +;; WARN: Return type mismatch process-drawable vs tomb-plat-simon. +(defmethod relocate tomb-plat-simon ((obj tomb-plat-simon) (arg0 int)) + (if (nonzero? (-> obj plat)) + (&+! (-> obj plat) arg0) + ) + (the-as tomb-plat-simon ((method-of-type process-drawable relocate) obj arg0)) + ) + +;; definition for method 11 of type tomb-plat-simon +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-plat-simon ((obj tomb-plat-simon) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (change-parent obj *pusher-pool*) + (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-2 (res-lump-data (-> obj entity) 'plat-seq pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-2 (nonzero? (-> sv-16 elt-count))) + (set! (-> obj plat-seq-count) (the-as int (-> sv-16 elt-count))) + (set! (-> obj plat-seq) (the-as (pointer uint32) v1-2)) + ) + (else + (set! (-> obj plat-seq-count) 0) + (set! (-> obj plat-seq) (the-as (pointer uint32) #f)) + ) + ) + ) + (let ((s4-0 arg0)) + (let ((v1-4 (entity-actor-lookup arg0 'path-actor 0))) + (if v1-4 + (set! s4-0 v1-4) + ) + ) + (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 s4-0 #f)) + ) + (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> obj plat-count) (-> obj path curve num-cverts)) + (set! (-> obj plat) (new 'process 'boxed-array handle (-> obj plat-count))) + (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj button-handle) (the-as handle #f)) + (go (method-of-object obj dormant)) + (none) + ) + +;; definition for function simon-block-handler +(defbehavior simon-block-handler tomb-simon-block ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (plat-event arg0 arg1 arg2 arg3) + ) + +;; definition for function tomb-simon-block-post +(defbehavior tomb-simon-block-post tomb-simon-block () + (when (!= (-> self basetrans y) (-> self base-height)) + (seek! (-> self basetrans y) (-> self base-height) (* (-> self move-rate) (-> self clock seconds-per-frame))) + (when (and (< (- (-> self base-height) (-> self basetrans y)) 21504.0) + (zero? (logand (-> self flags) (simon-block-flags sbf5))) + ) + (sound-play "simon-up") + (logior! (-> self flags) (simon-block-flags sbf5)) + ) + (if (< (- (-> self base-height) (-> self basetrans y)) 81920.0) + (seek! (-> self move-rate) 0.0 (* 81920.0 (-> self clock seconds-per-frame))) + ) + (when (< (+ -409.6 (-> self base-height)) (-> self basetrans y)) + (sound-play "simon-hit") + (set! (-> self basetrans y) (-> self base-height)) + ) + ) + (plat-post) + (none) + ) + +;; definition for function tomb-simon-block-trans +;; INFO: Used lq/sq +(defbehavior tomb-simon-block-trans tomb-simon-block () + (when (logtest? (-> self flags) (simon-block-flags sbf0)) + (when (>= (-> self clock frame-counter) (-> self blink-timer 1)) + (cond + ((logtest? (-> self flags) (simon-block-flags sbf1)) + (set! (-> self draw color-mult quad) (-> self color quad)) + ) + (else + (sound-play-by-name (the-as sound-name (-> self sound-show)) (new-sound-id) 1024 0 0 (sound-group sfx) #t) + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + ) + ) + (logxor! (-> self flags) (simon-block-flags sbf1)) + (set! (-> self blink-timer 1) (+ (-> self clock frame-counter) (seconds 0.2))) + ) + (when (>= (- (-> self clock frame-counter) (-> self blink-timer 0)) (seconds 1.2)) + (logclear! (-> self flags) (simon-block-flags sbf0)) + (set! (-> self draw color-mult quad) (-> self color quad)) + ) + ) + (plat-trans) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (tomb-simon-block) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as + object + (case event-type + (('reparent) + (change-parent self proc) + ) + (('blink) + (the-as object (set-blink-timers! self)) + ) + (('edge-grabbed) + (go-virtual dangerous) + ) + (('ridden 'bonk) + (let* ((gp-0 *target*) + (a0-12 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (when a0-12 + (let ((v1-6 (get-trans a0-12 0)) + (a0-14 (-> self root-override trans)) + ) + (if (and (>= 8192.0 (fabs (- (-> v1-6 x) (-> a0-14 x)))) (>= 8192.0 (fabs (- (-> v1-6 z) (-> a0-14 z))))) + (go-virtual dangerous) + ) + ) + ) + ) + ) + (('die 'die-unmaskable) + (go-virtual die) + ) + (('ready) + (go-virtual ready) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (logclear! (-> self flags) (simon-block-flags sbf0 sbf1 sbf2 sbf5)) + (set! (-> self move-rate) 122880.0) + (none) + ) + :trans tomb-simon-block-trans + :code (the-as (function none :behavior tomb-simon-block) sleep-code) + :post (behavior () + (if (>= (- (-> self clock frame-counter) (-> self state-time)) + (the int (* 300.0 (+ (* 0.1 (the float (-> self order))) (* 0.015 (the float (-> self my-idx)))))) + ) + (tomb-simon-block-post) + (plat-post) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate dangerous (tomb-simon-block) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('die-unmaskable) + (go-virtual die) + ) + (('reset) + (go-virtual idle) + ) + (('touch 'ridden 'bonk 'edge-grabbed) + (set! (-> self ride-timer) (-> self clock frame-counter)) + (when (logtest? (-> self flags) (simon-block-flags sbf4)) + (let* ((gp-0 *target*) + (a0-10 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + (v1-10 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-10 x) 0.0) + (set! (-> v1-10 y) 0.0) + (set! (-> v1-10 z) 1.0) + (set! (-> v1-10 w) 0.0) + (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) 'attack) + (set! (-> a1-6 param 0) (the-as uint #f)) + (let ((a2-4 (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up control id)))) + (let* ((a3-2 *game-info*) + (t0-1 (+ (-> a3-2 attack-id) 1)) + ) + (set! (-> a3-2 attack-id) t0-1) + (set! (-> a2-4 id) t0-1) + ) + (set! (-> a2-4 vector quad) (-> v1-10 quad)) + (set! (-> a2-4 shove-back) 0.0) + (set! (-> a2-4 shove-up) 12288.0) + (set! (-> a2-4 control) (if (logtest? (focus-status board) (-> a0-10 focus-status)) + 1.0 + 0.0 + ) + ) + (set! (-> a1-6 param 1) (the-as uint a2-4)) + ) + (send-event-function a0-10 a1-6) + ) + ) + (let ((v0-0 (the-as object (logclear (-> self flags) (simon-block-flags sbf4))))) + (set! (-> self flags) (the-as simon-block-flags v0-0)) + v0-0 + ) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (logior! (-> self flags) (simon-block-flags sbf4)) + (set! (-> self ride-timer) (-> self clock frame-counter)) + (send-event (ppointer->process (-> self parent)) 'die-but (-> self my-idx)) + (none) + ) + :trans (behavior () + (when (>= (- (-> self clock frame-counter) (-> self ride-timer)) (seconds 1)) + (sound-play "tomb-simon-last") + (go-virtual die) + ) + (plat-trans) + (none) + ) + :code (the-as (function none :behavior tomb-simon-block) sleep-code) + :post tomb-simon-block-post + ) + +;; failed to figure out what this is: +(defstate ready (tomb-simon-block) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk) + (the-as object (start-bouncing! self)) + ) + (('reset) + (go-virtual idle) + ) + (('blink) + (the-as object (set-blink-timers! self)) + ) + (('die 'die-unmaskable) + (go-virtual die) + ) + (('ridden) + (send-event (ppointer->process (-> self parent)) 'plat-ridden (-> self my-idx)) + (if (!= (-> self next-idx) -1) + (send-event (ppointer->process (-> self parent)) 'ready-index (-> self next-idx)) + ) + (go-virtual ridden) + ) + ) + ) + ) + :trans tomb-simon-block-trans + :code (the-as (function none :behavior tomb-simon-block) sleep-code) + :post tomb-simon-block-post + ) + +;; failed to figure out what this is: +(defstate ridden (tomb-simon-block) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk) + (the-as object (start-bouncing! self)) + ) + (('reset) + (go-virtual idle) + ) + (('die-unmaskable) + (go-virtual die) + ) + (('die) + (go-virtual temporary) + ) + (('ridden) + (let ((v0-0 (the-as object (-> self clock frame-counter)))) + (set! (-> self ride-timer) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self ride-timer) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (let* ((gp-0 *target*) + (a0-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (when a0-1 + (let ((v1-2 (get-trans a0-1 0)) + (a0-3 (-> self root-override trans)) + ) + (when (and (or (< 16384.0 (fabs (- (-> a0-3 x) (-> v1-2 x)))) (< 16384.0 (fabs (- (-> a0-3 z) (-> v1-2 z))))) + (>= (- (-> self clock frame-counter) (-> self ride-timer)) (seconds 0.25)) + ) + (when (= (-> self next-idx) -1) + (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) + (let ((v1-17 (-> *event-queue* data (-> *event-queue* length)))) + (+! (-> *event-queue* length) 1) + (set! (-> v1-17 form-handle) (process->handle self)) + (set! (-> v1-17 to-handle) (process->handle (the-as process (ppointer->process (-> self parent))))) + (set! (-> v1-17 num-params) 0) + (set! (-> v1-17 message) 'finished) + ) + ) + (sound-play "tomb-simon-last") + ) + (go-virtual temporary) + ) + ) + ) + ) + (tomb-simon-block-trans) + (none) + ) + :code (the-as (function none :behavior tomb-simon-block) sleep-code) + :post tomb-simon-block-post + ) + +;; failed to figure out what this is: +(defstate temporary (tomb-simon-block) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk) + (the-as object (start-bouncing! self)) + ) + (('reset) + (go-virtual idle) + ) + (('die-unmaskable) + (go-virtual die) + ) + (('ridden) + (when (not (logtest? (-> self flags) (simon-block-flags sbf2))) + (logior! (-> self flags) (simon-block-flags sbf2)) + (let ((v0-0 (the-as object (-> self clock frame-counter)))) + (set! (-> self ride-timer) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) + ) + ) + ) + :enter (behavior () + (logclear! (-> self flags) (simon-block-flags sbf0 sbf1 sbf2)) + (set! (-> self draw color-mult quad) (-> self color quad)) + (none) + ) + :trans (behavior () + (if (and (logtest? (-> self flags) (simon-block-flags sbf2)) + (>= (- (-> self clock frame-counter) (-> self ride-timer)) (seconds 0.5)) + ) + (go-virtual wobble-die) + ) + (plat-trans) + (none) + ) + :code (the-as (function none :behavior tomb-simon-block) sleep-code) + :post tomb-simon-block-post + ) + +;; failed to figure out what this is: +(defstate wobble-die (tomb-simon-block) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('reset) + (go-virtual idle) + ) + (('die-unmaskable) + (go-virtual die) + ) + ) + ) + :trans (the-as (function none :behavior tomb-simon-block) plat-trans) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sound-play "tomb-simon-last") + (go-virtual die) + (none) + ) + :post tomb-simon-block-post + ) + +;; failed to figure out what this is: +(defstate die (tomb-simon-block) + :virtual #t + :code (behavior () + (set! (-> self move-rate) (* 4096.0 (rand-vu-float-range 0.5 1.5))) + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.25)) + (suspend) + ) + ) + (logclear! (-> self root-override root-prim prim-core action) (collide-action rideable)) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) + (suspend) + ) + ) + (cleanup-for-death self) + (none) + ) + :post (behavior () + (set! (-> self root-override transv y) + (- (-> self root-override transv y) (* (-> self move-rate) (-> self clock seconds-per-frame))) + ) + (+! (-> self root-override trans y) (-> self root-override transv y)) + (transform-post) + (none) + ) + ) + +;; definition for method 41 of type tomb-simon-block +;; WARN: Return type mismatch time-frame vs none. +(defmethod set-blink-timers! tomb-simon-block ((obj tomb-simon-block)) + (with-pp + (logior! (-> obj flags) (simon-block-flags sbf0 sbf1)) + (set! (-> obj blink-timer 0) (-> pp clock frame-counter)) + (set! (-> obj blink-timer 1) (-> pp clock frame-counter)) + (none) + ) + ) + +;; definition for method 30 of type tomb-simon-block +(defmethod get-art-group tomb-simon-block ((obj tomb-simon-block)) + "@returns The associated [[art-group]]" + (art-group-get-by-name *level* "skel-tomb-simon-block" (the-as (pointer uint32) #f)) + ) + +;; definition for method 31 of type tomb-simon-block +;; WARN: Return type mismatch collide-shape vs none. +(defmethod base-plat-method-31 tomb-simon-block ((obj tomb-simon-block)) + "TODO - collision stuff" + (let ((s5-0 (new 'process 'collide-shape obj (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 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 -4096.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-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! (-> obj root-override) s5-0) + ) + (none) + ) + +;; definition for function tomb-simon-block-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior tomb-simon-block-init-by-other tomb-simon-block ((arg0 vector) (arg1 int) (arg2 int) (arg3 int) (arg4 int)) + (base-plat-method-31 self) + (set! (-> self mask) (logior (process-mask platform) (-> self mask))) + (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self base-height) (-> self root-override trans y)) + (set! (-> self root-override trans y) (+ -122880.0 (-> self root-override trans y))) + (quaternion-copy! (-> self root-override quat) *unity-quaternion*) + (vector-identity! (-> self root-override scale)) + (initialize-skeleton self (the-as skeleton-group (get-art-group self)) (the-as pair 0)) + (logclear! (-> self mask) (process-mask actor-pause)) + (update-transforms (-> self root-override)) + (stop-bouncing! self) + (set! (-> self my-idx) arg1) + (set! (-> self next-idx) arg2) + (set! (-> self flags) (simon-block-flags)) + (set! (-> self order) arg3) + (set! (-> self color quad) (-> *tomb-simon-color-tbl* arg4 quad)) + (set! (-> self sound-show) (-> *tomb-simon-sound-tbl* arg4)) + (set! (-> self draw color-mult quad) (-> self color quad)) + (set! (-> self event-hook) (-> (method-of-type tomb-simon-block idle) event)) + (go-virtual idle) + (none) + ) + +;; definition of type tomb-simon-button +(deftype tomb-simon-button (process-drawable) + ((notify-actor entity :offset-assert 200) + (on-notice (function none) :offset-assert 204) + (on-activate (function none) :offset-assert 208) + ) + :heap-base #x60 + :method-count-assert 25 + :size-assert #xd4 + :flag-assert #x19006000d4 + (:methods + (idle () _type_ :state 20) + (open (symbol) _type_ :state 21) + (waiting () _type_ :state 22) + (pressed (symbol) _type_ :state 23) + (unpress () _type_ :state 24) + ) + ) + +;; definition for method 3 of type tomb-simon-button +(defmethod inspect tomb-simon-button ((obj tomb-simon-button)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tnotify-actor: ~A~%" (-> obj notify-actor)) + (format #t "~2Ton-notice: ~A~%" (-> obj on-notice)) + (format #t "~2Ton-activate: ~A~%" (-> obj on-activate)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-simon-button tomb-simon-button tomb-simon-button-lod0-jg tomb-simon-button-open-ja + ((tomb-simon-button-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + ) + +;; failed to figure out what this is: +(defstate idle (tomb-simon-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger) + (go-virtual open #f) + ) + ) + ) + :trans (behavior () + (let ((gp-0 (-> self on-notice))) + (when gp-0 + (if (eval! + (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) + (the-as pair gp-0) + ) + (go-virtual open #f) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior tomb-simon-button) sleep-code) + ) + +;; failed to figure out what this is: +(defstate open (tomb-simon-button) + :virtual #t + :enter (behavior ((arg0 symbol)) + (let ((v1-2 (-> self entity extra perm))) + (set! (-> v1-2 user-int8 0) 1) + ) + (none) + ) + :trans (the-as (function none :behavior tomb-simon-button) rider-trans) + :code (behavior ((arg0 symbol)) + (cond + (arg0 + (ja :group! (-> self draw art-group data 3) + :num! (identity (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + ) + ) + (else + (sound-play "simon-btn-open") + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (go-virtual waiting) + (none) + ) + :post (the-as (function none :behavior tomb-simon-button) rider-post) + ) + +;; failed to figure out what this is: +(defstate waiting (tomb-simon-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('bonk 'touch) + (when ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> event param 0)) + (the-as collide-shape (-> self root)) + (the-as uint 1) + ) + (let ((v1-3 (-> self notify-actor))) + (if v1-3 + (send-event + (if v1-3 + (-> v1-3 extra process) + ) + 'trigger + ) + ) + ) + (go-virtual pressed #f) + ) + ) + (('trigger) + (go-virtual pressed #f) + ) + ) + ) + :enter (behavior () + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + :frame-num 0.0 + ) + (transform-post) + (none) + ) + :code (the-as (function none :behavior tomb-simon-button) sleep-code) + ) + +;; failed to figure out what this is: +(defstate pressed (tomb-simon-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('untrigger) + (go-virtual unpress) + ) + ) + ) + :code (behavior ((arg0 symbol)) + (let ((v1-2 (-> self entity extra perm))) + (set! (-> v1-2 user-int8 0) 2) + ) + (cond + (arg0 + (ja :group! (-> self draw art-group data 4) + :num! (identity (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + ) + (transform-post) + ) + (else + (sound-play "simon-btn-press") + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-2 (-> self on-activate))) + (if gp-2 + (eval! + (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) + (the-as pair gp-2) + ) + ) + ) + ) + ) + (sleep-code) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate unpress (tomb-simon-button) + :virtual #t + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 5) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek!)) + ) + (let ((v1-26 (-> self entity extra perm))) + (set! (-> v1-26 user-int8 0) 1) + ) + (go-virtual waiting) + (none) + ) + ) + +;; definition for method 11 of type tomb-simon-button +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-simon-button ((obj tomb-simon-button) (arg0 entity-actor)) + (with-pp + (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0))) + (set! (-> s4-0 total-prims) (the-as uint 6)) + (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable pull-rider-can-collide)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 122880.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (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 rideable)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 0.0 0.0 12288.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (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) 4) + (set-vector! (-> v1-12 local-sphere) 0.0 0.0 0.0 11059.2) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (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) 5) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 11059.2) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec obstacle)) + (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 11059.2) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec obstacle)) + (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) 7) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 11059.2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-21 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-simon-button" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> obj on-notice) (res-lump-struct (-> obj entity) 'on-notice (function none))) + (set! (-> obj on-activate) (res-lump-struct (-> obj entity) 'on-activate (function none))) + (let ((a0-42 (-> obj skel root-channel 0))) + (set! (-> a0-42 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> a0-42 param 0) 1.0) + (set! (-> a0-42 frame-num) 0.0) + (joint-control-channel-group! a0-42 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-loop!) + ) + (transform-post) + (let ((s5-1 (-> obj on-notice))) + (when s5-1 + (if (eval! + (new 'stack 'script-context (the-as basic (process->ppointer pp)) pp (the-as vector #f)) + (the-as pair s5-1) + ) + (go (method-of-object obj open) #t) + ) + ) + ) + (let ((v1-49 (-> obj entity extra perm user-uint8 0))) + (cond + ((zero? v1-49) + (go (method-of-object obj idle)) + ) + ((= v1-49 1) + (go (method-of-object obj open) #t) + ) + ((= v1-49 2) + (go (method-of-object obj pressed) #t) + ) + ) + ) + (none) + ) + ) + +;; definition of type tomb-vibe +(deftype tomb-vibe (process-drawable) + ((spawn-pos vector :inline :offset-assert 208) + (pat-tbl (array handle) :offset-assert 224) + (pat-count int32 :offset-assert 228) + (pat-index int32 :offset-assert 232) + (pat-entry-index int32 :offset-assert 236) + (pat-timer time-frame :offset-assert 240) + (pat-duration time-frame :offset-assert 248) + (actor-group (pointer actor-group) :offset-assert 256) + (actor-group-count int32 :offset-assert 260) + (flags uint16 :offset-assert 264) + (on-activate basic :offset-assert 268) + ) + :heap-base #x90 + :method-count-assert 24 + :size-assert #x110 + :flag-assert #x1800900110 + (:methods + (get-pattern () _type_ :state 20) + (idle () _type_ :state 21) + (vibrate () _type_ :state 22) + (die (symbol) _type_ :state 23) + ) + ) + +;; definition for method 3 of type tomb-vibe +(defmethod inspect tomb-vibe ((obj tomb-vibe)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tspawn-pos: #~%" (-> obj spawn-pos)) + (format #t "~2Tpat-tbl: #x~X~%" (-> obj pat-tbl)) + (format #t "~2Tpat-count: ~D~%" (-> obj pat-count)) + (format #t "~2Tpat-index: ~D~%" (-> obj pat-index)) + (format #t "~2Tpat-entry-index: ~D~%" (-> obj pat-entry-index)) + (format #t "~2Tpat-timer: ~D~%" (-> obj pat-timer)) + (format #t "~2Tpat-duration: ~D~%" (-> obj pat-duration)) + (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) + (dotimes (s5-0 (-> obj actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) + (format #t "~2Tflags: ~D~%" (-> obj flags)) + (format #t "~2Ton-activate: ~A~%" (-> obj on-activate)) + (label cfg-7) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-vibe tomb-vibe tomb-vibe-lod0-jg tomb-vibe-idle-ja + ((tomb-vibe-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; failed to figure out what this is: +(defstate get-pattern (tomb-vibe) + :virtual #t + :code (behavior () + (until #f + (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) 'ready?) + (let ((t9-0 send-event-function) + (v1-5 (-> self actor-group 0 data 0 actor)) + ) + (when (t9-0 + (if v1-5 + (-> v1-5 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) 0) + (set! (-> a1-1 message) 'get-pattern) + (let ((t9-1 send-event-function) + (v1-14 (-> self actor-group 0 data 0 actor)) + ) + (set! (-> self pat-index) (the-as int (t9-1 + (if v1-14 + (-> v1-14 extra process) + ) + a1-1 + ) + ) + ) + ) + ) + (go-virtual idle) + ) + ) + ) + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.45)) + (suspend) + ) + ) + ) + #f + (none) + ) + ) + +;; failed to figure out what this is: +(defstate idle (tomb-vibe) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 (new 'static 'array int32 4 -1 0 0 0)) + (gp-0 (new 'static 'array handle 2 + (new 'static 'handle :process #xffffffff :pid #xffffffff :u64 #xffffffffffffffff) + (new 'static 'handle) + ) + ) + ) + (case event-type + (('attack) + (case (-> (the-as attack-info (-> event param 1)) mode) + (('flop 'spin 'punch) + (cond + ((and (= (-> v1-0 0) (-> (the-as (pointer int32) (+ (the-as uint (-> self pat-tbl)) (* (-> self pat-index) 4))))) + (!= (-> gp-0 0) (process->handle self)) + ) + (send-event (handle->process (-> gp-0 0)) 'interrupt) + (send-event (handle->process (-> gp-0 0)) 'die) + (logior! (-> self flags) 1) + (go-virtual vibrate) + ) + (else + (set! (-> v1-0 0) (-> (the-as (pointer int32) (+ (the-as uint (-> self pat-tbl)) (* (-> self pat-index) 4))))) + (set! (-> gp-0 0) (process->handle self)) + (go-virtual vibrate) + ) + ) + ) + ) + ) + (('set-pattern) + (set! (-> v1-0 0) -1) + (set! (-> gp-0 0) (the-as handle #f)) + (let ((v0-0 (the-as object (-> event param 0)))) + (set! (-> self pat-index) (the-as int v0-0)) + v0-0 + ) + ) + (('get-pattern) + (-> self pat-index) + ) + (('ready?) + (!= (-> self pat-index) -1) + ) + (('die) + (go-virtual die #f) + ) + ) + ) + ) + :trans (behavior () + 0 + (none) + ) + :code (the-as (function none :behavior tomb-vibe) sleep-code) + :post (behavior () + (let* ((s5-0 *target*) + (gp-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when gp-0 + (when (and (not (logtest? (-> self flags) 2)) + (< (vector-vector-distance (-> self root trans) (get-trans gp-0 0)) 102400.0) + ) + (set-setting! 'sound-mode #f 0 2) + (logior! (-> self flags) 2) + ) + (when (and (logtest? (-> self flags) 2) + (< 184320.0 (vector-vector-distance (-> self root trans) (get-trans gp-0 0))) + ) + (remove-setting! 'sound-mode) + (set! (-> self flags) (logand -3 (-> self flags))) + ) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate vibrate (tomb-vibe) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as + object + (case event-type + (('interrupt) + (the-as object (kill-persister *setting-control* (the-as engine-pers (process->ppointer self)) 'sound-tune)) + ) + (('die) + (go-virtual die #f) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self pat-entry-index) 0) + (set-vector! (-> self draw color-mult) 0.9 0.9 0.9 1.0) + (let ((gp-0 (-> self actor-group 0))) + (dotimes (s5-0 (-> gp-0 length)) + (let ((v1-8 (-> gp-0 data s5-0 actor))) + (when (!= (if v1-8 + (-> v1-8 extra process) + ) + self + ) + (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) 'interrupt) + (let ((t9-0 send-event-function) + (v1-16 (-> gp-0 data s5-0 actor)) + ) + (t9-0 + (if v1-16 + (-> v1-16 extra process) + ) + a1-0 + ) + ) + ) + ) + ) + ) + ) + (none) + ) + :exit (behavior () + (process-release? *target*) + (kill-persister *setting-control* (the-as engine-pers (process->ppointer self)) 'sound-tune) + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + (none) + ) + :trans (behavior () + 0 + (none) + ) + :code (behavior () + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.2)) + (suspend) + ) + ) + (persist-with-delay + *setting-control* + (the-as symbol (process->ppointer self)) + (seconds 1) + 'sound-tune + #f + 0.0 + (+ (-> (the-as (pointer int32) (+ (the-as uint (-> self pat-tbl)) (* (-> self pat-index) 4)))) 18) + ) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 0.2)) + (suspend) + ) + ) + (process-grab? *target* #f) + (let ((gp-2 (-> self clock frame-counter)) + (s5-0 540) + (f30-0 1.0) + ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (loop! f30-0) :frame-num 0.0) + (until (>= (- (-> self clock frame-counter) gp-2) s5-0) + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + (process-release? *target*) + (if (logtest? (-> self flags) 1) + (go-virtual die #f) + (go-virtual idle) + ) + (none) + ) + :post (the-as (function none :behavior tomb-vibe) transform-post) + ) + +;; failed to figure out what this is: +(defstate die (tomb-vibe) + :virtual #t + :enter (behavior ((arg0 symbol)) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (none) + ) + :code (behavior ((arg0 symbol)) + (cond + (arg0 + (ja :group! (-> self draw art-group data 5) + :num! (identity (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + ) + (transform-post) + ) + (else + (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-1 + (let ((t9-3 (method-of-type part-tracker activate))) + (t9-3 (the-as part-tracker gp-1) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-4 run-function-in-process) + (a0-4 gp-1) + (a1-3 part-tracker-init) + (a2-5 (-> *part-group-id-table* 686)) + (a3-1 450) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> self spawn-pos quad)) + ((the-as (function object object object object object object object object none) t9-4) + a0-4 + a1-3 + a2-5 + a3-1 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> gp-1 ppointer) + ) + ) + (ja-no-eval :group! (-> self draw art-group data 5) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek!)) + ) + (let ((v1-45 (-> self actor-group 0))) + (dotimes (a0-8 (-> v1-45 length)) + (if (not (logtest? (-> v1-45 data a0-8 actor extra perm status) (entity-perm-status subtask-complete))) + (goto cfg-13) + ) + ) + ) + (task-node-close! (game-task-node tomb-water-vibe)) + ) + ) + (label cfg-13) + (sleep-code) + (none) + ) + ) + +;; definition for method 11 of type tomb-vibe +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-vibe ((obj tomb-vibe) (arg0 entity-actor)) + (local-vars (sv-16 res-tag) (sv-32 res-tag)) + (with-pp + (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum 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 camera-blocker pusher)) + (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 4096.0 0.0 9011.2) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-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 bot 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 4096.0 0.0 8192.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak bot 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 8192.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! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-vibe" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj entity) arg0) + (set! (-> obj spawn-pos quad) (-> obj root trans quad)) + (set! (-> obj spawn-pos y) (+ 81.92 (-> obj spawn-pos y))) + (set! (-> obj fact) + (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-26 (res-lump-data (-> obj entity) 'vibe-pattern pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-26 (nonzero? (-> sv-16 elt-count))) + (set! (-> obj pat-tbl) (the-as (array handle) v1-26)) + (set! (-> obj pat-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> obj pat-tbl) #f) + (set! (-> obj pat-count) 0) + 0 + ) + ) + ) + (set! sv-32 (new 'static 'res-tag)) + (let ((v1-33 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-32)))) + (cond + ((and v1-33 (nonzero? (-> sv-32 elt-count))) + (set! (-> obj actor-group) (the-as (pointer actor-group) v1-33)) + (set! (-> obj actor-group-count) (the-as int (-> sv-32 elt-count))) + ) + (else + (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> obj actor-group-count) 0) + 0 + ) + ) + ) + (when (logtest? (actor-option user17) (-> obj fact options)) + (let ((s5-1 (-> obj entity extra perm))) + (when (not (logtest? (-> s5-1 status) (entity-perm-status bit-5))) + (set! (-> s5-1 user-object 0) (rand-vu-int-range 0 (+ (-> obj pat-count) -1))) + (logior! (-> s5-1 status) (entity-perm-status bit-5)) + ) + (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) + (let ((v1-56 (-> *event-queue* data (-> *event-queue* length)))) + (+! (-> *event-queue* length) 1) + (set! (-> v1-56 form-handle) (process->handle pp)) + (set! (-> v1-56 to-handle) (process->handle obj)) + (set! (-> v1-56 num-params) 1) + (set! (-> v1-56 message) 'set-pattern) + (set! (-> v1-56 param 0) (the-as uint (-> s5-1 user-object 0))) + ) + ) + ) + ) + (set! (-> obj pat-index) -1) + (ja-channel-push! 1 0) + (let ((a0-53 (-> obj skel root-channel 0))) + (set! (-> a0-53 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> a0-53 frame-num) 0.0) + (joint-control-channel-group! a0-53 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + ) + (transform-post) + (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj event-hook) (-> (method-of-type tomb-vibe idle) event)) + (cond + ((logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object obj die) #t) + ) + ((logtest? (actor-option user17) (-> obj fact options)) + (go (method-of-object obj idle)) + ) + (else + (go (method-of-object obj get-pattern)) + ) + ) + (none) + ) + ) + +;; definition of type tomb-water-trap +(deftype tomb-water-trap (process-drawable) + ((bbox bounding-box :inline :offset-assert 208) + (run-bbox bounding-box :inline :offset-assert 240) + (sync sync-linear :inline :offset-assert 272) + (on-duration time-frame :offset-assert 288) + (harmless-time time-frame :offset-assert 296) + (l-spec lightning-spec :offset-assert 304) + (l-count uint32 :offset-assert 308) + (l-index (array uint32) :offset-assert 312) + (attack-id uint32 :offset-assert 316) + (volume float :offset-assert 320) + (can-exit-running? symbol :offset-assert 324) + ) + :heap-base #xd0 + :method-count-assert 25 + :size-assert #x148 + :flag-assert #x1900d00148 + (:methods + (idle () _type_ :state 20) + (running () _type_ :state 21) + (tomb-water-trap-method-22 (_type_) none 22) + (tomb-water-trap-method-23 (_type_ vector vector) none 23) + (tomb-water-trap-method-24 (_type_ vector vector int) none 24) + ) + ) + +;; definition for method 3 of type tomb-water-trap +(defmethod inspect tomb-water-trap ((obj tomb-water-trap)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tbbox: #~%" (-> obj bbox)) + (format #t "~2Trun-bbox: #~%" (-> obj run-bbox)) + (format #t "~2Tsync: #~%" (-> obj sync)) + (format #t "~2Ton-duration: ~D~%" (-> obj on-duration)) + (format #t "~2Tharmless-time: ~D~%" (-> obj harmless-time)) + (format #t "~2Tl-spec: ~A~%" (-> obj l-spec)) + (format #t "~2Tl-count: ~D~%" (-> obj l-count)) + (format #t "~2Tl-index: ~A~%" (-> obj l-index)) + (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) + (format #t "~2Tvolume: ~f~%" (-> obj volume)) + (format #t "~2Tcan-exit-running?: ~A~%" (-> obj can-exit-running?)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defstate idle (tomb-water-trap) + :virtual #t + :trans (behavior () + (let* ((gp-0 *target*) + (a0-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (if (and a0-1 (box-vector-inside? (-> self run-bbox) (get-trans a0-1 0))) + (go-virtual running) + ) + ) + (cond + ((< 0.0 (-> self volume)) + (seek! (-> self volume) 0.0 (* 2.0 (-> self clock seconds-per-frame))) + (update-vol! (-> self sound) (-> self volume)) + (update! (-> self sound)) + ) + (else + (logior! (-> self mask) (process-mask actor-pause)) + ) + ) + (none) + ) + :code (the-as (function none :behavior tomb-water-trap) sleep-code) + ) + +;; failed to figure out what this is: +(defstate running (tomb-water-trap) + :virtual #t + :enter (behavior () + (set! (-> self can-exit-running?) #f) + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((v1-3 (-> self path curve num-cverts))) + (dotimes (a0-1 (the-as int (-> self l-count))) + (set! (-> self l-index a0-1) + (the-as uint (the int (* (/ (the float a0-1) (the float (-> self l-count))) (the float v1-3)))) + ) + ) + ) + (none) + ) + :exit (behavior () + (set-tombc-electricity-scale! 0.0) + (none) + ) + :trans (behavior () + (when (-> self can-exit-running?) + (let ((a0-0 *target*)) + (if (not (and a0-0 (box-vector-inside? (-> self run-bbox) (get-trans a0-0 0)))) + (go-virtual idle) + ) + ) + ) + (none) + ) + :code (behavior () + (until #f + (set! (-> self can-exit-running?) #f) + (let ((gp-0 0) + (s5-0 (-> self clock frame-counter)) + ) + (until (>= (- (-> self clock frame-counter) s5-0) (-> self on-duration)) + (when (< (-> self harmless-time) (-> self clock frame-counter)) + (tomb-water-trap-method-22 self) + (dotimes (s4-0 (+ (-> self path curve num-cverts) -1)) + (let ((s3-0 (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (the float s4-0) 'interp)) + (a2-2 (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (the float (+ s4-0 1)) 'interp)) + ) + (tomb-water-trap-method-23 self s3-0 a2-2) + ) + ) + ) + (seek! (-> self volume) 1.0 (* 2.0 (-> self clock seconds-per-frame))) + (cond + ((logtest? gp-0 8) + (set! gp-0 0) + (set-tombc-electricity-scale! 1.0) + (dotimes (s4-1 (the-as int (-> self l-count))) + (let* ((v1-19 (-> self path curve num-cverts)) + (s1-0 (+ v1-19 -1)) + (s0-0 (mod (the-as int (-> self l-index s4-1)) v1-19)) + (s3-2 (max 0 (min (+ s0-0 (* (rand-vu-int-range -3 3) 2)) s1-0))) + (s2-1 (max 0 (min (+ (* (rand-vu-int-range -3 3) 2) 1 s0-0) s1-0))) + ) + (if (!= (logand s3-2 1) (logand s2-1 1)) + (tomb-water-trap-method-24 + self + (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (the float s3-2) 'interp) + (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (the float s2-1) 'interp) + (the int (* 9.0 (rand-vu-float-range 8.0 12.0))) + ) + ) + ) + ) + ) + (else + (+! gp-0 1) + ) + ) + (suspend) + ) + ) + (set! (-> self can-exit-running?) #t) + (let ((gp-1 90)) + (let ((s5-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s5-1) gp-1) + (suspend) + ) + ) + (let ((s5-2 #f) + (s4-2 (-> self clock frame-counter)) + ) + (until (>= (- (-> self clock frame-counter) s4-2) + (the-as time-frame (- (- (-> self sync period) (the-as uint (-> self on-duration))) (the-as uint gp-1))) + ) + (when (and (not s5-2) (>= (- (-> self clock frame-counter) s4-2) (seconds 0.3))) + (set! s5-2 #t) + (set-tombc-electricity-scale! 0.0) + ) + (seek! (-> self volume) 0.0 (* 2.0 (-> self clock seconds-per-frame))) + (suspend) + ) + ) + ) + ) + #f + (none) + ) + :post (behavior () + (update-vol! (-> self sound) (-> self volume)) + (update! (-> self sound)) + (none) + ) + ) + +;; definition for method 22 of type tomb-water-trap +(defmethod tomb-water-trap-method-22 tomb-water-trap ((obj tomb-water-trap)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (set! (-> gp-0 collide-with) (collide-spec jak bot player-list)) + (set! (-> gp-0 ignore-process0) obj) + (set! (-> gp-0 ignore-process1) #f) + (set! (-> gp-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> gp-0 action-mask) (collide-action solid)) + (mem-copy! (the-as pointer (-> gp-0 bbox)) (the-as pointer (-> obj bbox)) 32) + (fill-using-bounding-box *collide-cache* gp-0) + ) + (none) + ) + +;; definition for method 23 of type tomb-water-trap +;; INFO: Used lq/sq +;; WARN: Return type mismatch time-frame vs none. +(defmethod tomb-water-trap-method-23 tomb-water-trap ((obj tomb-water-trap) (arg0 vector) (arg1 vector)) + (with-pp + (let ((s4-0 (new 'stack-no-clear 'collide-query)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) + ) + (set! (-> s4-0 start-pos quad) (-> arg0 quad)) + (set! (-> s4-0 move-dist quad) (-> s3-1 quad)) + (let ((v1-3 s4-0)) + (set! (-> v1-3 radius) 2048.0) + (set! (-> v1-3 collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-3 ignore-process0) obj) + (set! (-> v1-3 ignore-process1) #f) + (set! (-> v1-3 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-3 action-mask) (collide-action solid semi-solid)) + ) + (let ((f30-0 (probe-using-line-sphere *collide-cache* s4-0))) + (when (>= f30-0 0.0) + (let* ((s2-0 (-> s4-0 best-other-tri collide-ptr)) + (s4-1 (if (type? s2-0 collide-shape-prim-sphere) + (the-as collide-shape-prim-sphere s2-0) + ) + ) + ) + (when s4-1 + (let ((s2-2 (vector+float*! (new 'stack-no-clear 'vector) arg0 s3-1 f30-0))) + (tomb-water-trap-method-24 obj arg0 s2-2 (the int (* 3.0 (rand-vu-float-range 5.0 11.0)))) + ) + (let ((v1-10 (vector-reset! (new 'stack-no-clear 'vector))) + (a1-5 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-5 from) (process->ppointer pp)) + (set! (-> a1-5 num-params) 2) + (set! (-> a1-5 message) 'attack) + (set! (-> a1-5 param 0) (the-as uint #f)) + (let ((a0-17 (new 'static 'attack-info :mask (attack-info-mask vector invinc-time mode shove-up id)))) + (set! (-> a0-17 id) (-> obj attack-id)) + (set! (-> a0-17 invinc-time) (seconds 3)) + (set! (-> a0-17 mode) 'shock) + (set! (-> a0-17 vector quad) (-> v1-10 quad)) + (set! (-> a0-17 shove-up) 12288.0) + (set! (-> a1-5 param 1) (the-as uint a0-17)) + ) + (if (send-event-function (-> s4-1 cshape process) a1-5) + (set! (-> obj harmless-time) (+ (-> pp clock frame-counter) (seconds 3))) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 24 of type tomb-water-trap +;; INFO: Used lq/sq +(defmethod tomb-water-trap-method-24 tomb-water-trap ((obj tomb-water-trap) (arg0 vector) (arg1 vector) (arg2 int)) + (let ((v1-1 (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> obj l-spec) + (+ arg2 120) + #f + #f + arg0 + arg1 + :to *entity-pool* + ) + ) + ) + (if v1-1 + (-> v1-1 0 self) + ) + ) + (let* ((s3-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg1 arg0) 1.0)) + (s2-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 arg1) 1.0)) + (s3-2 (forward-up-nopitch->quaternion (the-as quaternion (new 'stack-no-clear 'vector)) s3-1 *up-vector*)) + (s1-0 (forward-up-nopitch->quaternion (the-as quaternion (new 'stack-no-clear 'vector)) s2-1 *up-vector*)) + (s2-2 (quaternion->matrix (new 'stack-no-clear 'matrix) s3-2)) + (s3-3 (quaternion->matrix (new 'stack-no-clear 'matrix) s1-0)) + ) + (set! (-> s2-2 trans quad) (-> arg0 quad)) + (set! (-> s3-3 trans quad) (-> arg1 quad)) + (spawn-with-matrix (-> obj part) s2-2) + (spawn-with-matrix (-> obj part) s3-3) + ) + (none) + ) + +;; definition for method 7 of type tomb-water-trap +;; WARN: Return type mismatch process-drawable vs tomb-water-trap. +(defmethod relocate tomb-water-trap ((obj tomb-water-trap) (arg0 int)) + (if (nonzero? (-> obj l-index)) + (&+! (-> obj l-index) arg0) + ) + (the-as tomb-water-trap ((method-of-type process-drawable relocate) obj arg0)) + ) + +;; definition for method 11 of type tomb-water-trap +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-water-trap ((obj tomb-water-trap) (arg0 entity-actor)) + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (let ((a1-3 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-1 0)) + (if #t + (set! v1-1 (logior v1-1 1)) + ) + (set! (-> a1-3 sync-type) (the-as basic 'sync-linear)) + (set! (-> a1-3 sync-flags) (the-as sync-flags v1-1)) + ) + (set! (-> a1-3 entity) arg0) + (set! (-> a1-3 period) (the-as uint 2400)) + (set! (-> a1-3 percent) 0.75) + (initialize! (-> obj sync) a1-3) + ) + (set! (-> obj on-duration) (the-as time-frame (the int (-> obj sync offset)))) + (set! (-> obj harmless-time) 0) + (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 arg0 #f)) + (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((s5-1 (new 'stack-no-clear 'sphere))) + (get-point-in-path! (-> obj path) s5-1 0.0 'interp) + (set! (-> s5-1 r) 4096.0) + (set-from-sphere! (-> obj bbox) s5-1) + (countdown (s4-0 (+ (-> obj path curve num-cverts) -1)) + (add-point! + (-> obj bbox) + (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) (the float s4-0) 'interp) + ) + ) + (get-bounding-sphere (-> obj bbox) s5-1) + (set! (-> s5-1 r) (+ 81920.0 (-> s5-1 r))) + (set-from-sphere! (-> obj run-bbox) s5-1) + ) + (let* ((v1-29 *game-info*) + (a0-17 (+ (-> v1-29 attack-id) 1)) + ) + (set! (-> v1-29 attack-id) a0-17) + (set! (-> obj attack-id) a0-17) + ) + (set! (-> obj l-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 #x83 :page #xc) + :reduction 0.42 + :num-points 12 + :box-size 14336.0 + :merge-factor 0.5 + :merge-count 4 + :radius 3276.8 + :duration -1.0 + :sound #f + ) + ) + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 696) obj)) + (let ((a3-3 (new 'stack-no-clear 'vector))) + (set! (-> a3-3 x) (* 0.5 (+ (-> obj bbox min x) (-> obj bbox max x)))) + (set! (-> a3-3 y) (* 0.5 (+ (-> obj bbox min y) (-> obj bbox max y)))) + (set! (-> a3-3 z) (* 0.5 (+ (-> obj bbox min z) (-> obj bbox max z)))) + (set! (-> obj sound) (new 'process 'ambient-sound (static-sound-spec "water-trap-zap" :fo-max 55) a3-3)) + ) + (set! (-> obj volume) 0.0) + (let ((a0-20 (-> obj entity))) + (set! (-> obj l-count) (the-as uint ((method-of-object a0-20 get-property-value) + a0-20 + 'bolt-count + 'interp + -1000000000.0 + (the-as uint128 8) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (set! (-> obj l-index) (new 'process 'boxed-array uint32 (the-as int (-> obj l-count)))) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type tomb-smash-door +(deftype tomb-smash-door (process-drawable) + ((timeout time-frame :offset-assert 200) + (button handle :offset-assert 208) + ) + :heap-base #x60 + :method-count-assert 23 + :size-assert #xd8 + :flag-assert #x17006000d8 + (:methods + (idle () _type_ :state 20) + (open () _type_ :state 21) + (close () _type_ :state 22) + ) + ) + +;; definition for method 3 of type tomb-smash-door +(defmethod inspect tomb-smash-door ((obj tomb-smash-door)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Ttimeout: ~D~%" (-> obj timeout)) + (format #t "~2Tbutton: ~D~%" (-> obj button)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-tomb-smash-door tomb-smash-door 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 8 0 12) + ) + +;; failed to figure out what this is: +(defstate idle (tomb-smash-door) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger 'cue-chase) + (set! (-> self button) (process->handle proc)) + (go-virtual open) + ) + ) + ) + :code (the-as (function none :behavior tomb-smash-door) sleep-code) + ) + +;; failed to figure out what this is: +(defstate open (tomb-smash-door) + :virtual #t + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (-> self timeout)) + (let* ((s5-0 *target*) + (gp-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (cond + (gp-0 + (let* ((s5-1 (camera-pos)) + (s4-0 (get-trans gp-0 0)) + (gp-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (s5-2 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s5-1 (-> self root trans)) 1.0)) + ) + (if (or (>= (vector-dot (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 (-> self root trans)) 1.0) gp-1) + 0.0 + ) + (< (vector-dot s5-2 gp-1) 0.0) + ) + (go-virtual close) + ) + ) + ) + (else + (go-virtual close) + ) + ) + ) + ) + (none) + ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate close (tomb-smash-door) + :virtual #t + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek!)) + ) + (send-event (handle->process (-> self button)) 'untrigger) + (go-virtual idle) + (none) + ) + ) + +;; definition for method 11 of type tomb-smash-door +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-smash-door ((obj tomb-smash-door) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape obj (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 camera-blocker pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 32768.0 0.0 49152.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec camera-blocker pusher)) + (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) 12288.0 32768.0 0.0 40960.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec camera-blocker pusher)) + (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) 5) + (set-vector! (-> v1-12 local-sphere) -12288.0 32768.0 0.0 40960.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! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-smash-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((f30-0 300.0) + (a0-22 (-> obj entity)) + ) + (set! (-> obj timeout) + (the-as time-frame (the int (* f30-0 ((method-of-object a0-22 get-property-value-float) + a0-22 + 'timeout + 'interp + -1000000000.0 + 14.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + ) + ) + (ja-channel-push! 1 0) + (let ((a0-24 (-> obj skel root-channel 0))) + (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> a0-24 frame-num) 0.0) + (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) diff --git a/test/decompiler/reference/jak2/levels/ruins/breakable-wall_REF.gc b/test/decompiler/reference/jak2/levels/ruins/breakable-wall_REF.gc new file mode 100644 index 0000000000..047b56b382 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/ruins/breakable-wall_REF.gc @@ -0,0 +1,715 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-breakable-wall-1 ruins-breakable-wall ruins-breakable-wall-1-lod0-jg ruins-breakable-wall-1-idle-ja + ((ruins-breakable-wall-1-lod1-mg (meters 20)) + (ruins-breakable-wall-1-lod2-mg (meters 40)) + (ruins-breakable-wall-1-lod0-mg (meters 999999)) + ) + :bounds (static-spherem 0.3 5 0 8.8) + ) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-breakable-wall-2 ruins-breakable-wall ruins-breakable-wall-2-lod0-jg ruins-breakable-wall-2-idle-ja + ((ruins-breakable-wall-2-lod1-mg (meters 20)) + (ruins-breakable-wall-2-lod2-mg (meters 40)) + (ruins-breakable-wall-2-lod0-mg (meters 999999)) + ) + :bounds (static-spherem 0.3 5 0 8.8) + ) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-breakable-wall-3 ruins-breakable-wall ruins-breakable-wall-3-lod0-jg ruins-breakable-wall-3-idle-ja + ((ruins-breakable-wall-3-lod1-mg (meters 20)) + (ruins-breakable-wall-3-lod2-mg (meters 40)) + (ruins-breakable-wall-3-lod0-mg (meters 999999)) + ) + :bounds (static-spherem 0.3 5 0 8.8) + ) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-breakable-wall-4 ruins-breakable-wall ruins-breakable-wall-4-lod0-jg ruins-breakable-wall-4-idle-ja + ((ruins-breakable-wall-4-lod0-mg (meters 20)) + (ruins-breakable-wall-4-lod0-mg (meters 40)) + (ruins-breakable-wall-4-lod0-mg (meters 999999)) + ) + :bounds (static-spherem 0 6 0 10) + ) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-breakable-wall-5 ruins-breakable-wall ruins-breakable-wall-5-lod0-jg ruins-breakable-wall-5-idle-ja + ((ruins-breakable-wall-5-lod0-mg (meters 20)) + (ruins-breakable-wall-5-lod0-mg (meters 40)) + (ruins-breakable-wall-5-lod0-mg (meters 999999)) + ) + :bounds (static-spherem 0 5 0 9.5) + ) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-breakable-wall-6 ruins-breakable-wall ruins-breakable-wall-6-lod0-jg ruins-breakable-wall-6-idle-ja + ((ruins-breakable-wall-6-lod0-mg (meters 20)) + (ruins-breakable-wall-6-lod0-mg (meters 40)) + (ruins-breakable-wall-6-lod0-mg (meters 999999)) + ) + :bounds (static-spherem 0 6 0 9.5) + ) + +;; definition of type rbw-side +(deftype rbw-side (basic) + ((break-anim string :offset-assert 4) + (end-anim string :offset-assert 8) + (break-prim-mask uint8 :offset-assert 12) + (break-root-prim-joint int16 :offset-assert 14) + (break-bounds-joint int16 :offset-assert 16) + (break-root-prim-sphere sphere :inline :offset-assert 32) + (break-bounds-sphere sphere :inline :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type rbw-side +(defmethod inspect rbw-side ((obj rbw-side)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tbreak-anim: ~A~%" (-> obj break-anim)) + (format #t "~1Tend-anim: ~A~%" (-> obj end-anim)) + (format #t "~1Tbreak-prim-mask: ~D~%" (-> obj break-prim-mask)) + (format #t "~1Tbreak-root-prim-joint: ~D~%" (-> obj break-root-prim-joint)) + (format #t "~1Tbreak-bounds-joint: ~D~%" (-> obj break-bounds-joint)) + (format #t "~1Tbreak-root-prim-sphere: #~%" (-> obj break-root-prim-sphere)) + (format #t "~1Tbreak-bounds-sphere: #~%" (-> obj break-bounds-sphere)) + (label cfg-4) + obj + ) + +;; definition of type rbw-info +(deftype rbw-info (basic) + ((skel-group string :offset-assert 4) + (anim spool-anim :offset-assert 8) + (sides (array rbw-side) :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type rbw-info +(defmethod inspect rbw-info ((obj rbw-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tskel-group: ~A~%" (-> obj skel-group)) + (format #t "~1Tanim: ~A~%" (-> obj anim)) + (format #t "~1Tsides: ~A~%" (-> obj sides)) + (label cfg-4) + obj + ) + +;; definition for symbol *rbw-infos*, type (array rbw-info) +(define *rbw-infos* + (new 'static 'boxed-array :type rbw-info + (new 'static 'rbw-info + :skel-group "ruins-breakable-wall-1" + :anim (new 'static 'spool-anim :name "ruins-breakable-wall-1" :anim-name "1-break-front" :parts 2 :command-list '()) + :sides (new 'static 'boxed-array :type rbw-side + (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-1-break-front" + :end-anim "ruins-breakable-wall-1-end-front" + :break-prim-mask #xa + :break-root-prim-joint -1 + :break-bounds-joint -1 + :break-root-prim-sphere (new 'static 'sphere :y -17612.8 :z 49152.0 :r 106496.0) + :break-bounds-sphere (new 'static 'sphere :x 53248.0 :y -65536.0 :z 126976.0 :r 241664.0) + ) + (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-1-break-rear" + :end-anim "ruins-breakable-wall-1-end-rear" + :break-prim-mask #x6 + :break-root-prim-joint -1 + :break-bounds-joint -1 + :break-root-prim-sphere (new 'static 'sphere :x 16384.0 :y -17612.8 :z -40960.0 :r 90112.0) + :break-bounds-sphere (new 'static 'sphere :x -24576.0 :y -16384.0 :z -98304.0 :r 163840.0) + ) + ) + ) + (new 'static 'rbw-info + :skel-group "ruins-breakable-wall-2" + :anim (new 'static 'spool-anim :name "ruins-breakable-wall-2" :anim-name "2-break-front" :parts 2 :command-list '()) + :sides (new 'static 'boxed-array :type rbw-side + (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-2-break-front" + :end-anim "ruins-breakable-wall-2-end-front" + :break-prim-mask #x2 + :break-root-prim-joint 3 + :break-bounds-joint -1 + :break-root-prim-sphere (new 'static 'sphere :x -18432.0 :r 40960.0) + :break-bounds-sphere (new 'static 'sphere :z 36864.0 :r 98304.0) + ) + (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-2-break-rear" + :end-anim "ruins-breakable-wall-2-end-rear" + :break-prim-mask #x6 + :break-root-prim-joint 3 + :break-bounds-joint 3 + :break-root-prim-sphere (new 'static 'sphere :x -40960.0 :z -73728.0 :r 122880.0) + :break-bounds-sphere (new 'static 'sphere :x -40960.0 :y -16384.0 :z -61440.0 :r 114688.0) + ) + ) + ) + (new 'static 'rbw-info + :skel-group "ruins-breakable-wall-3" + :anim (new 'static 'spool-anim :name "ruins-breakable-wall-3" :anim-name "3-break-front" :parts 2 :command-list '()) + :sides (new 'static 'boxed-array :type rbw-side + (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-3-break-front" + :end-anim "ruins-breakable-wall-3-end-front" + :break-prim-mask #x2 + :break-root-prim-joint -1 + :break-bounds-joint -1 + :break-root-prim-sphere (new 'static 'sphere :r 36864.0) + :break-bounds-sphere (new 'static 'sphere :z 32768.0 :r 110592.0) + ) + (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-3-break-rear" + :end-anim "ruins-breakable-wall-3-end-rear" + :break-prim-mask #x6 + :break-root-prim-joint -1 + :break-bounds-joint -1 + :break-root-prim-sphere (new 'static 'sphere :x 16384.0 :y -18432.0 :z -65536.0 :r 126976.0) + :break-bounds-sphere (new 'static 'sphere :y -34816.0 :z -122880.0 :r 184320.0) + ) + ) + ) + (new 'static 'rbw-info + :skel-group "ruins-breakable-wall-4" + :anim (new 'static 'spool-anim :name "ruins-breakable-wall-4" :anim-name "4-break-front" :parts 2 :command-list '()) + :sides (new 'static 'boxed-array :type rbw-side + (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-4-break-front" + :end-anim "ruins-breakable-wall-4-end-front" + :break-prim-mask #x2 + :break-root-prim-joint 74 + :break-bounds-joint -1 + :break-root-prim-sphere (new 'static 'sphere :r 40960.0) + :break-bounds-sphere (new 'static 'sphere :x 20480.0 :z -61440.0 :r 102400.0) + ) + ) + ) + (new 'static 'rbw-info + :skel-group "ruins-breakable-wall-5" + :anim (new 'static 'spool-anim :name "ruins-breakable-wall-5" :anim-name "5-break-front" :parts 2 :command-list '()) + :sides (new 'static 'boxed-array :type rbw-side + (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-5-break-front" + :end-anim "ruins-breakable-wall-5-end-front" + :break-prim-mask #x6 + :break-root-prim-joint -1 + :break-bounds-joint -1 + :break-root-prim-sphere (new 'static 'sphere :z -73728.0 :r 126976.0) + :break-bounds-sphere (new 'static 'sphere :x -10240.0 :z -73728.0 :r 126976.0) + ) + ) + ) + (new 'static 'rbw-info + :skel-group "ruins-breakable-wall-6" + :anim (new 'static 'spool-anim :name "ruins-breakable-wall-6" :anim-name "6-break-front" :parts 3 :command-list '()) + :sides (new 'static 'boxed-array :type rbw-side (new 'static 'rbw-side + :break-anim "ruins-breakable-wall-6-break-front" + :end-anim "ruins-breakable-wall-6-end-front" + :break-prim-mask #x2 + :break-root-prim-joint -1 + :break-bounds-joint -1 + :break-root-prim-sphere (new 'static 'sphere :r 40960.0) + :break-bounds-sphere (new 'static 'sphere :x -32768.0 :z -81920.0 :r 180224.0) + ) + ) + ) + ) + ) + +;; definition of type ruins-breakable-wall +(deftype ruins-breakable-wall (process-focusable) + ((info rbw-info :offset-assert 204) + (side rbw-side :offset-assert 208) + (nav-mesh nav-mesh :offset-assert 212) + ) + :heap-base #x60 + :method-count-assert 31 + :size-assert #xd8 + :flag-assert #x1f006000d8 + (:methods + (unbroken () _type_ :state 27) + (hit () _type_ :state 28) + (broken () _type_ :state 29) + (ruins-breakable-wall-method-30 (_type_ symbol) none 30) + ) + ) + +;; definition for method 3 of type ruins-breakable-wall +(defmethod inspect ruins-breakable-wall ((obj ruins-breakable-wall)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (format #t "~2Tinfo: ~A~%" (-> obj info)) + (format #t "~2Tside: ~A~%" (-> obj side)) + (format #t "~2Tnav-mesh: ~A~%" (-> obj nav-mesh)) + (label cfg-4) + obj + ) + +;; definition for method 30 of type ruins-breakable-wall +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs none. +(defmethod ruins-breakable-wall-method-30 ruins-breakable-wall ((obj ruins-breakable-wall) (arg0 symbol)) + (case arg0 + (('hit) + (-> obj draw bounds w) + (set! (-> obj draw lod-set max-lod) 2) + (set! (-> obj draw force-lod) 2) + (set! (-> obj draw bounds w) 573440.0) + ) + (('broken) + (-> obj draw bounds w) + (set! (-> obj draw lod-set max-lod) 2) + (set! (-> obj draw force-lod) 2) + (set! (-> obj draw bounds quad) (-> obj side break-bounds-sphere quad)) + (let ((v1-12 (-> obj side break-bounds-joint))) + (if (>= v1-12 0) + (set! (-> obj draw origin-joint-index) (the-as uint v1-12)) + ) + ) + (let ((v1-14 (-> obj root-override root-prim)) + (a1-15 (-> obj side break-prim-mask)) + ) + (set! (-> v1-14 local-sphere quad) (-> obj side break-root-prim-sphere quad)) + (let ((a0-2 (-> obj side break-root-prim-joint))) + (if (>= a0-2 0) + (set! (-> v1-14 transform-index) a0-2) + ) + ) + (dotimes (a0-3 (the-as int (-> v1-14 specific 0))) + (let ((a2-4 (-> (the-as collide-shape-prim-group v1-14) child a0-3))) + (cond + ((logtest? a1-15 1) + (set! (-> a2-4 prim-core collide-as) (collide-spec obstacle)) + ) + (else + (set! (-> a2-4 prim-core collide-as) (collide-spec)) + 0 + ) + ) + ) + (set! a1-15 (shr a1-15 1)) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate unbroken (ruins-breakable-wall) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (when (task-node-closed? (game-task-node ruins-mech-introduction)) + (let ((s4-0 (the-as object (-> event param 1)))) + (case (-> (the-as attack-info s4-0) mode) + (('mech-punch 'crush) + (let ((s3-0 + (the-as object (mem-copy! (the-as pointer (new 'stack-no-clear 'attack-info)) (the-as pointer s4-0) 160)) + ) + ) + ((method-of-type attack-info compute-intersect-info) + (the-as attack-info s3-0) + (the-as uint s4-0) + self + (if (type? proc process-drawable) + proc + ) + (the-as touching-shapes-entry (-> event param 0)) + ) + (if (logtest? (-> (the-as attack-info s3-0) mask) (attack-info-mask intersection)) + (go-virtual hit) + ) + ) + ) + ) + ) + ) + ) + (('combo) + #t + ) + ) + ) + :enter (behavior () + (let ((gp-0 (matrix<-transformq! (new 'stack-no-clear 'matrix) (the-as transformq (-> self root-override trans))))) + (mech-target-spawn + (vector-matrix*! (new 'stack-no-clear 'vector) (new 'static 'vector :y 20480.0 :z 4096.0 :w 1.0) gp-0) + (the-as target self) + (-> self root-override quat) + (-> self entity) + ) + (mech-target-spawn + (vector-matrix*! (new 'stack-no-clear 'vector) (new 'static 'vector :y 20480.0 :z -4096.0 :w 1.0) gp-0) + (the-as target self) + (-> self root-override quat) + (-> self entity) + ) + ) + (set! (-> self nav-mesh) (nav-mesh-from-res-tag (-> self entity) 'nav-mesh-actor 0)) + (if (and (-> self nav-mesh) (not (nav-mesh-connect-from-ent self))) + (set! (-> self nav-mesh) #f) + ) + (none) + ) + :exit (behavior () + (while (-> self child) + (deactivate (-> self child 0)) + ) + (none) + ) + :code (behavior () + (if (task-node-closed? (game-task-node ruins-mech-introduction)) + (add-process *gui-control* self (gui-channel art-load) (gui-action queue) (-> self info anim name) -99.0 0) + ) + (until #f + (transform-post) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + ) + #f + (none) + ) + ) + +;; failed to figure out what this is: +(defstate hit (ruins-breakable-wall) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (if (-> self nav-mesh) + (logclear! (-> self root-override nav-flags) (nav-flags has-root-sphere)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-z-quaternion! s4-0 (-> self root-override quat)) + (set! (-> s4-0 y) 0.0) + (vector-! s5-0 (target-pos 0) (-> self root-override trans)) + (set! (-> s5-0 y) 0.0) + (let ((gp-2 0)) + (when (>= (vector-dot s4-0 s5-0) 0.0) + (if (>= (-> self info sides length) 2) + (set! gp-2 1) + ) + ) + (set! (-> self side) (-> self info sides gp-2)) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((v1-21 (-> self entity extra perm))) + (logior! (-> v1-21 status) (entity-perm-status bit-5)) + (set! (-> v1-21 user-int8 0) (+ gp-2 1)) + ) + ) + ) + (ruins-breakable-wall-method-30 self 'hit) + (none) + ) + :exit (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self root-override backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self root-override backup-collide-with)) + ) + (none) + ) + :code (behavior () + (let ((a2-1 (get-art-by-name (-> self draw art-group) (-> self side end-anim) art-joint-anim))) + (set! (-> self info anim anim-name) (-> self side break-anim)) + (ja-play-spooled-anim + (-> self info anim) + (ja-group) + a2-1 + (the-as (function process-drawable symbol) false-func) + ) + ) + (go-virtual broken) + (none) + ) + :post (the-as (function none :behavior ruins-breakable-wall) ja-post) + ) + +;; failed to figure out what this is: +(defstate broken (ruins-breakable-wall) + :virtual #t + :code (behavior () + (ruins-breakable-wall-method-30 self 'broken) + (let ((gp-0 (get-art-by-name (-> self draw art-group) (-> self side end-anim) art-joint-anim))) + (ja-channel-set! 1) + (set! (-> self skel root-channel 0 frame-group) gp-0) + ) + (logior! (-> self skel status) (joint-control-status sync-math)) + (transform-post) + (logclear! (-> self skel status) (joint-control-status sync-math)) + (suspend) + (transform-post) + (sleep-code) + (none) + ) + ) + +;; definition for method 11 of type ruins-breakable-wall +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! ruins-breakable-wall ((obj ruins-breakable-wall) (arg0 entity-actor)) + (stack-size-set! (-> obj main-thread) 512) + (set! (-> obj mask) (logior (process-mask collectable) (-> obj mask))) + (set! (-> obj side) #f) + (set! (-> obj nav-mesh) #f) + (let ((v1-5 (res-lump-value (-> obj entity) 'extra-id uint128 :time -1000000000.0))) + (set! (-> obj info) (-> *rbw-infos* v1-5)) + (cond + ((zero? v1-5) + (let ((s4-0 (new 'process 'collide-shape obj (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 4) 0))) + (set! (-> s4-0 total-prims) (the-as uint 5)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (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 36864.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint -1)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 36864.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (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 36864.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 3) + (set-vector! (-> v1-18 local-sphere) 21504.0 -24576.0 -49152.0 69632.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-20 prim-core action) (collide-action solid)) + (set! (-> v1-20 transform-index) 3) + (set-vector! (-> v1-20 local-sphere) 0.0 -17612.8 65536.0 81920.0) + ) + (set! (-> s4-0 nav-radius) 20480.0) + (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! (-> obj root-override) s4-0) + ) + ) + ((= (the-as uint v1-5) 1) + (let ((s4-1 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-1 penetrated-by) (penetrate)) + (let ((s3-1 (new 'process 'collide-shape-prim-group s4-1 (the-as uint 3) 0))) + (set! (-> s4-1 total-prims) (the-as uint 4)) + (set! (-> s3-1 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-1 prim-core action) (collide-action solid)) + (set! (-> s3-1 transform-index) 4) + (set-vector! (-> s3-1 local-sphere) 0.0 0.0 0.0 36864.0) + (set! (-> s4-1 root-prim) s3-1) + ) + (let ((v1-32 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 0) (the-as uint -1)))) + (set! (-> v1-32 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-32 prim-core action) (collide-action solid)) + (set! (-> v1-32 transform-index) 4) + (set-vector! (-> v1-32 local-sphere) 0.0 0.0 0.0 36864.0) + ) + (let ((v1-34 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-34 prim-core action) (collide-action solid)) + (set! (-> v1-34 transform-index) 3) + (set-vector! (-> v1-34 local-sphere) -18432.0 0.0 0.0 40960.0) + ) + (let ((v1-36 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-36 prim-core action) (collide-action solid)) + (set! (-> v1-36 transform-index) 3) + (set-vector! (-> v1-36 local-sphere) -40960.0 -20480.0 -98304.0 90112.0) + ) + (set! (-> s4-1 nav-radius) 20480.0) + (let ((v1-38 (-> s4-1 root-prim))) + (set! (-> s4-1 backup-collide-as) (-> v1-38 prim-core collide-as)) + (set! (-> s4-1 backup-collide-with) (-> v1-38 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-1) + ) + ) + ((= (the-as uint v1-5) 2) + (let ((s4-2 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-2 penetrated-by) (penetrate)) + (let ((s3-2 (new 'process 'collide-shape-prim-group s4-2 (the-as uint 3) 0))) + (set! (-> s4-2 total-prims) (the-as uint 4)) + (set! (-> s3-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-2 prim-core action) (collide-action solid)) + (set! (-> s3-2 transform-index) 3) + (set-vector! (-> s3-2 local-sphere) 0.0 0.0 0.0 36864.0) + (set! (-> s4-2 root-prim) s3-2) + ) + (let ((v1-48 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 0) (the-as uint -1)))) + (set! (-> v1-48 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-48 prim-core action) (collide-action solid)) + (set! (-> v1-48 transform-index) 3) + (set-vector! (-> v1-48 local-sphere) 0.0 0.0 0.0 36864.0) + ) + (let ((v1-50 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-50 prim-core action) (collide-action solid)) + (set! (-> v1-50 transform-index) 3) + (set-vector! (-> v1-50 local-sphere) -12288.0 0.0 0.0 49152.0) + ) + (let ((v1-52 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-52 prim-core action) (collide-action solid)) + (set! (-> v1-52 transform-index) 3) + (set-vector! (-> v1-52 local-sphere) 45056.0 -14336.0 -114688.0 40960.0) + ) + (set! (-> s4-2 nav-radius) 20480.0) + (let ((v1-54 (-> s4-2 root-prim))) + (set! (-> s4-2 backup-collide-as) (-> v1-54 prim-core collide-as)) + (set! (-> s4-2 backup-collide-with) (-> v1-54 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-2) + ) + ) + ((= (the-as uint v1-5) 3) + (let ((s4-3 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-3 penetrated-by) (penetrate)) + (let ((s3-3 (new 'process 'collide-shape-prim-group s4-3 (the-as uint 2) 0))) + (set! (-> s4-3 total-prims) (the-as uint 3)) + (set! (-> s3-3 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-3 prim-core action) (collide-action solid)) + (set! (-> s3-3 transform-index) 73) + (set-vector! (-> s3-3 local-sphere) 0.0 -24576.0 0.0 45056.0) + (set! (-> s4-3 root-prim) s3-3) + ) + (let ((v1-64 (new 'process 'collide-shape-prim-mesh s4-3 (the-as uint 0) (the-as uint -1)))) + (set! (-> v1-64 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-64 prim-core action) (collide-action solid)) + (set! (-> v1-64 transform-index) 73) + (set-vector! (-> v1-64 local-sphere) 0.0 -24576.0 0.0 45056.0) + ) + (let ((v1-66 (new 'process 'collide-shape-prim-mesh s4-3 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-66 prim-core action) (collide-action solid)) + (set! (-> v1-66 transform-index) 74) + (set-vector! (-> v1-66 local-sphere) 0.0 0.0 0.0 40960.0) + ) + (set! (-> s4-3 nav-radius) 20480.0) + (let ((v1-68 (-> s4-3 root-prim))) + (set! (-> s4-3 backup-collide-as) (-> v1-68 prim-core collide-as)) + (set! (-> s4-3 backup-collide-with) (-> v1-68 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-3) + ) + ) + ((= (the-as uint v1-5) 4) + (let ((s4-4 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-4 penetrated-by) (penetrate)) + (let ((s3-4 (new 'process 'collide-shape-prim-group s4-4 (the-as uint 3) 0))) + (set! (-> s4-4 total-prims) (the-as uint 4)) + (set! (-> s3-4 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-4 prim-core action) (collide-action solid)) + (set! (-> s3-4 transform-index) 78) + (set-vector! (-> s3-4 local-sphere) 0.0 0.0 0.0 36864.0) + (set! (-> s4-4 root-prim) s3-4) + ) + (let ((v1-78 (new 'process 'collide-shape-prim-mesh s4-4 (the-as uint 0) (the-as uint -1)))) + (set! (-> v1-78 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-78 prim-core action) (collide-action solid)) + (set! (-> v1-78 transform-index) 78) + (set-vector! (-> v1-78 local-sphere) 0.0 0.0 0.0 36864.0) + ) + (let ((v1-80 (new 'process 'collide-shape-prim-mesh s4-4 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-80 prim-core action) (collide-action solid)) + (set! (-> v1-80 transform-index) 78) + (set-vector! (-> v1-80 local-sphere) 0.0 0.0 0.0 36864.0) + ) + (let ((v1-82 (new 'process 'collide-shape-prim-mesh s4-4 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-82 prim-core action) (collide-action solid)) + (set! (-> v1-82 transform-index) 78) + (set-vector! (-> v1-82 local-sphere) 12288.0 -24576.0 -122880.0 69632.0) + ) + (set! (-> s4-4 nav-radius) 20480.0) + (let ((v1-84 (-> s4-4 root-prim))) + (set! (-> s4-4 backup-collide-as) (-> v1-84 prim-core collide-as)) + (set! (-> s4-4 backup-collide-with) (-> v1-84 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-4) + ) + ) + (else + (let ((s4-5 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-5 penetrated-by) (penetrate)) + (let ((s3-5 (new 'process 'collide-shape-prim-group s4-5 (the-as uint 2) 0))) + (set! (-> s4-5 total-prims) (the-as uint 3)) + (set! (-> s3-5 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-5 prim-core action) (collide-action solid)) + (set! (-> s3-5 transform-index) 74) + (set-vector! (-> s3-5 local-sphere) 0.0 0.0 0.0 40960.0) + (set! (-> s4-5 root-prim) s3-5) + ) + (let ((v1-94 (new 'process 'collide-shape-prim-mesh s4-5 (the-as uint 0) (the-as uint -1)))) + (set! (-> v1-94 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-94 prim-core action) (collide-action solid)) + (set! (-> v1-94 transform-index) 74) + (set-vector! (-> v1-94 local-sphere) 0.0 0.0 0.0 40960.0) + ) + (let ((v1-96 (new 'process 'collide-shape-prim-mesh s4-5 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-96 prim-core action) (collide-action solid)) + (set! (-> v1-96 transform-index) 74) + (set-vector! (-> v1-96 local-sphere) 0.0 0.0 0.0 40960.0) + ) + (set! (-> s4-5 nav-radius) 20480.0) + (let ((v1-98 (-> s4-5 root-prim))) + (set! (-> s4-5 backup-collide-as) (-> v1-98 prim-core collide-as)) + (set! (-> s4-5 backup-collide-with) (-> v1-98 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-5) + ) + ) + ) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton-by-name obj (-> obj info skel-group)) + (case (-> obj entity extra perm user-uint8 0) + ((1) + (set! (-> obj side) (-> obj info sides 0)) + (go (method-of-object obj broken)) + ) + ((2) + (set! (-> obj side) (-> obj info sides 1)) + (go (method-of-object obj broken)) + ) + (else + (go (method-of-object obj unbroken)) + ) + ) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc b/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc new file mode 100644 index 0000000000..5fbf0df278 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc @@ -0,0 +1,657 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type mechblock +(deftype mechblock (process-drawable) + ((root-override collide-shape-moving :offset 128) + (origin vector :inline :offset-assert 208) + (drop-point vector :inline :offset 256) + (allow-drag? symbol :offset-assert 272) + (reset-on-land? symbol :offset-assert 276) + (hit-something? symbol :offset-assert 280) + (attack-id uint32 :offset-assert 284) + (next-entity entity :offset-assert 288) + ) + :heap-base #xb0 + :method-count-assert 25 + :size-assert #x124 + :flag-assert #x1900b00124 + (:methods + (idle () _type_ :state 20) + (carry () _type_ :state 21) + (drag () _type_ :state 22) + (fall () _type_ :state 23) + (wait () _type_ :state 24) + ) + ) + +;; definition for method 3 of type mechblock +(defmethod inspect mechblock ((obj mechblock)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Torigin: ~`vector`P~%" (-> obj origin)) + (format #t "~2Tdrop-point: ~`vector`P~%" (-> obj drop-point)) + (format #t "~2Tallow-drag?: ~A~%" (-> obj allow-drag?)) + (format #t "~2Treset-on-land?: ~A~%" (-> obj reset-on-land?)) + (format #t "~2Thit-something?: ~A~%" (-> obj hit-something?)) + (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) + (format #t "~2Tnext-entity: ~A~%" (-> obj next-entity)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defstate idle (mechblock) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('carry? 'carry-info) + (-> self carry) + ) + (('pickup) + (cond + ((-> self allow-drag?) + (carry! + (the-as carry-info (-> event param 0)) + (-> self carry) + (the-as vector (-> event param 1)) + (the-as vector (-> event param 2)) + ) + (go-virtual drag) + ) + (else + (drag! (the-as carry-info (-> event param 0)) (-> self carry)) + (go-virtual carry) + ) + ) + ) + ) + ) + :code (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (dotimes (gp-0 2) + (transform-post) + (carry-info-method-9 (-> self carry)) + (suspend) + ) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate wait (mechblock) + :virtual #t + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-3 (-> self root-override root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root-override backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root-override backup-collide-with)) + ) + (none) + ) + :trans (behavior () + (when (or (not *target*) (< 40960.0 (vector-vector-distance (-> self origin) (-> *target* control trans)))) + (move-to-point! + (-> self root-override) + (vector+! (new 'stack-no-clear 'vector) (-> self origin) (new 'static 'vector :y 81920.0 :w 1.0)) + ) + (quaternion-copy! (-> self root-override quat) (the-as quaternion (&-> self stack 96))) + (set-vector! (-> self root-override transv) 0.0 -4096.0 0.0 1.0) + (set! (-> self drop-point quad) (-> self origin quad)) + (go-virtual fall) + ) + (none) + ) + :code (behavior () + (let ((v1-1 (-> self root-override 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)) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate carry (mechblock) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('carry? 'carry-info) + (-> self carry) + ) + (('drop) + (set! (-> self root-override transv quad) (-> (the-as vector (-> event param 1)) quad)) + (set! (-> self drop-point quad) (-> self root-override trans quad)) + (go-virtual fall) + ) + ) + ) + :code (the-as (function none :behavior mechblock) sleep-code) + :post (behavior () + (ja-post) + (carry-info-method-9 (-> self carry)) + (carry-info-method-13 (-> self carry)) + (update-transforms (-> self root-override)) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate drag (mechblock) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (local-vars (at-0 int)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (case event-type + (('carry? 'carry-info) + (-> self carry) + ) + (('drop) + (if (handle->process (-> self carry other)) + (drop! (the-as carry-info (send-event (handle->process (-> self carry other)) 'carry-info)) (-> self carry)) + ) + (set! (-> self root-override transv quad) (-> (the-as vector (-> event param 1)) quad)) + (set! (-> self drop-point quad) (-> self root-override trans quad)) + (go-virtual fall) + ) + (('move) + (let ((s4-0 (-> self root-override)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> s4-0 trans quad)) + (set! (-> s4-0 transv quad) (-> (the-as vector (-> event param 0)) quad)) + (let ((s2-0 (-> self nav)) + (s1-0 (-> s4-0 root-prim prim-core)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> (-> s4-0 transv) quad)) + (let ((f0-0 (-> self clock 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 (&-> s3-0 quad) vf1) + (set! (-> s3-0 y) 0.0) + (vector-float*! s3-0 s3-0 10.0) + (when (nonzero? s2-0) + (let ((v1-28 s2-0) + (a0-26 s1-0) + (a1-6 (new 'stack-no-clear 'nav-find-poly-parms)) + ) + (vector-! (-> a1-6 point) (the-as vector a0-26) (-> v1-28 state mesh bounds)) + (set! (-> a1-6 y-threshold) (-> v1-28 nearest-y-threshold)) + (set! (-> a1-6 ignore) (the-as uint 2)) + (let ((a2-4 (find-poly-containing-point-local (-> v1-28 state mesh) a1-6))) + (cond + (a2-4 + (clamp-vector-to-mesh-cross-gaps + s2-0 + (the-as vector s1-0) + a2-4 + s3-0 + 204.8 + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + ) + (else + ) + ) + ) + ) + ) + (vector-float*! (-> s4-0 transv) s3-0 (* 0.1 (-> self clock frames-per-second))) + ) + (let ((v1-35 (-> s4-0 root-prim))) + (set! (-> v1-35 prim-core collide-as) (-> s4-0 backup-collide-as)) + (set! (-> v1-35 prim-core collide-with) (-> s4-0 backup-collide-with)) + ) + (set! (-> s4-0 root-prim type) collide-shape-prim-sphere) + (let ((a2-5 (new 'stack-no-clear 'collide-query))) + (set! (-> a2-5 collide-with) + (logclear (-> s4-0 root-prim prim-core collide-with) (collide-spec backgnd jak player-list tobot)) + ) + (set! (-> a2-5 ignore-process0) self) + (set! (-> a2-5 ignore-process1) #f) + (set! (-> a2-5 ignore-pat) (-> s4-0 pat-ignore-mask)) + (set! (-> a2-5 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide s4-0 (-> s4-0 transv) a2-5 (meters 0)) + ) + (when (nonzero? (-> self nav)) + (let ((v1-44 (-> self nav)) + (a0-41 (-> self root-override root-prim prim-core)) + (a1-9 (new 'stack-no-clear 'nav-find-poly-parms)) + ) + (vector-! (-> a1-9 point) (the-as vector a0-41) (-> v1-44 state mesh bounds)) + (set! (-> a1-9 y-threshold) (-> v1-44 nearest-y-threshold)) + (set! (-> a1-9 ignore) (the-as uint 2)) + (let ((v1-46 (find-poly-containing-point-local (-> v1-44 state mesh) a1-9))) + (when v1-46 + (when (< (-> self root-override trans y) (-> v1-46 vertex0 y)) + (let* ((a0-47 (-> self root-override)) + (t9-7 (method-of-object a0-47 move-by-vector!)) + (a1-11 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-11 x) 0.0) + (set! (-> a1-11 y) (- (-> v1-46 vertex0 y) (-> self root-override trans y))) + (set! (-> a1-11 z) 0.0) + (set! (-> a1-11 w) 1.0) + (t9-7 a0-47 a1-11) + ) + ) + ) + ) + ) + ) + (set! (-> s4-0 root-prim type) collide-shape-prim-mesh) + (let ((v1-50 (-> s4-0 root-prim))) + (set! (-> v1-50 prim-core collide-as) (collide-spec)) + (set! (-> v1-50 prim-core collide-with) (collide-spec)) + ) + 0 + (vector-! (the-as vector (-> event param 1)) (-> s4-0 trans) s5-0) + ) + ) + ) + ) + ) + :code (the-as (function none :behavior mechblock) sleep-code) + :post (behavior () + (ja-post) + (carry-info-method-9 (-> self carry)) + (translate! (-> self carry)) + (update-transforms (-> self root-override)) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate fall (mechblock) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as + object + (case event-type + (('carry-info) + (-> self carry) + ) + (('carry? 'pickup) + (the-as basic #f) + ) + (('touched) + (when (and (!= (-> proc type) target) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 2) + (set! (-> a1-2 message) 'attack) + (set! (-> a1-2 param 0) (-> event param 0)) + (let ((v1-7 (new 'static 'attack-info :mask (attack-info-mask mode id)))) + (set! (-> v1-7 id) (-> self attack-id)) + (set! (-> v1-7 mode) 'crush) + (set! (-> a1-2 param 1) (the-as uint v1-7)) + ) + (send-event-function proc a1-2) + ) + ) + (sound-play "block-hit") + (let ((v0-0 (the-as basic (-> proc entity)))) + (set! (-> self hit-something?) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + ) + ) + :enter (behavior () + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self state-time) (-> self clock frame-counter)) + (if (handle->process (-> self carry other)) + (drop-impl! + (the-as carry-info (send-event (handle->process (-> self carry other)) 'carry-info)) + (-> self carry) + ) + ) + (set! (-> self root-override status) (collide-status)) + (set! (-> self root-override root-prim local-sphere w) (-> self carry carry-radius)) + (none) + ) + :trans (behavior () + (when (or (and (logtest? (-> self root-override status) (collide-status on-surface)) + (< 0.8 (-> self root-override surface-angle)) + ) + (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + ) + (vector-reset! (-> self root-override transv)) + (set! (-> self root-override root-prim local-sphere w) (-> self carry backup-radius)) + (cond + ((and (-> self reset-on-land?) + (and (or (< 12288.0 (vector-vector-distance (-> self drop-point) (-> self root-override trans))) + (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + ) + (and (-> self next-entity) + (zero? (logand (-> self next-entity extra perm status) (entity-perm-status subtask-complete))) + ) + ) + ) + (sound-play "block-break") + (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-1 + (let ((t9-4 (method-of-type part-tracker activate))) + (t9-4 (the-as part-tracker gp-1) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-5 run-function-in-process) + (a0-11 gp-1) + (a1-4 part-tracker-init) + (a2-5 (-> *part-group-id-table* 124)) + (a3-2 0) + (t0-1 #f) + (t1-1 #f) + (t2-1 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> self root-override trans quad)) + ((the-as (function object object object object object object object object none) t9-5) + a0-11 + a1-4 + a2-5 + a3-2 + t0-1 + t1-1 + t2-1 + t3-0 + ) + ) + (-> gp-1 ppointer) + ) + ) + (go-virtual wait) + ) + ((or (< 12288.0 (vector-vector-distance (-> self drop-point) (-> self root-override trans))) + (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + ) + (sound-play "block-break") + (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-3 + (let ((t9-11 (method-of-type part-tracker activate))) + (t9-11 (the-as part-tracker gp-3) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-12 run-function-in-process) + (a0-18 gp-3) + (a1-9 part-tracker-init) + (a2-11 (-> *part-group-id-table* 124)) + (a3-5 0) + (t0-3 #f) + (t1-3 #f) + (t2-3 #f) + (t3-1 *launch-matrix*) + ) + (set! (-> t3-1 trans quad) (-> self root-override trans quad)) + ((the-as (function object object object object object object object object none) t9-12) + a0-18 + a1-9 + a2-11 + a3-5 + t0-3 + t1-3 + t2-3 + t3-1 + ) + ) + (-> gp-3 ppointer) + ) + ) + (go-virtual wait) + ) + (else + (go-virtual idle) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior mechblock) sleep-code) + :post (behavior () + (vector-v++! + (-> self root-override transv) + (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 0.0) + ) + (let ((v1-2 (new-stack-vector0)) + (f0-1 (vector-dot (-> self root-override dynam gravity-normal) (-> self root-override transv))) + ) + 0.0 + (vector-! + v1-2 + (-> self root-override transv) + (vector-float*! v1-2 (-> self root-override dynam gravity-normal) f0-1) + ) + (let* ((f1-2 (vector-length v1-2)) + (f2-0 f1-2) + ) + (if (< f0-1 (- (-> self root-override dynam gravity-max))) + (set! f0-1 (- (-> self root-override dynam gravity-max))) + ) + (vector+! + (-> self root-override transv) + (vector-float*! (-> self root-override transv) (-> self root-override dynam gravity-normal) f0-1) + (vector-float*! v1-2 v1-2 (/ f1-2 f2-0)) + ) + ) + ) + (let ((a2-8 (new 'stack-no-clear 'collide-query)) + (gp-1 (-> self root-override)) + ) + (set! (-> gp-1 root-prim type) collide-shape-prim-sphere) + (set! (-> a2-8 collide-with) + (logclear (-> gp-1 root-prim prim-core collide-with) (collide-spec jak player-list tobot)) + ) + (set! (-> a2-8 ignore-process0) self) + (set! (-> a2-8 ignore-process1) #f) + (set! (-> a2-8 ignore-pat) (-> gp-1 pat-ignore-mask)) + (set! (-> a2-8 action-mask) (collide-action solid)) + (fill-cache-integrate-and-collide gp-1 (-> gp-1 transv) a2-8 (meters 0)) + (set! (-> gp-1 root-prim type) collide-shape-prim-mesh) + ) + (transform-post) + (carry-info-method-9 (-> self carry)) + (none) + ) + ) + +;; definition of type throwblock +(deftype throwblock (mechblock) + () + :heap-base #xb0 + :method-count-assert 25 + :size-assert #x124 + :flag-assert #x1900b00124 + ) + +;; definition for method 3 of type throwblock +(defmethod inspect throwblock ((obj throwblock)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type mechblock inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-throwblock throwblock throwblock-lod0-jg throwblock-idle-ja + ((throwblock-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1.5 0 2.7) + ) + +;; definition for method 11 of type throwblock +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! throwblock ((obj throwblock) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving obj (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 penetrated-by) (penetrate)) + (let ((v1-6 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-6 prim-core collide-with) + (collide-spec backgnd jak crate obstacle hit-by-others-list player-list tobot) + ) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 6144.0 0.0 11059.2) + (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 max-iteration-count) (the-as uint 4)) + (set! (-> s4-0 event-self) 'touched) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-throwblock" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (mem-copy! (the-as pointer (-> obj origin)) (the-as pointer (-> obj root-override trans)) 48) + (set! (-> obj allow-drag?) #f) + (set! (-> obj reset-on-land?) #t) + (let* ((v1-18 *game-info*) + (a0-16 (+ (-> v1-18 attack-id) 1)) + ) + (set! (-> v1-18 attack-id) a0-16) + (set! (-> obj attack-id) a0-16) + ) + (set! (-> obj hit-something?) #f) + (set! (-> obj next-entity) (entity-actor-lookup (-> obj entity) 'next-actor 0)) + (let ((v1-20 (new 'process 'carry-info obj 3 (new 'static 'vector :w 1.0) (new 'static 'vector :y 1.0 :w 1.0) 0.0)) + ) + (set! (-> v1-20 max-distance) 16384.0) + (set! (-> v1-20 min-pull) 2048.0) + (set! (-> v1-20 max-pull) 6963.2) + (set! (-> v1-20 carry-radius) 6144.0) + (set! (-> v1-20 mode) (carry-mode mech-carry)) + (set! (-> obj carry) v1-20) + ) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type pushblock +(deftype pushblock (mechblock) + () + :heap-base #xb0 + :method-count-assert 25 + :size-assert #x124 + :flag-assert #x1900b00124 + ) + +;; definition for method 3 of type pushblock +(defmethod inspect pushblock ((obj pushblock)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type mechblock inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-pushblock pushblock pushblock-lod0-jg pushblock-idle-ja + ((pushblock-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 4) + ) + +;; definition for method 11 of type pushblock +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pushblock ((obj pushblock) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving obj (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 penetrated-by) (penetrate)) + (let ((v1-6 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-6 prim-core collide-with) + (collide-spec backgnd jak crate obstacle hit-by-others-list player-list tobot) + ) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 0) + (set-vector! (-> v1-6 local-sphere) 0.0 11264.0 0.0 22528.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 max-iteration-count) (the-as uint 4)) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-pushblock" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (mem-copy! (the-as pointer (-> obj origin)) (the-as pointer (-> obj root-override trans)) 48) + (set! (-> obj reset-on-land?) #f) + (set! (-> obj allow-drag?) #t) + (let* ((v1-17 *game-info*) + (a0-15 (+ (-> v1-17 attack-id) 1)) + ) + (set! (-> v1-17 attack-id) a0-15) + (set! (-> obj attack-id) a0-15) + ) + (set! (-> obj next-entity) #f) + (get-nav-control obj (the-as nav-mesh #f)) + (let ((v1-19 + (new 'process 'carry-info obj 3 (new 'static 'vector :y 819.2 :w 1.0) (new 'static 'vector :y 1.0 :w 1.0) 0.0) + ) + ) + (set! (-> v1-19 max-distance) 22528.0) + (set! (-> v1-19 min-pull) 10240.0) + (set! (-> v1-19 max-pull) 14336.0) + (set! (-> v1-19 carry-radius) 11264.0) + (set! (-> v1-19 mode) (carry-mode mech-drag)) + (set! (-> obj carry) v1-19) + ) + (go (method-of-object obj idle)) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc b/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc new file mode 100644 index 0000000000..78aca5081d --- /dev/null +++ b/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc @@ -0,0 +1,400 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type ruins-pillar-collapse +(deftype ruins-pillar-collapse (process-drawable) + ((root-override collide-shape-moving :offset 128) + (player-attack-id int32 :offset-assert 200) + (fall-anim-index int32 :offset-assert 204) + (hit-points int8 :offset-assert 208) + (mesh-trans uint8 3 :offset-assert 209) + (mesh-joint joint 2 :offset-assert 212) + (deadly? symbol :offset 216) + (art-name string :offset 220) + (anim spool-anim :offset 224) + ) + :heap-base #x70 + :method-count-assert 24 + :size-assert #xe4 + :flag-assert #x18007000e4 + (:methods + (idle () _type_ :state 20) + (bump () _type_ :state 21) + (hit () _type_ :state 22) + (fall (symbol) _type_ :state 23) + ) + ) + +;; definition for method 3 of type ruins-pillar-collapse +(defmethod inspect ruins-pillar-collapse ((obj ruins-pillar-collapse)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tplayer-attack-id: ~D~%" (-> obj player-attack-id)) + (format #t "~2Tfall-anim-index: ~D~%" (-> obj fall-anim-index)) + (format #t "~2Thit-points: ~D~%" (-> obj hit-points)) + (format #t "~2Tmesh-trans[3] @ #x~X~%" (-> obj mesh-trans)) + (format #t "~2Tmesh-joint[2] @ #x~X~%" (-> obj mesh-joint)) + (format #t "~2Tdeadly?: ~A~%" (-> obj deadly?)) + (format #t "~2Tart-name: ~A~%" (-> obj art-name)) + (format #t "~2Tanim: ~A~%" (-> obj anim)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-pillar-collapse-1 ruins-pillar-collapse ruins-pillar-collapse-lod0-jg ruins-pillar-collapse-1-idle-ja + ((ruins-pillar-collapse-lod0-mg (meters 999999))) + :bounds (static-spherem 0 12 16 30) + ) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-pillar-collapse-2 ruins-pillar-collapse ruins-pillar-collapse-lod0-jg ruins-pillar-collapse-2-idle-ja + ((ruins-pillar-collapse-lod0-mg (meters 999999))) + :bounds (static-spherem 0 12 0 17) + ) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-pillar-collapse-3 ruins-pillar-collapse ruins-pillar-collapse-lod0-jg ruins-pillar-collapse-3-idle-ja + ((ruins-pillar-collapse-lod0-mg (meters 999999))) + :bounds (static-spherem 0 12 0 17) + ) + +;; failed to figure out what this is: +(defstate idle (ruins-pillar-collapse) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (when (task-node-closed? (game-task-node ruins-mech-introduction)) + (let* ((gp-1 (the-as attack-info (-> event param 1))) + (s4-0 (-> gp-1 id)) + (s5-0 (vector-x-quaternion! (new-stack-vector0) (-> self root-override quat))) + (a0-6 (vector-z-quaternion! (new-stack-vector0) (-> self root-override quat))) + (v1-4 + (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root-override trans)) + ) + ) + 0.0 + 0.0 + (when (!= s4-0 (-> self player-attack-id)) + (set! (-> self player-attack-id) (the-as int s4-0)) + (let* ((f0-3 (vector-dot s5-0 v1-4)) + (f1-1 (vector-dot a0-6 v1-4)) + (a0-8 (-> gp-1 mode)) + (v1-6 (cond + ((= a0-8 'mech-punch) + (and (< f1-1 0.0) (< (fabs (* 0.5 f0-3)) (fabs f1-1))) + ) + ((= a0-8 'crush) + (< (sqrtf (+ (* (-> v1-4 x) (-> v1-4 x)) (* (-> v1-4 z) (-> v1-4 z)))) 40960.0) + ) + ((= a0-8 'debug) + #t + ) + ) + ) + ) + (cond + (v1-6 + (go-virtual hit) + ) + (else + (go-virtual bump) + #f + ) + ) + ) + ) + ) + ) + ) + (('look-at-point) + (send-event (ppointer->process (-> self child)) 'look-at-point) + ) + (('combo) + #t + ) + ) + ) + :enter (behavior () + (let ((s5-0 (matrix<-transformq! (new 'stack-no-clear 'matrix) (the-as transformq (-> self root-override trans))))) + (if (string= (-> self name) "ruins-pillar-collapse-9") + (mech-target-spawn + (vector-matrix*! (new 'stack-no-clear 'vector) (new 'static 'vector :y 18432.0 :z 8192.0 :w 1.0) s5-0) + (the-as target self) + (-> self root-override quat) + (-> self entity) + ) + (mech-target-spawn + (vector-matrix*! (new 'stack-no-clear 'vector) (new 'static 'vector :y 18432.0 :z -8192.0 :w 1.0) s5-0) + (the-as target self) + (-> self root-override quat) + (-> self entity) + ) + ) + ) + (none) + ) + :exit (behavior () + (while (-> self child) + (deactivate (-> self child 0)) + ) + (none) + ) + :code (behavior () + (if (task-node-closed? (game-task-node ruins-mech-introduction)) + (add-process *gui-control* self (gui-channel art-load) (gui-action queue) (-> self anim name) -99.0 0) + ) + (ja :num-func num-func-identity :frame-num 0.0) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) + :post (the-as (function none :behavior ruins-pillar-collapse) transform-post) + ) + +;; failed to figure out what this is: +(defstate bump (ruins-pillar-collapse) + :virtual #t + :event (-> (method-of-type ruins-pillar-collapse idle) event) + :trans (the-as (function none :behavior ruins-pillar-collapse) rider-trans) + :code (behavior () + (go-virtual idle) + (none) + ) + :post (the-as (function none :behavior ruins-pillar-collapse) rider-post) + ) + +;; failed to figure out what this is: +(defstate hit (ruins-pillar-collapse) + :virtual #t + :event (-> (method-of-type ruins-pillar-collapse idle) event) + :trans (the-as (function none :behavior ruins-pillar-collapse) rider-trans) + :code (behavior () + (+! (-> self hit-points) -1) + (if (zero? (-> self hit-points)) + (go-virtual fall #f) + ) + (go-virtual idle) + (none) + ) + :post (the-as (function none :behavior ruins-pillar-collapse) rider-post) + ) + +;; failed to figure out what this is: +(defstate fall (ruins-pillar-collapse) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('touch 'attack) + (let* ((s5-0 (-> event param 0)) + (s4-0 proc) + (gp-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + (a1-4 (if s5-0 + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry s5-0) + (-> self root-override) + (the-as uint 2) + ) + ) + ) + ) + (when (and gp-0 a1-4) + (let ((s4-1 (get-intersect-point + (new 'stack-no-clear 'vector) + a1-4 + (-> self root-override) + (the-as touching-shapes-entry s5-0) + ) + ) + ) + (when (and (< (-> (get-trans (the-as process-focusable gp-0) 3) y) (-> s4-1 y)) + (< 40960.0 (vector-vector-distance s4-1 (-> self root-override trans))) + ) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) (process->ppointer self)) + (set! (-> a1-8 num-params) 2) + (set! (-> a1-8 message) 'attack) + (set! (-> a1-8 param 0) s5-0) + (let ((v1-13 (new 'static 'attack-info :mask (attack-info-mask mode id)))) + (let* ((a0-7 *game-info*) + (a2-5 (+ (-> a0-7 attack-id) 1)) + ) + (set! (-> a0-7 attack-id) a2-5) + (set! (-> v1-13 id) a2-5) + ) + (set! (-> v1-13 mode) 'crush) + (set! (-> a1-8 param 1) (the-as uint v1-13)) + ) + (send-event-function gp-0 a1-8) + ) + ) + ) + ) + ) + ) + ) + ) + :trans (the-as (function none :behavior ruins-pillar-collapse) rider-trans) + :post (the-as (function none :behavior ruins-pillar-collapse) rider-post) + ) + +;; definition for method 11 of type ruins-pillar-collapse +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! ruins-pillar-collapse ((obj ruins-pillar-collapse) (arg0 entity-actor)) + (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape-moving)) + (stack-size-set! (-> obj main-thread) 512) + (set! (-> obj mask) (logior (process-mask collectable) (-> obj mask))) + (dotimes (v1-3 3) + (set! (-> obj mesh-trans v1-3) (the-as uint v1-3)) + ) + (let ((s4-0 (new 'process 'collide-shape-moving obj (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 penetrated-by) (penetrate)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 33) 0))) + (set! (-> s4-0 total-prims) (the-as uint 34)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable)) + (set! (-> s3-0 transform-index) 0) + (set-vector! (-> s3-0 local-sphere) 0.0 49152.0 0.0 69632.0) + (set! (-> s4-0 root-prim) s3-0) + (let* ((s2-0 (the-as object '((5 22 61440) + (3 21 18432) + (4 22 61440) + (6 46 8192) + (7 47 6144) + (8 48 6963) + (9 49 6963) + (10 53 6963) + (11 54 6144) + (12 61 8192) + (13 62 10240) + (14 63 6963) + (15 64 6963) + (17 66 9011) + (18 67 16384) + (19 68 8192) + (20 69 6144) + (21 70 6553) + (22 71 9420) + (23 72 5734) + (24 73 7782) + (25 74 5734) + (26 75 8192) + (27 76 5734) + (28 77 5734) + (29 78 10240) + (30 79 6144) + (31 80 6144) + (32 81 6144) + (33 82 6963) + (34 83 9830) + (35 84 8192) + (16 65 8192) + ) + ) + ) + (s1-0 (-> (the-as pair s2-0) car)) + ) + (while (not (null? s2-0)) + (let ((s0-0 (method-of-type collide-shape-prim-mesh new))) + (set! sv-32 'process) + (set! sv-48 collide-shape-prim-mesh) + (set! sv-64 s4-0) + (let ((a3-2 (command-get-int (-> (the-as pair s1-0) car) 0)) + (t0-1 0) + ) + (set! sv-16 (s0-0 sv-32 sv-48 sv-64 (the-as uint a3-2) (the-as uint t0-1))) + ) + ) + (let ((s0-1 sv-16)) + (set! (-> s0-1 prim-core collide-as) (-> s3-0 prim-core collide-as)) + (set! (-> s0-1 prim-core collide-with) (-> s3-0 prim-core collide-with)) + (set! (-> s0-1 prim-core action) (-> s3-0 prim-core action)) + (set! (-> s0-1 transform-index) (command-get-int (-> (the-as pair (-> (the-as pair s1-0) cdr)) car) 0)) + ) + (set-vector! + (-> sv-16 local-sphere) + 0.0 + 0.0 + 0.0 + (command-get-float (-> (the-as pair (-> (the-as pair (-> (the-as pair s1-0) cdr)) cdr)) car) 0.0) + ) + (set! s2-0 (-> (the-as pair s2-0) cdr)) + (set! s1-0 (-> (the-as pair s2-0) car)) + ) + ) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-30 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-30 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-30 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (set! (-> obj mesh-trans 0) (the-as uint 1)) + (set! (-> obj mesh-trans 1) (the-as uint 2)) + (set! (-> obj mesh-trans 2) (the-as uint 0)) + (let ((s5-1 (res-lump-struct (-> obj entity) 'art-name structure))) + (set! (-> obj art-name) (the-as string s5-1)) + (cond + ((string= (the-as string s5-1) "ruins-pillar-collapse-1") + (let ((v1-38 (-> obj root-override root-prim local-sphere))) + (set! (-> v1-38 y) 49152.0) + (set! (-> v1-38 z) 65536.0) + (set! (-> v1-38 w) 122880.0) + ) + (set! (-> obj anim) (new 'static 'spool-anim + :name "ruins-pillar-collapse-1" + :anim-name "1-break-center" + :parts 2 + :command-list '() + ) + ) + ) + ((string= (the-as string s5-1) "ruins-pillar-collapse-2") + (set! (-> obj anim) (new 'static 'spool-anim + :name "ruins-pillar-collapse-2" + :anim-name "2-break-center" + :parts 2 + :command-list '() + ) + ) + (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (+ 32768.0 (y-angle (-> obj root-override)))) + ) + ((string= (the-as string s5-1) "ruins-pillar-collapse-3") + (set! (-> obj anim) (new 'static 'spool-anim + :name "ruins-pillar-collapse-3" + :anim-name "3-break-center" + :parts 2 + :command-list '() + ) + ) + (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (+ 32768.0 (y-angle (-> obj root-override)))) + ) + ) + (initialize-skeleton-by-name obj (the-as string s5-1)) + ) + (set! (-> obj hit-points) 1) + (set! (-> obj deadly?) #f) + (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object obj fall) #t) + (go (method-of-object obj idle)) + ) + (none) + ) diff --git a/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc b/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc index 0b3f7f21da..ef30b2f3c4 100644 --- a/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc @@ -89,7 +89,12 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1010501 #x0 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 5 :notice-anim 6 :hostile-anim -1 diff --git a/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc b/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc new file mode 100644 index 0000000000..5474058394 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc @@ -0,0 +1,1046 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sinking-plat +(deftype sinking-plat (rigid-body-platform) + ((anchor-point vector :inline :offset-assert 384) + ) + :heap-base #x110 + :method-count-assert 57 + :size-assert #x190 + :flag-assert #x3901100190 + ) + +;; definition for method 3 of type sinking-plat +(defmethod inspect sinking-plat ((obj sinking-plat)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type rigid-body-platform inspect))) + (t9-0 obj) + ) + (format #t "~2Tanchor-point: #~%" (-> obj anchor-point)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-sinking-plat sinking-plat sinking-plat-lod0-jg sinking-plat-idle-ja + ((sinking-plat-lod0-mg (meters 20)) (sinking-plat-lod1-mg (meters 999999))) + :bounds (static-spherem 0 1 0 4) + ) + +;; definition for method 29 of type sinking-plat +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-29 sinking-plat ((obj sinking-plat) (arg0 float)) + ((the-as (function rigid-body-platform float none) (find-parent-method sinking-plat 29)) obj arg0) + (rigid-body-platform-method-56 obj (-> obj anchor-point)) + 0 + (none) + ) + +;; definition for method 32 of type sinking-plat +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-32 sinking-plat ((obj sinking-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) 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 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 4096.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-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! (-> obj root-override-2) s5-0) + ) + 0 + (none) + ) + +;; definition for symbol *ruins-sinking-platform-constants*, type rigid-body-platform-constants +(define *ruins-sinking-platform-constants* (new 'static 'rigid-body-platform-constants + :mass 1.48 + :inv-mass 0.6756757 + :cm-joint (new 'static 'vector :w 1.0) + :linear-damping 0.8 + :angular-damping 1.0 + :friction-factor 0.1 + :inertial-tensor-x (meters 2) + :inertial-tensor-y (meters 1) + :inertial-tensor-z (meters 2) + :max-time-step 0.02 + :gravity (meters 80) + :idle-distance (meters 50) + :attack-force-scale 1.0 + :name '*ruins-sinking-platform-constants* + :drag-factor 2.0 + :buoyancy-factor 1.5 + :max-buoyancy-depth (meters 2) + :player-weight (meters 60) + :player-bonk-factor 0.5 + :player-dive-factor 1.0 + :player-force-distance (meters 2) + :player-force-clamp (meters 1000000) + :player-force-timeout #x1e + :explosion-force (meters 1000) + :control-point-count 5 + :platform #t + :sound-name "ruins-plat" + ) + ) + +;; definition for method 33 of type sinking-plat +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-33 sinking-plat ((obj sinking-plat)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-sinking-plat" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj float-height-offset) 4096.0) + (rigid-body-object-method-31 obj *ruins-sinking-platform-constants*) + (set! (-> obj anchor-point quad) (-> obj root-override-2 trans quad)) + (let ((s5-1 (-> obj info-override control-point-count))) + (dotimes (s4-1 s5-1) + (let ((s3-0 (-> obj control-point-array data s4-1))) + (let ((f30-0 (* 65536.0 (/ (the float s4-1) (the float s5-1))))) + (set! (-> s3-0 local-pos x) (* 12288.0 (sin f30-0))) + (set! (-> s3-0 local-pos y) 4096.0) + (set! (-> s3-0 local-pos z) (* 12288.0 (cos f30-0))) + ) + (set! (-> s3-0 local-pos w) 1.0) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate idle (sinking-plat) + :virtual #t + :event (the-as + (function process int symbol event-message-block object :behavior sinking-plat) + rigid-body-object-event-handler + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) + :num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (behavior () + (set! (-> self info-override) *ruins-sinking-platform-constants*) + (set! (-> self rbody state info) (the-as rigid-body-info (&-> (-> self info-override) mass))) + (rigid-body-object-method-37 self) + (none) + ) + ) + +;; definition of type beam +(deftype beam (process-drawable) + () + :heap-base #x50 + :method-count-assert 22 + :size-assert #xc8 + :flag-assert #x16005000c8 + (:methods + (idle () _type_ :state 20) + (collapse () _type_ :state 21) + ) + ) + +;; definition for method 3 of type beam +(defmethod inspect beam ((obj beam)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-beam beam beam-lod0-jg -1 + ((beam-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +;; failed to figure out what this is: +(defstate idle (beam) + :virtual #t + :trans (behavior () + (let ((f0-0 (vector-vector-distance-squared (-> self root trans) (camera-pos))) + (f1-0 102400.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (go-virtual collapse) + ) + ) + (none) + ) + :code (the-as (function none :behavior beam) sleep-code) + ) + +;; failed to figure out what this is: +(defstate collapse (beam) + :virtual #t + :code (behavior () + (sound-play "beam-slip") + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) + :post (the-as (function none :behavior beam) ja-post) + ) + +;; definition for method 11 of type beam +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! beam ((obj beam) (arg0 entity-actor)) + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-beam" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (ja-channel-push! 1 0) + (let ((s5-2 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-2 + (the-as art-joint-anim (-> obj draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-2 frame-num) 0.0) + ) + (ja-post) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type ruins-bridge +(deftype ruins-bridge (drop-plat) + () + :heap-base #xc0 + :method-count-assert 36 + :size-assert #x140 + :flag-assert #x2400c00140 + ) + +;; definition for method 3 of type ruins-bridge +(defmethod inspect ruins-bridge ((obj ruins-bridge)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type drop-plat inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-bridge-1 ruins-bridge ruins-bridge-1-lod0-jg ruins-bridge-1-idle-ja + ((ruins-bridge-1-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7) + ) + +;; definition for method 29 of type ruins-bridge +;; WARN: Return type mismatch int vs none. +(defmethod start-bouncing! ruins-bridge ((obj ruins-bridge)) + "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce + and translate the platform via the `smush` + @see [[smush-control]]" + (logclear! (-> obj mask) (process-mask sleep)) + (logclear! (-> obj mask) (process-mask sleep-code)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate fall (ruins-bridge) + :virtual #t + :trans (the-as (function none :behavior ruins-bridge) rider-trans) + ) + +;; definition for method 11 of type ruins-bridge +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! ruins-bridge ((obj ruins-bridge) (arg0 entity-actor)) + (stack-size-set! (-> obj main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum 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 4) 0))) + (set! (-> s4-0 total-prims) (the-as uint 5)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 49152.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak 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 26624.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec)) + (set! (-> v1-18 prim-core collide-with) (collide-spec)) + (set! (-> v1-18 prim-core action) (collide-action solid rideable)) + (set! (-> v1-18 transform-index) 69) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 26624.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec)) + (set! (-> v1-20 prim-core collide-with) (collide-spec)) + (set! (-> v1-20 prim-core action) (collide-action solid rideable)) + (set! (-> v1-20 transform-index) 70) + (set-vector! (-> v1-20 local-sphere) 0.0 0.0 0.0 18432.0) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec)) + (set! (-> v1-22 prim-core collide-with) (collide-spec)) + (set! (-> v1-22 prim-core action) (collide-action solid rideable)) + (set! (-> v1-22 transform-index) 71) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 14336.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-25 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-bridge-1" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-bridge-1") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-bridge-1" :anim-name "1-crumble" :parts 2 :command-list '()) + ) + (set! (-> obj basetrans quad) (-> obj root-override trans quad)) + (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object obj fall) #t) + (go (method-of-object obj idle)) + ) + (none) + ) + +;; definition of type ruins-drop-plat +(deftype ruins-drop-plat (drop-plat) + () + :heap-base #xc0 + :method-count-assert 36 + :size-assert #x140 + :flag-assert #x2400c00140 + ) + +;; definition for method 3 of type ruins-drop-plat +(defmethod inspect ruins-drop-plat ((obj ruins-drop-plat)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type drop-plat inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-drop-plat-a-1 ruins-drop-plat ruins-drop-plat-a-lod0-jg ruins-drop-plat-a-1-idle-ja + ((ruins-drop-plat-a-lod0-mg (meters 20)) (ruins-drop-plat-a-lod1-mg (meters 999999))) + :bounds (static-spherem 2.5 -10 2.5 12) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-drop-plat-a-2 ruins-drop-plat ruins-drop-plat-a-lod0-jg ruins-drop-plat-a-2-idle-ja + ((ruins-drop-plat-a-lod0-mg (meters 20)) (ruins-drop-plat-a-lod1-mg (meters 999999))) + :bounds (static-spherem 2.5 -10 2.5 12) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-drop-plat-a-3 ruins-drop-plat ruins-drop-plat-a-lod0-jg ruins-drop-plat-a-3-idle-ja + ((ruins-drop-plat-a-lod0-mg (meters 20)) (ruins-drop-plat-a-lod1-mg (meters 999999))) + :bounds (static-spherem 2.5 -10 2.5 12) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-drop-plat-b-1 ruins-drop-plat ruins-drop-plat-b-lod0-jg ruins-drop-plat-b-1-idle-ja + ((ruins-drop-plat-b-lod0-mg (meters 20)) (ruins-drop-plat-b-lod1-mg (meters 999999))) + :bounds (static-spherem 2.5 -10 2.5 12) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-drop-plat-b-2 ruins-drop-plat ruins-drop-plat-b-lod0-jg ruins-drop-plat-b-2-idle-ja + ((ruins-drop-plat-b-lod0-mg (meters 20)) (ruins-drop-plat-b-lod1-mg (meters 999999))) + :bounds (static-spherem 2.5 -10 2.5 12) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-drop-plat-c-1 ruins-drop-plat ruins-drop-plat-c-lod0-jg ruins-drop-plat-c-1-idle-ja + ((ruins-drop-plat-c-lod0-mg (meters 20)) (ruins-drop-plat-c-lod1-mg (meters 999999))) + :bounds (static-spherem 2.5 -10 2.5 12) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-drop-plat-c-2 ruins-drop-plat ruins-drop-plat-c-lod0-jg ruins-drop-plat-c-2-idle-ja + ((ruins-drop-plat-c-lod0-mg (meters 20)) (ruins-drop-plat-c-lod1-mg (meters 999999))) + :bounds (static-spherem 2.5 -10 2.5 12) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-ruins-drop-plat-c-3 ruins-drop-plat ruins-drop-plat-c-lod0-jg ruins-drop-plat-c-3-idle-ja + ((ruins-drop-plat-c-lod0-mg (meters 20)) (ruins-drop-plat-c-lod1-mg (meters 999999))) + :bounds (static-spherem 2.5 -10 2.5 12) + :origin-joint-index 3 + ) + +;; definition for method 29 of type ruins-drop-plat +;; WARN: Return type mismatch int vs none. +(defmethod start-bouncing! ruins-drop-plat ((obj ruins-drop-plat)) + "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce + and translate the platform via the `smush` + @see [[smush-control]]" + (activate! (-> obj smush) -1.0 60 150 1.0 1.0 (-> self clock)) + (set! (-> obj bounce-time) (-> self clock frame-counter)) + (set! (-> obj bouncing) #t) + (logclear! (-> obj mask) (process-mask sleep)) + (logclear! (-> obj mask) (process-mask sleep-code)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate fall (ruins-drop-plat) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('collide-shape) + (let ((v1-2 (-> self root-override root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v1-7 (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) child 1))) + (set! (-> v1-7 prim-core collide-with) (collide-spec)) + (set! (-> v1-7 prim-core collide-as) (collide-spec)) + ) + 0 + ) + (else + ((-> (method-of-type drop-plat fall) event) proc arg1 event-type event) + ) + ) + ) + :post (behavior () + (when (and (nonzero? (-> self root-override root-prim prim-core collide-as)) + (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.25)) + ) + (let ((v1-9 (-> self root-override root-prim))) + (set! (-> v1-9 prim-core collide-as) (collide-spec)) + (set! (-> v1-9 prim-core collide-with) (collide-spec)) + ) + 0 + ) + (let ((t9-0 (-> (method-of-type drop-plat fall) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + (none) + ) + ) + +;; definition for method 11 of type ruins-drop-plat +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! ruins-drop-plat ((obj ruins-drop-plat) (arg0 entity-actor)) + (stack-size-set! (-> obj main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum 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 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s3-0 local-sphere) 0.0 -40960.0 0.0 40960.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid)) + (set! (-> v1-16 transform-index) 3) + (set-vector! (-> v1-16 local-sphere) 10240.0 -40960.0 10240.0 49152.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid rideable)) + (set! (-> v1-18 transform-index) 3) + (set-vector! (-> v1-18 local-sphere) 10240.0 -16384.0 10240.0 28672.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-21 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (let ((s5-1 ((method-of-type res-lump get-property-struct) + (-> obj entity) + 'art-name + 'interp + -1000000000.0 + "ruins-drop-plat-a-1" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (set! (-> obj art-name) (the-as string s5-1)) + (cond + ((string= (the-as string s5-1) "ruins-drop-plat-a-1") + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ruins-drop-plat-a-1" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-drop-plat-a-1") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-drop-plat-a-1" :anim-name "a-1-break-center" :parts 1 :command-list '()) + ) + ) + ((string= (the-as string s5-1) "ruins-drop-plat-a-2") + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ruins-drop-plat-a-2" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-drop-plat-a-2") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-drop-plat-a-1" :anim-name "a-2-break-center" :parts 1 :command-list '()) + ) + ) + ((string= (the-as string s5-1) "ruins-drop-plat-a-3") + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ruins-drop-plat-a-3" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-drop-plat-a-3") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-drop-plat-a-1" :anim-name "a-3-break-center" :parts 1 :command-list '()) + ) + ) + ((string= (the-as string s5-1) "ruins-drop-plat-b-1") + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ruins-drop-plat-b-1" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-drop-plat-b-1") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-drop-plat-b-1" :anim-name "b-1-break-center" :parts 1 :command-list '()) + ) + ) + ((string= (the-as string s5-1) "ruins-drop-plat-b-2") + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ruins-drop-plat-b-2" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-drop-plat-b-2") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-drop-plat-b-1" :anim-name "b-2-break-center" :parts 1 :command-list '()) + ) + ) + ((string= (the-as string s5-1) "ruins-drop-plat-c-1") + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ruins-drop-plat-c-1" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-drop-plat-c-1") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-drop-plat-c-1" :anim-name "c-1-break-center" :parts 1 :command-list '()) + ) + ) + ((string= (the-as string s5-1) "ruins-drop-plat-c-2") + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ruins-drop-plat-c-2" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-drop-plat-c-2") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-drop-plat-c-1" :anim-name "c-2-break-center" :parts 1 :command-list '()) + ) + ) + ((string= (the-as string s5-1) "ruins-drop-plat-c-3") + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ruins-drop-plat-c-3" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj art-name) "ruins-drop-plat-c-3") + (set! (-> obj anim) + (new 'static 'spool-anim :name "ruins-drop-plat-c-1" :anim-name "c-3-break-center" :parts 1 :command-list '()) + ) + ) + (else + (go process-drawable-art-error (the-as string s5-1)) + ) + ) + ) + (set! (-> obj draw force-lod) 1) + (set! (-> obj break-anim-name) (new 'process 'string 128 (the-as string #f))) + (set! (-> obj basetrans quad) (-> obj root-override trans quad)) + (set! (-> obj bounce-scale) 0.0) + (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object obj fall) #t) + (go (method-of-object obj idle)) + ) + (none) + ) + +;; definition for function ruins-activate +;; WARN: Return type mismatch int vs none. +(defun ruins-activate () + (setup-user-array (-> *part-id-table* 1309) "grenadier-grenade-part") + (setup-user-array (-> *part-id-table* 638) "grenadier-grenade-part") + (setup-user-array (-> *part-id-table* 639) "grenadier-grenade-part") + 0 + (none) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 13 + 3 + (lambda :behavior task-manager + () + (set! (-> self data-int32 0) 0) + (set! (-> self beep-time) (+ (-> self clock frame-counter) (seconds -30))) + (until #f + (when (>= (- (-> self clock frame-counter) (-> self beep-time)) (seconds 40)) + (let ((v1-8 (mod (-> self data-int32 0) (if (= (-> self node-info task) (game-task ruins-tower)) + 4 + 2 + ) + ) + ) + ) + (cond + ((zero? v1-8) + (talker-spawn-func (-> *talker-speech* 68) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-8 1) + (talker-spawn-func (-> *talker-speech* 69) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-8 2) + (talker-spawn-func (-> *talker-speech* 70) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-8 3) + (talker-spawn-func (-> *talker-speech* 71) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (set! (-> self beep-time) (-> self clock frame-counter)) + (+! (-> self data-int32 0) 1) + ) + (b! + (>= (vector-vector-distance (target-pos 0) (-> self info end-sphere)) (-> self info end-sphere r)) + cfg-23 + :delay #f + ) + (send-event (handle->process (-> self arrow)) 'leave) + (b! #t cfg-39 :delay (nop!)) + (label cfg-23) + (when (and (>= (-> self data-int32 0) 4) (not (handle->process (-> self arrow)))) + (let ((gp-5 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-5 pos quad) (-> self info end-sphere quad)) + (quaternion-identity! (-> gp-5 quat)) + (set! (-> gp-5 flags) (task-arrow-flags)) + (set! (-> gp-5 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn gp-5 (the-as task-arrow self)))) + ) + ) + (label cfg-39) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(copy-hooks! (-> *game-info* sub-task-list 99) (-> *game-info* sub-task-list 13)) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 194 + 3 + (lambda :behavior task-manager + () + (let ((s4-0 (entity-by-type mech)) + (gp-0 (entity-by-name "ruins-breakable-wall-1")) + ) + (when s4-0 + (let ((s5-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> self begin-pos quad) (-> s4-0 extra trans quad)) + (set! (-> s5-0 pos quad) (-> self begin-pos quad)) + (quaternion-identity! (-> s5-0 quat)) + (set! (-> s5-0 flags) (task-arrow-flags)) + (set! (-> s5-0 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn s5-0 (the-as task-arrow self)))) + ) + ) + (b! #t cfg-17 :delay (nop!)) + (label cfg-8) + (when (and (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) + gp-0 + (< (vector-vector-xz-distance (target-pos 0) (-> gp-0 extra trans)) 40960.0) + ) + (talker-spawn-func (-> *talker-speech* 452) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self time-limit) (-> self clock frame-counter)) + ) + (suspend) + (label cfg-17) + (b! + (or (not *target*) + (and (handle->process (-> self arrow)) + (let ((f0-1 (vector-vector-xz-distance (-> self begin-pos) (-> *target* control trans)))) + (< 32768.0 f0-1) + ) + ) + ) + cfg-8 + :delay (nop!) + ) + (send-event (handle->process (-> self arrow)) 'leave) + (until (not (or (not *target*) (zero? (logand (focus-status mech) (-> *target* focus-status))))) + (b! #t cfg-47 :delay (nop!)) + (label cfg-38) + (when (and (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) + gp-0 + (< (vector-vector-xz-distance (target-pos 0) (-> gp-0 extra trans)) 40960.0) + ) + (talker-spawn-func (-> *talker-speech* 452) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self time-limit) (-> self clock frame-counter)) + ) + (suspend) + (label cfg-47) + (b! (or (not *target*) (zero? (logand (focus-status mech) (-> *target* focus-status)))) cfg-38 :delay (nop!)) + (talker-spawn-func (-> *talker-speech* 457) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self time-limit) (-> self clock frame-counter)) + (b! #t cfg-66 :delay (nop!)) + (label cfg-52) + ) + (when (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) + (b! + (not (and gp-0 (< (vector-vector-xz-distance (target-pos 0) (-> gp-0 extra trans)) 61440.0))) + cfg-63 + :delay (nop!) + ) + (talker-spawn-func (-> *talker-speech* 453) *entity-pool* (target-pos 0) (the-as region #f)) + (b! #t cfg-64 :delay (nop!)) + (label cfg-63) + (talker-spawn-func (-> *talker-speech* 454) *entity-pool* (target-pos 0) (the-as region #f)) + (label cfg-64) + (set! (-> self time-limit) (-> self clock frame-counter)) + ) + (suspend) + (label cfg-66) + (b! + (or (not *target*) + (not gp-0) + (zero? (logand (-> gp-0 extra perm status) (entity-perm-status subtask-complete))) + ) + cfg-52 + :delay (nop!) + ) + ) + (go-virtual complete) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 195 + 3 + (lambda :behavior task-manager + () + (local-vars (v1-3 object) (v1-14 symbol) (v1-18 symbol) (v1-25 object) (v1-31 symbol) (v1-32 symbol)) + (let ((gp-0 (entity-by-name "pushblock-6"))) + (label cfg-1) + (b! #t cfg-14 :delay (nop!)) + (label cfg-2) + (let ((a0-2 (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)))) + (b! (not a0-2) cfg-11 :likely-delay (set! v1-3 a0-2)) + ) + (b! (not gp-0) cfg-11 :likely-delay (set! v1-3 gp-0)) + (let ((v1-5 (-> gp-0 extra process))) + (b! (not v1-5) cfg-8 :delay (nop!)) + (let ((s4-0 (-> (the-as process-drawable v1-5) root trans))) + (b! #t cfg-9 :delay (nop!)) + (label cfg-8) + (set! s4-0 (-> gp-0 extra trans)) + (label cfg-9) + (set! v1-3 (< (vector-vector-xz-distance (target-pos 0) s4-0) 40960.0)) + ) + ) + (label cfg-11) + (when v1-3 + (talker-spawn-func (-> *talker-speech* 452) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self time-limit) (-> self clock frame-counter)) + ) + (suspend) + (label cfg-14) + (b! (not *target*) cfg-17 :likely-delay (set! v1-14 #t)) + (set! v1-14 (zero? (logand (focus-status mech) (-> *target* focus-status)))) + (label cfg-17) + (b! v1-14 cfg-2 :delay (nop!)) + (until #f + (b! (not *target*) cfg-22 :likely-delay (set! v1-18 #t)) + (set! v1-18 (zero? (logand (focus-status mech) (-> *target* focus-status)))) + (label cfg-22) + (b! v1-18 cfg-1 :delay (nop!)) + (when (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) + (b! (not gp-0) cfg-38 :likely-delay (set! v1-25 gp-0)) + (let ((v1-27 (-> gp-0 extra process))) + (b! (not v1-27) cfg-28 :delay (nop!)) + (let ((s5-2 (-> (the-as process-drawable v1-27) root trans))) + (b! #t cfg-29 :delay (nop!)) + (label cfg-28) + (set! s5-2 (-> gp-0 extra trans)) + (label cfg-29) + (let ((s4-2 (target-pos 0))) + (b! (< (vector-vector-xz-distance s4-2 s5-2) 40960.0) cfg-31 :delay (set! v1-31 #t)) + (set! v1-31 #f) + (label cfg-31) + (b! (not v1-31) cfg-35 :likely-delay (set! v1-32 v1-31)) + (b! (< (-> s4-2 y) (+ 16384.0 (-> s5-2 y))) cfg-35 :delay (set! v1-32 #t)) + ) + ) + ) + (set! v1-32 #f) + (label cfg-35) + (b! (not v1-32) cfg-38 :likely-delay (set! v1-25 v1-32)) + (set! v1-25 (zero? (logand (focus-status carry) (-> *target* focus-status)))) + (label cfg-38) + (when v1-25 + (talker-spawn-func (-> *talker-speech* 458) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self time-limit) (-> self clock frame-counter)) + ) + ) + (suspend) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 196 + 3 + (lambda :behavior task-manager + () + (local-vars (v1-6 object) (v1-58 symbol)) + (let ((gp-0 (entity-by-name "throwblock-3")) + (s4-0 (entity-by-name "ruins-pillar-collapse-7")) + (s5-0 (entity-by-name "ruins-pillar-collapse-9")) + ) + (b! #t cfg-2 :delay (nop!)) + (label cfg-1) + (suspend) + (label cfg-2) + (b! + (or (not s4-0) (zero? (logand (-> s4-0 extra perm status) (entity-perm-status subtask-complete)))) + cfg-1 + :delay (nop!) + ) + (until (not (or (not *target*) (zero? (logand (focus-status mech) (-> *target* focus-status))))) + (b! #t cfg-20 :delay (nop!)) + (label cfg-8) + (set! v1-6 + (and (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) + (and gp-0 (begin + (let ((v1-8 (-> gp-0 extra process))) + (b! (not v1-8) cfg-14 :delay (nop!)) + (let ((s3-0 (-> (the-as process-drawable v1-8) root trans))) + (b! #t cfg-15 :delay (nop!)) + (label cfg-14) + (set! s3-0 (-> gp-0 extra trans)) + (label cfg-15) + (b! (< (vector-vector-xz-distance (target-pos 0) s3-0) 40960.0) cfg-17 :delay (set! v1-6 #t)) + ) + ) + #f + ) + ) + ) + ) + (label cfg-17) + (b! (not v1-6) cfg-19 :delay (empty-form)) + (talker-spawn-func (-> *talker-speech* 452) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self time-limit) (-> self clock frame-counter)) + (label cfg-19) + (suspend) + (label cfg-20) + (b! (or (not *target*) (zero? (logand (focus-status mech) (-> *target* focus-status)))) cfg-8 :delay (nop!)) + (b! #t cfg-53 :delay (nop!)) + (label cfg-25) + ) + (when (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) + (b! + (not (and *target* (logtest? (focus-status carry) (-> *target* focus-status)))) + cfg-43 + :delay (empty-form) + ) + (when (< (vector-vector-xz-distance + (target-pos 0) + (new 'static 'vector :x 3881326.5 :y 148090.88 :z -2125870.8 :w 1.0) + ) + 32768.0 + ) + (when (zero? (-> self count)) + (persist-with-delay *setting-control* #f (seconds 3) 'entity-name (the-as symbol "camera-270") 0.0 0) + (set! (-> self count) 1) + ) + (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) 'look-at-point) + (let ((t9-10 send-event-function) + (v1-41 s5-0) + ) + (t9-10 + (if v1-41 + (-> v1-41 extra process) + ) + a1-10 + ) + ) + ) + (talker-spawn-func (-> *talker-speech* 459) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self time-limit) (-> self clock frame-counter)) + ) + (b! #t cfg-52 :delay (nop!)) + (label cfg-43) + (when (and gp-0 (let ((v1-49 (-> gp-0 extra process))) + (b! (not v1-49) cfg-47 :delay (nop!)) + (let ((s3-3 (-> (the-as process-drawable v1-49) root trans))) + (b! #t cfg-48 :delay (nop!)) + (label cfg-47) + (set! s3-3 (-> gp-0 extra trans)) + (label cfg-48) + (< (vector-vector-xz-distance (target-pos 0) s3-3) 40960.0) + ) + ) + ) + (talker-spawn-func (-> *talker-speech* 458) *entity-pool* (target-pos 0) (the-as region #f)) + (set! (-> self time-limit) (-> self clock frame-counter)) + ) + ) + (label cfg-52) + (suspend) + (label cfg-53) + (b! (not *target*) cfg-58 :likely-delay (set! v1-58 #t)) + (set! v1-58 + (or (not s5-0) (zero? (logand (-> s5-0 extra perm status) (entity-perm-status subtask-complete)))) + ) + ) + (label cfg-58) + (b! v1-58 cfg-25 :delay (nop!)) + (go-virtual complete) + ) + ) diff --git a/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc b/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc index 6605aa3e8e..75168c32a5 100644 --- a/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc @@ -46,108 +46,114 @@ ) ;; definition for symbol *gator-nav-enemy-info*, type nav-enemy-info -(define *gator-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 'array uint32 4 #x1e0002 #x64640d01 #x0 #x0) - :idle-anim 13 - :notice-anim 13 - :hostile-anim 14 - :hit-anim 6 - :knocked-anim 6 - :knocked-land-anim 7 - :die-anim 12 - :die-falling-anim 21 - :victory-anim -1 - :jump-wind-up-anim 13 - :jump-in-air-anim 13 - :jump-land-anim 13 - :neck-joint -1 - :look-at-joint 12 - :bullseye-joint 4 - :sound-hit (static-sound-name "gator-hit") - :sound-die (static-sound-name "gator-die") - :notice-distance (meters 80) - :notice-distance-delta (meters 10) - :proximity-notice-distance (meters 40) - :default-hit-points 1 - :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.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) - :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 - :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) - :callback-info #f - :use-momentum #f - :use-frustration #t - :use-stop-chase #f - :use-circling #t - :use-pacing #t - :walk-anim 13 - :turn-anim -1 - :run-anim 14 - :taunt-anim -1 - :run-travel-speed (meters 16) - :run-acceleration (meters 8) - :run-turning-acceleration (meters 40) - :walk-travel-speed (meters 4) - :walk-acceleration (meters 8) - :walk-turning-acceleration (meters 10) - :maximum-rotation-rate (degrees 200.00002) - :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 - ) - ) +(define *gator-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 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #xd :param0 #x64 :param1 #x64) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 13 + :notice-anim 13 + :hostile-anim 14 + :hit-anim 6 + :knocked-anim 6 + :knocked-land-anim 7 + :die-anim 12 + :die-falling-anim 21 + :victory-anim -1 + :jump-wind-up-anim 13 + :jump-in-air-anim 13 + :jump-land-anim 13 + :neck-joint -1 + :look-at-joint 12 + :bullseye-joint 4 + :sound-hit (static-sound-name "gator-hit") + :sound-die (static-sound-name "gator-die") + :notice-distance (meters 80) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 40) + :default-hit-points 1 + :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.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) + :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 + :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) + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 13 + :turn-anim -1 + :run-anim 14 + :taunt-anim -1 + :run-travel-speed (meters 16) + :run-acceleration (meters 8) + :run-turning-acceleration (meters 40) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 8) + :walk-turning-acceleration (meters 10) + :maximum-rotation-rate (degrees 200.00002) + :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! (-> *gator-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) diff --git a/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc index 248b2080f7..71cd9cfc0d 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc @@ -1644,7 +1644,12 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 4 #x1e0002 #x3010501 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x5 :param0 #x1 :param1 #x3) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 5 :notice-anim 13 :hostile-anim -1 diff --git a/test/decompiler/reference/jak2/levels/strip/strip-drop_REF.gc b/test/decompiler/reference/jak2/levels/strip/strip-drop_REF.gc index a92038e0e2..7a18e235eb 100644 --- a/test/decompiler/reference/jak2/levels/strip/strip-drop_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/strip-drop_REF.gc @@ -825,7 +825,7 @@ ) (let ((a1-8 (grunt-egg-method-23 obj))) (if a1-8 - (idle-control-method-9 (-> obj idle-anim-player) (the-as (pointer uint32) a1-8)) + (idle-control-method-9 (-> obj idle-anim-player) (the-as (pointer idle-control-frame) a1-8)) ) ) (if (>= (res-lump-value arg0 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) diff --git a/test/decompiler/reference/jak2/levels/temple/rhino_REF.gc b/test/decompiler/reference/jak2/levels/temple/rhino_REF.gc index eb2d1a225f..b9f20e4db4 100644 --- a/test/decompiler/reference/jak2/levels/temple/rhino_REF.gc +++ b/test/decompiler/reference/jak2/levels/temple/rhino_REF.gc @@ -407,7 +407,16 @@ :jump-debug-draw #f :move-to-ground #t :hover-if-no-ground #f - :idle-anim-script (new 'static 'array uint32 8 #x1e0002 #x4010301 #x1e0002 #x4010401 #x0 #x0 #x0 #x0) + :idle-anim-script (new 'static 'array idle-control-frame 8 + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x3 :param0 #x1 :param1 #x4) + (new 'static 'idle-control-frame :command #x2 :param0 #x1e) + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x4) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) :idle-anim 3 :notice-anim 7 :hostile-anim 10 diff --git a/test/offline/config/jak2/config.jsonc b/test/offline/config/jak2/config.jsonc index 6ec9c2d40d..e76c8a3765 100644 --- a/test/offline/config/jak2/config.jsonc +++ b/test/offline/config/jak2/config.jsonc @@ -62,6 +62,10 @@ "DGO/STR.DGO", "DGO/THR.DGO", "DGO/TOA.DGO", + "DGO/TOB.DGO", + "DGO/TOC.DGO", + "DGO/TOD.DGO", + "DGO/TOE.DGO", "DGO/UNB.DGO", "DGO/VIN.DGO" ], @@ -274,7 +278,8 @@ "(method 60 fort-turret)", // they defined the same method twice in the same file, identical impl, just returns #f "(method 23 dig-tether)", // working around annoying decomp array output "(method 16 sew-light-control)", // skipped for now, looking for a caller - "(method 3 rhino)" + "(method 3 rhino)", + "(method 193 grunt-mech)" // .mula.s ], "skip_compile_states": { @@ -283,6 +288,9 @@ "(target-gun-stance target)": ["code"], "(hostile hopper)": ["trans"], // adds b! but the corresponding label is missing "(broken rhino-wall)": ["code"], // missing cast to art-joint-anim - "(hit rhino-wall)": ["code"] // missing cast to art-joint-anim + "(hit rhino-wall)": ["code"], // missing cast to art-joint-anim + "(fall ruins-bridge)": ["code"], // missing cast to art-joint-anim + "(fall ruins-drop-plat)": ["code"], // missing cast to art-joint-anim + "(fall ruins-pillar-collapse)": ["code"] // missing cast to art-joint-anim } }