diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index c09dd2c2fe..ff9341ffa7 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -29310,7 +29310,7 @@ (define-extern target-flut-stance (state target)) ;; unknown type (define-extern target-flut-grab (state target)) ;; unknown type (define-extern target-flut-clone-anim (state handle target)) ;; unknown type -(define-extern target-flut-get-off-hit-ground (state target)) ;; unknown type +(define-extern target-flut-get-off-hit-ground (state symbol target)) ;; unknown type (define-extern target-flut-get-off-jump (state handle target)) ;; unknown type (define-extern target-flut-death (state symbol target)) ;; unknown type (define-extern target-flut-hit-ground (state target)) ;; unknown type @@ -29320,7 +29320,7 @@ (define-extern *FLUT-bank* flut-bank) ;; unknown type (define-extern target-flut-falling (state target)) ;; unknown type (define-extern *flut-run-attack-mods* surface) ;; unknown type -(define-extern target-flut-hit (state target)) ;; unknown type +(define-extern target-flut-hit (state symbol attack-info target)) ;; unknown type (define-extern *flut-jump-mods* surface) ;; unknown type (define-extern target-flut-walk (state target)) ;; unknown type (define-extern *flut-walk-mods* surface) ;; unknown type diff --git a/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc b/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc index 73f59c40ea..f7599f1b82 100644 --- a/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc @@ -4739,7 +4739,7 @@ "target-flut-standard-event-handler": [ [16, "vector"], - [32, "matrix"] + [32, "event-message-block"] ], "(code target-flut-start)": [ diff --git a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc index 6c9e1a461a..420d76f6ad 100644 --- a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc @@ -6127,6 +6127,7 @@ ], "(code target-flut-running-attack)": [ + [53, "v1", "float"], [181, "f30", "float"], [246, "f1", "float"], [247, "f0", "float"], @@ -6190,13 +6191,10 @@ "(code target-death)": [ [533, "v1", "art-joint-anim"], [655, "v0", "int"], - [691, "v1", "nav-enemy"], + [691, "v1", "process-drawable"], [844, "gp", "spool-anim"], - [968, "s5", "handle"], - [991, "s5", "handle"], - [1010, "gp", "spool-anim"], - [1028, "s5", "handle"], - [1031, "s5", "handle"] + [[957, 1035], "s5", "handle"], + [1010, "gp", "spool-anim"] ], "(anon-function 1 target-death)": [ @@ -7040,5 +7038,9 @@ [37, "v0", "sunkencam"] ], + "(code target-flut-jump)": [ + [137, "v1", "float"] + ], + "placeholder-do-not-add-below": [] } diff --git a/decompiler/config/jak1_ntsc_black_label/var_names.jsonc b/decompiler/config/jak1_ntsc_black_label/var_names.jsonc index dc7ef66c39..daca80a424 100644 --- a/decompiler/config/jak1_ntsc_black_label/var_names.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/var_names.jsonc @@ -3748,5 +3748,11 @@ } }, + "(code target-death)": { + "vars": { + "s5-8": ["s5-8", "handle"] + } + }, + "aaaaaaaaaaaaaaaaaaaaaaa": {} } diff --git a/goal_src/engine/camera/pov-camera-h.gc b/goal_src/engine/camera/pov-camera-h.gc index 5e4a2dfe0d..7487dd23de 100644 --- a/goal_src/engine/camera/pov-camera-h.gc +++ b/goal_src/engine/camera/pov-camera-h.gc @@ -5,6 +5,10 @@ ;; name in dgo: pov-camera-h ;; dgos: GAME, ENGINE +;; for target-death +(declare-type pov-camera process-drawable) +(define-extern pov-camera-init-by-other (function vector skeleton-group string int process-drawable pair none :behavior pov-camera)) ;; TODO - not confirmed -- sunken-elevator + ;; DECOMP BEGINS (deftype pov-camera (process-drawable) diff --git a/goal_src/engine/game/powerups.gc b/goal_src/engine/game/powerups.gc index 82c533d1b1..1a975964d4 100644 --- a/goal_src/engine/game/powerups.gc +++ b/goal_src/engine/game/powerups.gc @@ -7,714 +7,617 @@ ;; DECOMP BEGINS -(defbehavior - cloud-track process - ((arg0 process-tree) - (arg1 process-tree) - (arg2 (function vector none)) - (arg3 int) - (arg4 int) - (arg5 int) - ) +(defbehavior cloud-track process ((arg0 process-tree) (arg1 process-tree) (arg2 (function vector none)) (arg3 int) (arg4 int) (arg5 int)) (change-parent self arg0) (let ((s1-1 (process->handle arg0)) (s2-1 (process->handle arg1)) ) - (let ((s0-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s0-0) (+ arg3 arg4)) - (let - ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) - (if v1-8 - (deactivate self) - ) + (let ((s0-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) s0-0) (+ arg3 arg4)) + (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) + (if v1-8 + (deactivate self) + ) + ) + (let* ((f0-1 + (fmax + 0.0 + (fmin 1.0 (/ (- (the float (- (-> *display* base-frame-counter) s0-0)) (the float arg3)) (the float arg4))) + ) + ) + (a0-18 (process-drawable-pair-random-point! + (the-as process-drawable (-> s1-1 process 0)) + (the-as process-drawable (-> s2-1 process 0)) + (new-stack-vector0) + f0-1 + ) + ) + ) + (arg2 a0-18) + ) + (suspend) + ) ) - (let* - ((f0-1 - (fmax - 0.0 - (fmin - 1.0 - (/ - (- - (the float (- (-> *display* base-frame-counter) s0-0)) - (the float arg3) + (cond + ((zero? arg5) + (while #t + (suspend) + ) + ) + (else + (let ((s4-1 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) s4-1) arg5) + (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) + (arg2 a0-21) + ) + (suspend) ) - (the float arg4) - ) ) - ) ) - (a0-18 - (process-drawable-pair-random-point! - (the-as process-drawable (-> s1-1 process 0)) - (the-as process-drawable (-> s2-1 process 0)) - (new-stack-vector0) - f0-1 - ) - ) - ) - (arg2 a0-18) ) - (suspend) - ) ) - (cond - ((zero? arg5) - (while #t - (suspend) - ) - ) - (else - (let ((s4-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s4-1) arg5) - (let - ((a0-21 - (process-drawable-random-point! - (the-as process-drawable (-> s2-1 process 0)) - (new-stack-vector0) - ) - ) - ) - (arg2 a0-21) - ) - (suspend) - ) - ) - ) - ) - ) (none) ) -(set! - (-> *part-id-table* 255) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) - (sp-rnd-flt spt-num 1.0 1.0 1.0) - (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) - (sp-copy-from-other spt-scale-y -4) - (sp-flt spt-r 64.0) - (sp-flt spt-g 64.0) - (sp-flt spt-b 192.0) - (sp-flt spt-a 64.0) - (sp-flt spt-fade-a -1.0666667) - (sp-int spt-timer 60) - (sp-cpuinfo-flags bit2 bit3) - (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) - (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-flt spt-conerot-radius (meters 0.5)) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 255) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 192.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -1.0666667) + (sp-int spt-timer 60) + (sp-cpuinfo-flags bit2 bit3) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.5)) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 256) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) - (sp-rnd-flt spt-num 1.0 1.0 1.0) - (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) - (sp-copy-from-other spt-scale-y -4) - (sp-flt spt-r 64.0) - (sp-flt spt-g 64.0) - (sp-flt spt-b 192.0) - (sp-flt spt-a 64.0) - (sp-flt spt-fade-a -1.0666667) - (sp-int spt-timer 60) - (sp-cpuinfo-flags bit2 bit3) - (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) - (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-flt spt-conerot-radius (meters 0.5)) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 256) + (new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :page #x2)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 192.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -1.0666667) + (sp-int spt-timer 60) + (sp-cpuinfo-flags bit2 bit3) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.5)) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 257) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 16 - (sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) - (sp-rnd-flt spt-num 1.0 3.0 1.0) - (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) - (sp-int spt-rot-x 4) - (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) - (sp-flt spt-r 64.0) - (sp-flt spt-g 64.0) - (sp-flt spt-b 128.0) - (sp-flt spt-a 128.0) - (sp-flt spt-fade-a -1.6) - (sp-int spt-timer 90) - (sp-cpuinfo-flags bit2 bit3) - (sp-int spt-next-time 10) - (sp-launcher-by-id spt-next-launcher 258) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 257) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 16 + (sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + (sp-rnd-flt spt-num 1.0 3.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 90) + (sp-cpuinfo-flags bit2 bit3) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 258) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 259) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 16 - (sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) - (sp-rnd-flt spt-num 0.0 3.0 1.0) - (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) - (sp-int spt-rot-x 4) - (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) - (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) - (sp-flt spt-r 128.0) - (sp-flt spt-g 128.0) - (sp-flt spt-b 255.0) - (sp-flt spt-a 128.0) - (sp-flt spt-fade-a -1.6) - (sp-int spt-timer 91) - (sp-cpuinfo-flags bit2 bit3) - (sp-int spt-next-time 10) - (sp-launcher-by-id spt-next-launcher 258) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 259) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 16 + (sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + (sp-rnd-flt spt-num 0.0 3.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 91) + (sp-cpuinfo-flags bit2 bit3) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 258) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 258) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 6 - (sp-flt spt-r 64.0) - (sp-flt spt-g 64.0) - (sp-flt spt-fade-r -1.0) - (sp-flt spt-fade-g -0.4) - (sp-flt spt-fade-a -2.0) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 258) + (new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 6 + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-fade-r -1.0) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -2.0) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 260) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) - (sp-flt spt-num 1.0) - (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.15) 1.0) - (sp-copy-from-other spt-scale-y -4) - (sp-flt spt-r 32.0) - (sp-rnd-flt spt-g 32.0 64.0 1.0) - (sp-rnd-flt spt-b 192.0 64.0 1.0) - (sp-rnd-flt spt-a 64.0 128.0 1.0) - (sp-flt spt-scalevel-x (meters -0.00033333333)) - (sp-copy-from-other spt-scalevel-y -4) - (sp-flt spt-fade-a -0.2) - (sp-flt spt-accel-y -0.06826667) - (sp-int spt-timer 450) - (sp-cpuinfo-flags bit0 bit2 bit3) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 260) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.15) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 32.0) + (sp-rnd-flt spt-g 32.0 64.0 1.0) + (sp-rnd-flt spt-b 192.0 64.0 1.0) + (sp-rnd-flt spt-a 64.0 128.0 1.0) + (sp-flt spt-scalevel-x (meters -0.00033333333)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.2) + (sp-flt spt-accel-y -0.06826667) + (sp-int spt-timer 450) + (sp-cpuinfo-flags bit0 bit2 bit3) + (sp-end) + ) + ) + ) -(set! - (-> *part-group-id-table* 70) - (new 'static 'sparticle-launch-group - :length 5 - :duration #x5 - :linger-duration #x1c2 - :name "group-blue-hit-ground-effect" - :launcher - (new 'static 'inline-array sparticle-group-item 5 - (sp-item 261) - (sp-item 262) - (sp-item 263 :flags (is-3d)) - (sp-item 264) - (sp-item 265 :flags (is-3d)) - ) - :bounds (new 'static 'sphere :w 8192.0) - ) - ) +(set! (-> *part-group-id-table* 70) (new 'static 'sparticle-launch-group + :length 5 + :duration #x5 + :linger-duration #x1c2 + :name "group-blue-hit-ground-effect" + :launcher + (new 'static 'inline-array sparticle-group-item 5 + (sp-item 261) + (sp-item 262) + (sp-item 263 :flags (is-3d)) + (sp-item 264) + (sp-item 265 :flags (is-3d)) + ) + :bounds (new 'static 'sphere :w 8192.0) + ) + ) -(set! - (-> *part-id-table* 264) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 20 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) - (sp-flt spt-num 32.0) - (sp-flt spt-y (meters 0.5)) - (sp-rnd-flt spt-scale-x (meters 1.0) (meters 3.0) 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 0.0) - (sp-rnd-flt spt-g 32.0 32.0 1.0) - (sp-rnd-flt spt-b 192.0 63.0 1.0) - (sp-rnd-int spt-a 0 63 1.0) - (sp-flt spt-vel-y (meters 0.093333334)) - (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) - (sp-int spt-timer 150) - (sp-cpuinfo-flags bit3) - (sp-int-plain-rnd spt-next-time 20 19 1) - (sp-launcher-by-id spt-next-launcher 266) - (sp-flt spt-conerot-x (degrees 90.0)) - (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-flt spt-conerot-radius (meters 0.0)) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 264) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 20 + (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + (sp-flt spt-num 32.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-scale-x (meters 1.0) (meters 3.0) 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 0.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 192.0 63.0 1.0) + (sp-rnd-int spt-a 0 63 1.0) + (sp-flt spt-vel-y (meters 0.093333334)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-int spt-timer 150) + (sp-cpuinfo-flags bit3) + (sp-int-plain-rnd spt-next-time 20 19 1) + (sp-launcher-by-id spt-next-launcher 266) + (sp-flt spt-conerot-x (degrees 90.0)) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.0)) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 266) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 7 - (sp-flt spt-r 0.0) - (sp-rnd-flt spt-g 32.0 32.0 1.0) - (sp-rnd-flt spt-b 192.0 63.0 1.0) - (sp-rnd-int spt-a 0 63 1.0) - (sp-int-plain-rnd spt-next-time 20 19 1) - (sp-launcher-by-id spt-next-launcher 266) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 266) + (new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 7 + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 192.0 63.0 1.0) + (sp-rnd-int spt-a 0 63 1.0) + (sp-int-plain-rnd spt-next-time 20 19 1) + (sp-launcher-by-id spt-next-launcher 266) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 265) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 16 - (sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) - (sp-flt spt-num 1.0) - (sp-flt spt-y (meters 0.5)) - (sp-flt spt-scale-x (meters 0.0)) - (sp-copy-from-other spt-scale-y -4) - (sp-flt spt-r 0.0) - (sp-rnd-flt spt-g 32.0 32.0 1.0) - (sp-rnd-flt spt-b 192.0 63.0 1.0) - (sp-rnd-flt spt-a 96.0 32.0 1.0) - (sp-flt spt-scalevel-x (meters 0.21333334)) - (sp-copy-from-other spt-scalevel-y -4) - (sp-int spt-timer 120) - (sp-cpuinfo-flags bit2 bit3 left-multiply-quat) - (sp-int spt-next-time 60) - (sp-launcher-by-id spt-next-launcher 267) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 265) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 16 + (sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-flt spt-scale-x (meters 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 192.0 63.0 1.0) + (sp-rnd-flt spt-a 96.0 32.0 1.0) + (sp-flt spt-scalevel-x (meters 0.21333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-timer 120) + (sp-cpuinfo-flags bit2 bit3 left-multiply-quat) + (sp-int spt-next-time 60) + (sp-launcher-by-id spt-next-launcher 267) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 267) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 2 - (sp-flt spt-fade-a -2.1333334) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 267) + (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 2 (sp-flt spt-fade-a -2.1333334) (sp-end)) + ) + ) -(set! - (-> *part-id-table* 263) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 17 - (sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) - (sp-flt spt-num 1.0) - (sp-flt spt-y (meters 0.5)) - (sp-flt spt-scale-x (meters 0.0)) - (sp-copy-from-other spt-scale-y -4) - (sp-flt spt-r 0.0) - (sp-rnd-flt spt-g 32.0 32.0 1.0) - (sp-rnd-flt spt-b 192.0 63.0 1.0) - (sp-rnd-flt spt-a 32.0 32.0 1.0) - (sp-flt spt-scalevel-x (meters 0.22666667)) - (sp-copy-from-other spt-scalevel-y -4) - (sp-flt spt-fade-a -0.7111111) - (sp-int spt-timer 90) - (sp-cpuinfo-flags bit2 bit3 left-multiply-quat) - (sp-int spt-next-time 45) - (sp-launcher-by-id spt-next-launcher 268) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 263) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 17 + (sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-flt spt-scale-x (meters 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 192.0 63.0 1.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-flt spt-scalevel-x (meters 0.22666667)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.7111111) + (sp-int spt-timer 90) + (sp-cpuinfo-flags bit2 bit3 left-multiply-quat) + (sp-int spt-next-time 45) + (sp-launcher-by-id spt-next-launcher 268) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 268) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 2 - (sp-flt spt-fade-a -1.4222223) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 268) + (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 2 (sp-flt spt-fade-a -1.4222223) (sp-end)) + ) + ) -(set! - (-> *part-id-table* 261) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 21 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) - (sp-flt spt-num 32.0) - (sp-rnd-flt spt-scale-x (meters 1.0) (meters 1.0) 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 0.0) - (sp-rnd-flt spt-g 32.0 32.0 1.0) - (sp-rnd-flt spt-b 192.0 63.0 1.0) - (sp-rnd-flt spt-a 16.0 32.0 1.0) - (sp-rnd-flt spt-vel-y (meters 0.053333335) (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 bit2 bit12) - (sp-rnd-flt spt-conerot-x (degrees 60.0) (degrees 30.0) 1.0) - (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 261) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 21 + (sp-tex spt-texture (new 'static 'texture-id :page #x2)) + (sp-flt spt-num 32.0) + (sp-rnd-flt spt-scale-x (meters 1.0) (meters 1.0) 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 0.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 192.0 63.0 1.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.053333335) (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 bit2 bit12) + (sp-rnd-flt spt-conerot-x (degrees 60.0) (degrees 30.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 262) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 21 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) - (sp-flt spt-num 12.0) - (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 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 0.0) - (sp-rnd-flt spt-g 32.0 32.0 1.0) - (sp-rnd-flt spt-b 192.0 63.0 1.0) - (sp-rnd-flt spt-a 16.0 16.0 1.0) - (sp-rnd-flt spt-vel-y (meters 0.10666667) (meters 0.053333335) 1.0) - (sp-flt spt-scalevel-x (meters 0.0016666667)) - (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) - (sp-copy-from-other spt-scalevel-y -4) - (sp-flt spt-fade-a -0.21333334) - (sp-flt spt-accel-y -1.3653333) - (sp-flt spt-friction 0.95) - (sp-int spt-timer 150) - (sp-cpuinfo-flags bit2 bit12) - (sp-rnd-flt spt-conerot-x (degrees 60.0) (degrees 30.0) 1.0) - (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 262) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 21 + (sp-tex spt-texture (new 'static 'texture-id :page #x2)) + (sp-flt spt-num 12.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 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 0.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 192.0 63.0 1.0) + (sp-rnd-flt spt-a 16.0 16.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.10666667) (meters 0.053333335) 1.0) + (sp-flt spt-scalevel-x (meters 0.0016666667)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.21333334) + (sp-flt spt-accel-y -1.3653333) + (sp-flt spt-friction 0.95) + (sp-int spt-timer 150) + (sp-cpuinfo-flags bit2 bit12) + (sp-rnd-flt spt-conerot-x (degrees 60.0) (degrees 30.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 269) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) - (sp-rnd-flt spt-num 1.0 1.0 1.0) - (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) - (sp-copy-from-other spt-scale-y -4) - (sp-rnd-flt spt-r 92.0 32.0 1.0) - (sp-rnd-flt spt-g 32.0 92.0 1.0) - (sp-flt spt-b 0.0) - (sp-flt spt-a 64.0) - (sp-flt spt-fade-a -1.0) - (sp-int spt-timer 60) - (sp-cpuinfo-flags bit2 bit3) - (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) - (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-flt spt-conerot-radius (meters 0.5)) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 269) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 92.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 92.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -1.0) + (sp-int spt-timer 60) + (sp-cpuinfo-flags bit2 bit3) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.5)) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 270) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) - (sp-rnd-flt spt-num 1.0 1.0 1.0) - (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) - (sp-copy-from-other spt-scale-y -4) - (sp-rnd-flt spt-r 92.0 32.0 1.0) - (sp-rnd-flt spt-g 32.0 92.0 1.0) - (sp-flt spt-b 0.0) - (sp-flt spt-a 64.0) - (sp-flt spt-fade-a -1.0) - (sp-int spt-timer 60) - (sp-cpuinfo-flags bit2 bit3) - (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) - (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-flt spt-conerot-radius (meters 0.5)) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 270) + (new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :page #x2)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 92.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 92.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -1.0) + (sp-int spt-timer 60) + (sp-cpuinfo-flags bit2 bit3) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.5)) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 271) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 24 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) - (sp-rnd-flt spt-num 0.5 2.0 1.0) - (sp-flt spt-y (meters -0.05)) - (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) - (sp-copy-from-other spt-scale-y -4) - (sp-rnd-flt spt-r 100.0 28.0 1.0) - (sp-rnd-flt spt-g 64.0 64.0 1.0) - (sp-flt spt-b 0.0) - (sp-rnd-flt spt-a 64.0 64.0 1.0) - (sp-rnd-flt spt-vel-y (meters 0.0023333333) (meters 0.0016666667) 1.0) - (sp-flt spt-scalevel-x (meters -0.00083333335)) - (sp-copy-from-other spt-scalevel-y -4) - (sp-flt spt-fade-g -0.4) - (sp-flt spt-fade-a -0.024242423) - (sp-rnd-flt spt-accel-y -0.40960002 -1.2288 1.0) - (sp-flt spt-friction 0.93) - (sp-int-plain-rnd spt-timer 30 209 1) - (sp-cpuinfo-flags bit2 bit3) - (sp-int spt-next-time 90) - (sp-launcher-by-id spt-next-launcher 272) - (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) - (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-flt spt-conerot-radius (meters 0.05)) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 271) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 24 + (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + (sp-rnd-flt spt-num 0.5 2.0 1.0) + (sp-flt spt-y (meters -0.05)) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 100.0 28.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.0023333333) (meters 0.0016666667) 1.0) + (sp-flt spt-scalevel-x (meters -0.00083333335)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -0.024242423) + (sp-rnd-flt spt-accel-y -0.40960002 -1.2288 1.0) + (sp-flt spt-friction 0.93) + (sp-int-plain-rnd spt-timer 30 209 1) + (sp-cpuinfo-flags bit2 bit3) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 272) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.05)) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 272) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 2 - (sp-flt spt-fade-r 0.0) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 272) + (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 2 (sp-flt spt-fade-r 0.0) (sp-end)) + ) + ) -(set! - (-> *part-id-table* 273) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) - (sp-rnd-flt spt-num 1.0 1.0 1.0) - (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) - (sp-copy-from-other spt-scale-y -4) - (sp-rnd-flt spt-r 92.0 32.0 1.0) - (sp-flt spt-g 0.0) - (sp-flt spt-b 0.0) - (sp-flt spt-a 64.0) - (sp-flt spt-fade-a -1.0) - (sp-int spt-timer 60) - (sp-cpuinfo-flags bit2 bit3) - (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) - (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-flt spt-conerot-radius (meters 0.5)) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 273) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 92.0 32.0 1.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -1.0) + (sp-int spt-timer 60) + (sp-cpuinfo-flags bit2 bit3) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.5)) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 274) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) - (sp-rnd-flt spt-num 1.0 1.0 1.0) - (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) - (sp-copy-from-other spt-scale-y -4) - (sp-rnd-flt spt-r 92.0 32.0 1.0) - (sp-flt spt-g 0.0) - (sp-flt spt-b 0.0) - (sp-flt spt-a 64.0) - (sp-flt spt-fade-a -1.0) - (sp-int spt-timer 60) - (sp-cpuinfo-flags bit2 bit3) - (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) - (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-flt spt-conerot-radius (meters 0.5)) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 274) + (new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :page #x2)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 92.0 32.0 1.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -1.0) + (sp-int spt-timer 60) + (sp-cpuinfo-flags bit2 bit3) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.5)) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 275) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 24 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) - (sp-rnd-flt spt-num 0.5 2.0 1.0) - (sp-flt spt-y (meters -0.05)) - (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) - (sp-copy-from-other spt-scale-y -4) - (sp-rnd-flt spt-r 100.0 28.0 1.0) - (sp-flt spt-g 0.0) - (sp-flt spt-b 0.0) - (sp-rnd-flt spt-a 64.0 64.0 1.0) - (sp-rnd-flt spt-vel-y (meters 0.0023333333) (meters 0.0016666667) 1.0) - (sp-flt spt-scalevel-x (meters -0.00083333335)) - (sp-copy-from-other spt-scalevel-y -4) - (sp-flt spt-fade-g -0.4) - (sp-flt spt-fade-a -0.024242423) - (sp-rnd-flt spt-accel-y -0.40960002 -1.2288 1.0) - (sp-flt spt-friction 0.93) - (sp-int-plain-rnd spt-timer 30 209 1) - (sp-cpuinfo-flags bit2 bit3) - (sp-int spt-next-time 90) - (sp-launcher-by-id spt-next-launcher 276) - (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) - (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-flt spt-conerot-radius (meters 0.05)) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 275) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 24 + (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + (sp-rnd-flt spt-num 0.5 2.0 1.0) + (sp-flt spt-y (meters -0.05)) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 100.0 28.0 1.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.0023333333) (meters 0.0016666667) 1.0) + (sp-flt spt-scalevel-x (meters -0.00083333335)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -0.024242423) + (sp-rnd-flt spt-accel-y -0.40960002 -1.2288 1.0) + (sp-flt spt-friction 0.93) + (sp-int-plain-rnd spt-timer 30 209 1) + (sp-cpuinfo-flags bit2 bit3) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 276) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.05)) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 276) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 2 - (sp-flt spt-fade-r 0.0) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 276) + (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 2 (sp-flt spt-fade-r 0.0) (sp-end)) + ) + ) -(set! - (-> *part-id-table* 277) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) - (sp-rnd-flt spt-num 1.0 1.0 1.0) - (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) - (sp-copy-from-other spt-scale-y -4) - (sp-flt spt-r 0.0) - (sp-rnd-flt spt-g 92.0 32.0 1.0) - (sp-flt spt-b 0.0) - (sp-flt spt-a 64.0) - (sp-flt spt-fade-a -1.0) - (sp-int spt-timer 60) - (sp-cpuinfo-flags bit2 bit3) - (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) - (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-flt spt-conerot-radius (meters 0.5)) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 277) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 92.0 32.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -1.0) + (sp-int spt-timer 60) + (sp-cpuinfo-flags bit2 bit3) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.5)) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 278) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 15 - (sp-tex spt-texture (new 'static 'texture-id :page #x2)) - (sp-rnd-flt spt-num 1.0 1.0 1.0) - (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) - (sp-copy-from-other spt-scale-y -4) - (sp-flt spt-r 0.0) - (sp-rnd-flt spt-g 92.0 32.0 1.0) - (sp-flt spt-b 0.0) - (sp-flt spt-a 64.0) - (sp-flt spt-fade-a -1.0) - (sp-int spt-timer 60) - (sp-cpuinfo-flags bit2 bit3) - (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) - (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-flt spt-conerot-radius (meters 0.5)) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 278) + (new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :page #x2)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 92.0 32.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -1.0) + (sp-int spt-timer 60) + (sp-cpuinfo-flags bit2 bit3) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.5)) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 279) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 24 - (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) - (sp-rnd-flt spt-num 0.5 2.0 1.0) - (sp-flt spt-y (meters -0.05)) - (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) - (sp-copy-from-other spt-scale-y -4) - (sp-flt spt-r 0.0) - (sp-rnd-flt spt-g 100.0 28.0 1.0) - (sp-flt spt-b 0.0) - (sp-rnd-flt spt-a 64.0 64.0 1.0) - (sp-rnd-flt spt-vel-y (meters 0.0023333333) (meters 0.0016666667) 1.0) - (sp-flt spt-scalevel-x (meters -0.00083333335)) - (sp-copy-from-other spt-scalevel-y -4) - (sp-flt spt-fade-g -0.4) - (sp-flt spt-fade-a -0.024242423) - (sp-rnd-flt spt-accel-y -0.40960002 -1.2288 1.0) - (sp-flt spt-friction 0.93) - (sp-int-plain-rnd spt-timer 30 209 1) - (sp-cpuinfo-flags bit2 bit3) - (sp-int spt-next-time 90) - (sp-launcher-by-id spt-next-launcher 280) - (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) - (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) - (sp-flt spt-conerot-radius (meters 0.05)) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 279) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 24 + (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + (sp-rnd-flt spt-num 0.5 2.0 1.0) + (sp-flt spt-y (meters -0.05)) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 100.0 28.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.0023333333) (meters 0.0016666667) 1.0) + (sp-flt spt-scalevel-x (meters -0.00083333335)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -0.024242423) + (sp-rnd-flt spt-accel-y -0.40960002 -1.2288 1.0) + (sp-flt spt-friction 0.93) + (sp-int-plain-rnd spt-timer 30 209 1) + (sp-cpuinfo-flags bit2 bit3) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 280) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.05)) + (sp-end) + ) + ) + ) -(set! - (-> *part-id-table* 280) - (new 'static 'sparticle-launcher - :init-specs - (new 'static 'inline-array sp-field-init-spec 2 - (sp-flt spt-fade-g 0.0) - (sp-end) - ) - ) - ) +(set! (-> *part-id-table* 280) + (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 2 (sp-flt spt-fade-g 0.0) (sp-end)) + ) + ) (defun eco-blue-glow ((arg0 vector)) (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 255) - arg0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (if (rand-vu-percent? 0.5) - (sp-launch-particles-var *sp-particle-system-2d* - (-> *part-id-table* 257) + (-> *part-id-table* 255) arg0 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0 ) - ) + (if (rand-vu-percent? 0.5) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 257) + arg0 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) 0 (none) ) @@ -722,400 +625,316 @@ (defbehavior target-powerup-process target () (dummy-10 (-> self water)) (when (not *weather-off*) - (case (-> self current-level name) - (('swamp) - (update-rain self) + (case (-> self current-level name) + (('swamp) + (update-rain self) + ) + (('snow) + (update-snow self) + ) ) - (('snow) - (update-snow self) - ) ) - ) (cond - ((and - (= (-> self control ground-pat material) (pat-material ice)) - (and - (>= (-> self control unknown-float01) 204.8) - (< - (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) - 15 - ) - ) - ) - (let - ((gp-0 - (vector<-cspace! - (new 'stack-no-clear 'vector) - (-> self node-list data 74) - ) - ) - ) - (if - (and - (< - (fabs - (vector-dot - (-> self control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) gp-0 (-> self control trans)) - ) + ((and + (= (-> self control ground-pat material) (pat-material ice)) + (and + (>= (-> self control unknown-float01) 204.8) + (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 15) ) - 819.2 - ) - (rand-vu-percent? 0.5) ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2391) - gp-0 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - ) - ) - (let - ((gp-1 - (vector<-cspace! - (new 'stack-no-clear 'vector) - (-> self node-list data 70) - ) - ) - ) - (if - (and - (< - (fabs - (vector-dot - (-> self control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) gp-1 (-> self control trans)) - ) - ) - 819.2 - ) - (rand-vu-percent? 0.5) - ) - (sp-launch-particles-var - *sp-particle-system-3d* - (-> *part-id-table* 2391) - gp-1 - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - ) - ) - (let - ((f0-8 - (lerp-scale 60.0 90.0 (-> self control unknown-float01) 0.0 81920.0) - ) - ) - (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) + (let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 74)))) + (if (and + (< (fabs + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) gp-0 (-> self control trans)) + ) + ) + 819.2 ) - (-> self draw art-group data 104) + (rand-vu-percent? 0.5) ) - ) - (set! f0-8 (* 0.75 f0-8)) - ) - (set! - (-> self control unknown-float130) - (seek - (-> self control unknown-float130) - f0-8 - (* 100.0 (-> *display* seconds-per-frame)) - ) - ) - ) - (let ((f30-0 (-> self control unknown-float130)) - (f0-13 - (lerp-scale -0.3 0.3 (-> self control unknown-float01) 0.0 81920.0) + (sp-launch-particles-var + *sp-particle-system-3d* + (-> *part-id-table* 2391) + gp-0 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) ) - ) - (sound-play-by-name - (static-sound-name "ice-loop") - (-> self control unknown-soundid00) - (the int (* 10.24 f30-0)) - (the int (* 1524.0 f0-13)) - 0 - 1 - (the-as symbol (-> self control trans)) - ) + ) + (let ((gp-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 70)))) + (if (and + (< (fabs + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) gp-1 (-> self control trans)) + ) + ) + 819.2 + ) + (rand-vu-percent? 0.5) + ) + (sp-launch-particles-var + *sp-particle-system-3d* + (-> *part-id-table* 2391) + gp-1 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + ) + (let ((f0-8 (lerp-scale 60.0 90.0 (-> self control unknown-float01) 0.0 81920.0))) + (if (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 104) + ) + ) + (set! f0-8 (* 0.75 f0-8)) + ) + (set! (-> self control unknown-float141) + (seek (-> self control unknown-float141) f0-8 (* 100.0 (-> *display* seconds-per-frame))) + ) + ) + (let ((f30-0 (-> self control unknown-float141)) + (f0-13 (lerp-scale -0.3 0.3 (-> self control unknown-float01) 0.0 81920.0)) + ) + (sound-play-by-name + (static-sound-name "ice-loop") + (-> self control unknown-soundid00) + (the int (* 10.24 f30-0)) + (the int (* 1524.0 f0-13)) + 0 + 1 + (the-as symbol (-> self control trans)) + ) + ) + ) + ((< 0.0 (-> self control unknown-float141)) + (set! (-> self control unknown-float141) 0.0) + (let ((v1-64 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-64 command) (sound-command set-param)) + (set! (-> v1-64 id) (-> self control unknown-soundid00)) + (set! (-> v1-64 parms volume) -4) + (set! (-> v1-64 auto-time) 48) + (set! (-> v1-64 auto-from) 2) + (set! (-> v1-64 parms mask) (the-as uint 17)) + (-> v1-64 id) + ) ) ) - ((< 0.0 (-> self control unknown-float130)) - (set! (-> self control unknown-float130) 0.0) - (let ((v1-64 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) - (set! (-> v1-64 command) (sound-command set-param)) - (set! (-> v1-64 id) (-> self control unknown-soundid00)) - (set! (-> v1-64 parms volume) -4) - (set! (-> v1-64 auto-time) 48) - (set! (-> v1-64 auto-from) 2) - (set! (-> v1-64 parms mask) (the-as uint 17)) - (-> v1-64 id) - ) - ) - ) (let ((v1-67 (-> *time-of-day-context* current-shadow)) (a0-33 (-> self draw shadow-ctrl)) ) - (set! (-> a0-33 settings shadow-dir x) (-> v1-67 x)) - (set! (-> a0-33 settings shadow-dir y) (-> v1-67 y)) - (set! (-> a0-33 settings shadow-dir z) (-> v1-67 z)) - ) - (when - (and - (!= (-> self fact-info-target eco-level) 0.0) - (>= - (- - (-> *display* game-frame-counter) - (the-as int (-> self fact-info-target eco-pickup-time)) - ) - (the-as int (-> self fact-info-target eco-timeout)) - ) + (set! (-> a0-33 settings shadow-dir x) (-> v1-67 x)) + (set! (-> a0-33 settings shadow-dir y) (-> v1-67 y)) + (set! (-> a0-33 settings shadow-dir z) (-> v1-67 z)) ) - (set! (-> self fact-info-target eco-level) 0.0) - (set! (-> self fact-info-target eco-timeout) 0) - (set! (-> self state-flags) (logand -65 (-> self state-flags))) - (send-event self 'reset-collide) - (stop! (-> self sound)) - ) - (when - (and - (< 0.0 (-> self fact-info-target eco-level)) - (zero? (logand (-> self state-flags) 512)) - (zero? (logand (-> self draw status) 6)) - (not (movie?)) - (rand-vu-percent? - (lerp-scale - 0.0 - 1.0 - (the - float - (- - (-> self fact-info-target eco-timeout) - (the-as - uint - (- - (-> *display* game-frame-counter) - (the-as int (-> self fact-info-target eco-pickup-time)) + (when (and + (!= (-> self fact-info-target eco-level) 0.0) + (>= (- (-> *display* game-frame-counter) (the-as int (-> self fact-info-target eco-pickup-time))) + (the-as int (-> self fact-info-target eco-timeout)) + ) ) - ) - ) - ) - 0.0 - 900.0 - ) - ) + (set! (-> self fact-info-target eco-level) 0.0) + (set! (-> self fact-info-target eco-timeout) 0) + (set! (-> self state-flags) (logand -65 (-> self state-flags))) + (send-event self 'reset-collide) + (stop! (-> self sound)) ) - (case (-> self fact-info-target eco-type) - ((1) - (change-sound! (-> self sound) (static-sound-name "yel-eco-jak")) - (let ((s4-0 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* (if (rand-vu-percent? 0.5) - 269 - 270 - ) - ) - (vector<-cspace! - (new 'stack-no-clear 'vector) - (-> self node-list data s4-0) - ) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - ) - (dotimes (gp-4 2) - (let ((v1-111 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 271) - (vector<-cspace! - (new 'stack-no-clear 'vector) - (-> self node-list data v1-111) + (when (and + (< 0.0 (-> self fact-info-target eco-level)) + (zero? (logand (-> self state-flags) 512)) + (zero? (logand (-> self draw status) 6)) + (not (movie?)) + (rand-vu-percent? + (lerp-scale + 0.0 + 1.0 + (the float + (- (-> self fact-info-target eco-timeout) + (the-as uint (- (-> *display* game-frame-counter) (the-as int (-> self fact-info-target eco-pickup-time)))) + ) + ) + 0.0 + 900.0 + ) + ) ) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 + (case (-> self fact-info-target eco-type) + ((1) + (change-sound! (-> self sound) (static-sound-name "yel-eco-jak")) + (let ((s4-0 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* (if (rand-vu-percent? 0.5) + 269 + 270 + ) + ) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-0)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) ) - ) - ) - ) - ((2) - (target-danger-set! (-> self control unknown-symbol30) #t) - (dummy-47 (-> self control)) - (let ((a1-23 (new 'stack-no-clear 'touching-shapes-entry))) - (set! (-> a1-23 cshape1) (the-as collide-shape 0)) - (set! (-> a1-23 cshape2) (the-as collide-shape *touching-list*)) - (dummy-40 (-> self control) a1-23) - ) - (target-danger-set! (-> self control unknown-symbol30) #f) - (dummy-47 (-> self control)) - (change-sound! (-> self sound) (static-sound-name "red-eco-jak")) - (let ((s4-2 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* (if (rand-vu-percent? 0.5) - 273 - 274 - ) - ) - (vector<-cspace! - (new 'stack-no-clear 'vector) - (-> self node-list data s4-2) - ) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - ) - (dotimes (gp-6 2) - (let ((v1-139 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 275) - (vector<-cspace! - (new 'stack-no-clear 'vector) - (-> self node-list data v1-139) + (dotimes (gp-4 2) + (let ((v1-111 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 271) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-111)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) ) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) ) - ) - ) - ((3) - (change-sound! (-> self sound) (static-sound-name "blue-eco-jak")) - (let ((v1-150 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (cond - ((and - (logtest? (-> self control unknown-surface00 flags) 2048) - (zero? (logand (-> self control status) 1)) + ((2) + (target-danger-set! (-> self control unknown-symbol30) #t) + (dummy-47 (-> self control)) + (let ((a1-23 (new 'stack-no-clear 'touching-shapes-entry))) + (set! (-> a1-23 cshape1) (the-as collide-shape 0)) + (set! (-> a1-23 cshape2) (the-as collide-shape *touching-list*)) + (dummy-40 (-> self control) a1-23) ) - (set! (-> *part-id-table* 259 init-specs 4 initial-valuef) 0.0) - (set! (-> *part-id-table* 259 init-specs 4 random-rangef) 65536.0) - ) - (else - (set! (-> *part-id-table* 259 init-specs 4 initial-valuef) 40960.0) - (set! (-> *part-id-table* 259 init-specs 4 random-rangef) 16384.0) - ) - ) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 259) - (vector<-cspace! - (new 'stack-no-clear 'vector) - (-> self node-list data v1-150) - ) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - ) - (let ((gp-8 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* (if (rand-vu-percent? 0.5) - 255 - 256 - ) - ) - (vector<-cspace! - (new 'stack-no-clear 'vector) - (-> self node-list data gp-8) - ) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - (if (rand-vu-percent? 0.5) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 257) - (vector<-cspace! - (new 'stack-no-clear 'vector) - (-> self node-list data gp-8) + (target-danger-set! (-> self control unknown-symbol30) #f) + (dummy-47 (-> self control)) + (change-sound! (-> self sound) (static-sound-name "red-eco-jak")) + (let ((s4-2 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* (if (rand-vu-percent? 0.5) + 273 + 274 + ) + ) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-2)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) ) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - ) - ) - (let ((v1-168 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 260) - (vector<-cspace! - (new 'stack-no-clear 'vector) - (-> self node-list data v1-168) - ) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - ) - (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 1 30) - ) - ((4) - (change-sound! (-> self sound) (static-sound-name "green-eco-jak")) - (let ((s4-8 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* (if (rand-vu-percent? 0.5) - 277 - 278 - ) - ) - (vector<-cspace! - (new 'stack-no-clear 'vector) - (-> self node-list data s4-8) - ) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) - ) - (dotimes (gp-11 2) - (let ((v1-188 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (sp-launch-particles-var - *sp-particle-system-2d* - (-> *part-id-table* 279) - (vector<-cspace! - (new 'stack-no-clear 'vector) - (-> self node-list data v1-188) + (dotimes (gp-6 2) + (let ((v1-139 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 275) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-139)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + ) + ) + ((3) + (change-sound! (-> self sound) (static-sound-name "blue-eco-jak")) + (let ((v1-150 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (cond + ((and (logtest? (-> self control unknown-surface00 flags) 2048) (zero? (logand (-> self control status) 1))) + (set! (-> *part-id-table* 259 init-specs 4 initial-valuef) 0.0) + (set! (-> *part-id-table* 259 init-specs 4 random-rangef) 65536.0) + ) + (else + (set! (-> *part-id-table* 259 init-specs 4 initial-valuef) 40960.0) + (set! (-> *part-id-table* 259 init-specs 4 random-rangef) 16384.0) + ) + ) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 259) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-150)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + (let ((gp-8 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* (if (rand-vu-percent? 0.5) + 255 + 256 + ) + ) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-8)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + (if (rand-vu-percent? 0.5) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 257) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-8)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + ) + (let ((v1-168 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 260) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-168)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 1 30) + ) + ((4) + (change-sound! (-> self sound) (static-sound-name "green-eco-jak")) + (let ((s4-8 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* (if (rand-vu-percent? 0.5) + 277 + 278 + ) + ) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-8)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + (dotimes (gp-11 2) + (let ((v1-188 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 279) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-188)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) ) - (the-as sparticle-launch-state #f) - (the-as sparticle-launch-control #f) - 1.0 - ) ) ) - ) + (update-trans! (-> self sound) (-> self control trans)) + (update! (-> self sound)) ) - (update-trans! (-> self sound) (-> self control trans)) - (update! (-> self sound)) - ) 0 (none) ) (defbehavior target-powerup-effect target ((arg0 symbol)) - (case arg0 - (('eco-blue) + (case arg0 + (('eco-blue) (let ((v1-4 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (eco-blue-glow - (vector<-cspace! - (new 'stack-no-clear 'vector) - (-> self node-list data v1-4) - ) + (eco-blue-glow (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-4))) ) - ) ) - ) + ) 0 (none) ) diff --git a/goal_src/engine/target/target-death.gc b/goal_src/engine/target/target-death.gc index 7bc9768175..243f8fe80d 100644 --- a/goal_src/engine/target/target-death.gc +++ b/goal_src/engine/target/target-death.gc @@ -5,3 +5,1611 @@ ;; name in dgo: target-death ;; dgos: GAME, ENGINE +;; TODO - for target-flut +; (define-extern target-hit-effect (function attack-info none :behavior target)) +; (define-extern *smack-mods* surface) ;; unknown type +; (define-extern target-hit-orient (function attack-info vector symbol :behavior target)) +; (define-extern target-hit-move (function attack-info symbol (function none :behavior target) float none :behavior target)) + +(define-extern target-title (state target)) ;; unknown type +(define-extern target-demo (state target)) ;; unknown type +(define-extern target-warp-in (state target)) ;; unknown type + +;; DECOMP BEGINS + +(defskelgroup *deathcam-sg* deathcam + 0 + 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :longest-edge (meters 0) + :texture-level 2 + ) + +(define *auto-continue* #f) + +(defun next-level ((arg0 symbol)) + (let ((v1-0 (lookup-level-info arg0))) + (the-as level-load-info (when v1-0 + (let* ((a0-1 *level-load-list*) + (a1-0 (car a0-1)) + ) + (while (not (null? a0-1)) + (let ((a1-1 (the-as basic (-> (the-as level-load-info a1-0) name)))) + (if (= (-> (the-as level-load-info a1-1) index) (+ (-> v1-0 index) 1)) + (return (the-as level-load-info a1-1)) + ) + ) + (set! a0-1 (cdr a0-1)) + (set! a1-0 (car a0-1)) + ) + ) + #f + ) + ) + ) + ) + +(defstate target-continue (target) + :event + target-generic-event-handler + :exit + (behavior () + (set! (-> *load-boundary-target* 0 quad) (-> (camera-pos) quad)) + (set! (-> *load-boundary-target* 1 quad) (-> (target-pos 0) quad)) + (set! (-> *load-boundary-target* 2 quad) (-> *load-boundary-target* 0 quad)) + (set! (-> *load-boundary-target* 3 quad) (-> *load-boundary-target* 1 quad)) + (when (zero? (logand (-> *game-info* current-continue flags) 176)) + (set! (-> *level* border?) (-> *level* play?)) + (set! (-> *setting-control* default border-mode) (-> *level* play?)) + ) + (clear-pending-settings-from-process *setting-control* self 'allow-pause) + (clear-pending-settings-from-process *setting-control* self 'allow-progress) + (clear-pending-settings-from-process *setting-control* self 'bg-a) + (clear-pending-settings-from-process *setting-control* self 'music-volume) + (clear-pending-settings-from-process *setting-control* self 'sfx-volume) + (clear-pending-settings-from-process *setting-control* self 'ambient-volume) + (clear-pending-settings-from-process *setting-control* self 'music) + (none) + ) + :code + (behavior ((arg0 continue-point)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (if (-> *art-control* reserve-buffer) + (reserve-free *art-control* (-> *art-control* reserve-buffer heap)) + ) + (push-setting! *setting-control* self 'bg-a 'abs 1.0 0) + (set! (-> *setting-control* current bg-a) 1.0) + (set-setting! *setting-control* self 'sfx-volume 'abs (the-as float 0.0) 0) + (set-setting! *setting-control* self 'ambient-volume 'abs (the-as float 0.0) 0) + (let ((v1-20 (lookup-level-info (-> arg0 level)))) + (when v1-20 + (set-setting! *setting-control* self 'music (-> v1-20 music-bank) (the-as float 0.0) 0) + (set-setting! *setting-control* self 'music-volume 'abs (the-as float 0.0) 0) + ) + ) + (set! (-> *level* border?) #f) + (set! (-> *setting-control* default border-mode) #f) + (reset-target-state #t) + (target-exit) + (ja-channel-set! 0) + (quaternion-copy! (-> self control unknown-quaternion00) (-> arg0 quat)) + (TODO-RENAME-30 (-> self control) (-> arg0 trans)) + (rot->dir-targ! (-> self control)) + (set! (-> (&-> (-> self control) unknown-qword00) 0) (-> self control trans quad)) + (cond + ((not (string= (-> arg0 name) "default")) + (set! *external-cam-mode* #f) + (cam-stop) + (suspend) + 0 + ) + (else + (send-event *camera* 'clear-entity) + (send-event *camera* 'change-state cam-fixed 0) + (suspend) + 0 + ) + ) + (set! (-> *load-state* vis-nick) (-> arg0 vis-nick)) + (set! (-> *load-state* want 0 name) (-> arg0 lev0)) + (set! (-> *load-state* want 0 display?) (-> arg0 disp0)) + (set! (-> *load-state* want 0 force-vis?) #f) + (set! (-> *load-state* want 0 force-inside?) #f) + (set! (-> *load-state* want 1 name) (-> arg0 lev1)) + (set! (-> *load-state* want 1 display?) (-> arg0 disp1)) + (set! (-> *load-state* want 1 force-vis?) #f) + (set! (-> *load-state* want 1 force-inside?) #f) + (when (not (string= (-> arg0 name) "default")) + (while (not + (and + (or (not (-> arg0 lev0)) (not (-> arg0 disp0)) (= (level-status *level* (-> arg0 lev0)) 'active)) + (or (not (-> arg0 lev1)) (not (-> arg0 disp1)) (= (level-status *level* (-> arg0 lev1)) 'active)) + ) + ) + (let ((v1-52 (lookup-level-info (-> arg0 level)))) + (if (and + v1-52 + (= (-> *setting-control* current music) (-> v1-52 music-bank)) + (zero? (logand (-> arg0 flags) 160)) + ) + (clear-pending-settings-from-process *setting-control* self 'music-volume) + ) + ) + (suspend) + ) + ) + (backup-load-state-and-set-cmds *load-state* '()) + (execute-command *load-state* '(teleport)) + (let* ((s5-0 (-> arg0 load-commands)) + (a1-18 (car s5-0)) + ) + (while (not (null? s5-0)) + (execute-command *load-state* (the-as pair a1-18)) + (set! s5-0 (cdr s5-0)) + (set! a1-18 (car s5-0)) + ) + ) + (restore-load-state *load-state*) + (set! (-> *ACTOR-bank* birth-max) 1000) + (new 'stack 'transformq) + (cond + ((not (string= (-> arg0 name) "default")) + (cam-start #t) + (suspend) + (suspend) + (set! (-> *camera-combiner* trans quad) (-> arg0 camera-trans quad)) + (let ((s5-1 (-> *camera-combiner* inv-camera-rot)) + (s4-0 (-> arg0 camera-rot)) + ) + (matrix-identity! s5-1) + (set! (-> s5-1 vector 0 x) (-> s4-0 0)) + (set! (-> s5-1 vector 0 y) (-> s4-0 1)) + (set! (-> s5-1 vector 0 z) (-> s4-0 2)) + (set! (-> s5-1 vector 1 x) (-> s4-0 3)) + (set! (-> s5-1 vector 1 y) (-> s4-0 4)) + (set! (-> s5-1 vector 1 z) (-> s4-0 5)) + (set! (-> s5-1 vector 2 x) (-> s4-0 6)) + (set! (-> s5-1 vector 2 y) (-> s4-0 7)) + (set! (-> s5-1 vector 2 z) (-> s4-0 8)) + ) + (send-event *camera* 'change-target self) + (send-event *camera* 'no-intro) + (send-event *camera* 'clear-entity) + (send-event *camera* 'force-blend 0) + (send-event *camera* 'change-state cam-fixed 0) + (send-event *camera* 'change-state cam-string 0) + ) + (else + (send-event *camera* 'change-target self) + (send-event *camera* 'change-state cam-string 0) + (send-event *camera* 'teleport) + (send-event *camera* 'no-intro) + (send-event *camera* 'clear-entity) + ) + ) + (send-event self 'level-enter (-> arg0 level)) + (dotimes (v1-124 (-> *level* length)) + (let ((a0-64 (-> *level* level v1-124))) + (if (= (-> a0-64 status) 'active) + (set! (-> a0-64 all-visible?) 'loading) + ) + ) + ) + (let ((s5-2 (level-get *level* (-> arg0 level)))) + (when s5-2 + (while (and (= (-> s5-2 all-visible?) 'loading) (-> *level* vis?)) + (suspend) + ) + ) + ) + (set! *spawn-actors* #t) + (set! *teleport* #t) + (set! (-> *ACTOR-bank* birth-max) 1000) + (set-blackout-frames 30) + (cond + ((logtest? (-> arg0 flags) 128) + (go target-title) + ) + ((logtest? (-> arg0 flags) 16) + (start-sequence-a) + ) + ((logtest? (-> arg0 flags) 32) + (let ((s5-3 (entity-by-name "sage-23"))) + (when s5-3 + (set-blackout-frames #x7530) + (entity-birth-no-kill s5-3) + (suspend) + (send-event + (if s5-3 + (-> s5-3 extra process) + ) + 'play-anim + ) + ) + ) + ) + ((and + (logtest? (-> arg0 flags) 2048) + (or + (= (get-task-status (game-task beach-ecorocks)) (task-status need-hint)) + (= (get-task-status (game-task beach-ecorocks)) (task-status need-introduction)) + ) + ) + (let ((s5-4 (entity-by-name "sage-23"))) + (when s5-4 + (set-blackout-frames #x7530) + (entity-birth-no-kill s5-4) + (suspend) + (set! arg0 (get-continue-by-name *game-info* "village1-hut")) + (send-event + (if s5-4 + (-> s5-4 extra process) + ) + 'play-anim + ) + ) + ) + ) + ((logtest? (-> arg0 flags) 8) + (go target-demo) + ) + ((logtest? (-> arg0 flags) 64) + (set-blackout-frames 300) + (let ((s5-5 (get-process *default-dead-pool* process #x4000))) + (when s5-5 + (let ((t9-60 (method-of-type process activate))) + (t9-60 s5-5 *default-pool* 'process (the-as pointer #x70004000)) + ) + (run-next-time-in-process + s5-5 + (lambda () + (local-vars (v1-10 basic)) + (let ((gp-0 (entity-by-name "sage-23"))) + (when gp-0 + (set-blackout-frames #x7530) + (entity-birth-no-kill gp-0) + (suspend) + (suspend) + (send-event + (if gp-0 + (-> gp-0 extra process) + ) + 'play-anim + ) + ) + ) + (let ((gp-1 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-1) 600) + (suspend) + ) + ) + (until (not v1-10) + (suspend) + (set! v1-10 (and *target* (logtest? (-> *target* state-flags) 256))) + ) + (set! (-> *cpad-list* cpads 0 change-time) (-> *display* base-frame-counter)) + (reset-actors 'dead) + (start 'play (get-continue-by-name *game-info* "misty-start")) + ) + ) + (-> s5-5 ppointer) + ) + ) + ) + ((logtest? (-> arg0 flags) 4) + (let ((s5-6 (new 'static 'vector))) + (cond + ((string= (-> arg0 name) "village1-warp") + (set! (-> s5-6 quad) (-> (entity-by-name "villagea-part-1") extra trans quad)) + (suspend) + (let ((s4-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-2 from) self) + (set! (-> s4-2 num-params) 0) + (set! (-> s4-2 message) 'hidden-other) + (let ((s3-0 send-event-function) + (v1-175 (entity-by-name "sage-23")) + ) + (s3-0 + (if v1-175 + (-> v1-175 extra process) + ) + s4-2 + ) + ) + ) + (let ((s4-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-3 from) self) + (set! (-> s4-3 num-params) 0) + (set! (-> s4-3 message) 'hidden-other) + (let ((s3-1 send-event-function) + (v1-179 (entity-by-name "assistant-11")) + ) + (s3-1 + (if v1-179 + (-> v1-179 extra process) + ) + s4-3 + ) + ) + ) + (set-continue! *game-info* "village1-hut") + ) + ((or (string= (-> arg0 name) "training-warp") (string= (-> arg0 name) "game-start")) + (if (logtest? (-> arg0 flags) 1024) + (close-specific-task! (game-task intro) (task-status need-resolution)) + ) + (set! (-> s5-6 quad) (-> (entity-by-name "training-part-1") extra trans quad)) + (set-continue! *game-info* "training-start") + ) + ((string= (-> arg0 name) "village2-warp") + (set! (-> s5-6 quad) (-> (entity-by-name "villageb-part-55") extra trans quad)) + (when (task-closed? (game-task village2-levitator) (task-status need-hint)) + (suspend) + (let ((s4-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-6 from) self) + (set! (-> s4-6 num-params) 0) + (set! (-> s4-6 message) 'hidden-other) + (let ((s3-2 send-event-function) + (v1-201 (entity-by-name "assistant-bluehut-1")) + ) + (s3-2 + (if v1-201 + (-> v1-201 extra process) + ) + s4-6 + ) + ) + ) + (let ((s4-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-7 from) self) + (set! (-> s4-7 num-params) 0) + (set! (-> s4-7 message) 'hidden-other) + (let ((s3-3 send-event-function) + (v1-205 (entity-by-name "sage-bluehut-1")) + ) + (s3-3 + (if v1-205 + (-> v1-205 extra process) + ) + s4-7 + ) + ) + ) + (let ((s4-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-8 from) self) + (set! (-> s4-8 num-params) 0) + (set! (-> s4-8 message) 'hidden-other) + (let ((s3-4 send-event-function) + (v1-209 (entity-by-name "flutflut-bluehut-1")) + ) + (s3-4 + (if v1-209 + (-> v1-209 extra process) + ) + s4-8 + ) + ) + ) + ) + (set-continue! *game-info* "village2-start") + ) + ((string= (-> arg0 name) "village3-warp") + (set! (-> s5-6 quad) (-> (entity-by-name "villagec-part-32") extra trans quad)) + (when (task-closed? (game-task village3-button) (task-status need-hint)) + (suspend) + (let ((s4-10 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-10 from) self) + (set! (-> s4-10 num-params) 0) + (set! (-> s4-10 message) 'hidden-other) + (let ((s3-5 send-event-function) + (v1-220 (entity-by-name "assistant-villagec-1")) + ) + (s3-5 + (if v1-220 + (-> v1-220 extra process) + ) + s4-10 + ) + ) + ) + (let ((s4-11 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-11 from) self) + (set! (-> s4-11 num-params) 0) + (set! (-> s4-11 message) 'hidden-other) + (let ((s3-6 send-event-function) + (v1-224 (entity-by-name "sage-villagec-1")) + ) + (s3-6 + (if v1-224 + (-> v1-224 extra process) + ) + s4-11 + ) + ) + ) + ) + (set-continue! *game-info* "village3-start") + ) + ((string= (-> arg0 name) "citadel-warp") + (set! (-> s5-6 quad) (-> (entity-by-name "citb-part-1") extra trans quad)) + (when (task-closed? (game-task village4-button) (task-status need-hint)) + (suspend) + (let ((s4-13 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-13 from) self) + (set! (-> s4-13 num-params) 0) + (set! (-> s4-13 message) 'hidden-other) + (let ((s3-7 send-event-function) + (v1-235 (entity-by-name "assistant-lavatube-end-3")) + ) + (s3-7 + (if v1-235 + (-> v1-235 extra process) + ) + s4-13 + ) + ) + ) + ) + (set-continue! *game-info* "lavatube-end") + ) + ) + ) + enter-state + (-> arg0 trans) + (go target-warp-in) + ) + (else + (let ((s5-7 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) s5-7) 15) + (suspend) + ) + ) + ) + ) + (set-continue! *game-info* arg0) + (when *auto-continue* + (let ((s5-8 (next-level (-> arg0 level)))) + (when (and s5-8 (not (null? (-> s5-8 continues)))) + (format 0 "~A ~A ~A~%" (-> arg0 level) (-> s5-8 name) (car (-> s5-8 continues))) + (inspect global) + (let ((gp-1 (get-process *default-dead-pool* process #x4000))) + (when gp-1 + (let ((t9-104 (method-of-type process activate))) + (t9-104 gp-1 *default-pool* 'process (the-as pointer #x70004000)) + ) + (run-next-time-in-process gp-1 (lambda ((arg0 continue-point)) (start 'play arg0)) (car (-> s5-8 continues))) + (-> gp-1 ppointer) + ) + ) + ) + ) + ) + (ja-channel-set! 1) + (let ((v1-264 (-> self skel root-channel 0))) + (set! (-> v1-264 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) + ) + (suspend) + (logior! (-> self control status) 7) + (go target-stance) + (none) + ) + :post + target-no-move-post + ) + +(define *smack-mods* (new 'static 'surface + :name 'jump + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook + (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (when (= arg3 1) + (let ((f30-0 (-> self control unknown-float40)) + (f28-0 (-> self control unknown-float41)) + ) + (set! (-> arg0 seek0) (lerp (-> arg0 seek0) (the-as float 409600.0) f28-0)) + (set! (-> arg0 seek90) (lerp (-> arg0 seek90) (the-as float 409600.0) f28-0)) + (set! (-> arg0 seek180) (lerp (-> arg0 seek180) (the-as float 409600.0) f28-0)) + (set! (-> arg0 target-speed) (lerp (-> arg0 target-speed) f30-0 f28-0)) + (set! (-> arg0 transv-max) (lerp (-> arg0 transv-max) f30-0 f28-0)) + ) + ) + (none) + ) + :mode 'air + :flags #x800 + ) + ) + +(define + *smack-up-mods* + (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 32768.0 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook + (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (when (= arg3 1) + (let ((f30-0 (-> self control unknown-float40)) + (f28-0 (-> self control unknown-float41)) + ) + (set! (-> arg0 seek0) (lerp (-> arg0 seek0) (the-as float 409600.0) f28-0)) + (set! (-> arg0 seek90) (lerp (-> arg0 seek90) (the-as float 409600.0) f28-0)) + (set! (-> arg0 seek180) (lerp (-> arg0 seek180) (the-as float 409600.0) f28-0)) + (set! (-> arg0 target-speed) (lerp (-> arg0 target-speed) f30-0 f28-0)) + (set! (-> arg0 transv-max) (lerp (-> arg0 transv-max) f30-0 f28-0)) + ) + ) + (none) + ) + :mode 'air + :flags #x818 + ) + ) + +(defbehavior velocity-set-to-target! target ((arg0 vector) (arg1 float) (arg2 attack-info)) + (let* ((v1-1 (-> self control trans)) + (gp-1 (vector-! (new 'stack-no-clear 'vector) arg0 v1-1)) + ) + (set! (-> gp-1 y) 0.0) + (set! (-> self control unknown-vector40 quad) (-> gp-1 quad)) + (vector-xz-normalize! (-> self control unknown-vector40) (the-as float 1.0)) + (set! (-> self control unknown-float50) 1.0) + (set! (-> self control unknown-float40) arg1) + (set! (-> self control unknown-float41) (- 1.0 (-> arg2 control))) + gp-1 + ) + ) + +(defbehavior target-hit-effect target ((arg0 attack-info)) + (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when s5-0 + (let ((t9-1 (method-of-type part-tracker activate))) + (t9-1 (the-as part-tracker s5-0) self 'part-tracker (the-as pointer #x70004000)) + ) + (run-now-in-process + s5-0 + part-tracker-init + (-> *part-group-id-table* 1) + -1 + #f + #f + #f + (if (logtest? (-> arg0 mask) 4) + (-> arg0 intersection) + (-> self control root-prim prim-core) + ) + ) + (-> s5-0 ppointer) + ) + ) + (let ((v1-9 (-> arg0 mode))) + (cond + ((or (= v1-9 'endlessfall) (= v1-9 'instant-death)) + ) + ((begin + (target-timed-invulnerable (-> arg0 invinc-time) self) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 150) + (let ((v1-13 (-> arg0 angle))) + (= v1-13 'up) + ) + ) + (sound-play-by-name (static-sound-name "hit-up") (new-sound-id) 1024 0 0 1 #t) + ) + (else + (sound-play-by-name (static-sound-name "oof") (new-sound-id) 1024 0 0 1 #t) + ) + ) + ) + (case (-> arg0 mode) + (('burn 'burnup) + (let ((gp-1 (get-process *default-dead-pool* process #x4000))) + (when gp-1 + (let ((t9-10 (method-of-type process activate))) + (t9-10 gp-1 self 'process (the-as pointer #x70004000)) + ) + (run-next-time-in-process gp-1 process-drawable-burn-effect 1200) + (-> gp-1 ppointer) + ) + ) + ) + (('tar) + (sound-play-by-name (static-sound-name "get-burned") (new-sound-id) 1024 0 0 1 #t) + ) + ) + 0 + (none) + ) + +(defbehavior target-hit-push target ((arg0 vector) (arg1 matrix) (arg2 float) (arg3 float) (arg4 attack-info)) + (case (-> arg4 angle) + (('jump 'up 'up-forward) + (when (and + (zero? (logand (-> self control root-prim prim-core action) #x4200)) + (not (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health)))) + ) + (if (and + (logtest? + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons circle) + ) + (can-feet?) + ) + (go target-attack-air #f) + ) + (if (and + (logtest? + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons square) + ) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 26624.0) + (and + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) + (the-as int (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) 4096)) + (zero? (logand (-> self control unknown-surface01 flags) 384)) + ) + ) + (go + target-flop + (the-as float 65502.96) + (the-as float -163840.0) + (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + 0.0 + 68812.8 + ) + ) + ) + ) + ) + ) + ) + (when (if (and + (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) + (and + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> *TARGET-bank* stuck-time))) + (not + (and + *cheat-mode* + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + ) + ) + ) + #t + ) + (logior! (-> self control status) 1) + (return (the-as object 'stuck)) + ) + (let ((s1-0 (new-stack-vector0))) + (set! (-> s1-0 z) arg2) + (vector-matrix*! s1-0 s1-0 arg1) + (vector+! s1-0 s1-0 arg0) + (cond + ((< (vector-vector-distance arg0 s1-0) (fabs (-> arg4 dist))) + (velocity-set-to-target! s1-0 (fabs arg3) arg4) + #t + ) + (else + (set! (-> self control unknown-float40) 0.0) + (set! (-> self control unknown-float41) (- 1.0 (-> arg4 control))) + #f + ) + ) + ) + ) + +(defbehavior target-hit-orient target ((arg0 attack-info) (arg1 vector)) + (let ((s5-0 #f)) + (if (and + (!= (-> arg0 angle) 'front) + (!= (-> arg0 angle) 'shove) + (logtest? (-> arg0 mask) 2) + (!= (-> arg0 shove-back) 0.0) + ) + (forward-up-nopitch->quaternion (-> self control dir-targ) arg1 (-> self control dynam gravity-normal)) + ) + (case (-> arg0 angle) + (('back 'air) + (set! s5-0 #t) + ) + (('up-forward) + (set! (-> self control unknown-surface00) *smack-up-mods*) + ) + (('front) + (if (and (logtest? (-> arg0 mask) 2) (!= (-> arg0 shove-back) 0.0)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-negate! (new 'stack-no-clear 'vector) arg1) + (-> self control dynam gravity-normal) + ) + ) + (set! s5-0 #t) + ) + (('jump) + (set! s5-0 #t) + (set! (-> self control unknown-surface00) *forward-high-jump-mods*) + ) + ) + s5-0 + ) + ) + +(defbehavior target-hit-setup-anim target ((arg0 attack-info)) + (case (-> arg0 angle) + (('back) + (when (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 74) + ) + ) + (ja-channel-push! 1 22) + (let ((gp-1 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-1 + (the-as art-joint-anim (-> self draw art-group data 74)) + num-func-identity + ) + (let ((f0-0 0.0)) + (set! (-> gp-1 frame-num) f0-0) + f0-0 + ) + ) + ) + ) + (('up 'up-forward) + (when (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 75) + ) + ) + (ja-channel-push! 1 22) + (let ((gp-2 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-2 + (the-as art-joint-anim (-> self draw art-group data 75)) + num-func-identity + ) + (let ((f0-1 0.0)) + (set! (-> gp-2 frame-num) f0-1) + f0-1 + ) + ) + ) + ) + (('air 'jump) + (ja-channel-push! 1 15) + (let ((a0-21 (-> self skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> self draw art-group data 34))) + (set! (-> a0-21 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) data 0 length) -1)) + ) + (set! (-> a0-21 param 1) 1.0) + (set! (-> a0-21 frame-num) 0.0) + (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> self draw art-group data 34)) num-func-seek!) + ) + (when (= (-> arg0 angle) 'air) + (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + (dummy-10 (-> self skel effect) 'group-smack-surface (the-as float 0.0) 5) + (dummy-10 (-> self skel effect) 'group-smack-surface-dizzy (the-as float 0.0) 8) + ) + ) + (('shove) + (ja-channel-push! 1 15) + (let ((a0-30 (-> self skel root-channel 0))) + (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> self draw art-group data 78))) + (set! (-> a0-30 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 78)) data 0 length) -1)) + ) + (set! (-> a0-30 param 1) 1.0) + (set! (-> a0-30 frame-num) 0.0) + (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> self draw art-group data 78)) num-func-seek!) + ) + (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + ) + (else + (when (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 73) + ) + ) + (ja-channel-push! 1 22) + (let ((gp-5 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-5 + (the-as art-joint-anim (-> self draw art-group data 73)) + num-func-identity + ) + (let ((f0-10 0.0)) + (set! (-> gp-5 frame-num) f0-10) + f0-10 + ) + ) + ) + ) + ) + ) + +(defbehavior target-hit-move target ((arg0 attack-info) (arg1 symbol) (arg2 (function none :behavior target)) (arg3 float)) + (local-vars (v1-40 symbol) (s2-1 object)) + (vector-identity! (-> self control transv)) + (let ((s3-0 (new-stack-vector0))) + (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! s3-0 (-> self control transv) (vector-float*! s3-0 (-> self control dynam gravity-normal) f0-1)) + ) + (let* ((f0-2 (vector-length s3-0)) + (f1-1 f0-2) + (f2-1 (+ 2048.0 (sqrtf (* 491520.0 (-> arg0 shove-up))))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-1) + (vector-float*! s3-0 s3-0 (/ f0-2 f1-1)) + ) + ) + ) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (set! (-> s3-1 quad) (-> self control trans quad)) + (let ((s1-1 (matrix-rotate-y! (new 'stack-no-clear 'matrix) (+ 32768.0 (vector-y-angle (-> arg0 vector))))) + (f30-1 0.0) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + #t + (let ((f28-1 (* 1.05 (/ (* -60.0 arg3) (* (the float (+ (-> (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -1 + ) + ) + (ja-step 0) + ) + ) + ) + ) + ) + (until v1-40 + (+! f30-1 (* (-> arg0 shove-back) f28-1 (-> *display* seconds-per-frame))) + (set! s2-1 (target-hit-push s3-1 s1-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0)) + (suspend) + (let ((a0-14 (-> self skel root-channel 0))) + (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) + (set! (-> a0-14 param 1) 1.0) + (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) + ) + (set! v1-40 (or (ja-done? 0) (and arg1 (logtest? (-> self control status) 1)))) + ) + (while (and (or (zero? (logand (-> self control status) 1)) s2-1) (!= s2-1 'stuck)) + (arg2) + (+! f30-1 (* (-> arg0 shove-back) f28-1 (-> *display* seconds-per-frame))) + (set! s2-1 (target-hit-push s3-1 s1-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0)) + (if (not s2-1) + (set! (-> self state-flags) (logand -9 (-> self state-flags))) + ) + (suspend) + ) + ) + ) + ) + 0 + (none) + ) + +(defstate target-hit (target) + :event + target-standard-event-handler + :exit + (behavior () + (let ((gp-0 (new-stack-vector0)) + (f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! gp-0 (-> self control transv) (vector-float*! gp-0 (-> self control dynam gravity-normal) f30-0)) + (let* ((f1-0 (vector-length gp-0)) + (f0-3 f1-0) + ) + (if (< 40960.0 f1-0) + (set! f1-0 40960.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f30-0) + (vector-float*! gp-0 gp-0 (/ f1-0 f0-3)) + ) + ) + ) + (if (!= (-> self next-state name) 'target-death) + (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + ) + (target-exit) + (none) + ) + :trans + (behavior () + (when (= *cheat-mode* 'debug) + (when (and + (not *pause-lock*) + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + (pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) + (go target-stance) + ) + ) + (none) + ) + :code + (behavior ((arg0 symbol) (arg1 attack-info)) + (set! (-> self water flags) (logand -65537 (-> self water flags))) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (let ((gp-0 (-> self attack-info))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 gp-0)) + (set! (-> v1-4 attacker) (the-as handle #f)) + (set! (-> v1-4 mode) 'generic) + (set! (-> v1-4 shove-back) 6144.0) + (set! (-> v1-4 shove-up) 4915.2) + (set! (-> v1-4 angle) #f) + (set! (-> v1-4 trans quad) (-> self control trans quad)) + (set! (-> v1-4 control) 0.0) + (set! (-> v1-4 invinc-time) (-> *TARGET-bank* hit-invulnerable-timeout)) + ) + (case arg0 + (('shove) + (let ((v1-7 gp-0)) + (set! (-> v1-7 shove-back) (-> *TARGET-bank* smack-surface-dist)) + (set! (-> v1-7 shove-up) (-> *TARGET-bank* smack-surface-height)) + (set! (-> v1-7 angle) 'shove) + ) + ) + ) + (dummy-9 gp-0 arg1) + (when (zero? (logand (-> gp-0 mask) 2)) + (vector-z-quaternion! (-> gp-0 vector) (-> self control unknown-quaternion00)) + (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) + (set! (-> gp-0 vector y) (-> gp-0 shove-up)) + ) + (set! (-> s5-0 quad) (-> gp-0 vector quad)) + (let ((f0-10 (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-0 (the-as float 1.0)) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)) + ) + ) + ) + (if (not (-> self attack-info angle)) + (set! (-> self attack-info angle) (if (>= 0.0 f0-10) + 'front + 'back + ) + ) + ) + ) + (when (= arg0 'attack) + (logior! (-> self state-flags) 8) + (set! (-> self game hit-time) (-> *display* base-frame-counter)) + (case (-> gp-0 mode) + (('endlessfall) + (cond + ((= (-> self game mode) 'debug) + (let ((s4-1 (new-stack-vector0))) + (set! (-> s4-1 quad) (-> self control unknown-vector54 quad)) + (ja-channel-set! 0) + (let ((s3-1 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) s3-1) 300) + (suspend) + ) + ) + (TODO-RENAME-30 (-> self control) s4-1) + ) + (set! (-> (&-> (-> self control) unknown-qword00) 0) (-> self control trans quad)) + (send-event *camera* 'teleport) + (go target-stance) + ) + (else + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (the-as float -1000.0) + (the-as handle #f) + ) + (go target-death (-> gp-0 mode)) + ) + ) + ) + (('drown-death 'sharkey 'lava 'dark-eco-pool 'ogreboss-super-boulder 'melt 'instant-death) + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (the-as float -1000.0) + (the-as handle #f) + ) + (if (= (-> self game mode) 'play) + (go target-death (-> gp-0 mode)) + ) + ) + (('death) + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (the-as float -1000.0) + (the-as handle #f) + ) + ) + (('plant-boss) + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (- (-> *FACT-bank* health-single-inc)) + (the-as handle #f) + ) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + (go target-death (-> gp-0 mode)) + ) + ) + (else + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (- (-> *FACT-bank* health-single-inc)) + (the-as handle #f) + ) + ) + ) + (target-hit-effect gp-0) + ) + (set! (-> self control unknown-surface00) *smack-mods*) + (target-hit-setup-anim gp-0) + (target-hit-move gp-0 (target-hit-orient gp-0 s5-0) target-falling-anim-trans (the-as float 1.0)) + ) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + (go target-death (-> gp-0 mode)) + ) + ) + (go target-hit-ground #f) + (none) + ) + :post + (the-as (function none :behavior target) target-post) + ) + +(define + *death-spool-array* + (the-as (array spool-anim) + (new + 'static + 'boxed-array + :type spool-anim :length 11 :allocated-length 11 + (new 'static 'spool-anim :name "death-0181" :index 3 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0182" :index 4 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0184" :index 5 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0186" :index 6 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0187" :index 7 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0191" :index 8 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0193" :index 9 :parts 2 :command-list '()) + (new 'static 'spool-anim :name "death-0195" :index 10 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0197" :index 11 :parts 2 :command-list '()) + (new 'static 'spool-anim :name "death-0199" :index 12 :parts 2 :command-list '()) + (new 'static 'spool-anim :name "death-0202" :index 13 :parts 1 :command-list '()) + ) + ) + ) + +(if (!= *kernel-boot-message* 'play) + (set! (-> *death-spool-array* length) 3) + ) + +(defun death-movie-remap ((arg0 int) (arg1 int)) + (let ((v1-0 (/ arg0 arg1))) + (mod + (if (zero? (logand v1-0 1)) + (logxor v1-0 arg0) + (logand #xfffffff (- (logxor v1-0 arg0))) + ) + arg1 + ) + ) + ) + +(defbehavior target-death-anim target ((arg0 spool-anim)) + (set! (-> self control unknown-surface00) *neutral-mods*) + (ja-channel-push! 1 30) + (let ((a0-3 (-> self skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 76))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 76)) data 0 length) -1)) + ) + (set! (-> a0-3 param 1) 1.0) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 76)) num-func-seek!) + ) + (until (ja-done? 0) + (if arg0 + (spool-push *art-control* (-> arg0 name) 0 self (the-as float -99.0)) + ) + (send-event *camera* 'joystick 0.0 -1.0) + (TODO-RENAME-9 (-> self align)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (when (zero? (logand (-> self align flags) 1)) + (vector-matrix*! s5-0 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) + (vector-float*! (-> self control transv) s5-0 (-> *display* frames-per-second)) + ) + ) + (suspend) + (let ((a0-9 (-> self skel root-channel 0))) + (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) + (set! (-> a0-9 param 1) 1.0) + (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + 0 + (none) + ) + +(defstate target-death (target) + :event + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('end-mode) + (let ((v0-0 (the-as object #t))) + (set! (-> self control unknown-uint20) (the-as uint v0-0)) + v0-0 + ) + ) + (('change-mode) + (case (-> arg3 param 0) + (('grab) + #t + ) + ) + ) + (('notify) + (when (type-type? (-> arg0 type) pov-camera) + (case (-> arg3 param 0) + (('die 'abort-request) + (set! (-> self control unknown-uint20) (the-as uint #t)) + (set-blackout-frames 60) + ) + ) + ) + ) + (('get-pickup) + #f + ) + (('touched) + #f + ) + (else + (target-generic-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :exit + (behavior () + (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + (target-exit) + (clear-pending-settings-from-process *setting-control* self 'process-mask) + (clear-pending-settings-from-process *setting-control* self 'allow-progress) + (restore-collide-with-as (-> self control)) + (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :skip #x1 :noentity #x1)) + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (none) + ) + :trans + (-> target-hit trans) + :code + (behavior ((arg0 symbol)) + (set! (-> self control unknown-uint20) (the-as uint #f)) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) self) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'target) + (set! (-> a1-0 param 0) (the-as uint 'die)) + (set! (-> a1-0 param 1) (the-as uint arg0)) + (set! (-> self control unknown-int21) + (the-as int (send-event-function (handle->process (-> self attack-info attacker)) a1-0)) + ) + ) + (set! (-> self neck flex-blend) 0.0) + (target-timed-invulnerable-off self) + (set-setting! *setting-control* self 'process-mask 'set (the-as float 0.0) #x14a0000) + (copy-settings-from-target! *setting-control*) + (set! (-> self control transv quad) (the-as uint128 0)) + (logior! (-> self state-flags) #x8000) + (case arg0 + (('none 'instant-death) + ) + (('ogreboss-super-boulder) + (set! (-> self post-hook) target-no-ja-move-post) + (-> self attack-info attacker) + (ja-channel-set! 0) + (ja-post) + (let ((gp-1 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-1) 300) + (suspend) + ) + ) + ) + (('drown 'drown-death) + (sound-play-by-name (static-sound-name "death-drown") (new-sound-id) 1024 0 0 1 #t) + (set! (-> self water flags) (logand -17 (-> self water flags))) + (clear-collide-with-as (-> self control)) + (set! (-> self control unknown-surface00) *dive-mods*) + (set! (-> self control dynam gravity-max) 6144.0) + (set! (-> self control dynam gravity-length) 6144.0) + (ja-channel-push! 1 30) + (let ((f30-0 0.7) + (gp-3 (-> self skel root-channel 0)) + ) + (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 93))) + (set! (-> gp-3 param 0) (ja-aframe (the-as float 73.0) 0)) + (let ((f30-1 (seek f30-0 (the-as float 0.05) (* 1.5 (-> *display* seconds-per-frame))))) + (set! (-> gp-3 param 1) f30-1) + (set! (-> gp-3 frame-num) 0.0) + (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 93)) num-func-seek!) + (until (ja-done? 0) + (suspend) + (let ((gp-4 (-> self skel root-channel 0))) + (set! (-> gp-4 param 0) (ja-aframe (the-as float 73.0) 0)) + (set! f30-1 (seek f30-1 (the-as float 0.05) (* 1.5 (-> *display* seconds-per-frame)))) + (set! (-> gp-4 param 1) f30-1) + (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + ) + (('lava 'dark-eco-pool 'melt) + (let ((s5-1 (handle->process (-> self attack-info attacker)))) + (when (if (and (nonzero? s5-1) (type-type? (-> s5-1 type) water-vol)) + s5-1 + ) + (set! (-> self state-flags) (logior #x80000 (-> self state-flags))) + (set! (-> self alt-cam-pos y) (+ 4096.0 (-> self water height))) + ) + ) + (cond + ((= arg0 'dark-eco-pool) + (sound-play-by-name (static-sound-name "death-darkeco") (new-sound-id) 1024 0 0 1 #t) + (let ((gp-6 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-6 + (let ((t9-21 (method-of-type part-tracker activate))) + (t9-21 (the-as part-tracker gp-6) *entity-pool* 'part-tracker (the-as pointer #x70004000)) + ) + (run-now-in-process gp-6 part-tracker-init (-> *part-group-id-table* 31) -1 #f #f #f (-> self control trans)) + (-> gp-6 ppointer) + ) + ) + ) + ((or (= arg0 'lava) (= arg0 'melt)) + (sound-play-by-name (static-sound-name "death-melt") (new-sound-id) 1024 0 0 1 #t) + (let ((gp-8 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-8 + (let ((t9-26 (method-of-type part-tracker activate))) + (t9-26 (the-as part-tracker gp-8) *entity-pool* 'part-tracker (the-as pointer #x70004000)) + ) + (run-now-in-process gp-8 part-tracker-init (-> *part-group-id-table* 32) -1 #f #f #f (-> self control trans)) + (-> gp-8 ppointer) + ) + ) + ) + ) + (clear-collide-with-as (-> self control)) + (set! (-> self post-hook) target-no-ja-move-post) + (ja-channel-set! 0) + (ja-post) + (let ((gp-9 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-9) 600) + (suspend) + ) + ) + ) + (('endlessfall) + (sound-play-by-name (static-sound-name "death-fall") (new-sound-id) 1024 0 0 1 #t) + (camera-change-to (the-as string cam-endlessfall) 30 #f) + (set! (-> self control pat-ignore-mask unknown-bit) 1) + (set! (-> self water flags) (logand -17 (-> self water flags))) + (let ((f30-2 (fmin -4096.0 (- (-> self control ground-impact-vel))))) + (set! (-> self control unknown-uint20) (the-as uint f30-2)) + (let ((gp-11 (new-stack-vector0))) + (let ((f0-14 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! gp-11 (-> self control transv) (vector-float*! gp-11 (-> self control dynam gravity-normal) f0-14)) + ) + (let* ((f0-15 (vector-length gp-11)) + (f1-6 f0-15) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f30-2) + (vector-float*! gp-11 gp-11 (/ f0-15 f1-6)) + ) + ) + ) + ) + (set! (-> self trans-hook) + (lambda :behavior target + () + (vector-seek! (-> self draw color-mult) *zero-vector* (-> *display* seconds-per-frame)) + (let ((gp-0 (new-stack-vector0)) + (f30-0 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + ) + 0.0 + (vector-! + gp-0 + (-> self control transv) + (vector-float*! gp-0 (-> self control dynam gravity-normal) (the-as float f30-0)) + ) + (let* ((f0-4 (vector-length gp-0)) + (f1-0 f0-4) + ) + (if (< (the-as float (-> self control unknown-uint20)) (the-as float f30-0)) + (set! f30-0 (-> self control unknown-uint20)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f30-0)) + (vector-float*! gp-0 gp-0 (/ f0-4 f1-0)) + ) + ) + ) + ((-> target-hit trans)) + (none) + ) + ) + (target-falling-anim 30 99) + (ja-channel-push! 1 90) + (let ((a0-75 (-> self skel root-channel 0))) + (set! (-> a0-75 frame-group) (the-as art-joint-anim (-> self draw art-group data 43))) + (set! (-> a0-75 param 0) 0.5) + (set! (-> a0-75 frame-num) 0.0) + (joint-control-channel-group! a0-75 (the-as art-joint-anim (-> self draw art-group data 43)) num-func-loop!) + ) + (let ((gp-12 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-12) 240) + (let ((a0-76 (-> self skel root-channel 0))) + (set! (-> a0-76 frame-group) (the-as art-joint-anim (-> self draw art-group data 43))) + (set! (-> a0-76 param 0) 0.5) + (joint-control-channel-group-eval! + a0-76 + (the-as art-joint-anim (-> self draw art-group data 43)) + num-func-loop! + ) + ) + (suspend) + ) + ) + (camera-change-to (the-as string 'base) 0 #f) + ) + (('target-hit-ground-hard) + (set! (-> self control unknown-surface00) *neutral-mods*) + (ja-channel-push! 1 30) + (let ((a0-81 (-> self skel root-channel 0))) + (set! (-> a0-81 frame-group) (the-as art-joint-anim (-> self draw art-group data 77))) + (set! (-> a0-81 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 77)) data 0 length) -1)) + ) + (set! (-> a0-81 param 1) 1.0) + (set! (-> a0-81 frame-num) 0.0) + (joint-control-channel-group! a0-81 (the-as art-joint-anim (-> self draw art-group data 77)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-82 (-> self skel root-channel 0))) + (set! (-> a0-82 param 0) (the float (+ (-> a0-82 frame-group data 0 length) -1))) + (set! (-> a0-82 param 1) 1.0) + (joint-control-channel-group-eval! a0-82 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + (('sharkey) + (send-event self 'dry) + (set! (-> self post-hook) target-no-ja-move-post) + (let ((gp-13 (-> self attack-info attacker))) + (ja-channel-set! 0) + (ja-post) + (while (and (handle->process gp-13) (not (-> self control unknown-spoolanim00))) + (send-event *camera* 'joystick 0.0 0.0) + (suspend) + ) + ) + ) + (('plant-boss) + (set! (-> self trans-hook) #f) + (let ((gp-14 (-> self attack-info attacker)) + (a1-44 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-44 from) self) + (set! (-> a1-44 num-params) 0) + (set! (-> a1-44 message) 'joint) + (let ((s5-5 (the-as int (send-event-function (handle->process gp-14) a1-44)))) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'copy-parent) + (set! (-> self post-hook) target-no-ja-move-post) + (let ((a0-98 (-> self node-list data))) + (set! (-> a0-98 0 param0) nothing) + (set! (-> a0-98 0 param1) #f) + (set! (-> a0-98 0 param2) #f) + ) + (while (and (handle->process gp-14) (not (-> self control unknown-spoolanim00)) (-> self control unknown-int21)) + (let* ((v1-205 (-> (the-as process-drawable (handle->process gp-14)) node-list data s5-5 bone transform)) + (a3-9 (-> self node-list data 0 bone transform)) + (a0-106 (-> v1-205 vector 0 quad)) + (a1-47 (-> v1-205 vector 1 quad)) + (a2-26 (-> v1-205 vector 2 quad)) + (v1-206 (-> v1-205 vector 3 quad)) + ) + (set! (-> a3-9 vector 0 quad) a0-106) + (set! (-> a3-9 vector 1 quad) a1-47) + (set! (-> a3-9 vector 2 quad) a2-26) + (set! (-> a3-9 vector 3 quad) v1-206) + ) + (clone-anim-once gp-14 33 #f "") + (suspend) + 0 + ) + ) + ) + ) + (('burn 'burnup) + (let ((gp-15 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-15 + (let ((t9-52 (method-of-type part-tracker activate))) + (t9-52 (the-as part-tracker gp-15) *entity-pool* 'part-tracker (the-as pointer #x70004000)) + ) + (run-now-in-process + gp-15 + part-tracker-init + (-> *part-group-id-table* 708) + -1 + #f + #f + #f + (-> self control trans) + ) + (-> gp-15 ppointer) + ) + ) + (target-death-anim (the-as spool-anim #f)) + ) + (else + (case arg0 + (('tar) + (sound-play-by-name (static-sound-name "death-drown") (new-sound-id) 1024 0 0 1 #t) + ) + ) + (+! (-> *game-info* death-movie-tick) 1) + (if (= (death-movie-remap (+ (-> *game-info* death-movie-tick) -1) (-> *death-spool-array* length)) + (death-movie-remap (-> *game-info* death-movie-tick) (-> *death-spool-array* length)) + ) + (+! (-> *game-info* death-movie-tick) 1) + ) + (let ((gp-18 + (-> *death-spool-array* (death-movie-remap (-> *game-info* death-movie-tick) (-> *death-spool-array* length))) + ) + ) + (set-setting! *setting-control* self 'allow-progress #f (the-as float 0.0) 0) + (target-death-anim gp-18) + (when (and + (< (rand-vu-int-count (-> *game-info* death-movie-tick)) (* (-> *death-spool-array* length) 2)) + (zero? (logand (-> self water flags) 512)) + (!= (-> self control ground-pat material) 9) + (!= (-> self control ground-pat material) 10) + ) + (iterate-process-tree + *entity-pool* + (lambda :behavior target + ((arg0 process)) + (if (and + (logtest? (process-mask enemy) (-> arg0 mask)) + (type-type? (-> arg0 type) process-drawable) + (nonzero? (-> (the-as process-drawable arg0) root)) + (< (vector-vector-distance (-> (the-as process-drawable arg0) root trans) (-> *target* control trans)) + 61440.0 + ) + ) + (process-entity-status! arg0 (entity-perm-status bit-9) #t) + ) + ) + *null-kernel-context* + ) + (set! (-> *ACTOR-bank* birth-max) 1000) + (set! (-> self trans-hook) #f) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) + (send-event (ppointer->process (-> self sidekick)) 'shadow #f) + (send-event self 'blend-shape #t) + (let* ((s5-7 (get-process *default-dead-pool* pov-camera #x4000)) + (s5-8 + (ppointer->handle + (when s5-7 + (let ((t9-68 (method-of-type pov-camera activate))) + (t9-68 (the-as pov-camera s5-7) *target-pool* 'pov-camera (the-as pointer #x70004000)) + ) + (run-now-in-process s5-7 pov-camera-init-by-other (-> self control trans) *deathcam-sg* gp-18 4 self '()) + (-> s5-7 ppointer) + ) + ) + ) + ) + (send-event (handle->process s5-8) 'music-movie-volume 0.0) + (send-event (handle->process s5-8) 'sfx-movie-volume 50.0) + (set! (-> self post-hook) target-no-ja-move-post) + (while (not (-> self control unknown-spoolanim00)) + (spool-push *art-control* (-> gp-18 name) 0 self (the-as float -99.0)) + (clone-anim-once s5-8 33 #f "") + (suspend) + ) + (let ((a0-155 (handle->process s5-8))) + (if a0-155 + (deactivate a0-155) + ) + ) + ) + (send-event (ppointer->process (-> self sidekick)) 'shadow #t) + (suspend) + 0 + ) + ) + ) + ) + (set! (-> self control transv quad) (the-as uint128 0)) + (initialize! (-> self game) 'dead (the-as game-save #f) (the-as string #f)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (anim-loop) + (none) + ) + :post + target-no-stick-post + ) + + + + diff --git a/goal_src/engine/target/target-h.gc b/goal_src/engine/target/target-h.gc index 39901bf6d1..5e069942bf 100644 --- a/goal_src/engine/target/target-h.gc +++ b/goal_src/engine/target/target-h.gc @@ -47,6 +47,9 @@ ;; NOTE - for logic-target - defined in sidekick (declare-type sidekick process-drawable) +;; NOTE - for target-death +(define-extern start-sequence-a (function none)) ;; not confirmed + ;; DECOMP BEGINS (deftype target (process-drawable) diff --git a/goal_src/levels/flut_common/target-flut.gc b/goal_src/levels/flut_common/target-flut.gc index 96970eaaa2..3ee1b01f2f 100644 --- a/goal_src/levels/flut_common/target-flut.gc +++ b/goal_src/levels/flut_common/target-flut.gc @@ -5,3 +5,2805 @@ ;; name in dgo: target-flut ;; dgos: L1, SNO, SWA +(define-extern target-flut-stance (state target)) ;; unknown type +(define-extern target-flut-grab (state target)) ;; unknown type +(define-extern target-flut-clone-anim (state handle target)) ;; unknown type +(define-extern target-flut-get-off-hit-ground (state symbol target)) ;; unknown type +(define-extern target-flut-get-off-jump (state handle target)) ;; unknown type +(define-extern target-flut-death (state symbol target)) ;; unknown type +(define-extern target-flut-hit-ground (state target)) ;; unknown type +(define-extern target-flut-air-attack-hit-ground (state target)) ;; unknown type +(define-extern target-flut-jump (state float float target)) ;; unknown type +(define-extern target-flut-falling (state target)) ;; unknown type +(define-extern target-flut-hit (state symbol attack-info target)) ;; unknown type +(define-extern target-flut-walk (state target)) ;; unknown type +(define-extern target-flut-air-attack (state float target)) ;; unknown type +(define-extern target-flut-double-jump (state float float target)) ;; unknown type +(define-extern target-flut-running-attack (state target)) ;; unknown type +(define-extern target-flut-get-on (state handle target)) ;; unknown type +(define-extern target-flut-get-off (state handle target)) ;; unknown type + +(define-extern target-flut-falling-anim-trans (function none :behavior target)) + +;; DECOMP BEGINS + +(deftype flut-info (basic) + ((entity basic :offset-assert 4) + (flut-trans vector :inline :offset-assert 16) + (flut-quat vector :inline :offset-assert 32) + (flut-scale vector :inline :offset-assert 48) + (stick-lock basic :offset-assert 64) + (flap-sound-id sound-id :offset-assert 68) + ) + :method-count-assert 9 + :size-assert #x48 + :flag-assert #x900000048 + ) + + +(deftype flut-bank (basic) + ((jump-height-min meters :offset-assert 4) + (jump-height-max meters :offset-assert 8) + (double-jump-height-min meters :offset-assert 12) + (double-jump-height-max meters :offset-assert 16) + (air-attack-speed meters :offset-assert 20) + (ground-timeout int64 :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + + +(define *FLUT-bank* (new 'static 'flut-bank + :jump-height-min (meters 5.0) + :jump-height-max (meters 7.0) + :double-jump-height-min (meters 1.0) + :double-jump-height-max (meters 2.0) + :air-attack-speed (meters 20.0) + :ground-timeout #x96 + ) + ) + +(define *flut-walk-mods* (new 'static 'surface + :name 'run + :turnv 54613.332 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 81920.0 + :target-speed 81920.0 + :seek0 1.5 + :seek90 3.0 + :seek180 2.0 + :fric 1.0 + :nonlin-fric-dist 0.1 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :flags #x8 + ) + ) + +(define *flut-jump-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 54613.332 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 81920.0 + :target-speed 81920.0 + :seek0 0.9 + :seek90 1.5 + :seek180 1.5 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags #x800 + ) + ) + +(define *flut-double-jump-mods* (new 'static 'surface + :name 'jump-double + :turnv 131072.0 + :turnvv 54613.332 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 81920.0 + :target-speed 81920.0 + :seek0 0.9 + :seek90 1.5 + :seek180 1.5 + :fric 0.1 + :nonlin-fric-dist 10.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags #x800 + ) + ) + +(define *flut-run-attack-mods* (new 'static 'surface + :name 'wheel-flip + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 122880.0 + :target-speed 122880.0 + :seek90 0.5 + :seek180 0.15 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + :flags #x1018 + ) + ) + +(define *flut-air-attack-mods* (new 'static 'surface + :name 'flop + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 122880.0 + :target-speed 122880.0 + :seek0 1.0 + :seek90 0.3 + :seek180 1.5 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + :flags #x1800 + ) + ) + +(defbehavior target-flut-post-post target () + (vector+! (-> self flut flut-trans) (-> self control trans) (-> self control unknown-vector12)) + (quaternion-copy! (the-as quaternion (-> self flut flut-quat)) (-> self control quat)) + (set! (-> self flut flut-scale quad) (-> self control scale quad)) + (let ((v1-8 (-> *target-shadow-control* settings shadow-dir quad))) + (set! (-> *flutflut-shadow-control* settings shadow-dir quad) v1-8) + ) + 0 + (none) + ) + +(defbehavior target-flut-post target () + (target-post) + (target-flut-post-post) + 0 + (none) + ) + +;; ERROR: function was not converted to expressions. Cannot decompile. + +(defbehavior target-flut-hit-ground-anim target () + (cond + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 144) + ) + (if (!= (-> self skel root-channel 0) (-> self skel channel)) + (ja-channel-push! 2 15) + (ja-channel-set! 2) + ) + (let ((gp-0 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-0 + (the-as art-joint-anim (-> self draw art-group data 145)) + num-func-identity + ) + (set! (-> gp-0 frame-num) 0.0) + ) + (let ((gp-1 (-> self skel root-channel 1))) + (joint-control-channel-group-eval! + gp-1 + (the-as art-joint-anim (-> self draw art-group data 148)) + num-func-identity + ) + (set! (-> gp-1 frame-num) 0.0) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-11 (-> self skel root-channel 0))) + (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) + (set! (-> a0-11 param 1) 1.0) + (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) + ) + (let ((a0-12 (-> self skel root-channel 1))) + (set! (-> a0-12 param 0) 0.0) + (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) + ) + ) + #f + ) + ((let ((v1-33 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or (= v1-33 (-> self draw art-group data 143)) (= v1-33 (-> self draw art-group data 145))) + ) + #f + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 149) + ) + (ja-channel-set! 1) + (let ((a0-26 (-> self skel root-channel 0))) + (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> self draw art-group data 145))) + (set! (-> a0-26 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 145)) data 0 length) -1)) + ) + (set! (-> a0-26 param 1) 1.0) + (set! (-> a0-26 frame-num) 0.0) + (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> self draw art-group data 145)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-27 (-> self skel root-channel 0))) + (set! (-> a0-27 param 0) (the float (+ (-> a0-27 frame-group data 0 length) -1))) + (set! (-> a0-27 param 1) 1.0) + (joint-control-channel-group-eval! a0-27 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + #f + ) + ((let ((v1-68 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or (= v1-68 (-> self draw art-group data 152)) (= v1-68 (-> self draw art-group data 153))) + ) + (ja-channel-set! 1) + (let ((a0-37 (-> self skel root-channel 0))) + (set! (-> a0-37 frame-group) (the-as art-joint-anim (-> self draw art-group data 154))) + (set! (-> a0-37 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 154)) data 0 length) -1)) + ) + (set! (-> a0-37 param 1) 1.0) + (set! (-> a0-37 frame-num) 0.0) + (joint-control-channel-group! a0-37 (the-as art-joint-anim (-> self draw art-group data 154)) num-func-seek!) + ) + (until (ja-done? 0) + (TODO-RENAME-9 (-> self align)) + (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (suspend) + (let ((a0-40 (-> self skel root-channel 0))) + (set! (-> a0-40 param 0) (the float (+ (-> a0-40 frame-group data 0 length) -1))) + (set! (-> a0-40 param 1) 1.0) + (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + #f + ) + ) + ) + +(defbehavior target-flut-standard-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + 'flut + ) + (else + (case arg2 + (('end-mode) + (go target-flut-get-off (process->handle arg0)) + ) + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as process (-> arg3 param 0)) + (the-as (state handle attack-info target) target-flut-hit) + ) + ) + (('shove) + (when (!= (-> self next-state name) 'target-hit) + (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 104) + (when (zero? (logand (-> self attack-info-rec mask) 8)) + (set! (-> self attack-info-rec attacker) (process->handle arg0)) + (logior! (-> self attack-info-rec mask) 8) + ) + (go target-flut-hit 'shove (-> self attack-info-rec)) + ) + ) + (('falling) + (when #t + enter-state + (go target-flut-falling) + ) + ) + (('swim) + (let* ((gp-1 (-> self control unknown-vector54)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) gp-1 (-> self control trans))) + (f30-1 (fmax 8192.0 (fmin 40960.0 (vector-xz-length s3-1)))) + ) + (vector-xz-normalize! s3-1 f30-1) + (let ((s5-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> s5-0 from) self) + (set! (-> s5-0 num-params) 2) + (set! (-> s5-0 message) 'shove) + (set! (-> s5-0 param 0) (the-as uint #f)) + (let ((s4-0 (new 'static 'attack-info :mask #x882))) + (set! (-> s4-0 vector quad) (-> s3-1 quad)) + (set! (-> s4-0 shove-up) + (+ (lerp-scale (the-as float 4096.0) (the-as float 16384.0) f30-1 (the-as float 4096.0) (the-as float 40960.0)) + (fmax 0.0 (- (-> gp-1 y) (-> self control trans y))) + ) + ) + (set! (-> s4-0 angle) 'up) + (set! (-> s5-0 param 1) (the-as uint s4-0)) + ) + (send-event-function self s5-0) + ) + ) + ) + (('change-mode) + (case (-> arg3 param 0) + (('grab) + (go target-flut-grab) + ) + ) + ) + (('clone-anim) + (go target-flut-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + (else + (target-generic-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + +(defbehavior target-flut-dangerous-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('touched) + (if ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 224) + ) + (target-send-attack + arg0 + (the-as uint (-> self control unknown-symbol30)) + (-> arg3 param 0) + (-> self control unknown-dword50) + (-> self control unknown-dword51) + ) + (target-flut-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as process (-> arg3 param 0)) + (the-as (state handle attack-info target) target-flut-hit) + ) + ) + (else + (target-flut-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + +(defstate target-flut-start (target) + :event + target-flut-standard-event-handler + :exit + (behavior () + (when (not + (or + (= (-> self next-state name) 'target-flut-stance) + (= (-> self next-state name) 'target-flut-walk) + (= (-> self next-state name) 'target-flut-jump) + (= (-> self next-state name) 'target-flut-double-jump) + (= (-> self next-state name) 'target-flut-hit-ground) + (= (-> self next-state name) 'target-flut-falling) + (= (-> self next-state name) 'target-flut-running-attack) + (= (-> self next-state name) 'target-flut-air-attack) + (= (-> self next-state name) 'target-flut-air-attack-hit-ground) + (= (-> self next-state name) 'target-flut-hit) + (= (-> self next-state name) 'target-flut-death) + (= (-> self next-state name) 'target-flut-get-on) + (= (-> self next-state name) 'target-flut-get-off) + (= (-> self next-state name) 'target-flut-get-off-jump) + (= (-> self next-state name) 'target-flut-grab) + (= (-> self next-state name) 'target-flut-clone-anim) + ) + ) + (let ((v1-33 (-> self manipy))) + (when v1-33 + (deactivate (-> v1-33 0)) + (set! (-> self manipy) (the-as (pointer manipy) #f)) + ) + ) + (set! (-> self control root-prim prim-core action) + (logand -16385 (-> self control root-prim prim-core action)) + ) + (set! (-> self control unknown-surface00) *walk-mods*) + (set! (-> self state-flags) (logand -1025 (-> self state-flags))) + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (target-collide-set! 'normal (-> (new 'static 'array float 1 0.0) 0)) + (set! (-> self control reaction) target-collision-reaction) + (set! (-> self control unknown-vector12 quad) (the-as uint128 0)) + (clear-pending-settings-from-process *setting-control* self 'sound-flava) + (target-exit) + ) + (none) + ) + :code + (behavior ((arg0 handle)) + (target-exit) + (set! *display-profile* #f) + (set! *display-entity-errors* #f) + (set-setting! *setting-control* self 'sound-flava #f (the-as float 30.0) 2) + (if (zero? (-> self flut)) + (set! (-> self flut) (new 'process 'flut-info)) + ) + (set! (-> self flut stick-lock) #f) + (set! (-> self flut flap-sound-id) (new-sound-id)) + (set! (-> self flut entity) #f) + (let ((v1-11 (handle->process arg0))) + (if v1-11 + (set! (-> self flut entity) (-> v1-11 entity)) + ) + ) + (target-collide-set! 'flut (-> (new 'static 'array float 1 0.0) 0)) + (set! (-> self control transv quad) (the-as uint128 0)) + (set! (-> self control unknown-float01) 0.0) + (logior! (-> self control root-prim prim-core action) #x4000) + (let ((s5-0 (-> self entity))) + (set! (-> self entity) (the-as entity (-> self flut entity))) + (let ((s4-0 (get-process *default-dead-pool* manipy #x4000))) + (set! (-> self manipy) + (the-as (pointer manipy) (when s4-0 + (let ((t9-6 (method-of-type manipy activate))) + (t9-6 (the-as manipy s4-0) self 'manipy (the-as pointer #x70004000)) + ) + (run-now-in-process + s4-0 + manipy-init + (-> self control trans) + (-> self entity) + *flutflut-sg* + 'collide-shape-moving + ) + (-> s4-0 ppointer) + ) + ) + ) + ) + (set! (-> self entity) s5-0) + ) + (when (-> self manipy) + (send-event + (ppointer->process (-> self manipy)) + 'trans-hook + (lambda :behavior flutflut + () + (let* ((a0-0 (-> self parent-override)) + (v1-0 (if a0-0 + (-> a0-0 0 self-override) + ) + ) + ) + (set! (-> self root-override trans quad) (-> v1-0 flut flut-trans quad)) + (let ((a0-4 (-> v1-0 flut flut-quat quad))) + (set! (-> self root-override quat vec quad) a0-4) + ) + (set! (-> self root-override scale quad) (-> v1-0 flut flut-scale quad)) + (set! (-> self root-override ground-pat material) (the-as int (-> v1-0 control ground-pat material))) + (set! (-> self draw light-index) (the-as uint 255)) + (let ((a0-13 (-> v1-0 draw color-mult quad))) + (set! (-> self draw color-mult quad) a0-13) + ) + (let ((a0-15 (-> v1-0 draw color-emissive quad))) + (set! (-> self draw color-emissive quad) a0-15) + ) + (let ((f0-0 (-> v1-0 draw secondary-interp))) + (set! (-> self draw secondary-interp) f0-0) + f0-0 + ) + ) + ) + ) + (send-event (ppointer->process (-> self manipy)) 'anim-mode 'loop) + (send-event + (ppointer->process (-> self manipy)) + 'art-joint-anim + "flut-get-on" + (-> (new 'static 'array float 1 0.0) 0) + ) + (send-event (ppointer->process (-> self manipy)) 'blend-shape #t) + (send-event + (ppointer->process (-> self manipy)) + 'eval + (lambda :behavior target + () + (set! (-> self attack-info intersection z) (the-as float #f)) + (let ((v1-1 (-> *target-shadow-control* settings shadow-dir quad))) + (set! (-> *flutflut-shadow-control* settings shadow-dir quad) v1-1) + ) + (let ((v0-0 *flutflut-shadow-control*)) + (set! (-> self draw shadow-ctrl) v0-0) + v0-0 + ) + ) + ) + ) + (remove-exit) + (go target-flut-get-on arg0) + (none) + ) + :post + (the-as (function none :behavior target) target-post) + ) + +(defstate target-flut-stance (target) + :event + target-flut-standard-event-handler + :enter + (behavior () (set! (-> self control unknown-surface00) *flut-walk-mods*) (none)) + :exit + (-> target-flut-start exit) + :trans + (behavior () + (if (move-legs?) + (go target-flut-walk) + ) + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (go target-flut-jump (-> *FLUT-bank* jump-height-min) (-> *FLUT-bank* jump-height-max)) + ) + (if (can-hands? #t) + (go target-flut-running-attack) + ) + (when (and + (zero? (logand (-> self control status) 1)) + (and + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-37 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or + (not (or + (= v1-37 (-> self draw art-group data 59)) + (= v1-37 (-> self draw art-group data 60)) + (= v1-37 (-> self draw art-group data 61)) + ) + ) + (< 4096.0 (target-height-above-ground)) + ) + ) + ) + ) + enter-state + (go target-flut-falling) + ) + (none) + ) + :code + (behavior () + (let ((gp-0 22)) + (let ((v1-2 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((or (= v1-2 (-> self draw art-group data 141)) (= v1-2 (-> self draw art-group data 161))) + (set! gp-0 60) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 155) + ) + (let ((a0-11 (-> self skel root-channel 0))) + (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) + (set! (-> a0-11 param 1) 1.0) + (joint-control-channel-group! a0-11 (the-as art-joint-anim #f) num-func-seek!) + ) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 158) + ) + (let ((a0-17 (-> self skel root-channel 0))) + (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 159))) + (set! (-> a0-17 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 159)) data 0 length) -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 159)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-18 (-> self skel root-channel 0))) + (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) + (set! (-> a0-18 param 1) 1.0) + (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 150) + ) + (let ((a0-24 (-> self skel root-channel 0))) + (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> self draw art-group data 151))) + (set! (-> a0-24 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 151)) data 0 length) -1)) + ) + (set! (-> a0-24 param 1) 1.0) + (set! (-> a0-24 frame-num) 0.0) + (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> self draw art-group data 151)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-25 (-> self skel root-channel 0))) + (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) + (set! (-> a0-25 param 1) 1.0) + (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + ) + (if (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 140) + ) + ) + (ja-channel-push! 1 gp-0) + ) + ) + (let ((v1-91 (-> self skel root-channel 0))) + (set! (-> v1-91 frame-group) (the-as art-joint-anim (-> self draw art-group data 140))) + ) + (while #t + (suspend) + (let ((a0-35 (-> self skel root-channel 0))) + (set! (-> a0-35 param 0) 1.0) + (joint-control-channel-group-eval! a0-35 (the-as art-joint-anim #f) num-func-loop!) + ) + ) + (none) + ) + :post + target-flut-post + ) + +(defstate target-flut-walk (target) + :event + target-flut-standard-event-handler + :enter + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (set! (-> self control unknown-surface00) *flut-walk-mods*) + (set! (-> self control unknown-uint20) (the-as uint (-> self control unknown-surface00 turnv))) + (set! (-> self control unknown-int21) (the-as int (-> self control unknown-surface00 target-speed))) + (none) + ) + :exit + (behavior () + (set! (-> self control unknown-surface00 turnv) (the-as float (-> self control unknown-uint20))) + (set! (-> self control unknown-surface00 target-speed) (the-as float (-> self control unknown-uint30))) + ((-> target-flut-start exit)) + (none) + ) + :trans + (behavior () + (if (not (move-legs?)) + (go target-flut-stance) + ) + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (go target-flut-jump (-> *FLUT-bank* jump-height-min) (-> *FLUT-bank* jump-height-max)) + ) + (if (can-hands? #t) + (go target-flut-running-attack) + ) + (when (and + (zero? (logand (-> self control status) 1)) + (and + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-37 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or + (not (or + (= v1-37 (-> self draw art-group data 59)) + (= v1-37 (-> self draw art-group data 60)) + (= v1-37 (-> self draw art-group data 61)) + ) + ) + (< 4096.0 (target-height-above-ground)) + ) + ) + ) + ) + enter-state + (go target-flut-falling) + ) + (let ((f30-1 (fabs (deg-diff (quaternion-y-angle (-> self control dir-targ)) (y-angle (-> self control)))))) + (set! (-> self control unknown-surface00 turnv) (lerp-scale + (the-as float (-> self control unknown-uint20)) + (* 4.0 (the-as float (-> self control unknown-uint20))) + f30-1 + (the-as float 8192.0) + (the-as float 21845.334) + ) + ) + (if (and (= (-> self control surf name) '*tar-surface*) (< 8192.0 f30-1)) + (set! (-> self control unknown-surface00 target-speed) (seek + (-> self control unknown-surface00 target-speed) + (the-as float 4096.0) + (* 245760.0 (-> *display* seconds-per-frame)) + ) + ) + (set! (-> self control unknown-surface00 target-speed) (seek + (-> self control unknown-surface00 target-speed) + (the-as float (-> self control unknown-uint30)) + (* 81920.0 (-> *display* seconds-per-frame)) + ) + ) + ) + ) + (none) + ) + :code + (behavior () + (let ((f28-0 0.0) + (f30-0 0.0) + ) + (let ((gp-0 22)) + (cond + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 140) + ) + (set! gp-0 60) + ) + ((let ((v1-9 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or + (= v1-9 (-> self draw art-group data 143)) + (= v1-9 (-> self draw art-group data 144)) + (= v1-9 (-> self draw art-group data 152)) + (= v1-9 (-> self draw art-group data 154)) + ) + ) + (ja-channel-push! 1 24) + (let ((a0-18 (-> self skel root-channel 0))) + (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 161))) + (set! (-> a0-18 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 161)) data 0 length) -1)) + ) + (set! (-> a0-18 param 1) 1.0) + (set! (-> a0-18 frame-num) 0.0) + (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 161)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-19 (-> self skel root-channel 0))) + (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) + (set! (-> a0-19 param 1) 1.0) + (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + (set! f30-0 (cond + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 161) + ) + (ja-channel-set! 2) + 1.0 + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 141) + ) + (set! f28-0 (ja-frame-num 0)) + (-> self skel root-channel 1 frame-interp) + ) + (else + (ja-channel-push! 2 gp-0) + f30-0 + ) + ) + ) + ) + (let ((a0-32 (-> self skel root-channel 0))) + (set! (-> a0-32 dist) 49152.0) + (set! (-> a0-32 frame-group) (the-as art-joint-anim (-> self draw art-group data 141))) + (set! (-> a0-32 param 0) 1.0) + (set! (-> a0-32 frame-num) f28-0) + (joint-control-channel-group! a0-32 (the-as art-joint-anim (-> self draw art-group data 141)) num-func-loop!) + ) + (let ((gp-1 (-> self skel root-channel 1))) + (set! (-> gp-1 frame-interp) f30-0) + (set! (-> gp-1 dist) 40960.0) + (joint-control-channel-group! + gp-1 + (the-as art-joint-anim (-> self draw art-group data 142)) + num-func-identity + ) + (set! (-> gp-1 frame-num) (* 0.5 f28-0)) + ) + (while #t + (suspend) + (let ((f0-13 (lerp-scale + (-> (new 'static 'array float 1 0.0) 0) + (the-as float 1.0) + (-> self control unknown-float01) + (the-as float 49152.0) + (the-as float 77824.0) + ) + ) + ) + (set! f30-0 (seek f30-0 f0-13 (* 4.0 (-> *display* seconds-per-frame)))) + ) + (set! (-> self skel root-channel 1 frame-interp) f30-0) + (let* ((f0-16 (dummy-9 (-> self skel))) + (f0-18 (/ (* 58.0 (-> self control unknown-float01)) (* 60.0 f0-16))) + ) + (if (= (-> self control surf name) '*tar-surface*) + (set! f0-18 (* 0.4 (-> self control unknown-float12))) + ) + (let ((a0-40 (-> self skel root-channel 0))) + (set! (-> a0-40 param 0) f0-18) + (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-loop!) + ) + ) + (let ((gp-2 (-> self skel root-channel 1))) + (set! (-> gp-2 num-func) num-func-identity) + (set! (-> gp-2 frame-num) (* 0.5 (ja-frame-num 0))) + ) + (let ((f0-22 (ja-aframe-num 0))) + (cond + ((and (>= (-> self skel effect last-frame-num) 20.0) (< f0-22 20.0)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 51 120) + ) + ((and (< (-> self skel effect last-frame-num) 12.0) (>= f0-22 12.0)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 51 120) + ) + ) + ) + ) + ) + (none) + ) + :post + target-flut-post + ) + +(defstate target-flut-jump (target) + :event + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (when (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) + ) + (< 0.0 + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> self control trans-old)) (-> self control trans)) + ) + ) + ) + (send-event arg0 'bonk (-> arg3 param 0) (-> self control ground-impact-vel)) + (when (target-send-attack + arg0 + (the-as uint 'flut-bonk) + (-> arg3 param 0) + (-> self control unknown-dword50) + (-> self control unknown-dword51) + ) + ) + ) + (case arg2 + (('jump) + (go target-flut-jump (the-as float (-> arg3 param 0)) (the-as float (-> arg3 param 0))) + ) + (else + (target-flut-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter + (behavior ((arg0 float) (arg1 float)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 -762 0 1 #t) + (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) + (set! (-> self control status) (logand -8 (-> self control status))) + (set! (-> self control unknown-surface00) *flut-jump-mods*) + (set! (-> self control unknown-float123) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float01))))) + ) + (set! (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + ) + (none) + ) + :exit + (behavior () (target-exit) ((-> target-flut-start exit)) (none)) + :trans + (behavior () + (set! (-> self control unknown-float123) + (fmax + (-> self control unknown-float123) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6))) + ) + ) + (if (logtest? (-> self control status) 1) + (go target-flut-hit-ground) + ) + (if (and + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (pad-buttons x)) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 40960.0) + (and + (zero? (logand (-> self water flags) 512)) + (zero? (logand (-> self state-flags) 2048)) + (< 4096.0 (target-height-above-ground)) + ) + ) + (go target-flut-double-jump (-> *FLUT-bank* double-jump-height-min) (-> *FLUT-bank* double-jump-height-max)) + ) + (if (and + (logtest? + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons square) + ) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 61440.0) + (and + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) + (the-as int (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) 4096)) + (zero? (logand (-> self control unknown-surface01 flags) 384)) + ) + ) + (go target-flut-air-attack (-> *FLUT-bank* air-attack-speed)) + ) + (when (if (and + (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) + (and + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) + (not + (and + *cheat-mode* + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + ) + ) + ) + #t + ) + (logior! (-> self control status) 1) + enter-state + 'stuck + (go target-flut-hit-ground) + ) + (mod-var-jump + #t + #t + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) + (-> self control transv) + ) + (set! (-> self control unknown-float122) + (seek + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) + ) + (none) + ) + :code + (behavior ((arg0 float) (arg1 float)) + (ja-channel-push! 2 36) + (let ((gp-0 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-0 + (the-as art-joint-anim (-> self draw art-group data 143)) + num-func-identity + ) + (set! (-> gp-0 frame-num) 0.0) + ) + (let ((a0-3 (-> self skel root-channel 1))) + (set! (-> a0-3 frame-interp) (-> self control unknown-float122)) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 146))) + (set! (-> a0-3 param 0) 0.0) + (joint-control-channel-group-eval! + a0-3 + (the-as art-joint-anim (-> self draw art-group data 146)) + num-func-chan + ) + ) + (suspend) + (let ((a0-4 (-> self skel root-channel 0))) + (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 143))) + (set! (-> a0-4 param 0) 1.0) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim (-> self draw art-group data 143)) num-func-+!) + ) + (let ((a0-5 (-> self skel root-channel 1))) + (set! (-> a0-5 frame-interp) (-> self control unknown-float122)) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 146))) + (set! (-> a0-5 param 0) 0.0) + (joint-control-channel-group-eval! + a0-5 + (the-as art-joint-anim (-> self draw art-group data 146)) + num-func-chan + ) + ) + (suspend) + (until (ja-done? 0) + (let ((f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f0-10 (/ (- 10.0 (ja-aframe-num 0)) (* (ja-step 0) (ja-speed 0)))) + (gp-1 (-> self skel root-channel 0)) + ) + (set! (-> gp-1 param 0) (the float (+ (-> gp-1 frame-group data 0 length) -1))) + (let ((v1-45 (and (< 0.0 f30-0) (< 0.0 f0-10)))) + (set! (-> gp-1 param 1) + (the-as + float + (if v1-45 + (fmin (fmin 3.0 f0-10) (/ (* 5.0 f0-10) (the float (time-to-apex f30-0 (the-as float -245760.0))))) + 1.0 + ) + ) + ) + ) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) + ) + (let ((a0-12 (-> self skel root-channel 1))) + (set! (-> a0-12 frame-interp) (-> self control unknown-float122)) + (set! (-> a0-12 param 0) 0.0) + (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) + ) + (suspend) + ) + (let ((a0-14 (-> self skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) + (set! (-> a0-14 param 0) 1.0) + (set! (-> a0-14 frame-num) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 144)) num-func-loop!) + ) + (let ((a0-15 (-> self skel root-channel 1))) + (set! (-> a0-15 frame-interp) (-> self control unknown-float122)) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 147))) + (set! (-> a0-15 param 0) 0.0) + (joint-control-channel-group-eval! + a0-15 + (the-as art-joint-anim (-> self draw art-group data 147)) + num-func-chan + ) + ) + (while #t + (suspend) + (let ((a0-16 (-> self skel root-channel 0))) + (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) + (set! (-> a0-16 param 0) 1.0) + (joint-control-channel-group-eval! + a0-16 + (the-as art-joint-anim (-> self draw art-group data 144)) + num-func-loop! + ) + ) + (let ((a0-17 (-> self skel root-channel 1))) + (set! (-> a0-17 frame-interp) (-> self control unknown-float122)) + (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 147))) + (set! (-> a0-17 param 0) 0.0) + (joint-control-channel-group-eval! + a0-17 + (the-as art-joint-anim (-> self draw art-group data 147)) + num-func-chan + ) + ) + ) + (none) + ) + :post + target-flut-post + ) + +(defstate target-flut-double-jump (target) + :event + (-> target-flut-jump event) + :enter + (behavior ((arg0 float) (arg1 float)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) + (set! (-> self control dynam gravity-max) 40960.0) + (set! (-> self control dynam gravity-length) 245760.0) + (set! (-> self control status) (logand -8 (-> self control status))) + (set! (-> self control unknown-surface00) *flut-double-jump-mods*) + (none) + ) + :exit + (behavior () + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (target-exit) + ((-> target-flut-start exit)) + (none) + ) + :trans + (behavior () + (if (logtest? (-> self control status) 1) + (go target-flut-hit-ground) + ) + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons square) + ) + (and + (zero? (logand (-> self state-flags) 4096)) + (zero? (logand (-> self control unknown-surface01 flags) 384)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) + (the-as int (-> *TARGET-bank* stuck-timeout)) + ) + (< 4096.0 (target-height-above-ground)) + ) + ) + (go target-flut-air-attack (-> *FLUT-bank* air-attack-speed)) + ) + (if (!= (-> self state-time) (-> *display* base-frame-counter)) + (mod-var-jump + #t + #t + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) + (-> self control transv) + ) + ) + (if (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 149) + ) + (sound-play-by-name (static-sound-name "flut-flap") (-> self flut flap-sound-id) 1024 0 0 1 #t) + ) + (set! (-> self control unknown-float122) + (seek + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) + ) + (none) + ) + :code + (behavior ((arg0 float) (arg1 float)) + (ja-channel-push! 1 15) + (let ((a0-2 (-> self skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 149))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 149)) data 0 length) -1)) + ) + (set! (-> a0-2 param 1) 1.0) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 149)) num-func-seek!) + ) + (until (ja-done? 0) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 3 30) + (suspend) + (let ((a0-4 (-> self skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) + (set! (-> a0-4 param 1) 1.0) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (set! (-> self control unknown-surface00) *flut-jump-mods*) + (dotimes (gp-0 1) + (let ((s5-0 (-> self skel root-channel 0))) + (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 149))) + (set! (-> s5-0 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 149)) data 0 length) -1)) + ) + (set! (-> s5-0 param 1) 1.0) + (set! (-> s5-0 frame-num) (ja-aframe (the-as float 14.0) 0)) + (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 149)) num-func-seek!) + ) + (until (ja-done? 0) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 3 30) + (suspend) + (let ((a0-10 (-> self skel root-channel 0))) + (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) + (set! (-> a0-10 param 1) 1.0) + (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + (while (< 8192.0 (target-height-above-ground)) + (suspend) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 3 30) + (let ((a0-13 (-> self skel root-channel 0))) + (set! (-> a0-13 param 0) 1.0) + (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-loop!) + ) + (when (< (ja-aframe-num 0) 14.0) + (let ((gp-1 (-> self skel root-channel 0))) + (set! (-> gp-1 num-func) num-func-identity) + (set! (-> gp-1 frame-num) (ja-aframe (the-as float 14.0) 0)) + ) + ) + (set! (-> self control dynam gravity-max) (seek + (-> self control dynam gravity-max) + (-> self control unknown-dynamics00 gravity-max) + (* 163840.0 (-> *display* seconds-per-frame)) + ) + ) + (set! (-> self control dynam gravity-length) (seek + (-> self control dynam gravity-length) + (-> self control unknown-dynamics00 gravity-length) + (* 163840.0 (-> *display* seconds-per-frame)) + ) + ) + ) + (-> *display* base-frame-counter) + (ja-channel-push! 2 30) + (let ((a0-19 (-> self skel root-channel 0))) + (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) + (set! (-> a0-19 param 0) 1.0) + (set! (-> a0-19 frame-num) 0.0) + (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 144)) num-func-loop!) + ) + (let ((gp-2 (-> self skel root-channel 1))) + (set! (-> gp-2 frame-interp) (-> self control unknown-float122)) + (joint-control-channel-group-eval! + gp-2 + (the-as art-joint-anim (-> self draw art-group data 147)) + num-func-identity + ) + (set! (-> gp-2 frame-num) 0.0) + ) + (while #t + (suspend) + (set! (-> self control dynam gravity-max) (seek + (-> self control dynam gravity-max) + (-> self control unknown-dynamics00 gravity-max) + (* 163840.0 (-> *display* seconds-per-frame)) + ) + ) + (set! (-> self control dynam gravity-length) (seek + (-> self control dynam gravity-length) + (-> self control unknown-dynamics00 gravity-length) + (* 163840.0 (-> *display* seconds-per-frame)) + ) + ) + (let ((a0-23 (-> self skel root-channel 0))) + (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) + (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-loop!) + ) + (let ((a0-24 (-> self skel root-channel 1))) + (set! (-> a0-24 frame-interp) (-> self control unknown-float122)) + (set! (-> a0-24 param 0) 0.0) + (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (none) + ) + :post + target-flut-post + ) + +(defstate target-flut-hit-ground (target) + :event + target-flut-standard-event-handler + :enter + (behavior () + (target-land-effect) + (if (< 40960.0 (-> self control ground-impact-vel)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 60) + ) + (set! (-> self control unknown-dword31) 0) + (set! (-> self control unknown-dword33) 0) + (set! (-> self control unknown-surface00) *flut-walk-mods*) + (none) + ) + :exit + (-> target-flut-start exit) + :trans + (behavior () + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (go target-flut-jump (-> *FLUT-bank* jump-height-min) (-> *FLUT-bank* jump-height-max)) + ) + (if (move-legs?) + (go target-flut-walk) + ) + (when (and + (zero? (logand (-> self control status) 1)) + (and + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-34 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or + (not (or + (= v1-34 (-> self draw art-group data 59)) + (= v1-34 (-> self draw art-group data 60)) + (= v1-34 (-> self draw art-group data 61)) + ) + ) + (< 4096.0 (target-height-above-ground)) + ) + ) + ) + ) + enter-state + (go target-flut-falling) + ) + (none) + ) + :code + (behavior () + (let ((t9-0 target-flut-hit-ground-anim)) + (t9-0) + ) + (go target-flut-stance) + (none) + ) + :post + target-flut-post + ) + +(defstate target-flut-falling (target) + :event + (-> target-flut-jump event) + :enter + (behavior () + (set! (-> self control unknown-surface00) *flut-jump-mods*) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) + :exit + (-> target-flut-start exit) + :trans + (behavior () + (when (or + (logtest? (-> self control status) 1) + (if (and + (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) + (and + (>= (- (-> *display* base-frame-counter) (-> self state-time)) + (/ (the-as int (-> *TARGET-bank* stuck-time)) 2) + ) + (not + (and + *cheat-mode* + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + ) + ) + ) + #t + ) + ) + (logior! (-> self control status) 1) + (go target-flut-hit-ground) + ) + (set! (-> self control unknown-float122) + (seek + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) + ) + (none) + ) + :code + (behavior () + (cond + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 144) + ) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 149) + ) + (ja-channel-push! 2 60) + ) + (else + (ja-channel-push! 2 150) + ) + ) + (let ((a0-10 (-> self skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) + (set! (-> a0-10 param 0) 1.0) + (set! (-> a0-10 frame-num) 0.0) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 144)) num-func-loop!) + ) + (let ((gp-0 (-> self skel root-channel 1))) + (set! (-> gp-0 frame-interp) (-> self control unknown-float122)) + (joint-control-channel-group-eval! + gp-0 + (the-as art-joint-anim (-> self draw art-group data 147)) + num-func-identity + ) + (set! (-> gp-0 frame-num) 0.0) + ) + (while #t + (suspend) + (let ((a0-12 (-> self skel root-channel 0))) + (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) + (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-loop!) + ) + (let ((a0-13 (-> self skel root-channel 1))) + (set! (-> a0-13 frame-interp) (-> self control unknown-float122)) + (set! (-> a0-13 param 0) 0.0) + (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (none) + ) + :post + target-flut-post + ) + +(defstate target-flut-running-attack (target) + :event + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('touched) + (cond + (((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 224) + ) + (let ((gp-1 + (target-send-attack + arg0 + (the-as uint (-> self control unknown-symbol30)) + (-> arg3 param 0) + (-> self control unknown-dword50) + (-> self control unknown-dword51) + ) + ) + ) + (when gp-1 + (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) + (let ((v1-9 (if (and (nonzero? arg0) (type-type? (-> arg0 type) process-drawable)) + arg0 + ) + ) + ) + (when v1-9 + (let* ((s5-1 (-> (the-as process-drawable v1-9) root)) + (v1-11 (if (and (nonzero? s5-1) (type-type? (-> s5-1 type) collide-shape)) + s5-1 + ) + ) + ) + (if (and + v1-11 + (or + (logtest? (-> (the-as collide-shape v1-11) root-prim prim-core collide-as) 256) + (logtest? (-> (the-as collide-shape v1-11) root-prim prim-core action) 1024) + ) + ) + (set! (-> self control unknown-uint31) (the-as uint 1)) + ) + ) + ) + ) + (when (or (= gp-1 'die) (= gp-1 'push)) + (let ((v0-2 (the-as object (-> *display* base-frame-counter)))) + (set! (-> self control unknown-int21) (the-as int v0-2)) + v0-2 + ) + ) + ) + ) + ) + (else + (target-flut-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + (else + (target-flut-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (set! (-> self control unknown-uint20) (the-as uint 0)) + (set! (-> self control unknown-int21) 0) + (set! (-> self control unknown-uint31) (the-as uint 0)) + (set! (-> self control unknown-surface00) *flut-run-attack-mods*) + (set! (-> *run-attack-mods* turnv) 655360.0) + (set! (-> *run-attack-mods* turnvv) 655360.0) + (target-start-attack) + (target-danger-set! 'flut-attack #f) + (when (and + (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) 75) + ) + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat))) + (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 32))) + ) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 (+ 81920.0 (-> *TARGET-bank* yellow-projectile-speed))) + (vector+! gp-0 gp-0 (-> self control transv)) + (let ((s4-0 (get-process *default-dead-pool* projectile-yellow #x4000))) + (when s4-0 + (let ((t9-6 (method-of-type projectile-yellow activate))) + (t9-6 (the-as projectile-yellow s4-0) self 'projectile-yellow (the-as pointer #x70004000)) + ) + (run-now-in-process + s4-0 + projectile-init-by-other + (-> self entity) + s5-0 + gp-0 + (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + 281 + 265 + ) + #f + ) + (-> s4-0 ppointer) + ) + ) + ) + (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) + ) + (none) + ) + :exit + (behavior () + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (set! (-> *run-attack-mods* turnv) 0.0) + (set! (-> *run-attack-mods* turnvv) 0.0) + (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) + (target-exit) + (none) + ) + :trans + (behavior () + (when (!= (-> self state-time) (-> *display* base-frame-counter)) + (if (and + (or + (smack-surface? #t) + (and (>= (-> self control unknown-float63) 0.7) (zero? (logand (-> self control status) 32))) + ) + (begin + (set! (-> self control unknown-int21) (-> *display* base-frame-counter)) + (set! (-> self control unknown-float81) 0.0) + (let ((gp-0 (new-stack-vector0)) + (f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! gp-0 (-> self control transv) (vector-float*! gp-0 (-> self control dynam gravity-normal) f30-0)) + (let* ((f0-5 (vector-length gp-0)) + (f1-1 f0-5) + (f2-1 (fmin 0.0 f30-0)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-1) + (vector-float*! gp-0 gp-0 (/ f0-5 f1-1)) + ) + ) + ) + #t + ) + (or + (zero? (-> self control unknown-uint20)) + (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) + (the-as uint 12) + ) + ) + (!= (-> self control unknown-uint31) 1) + ) + (target-shoved + (meters 2.0) + (-> *TARGET-bank* smack-surface-height) + (the-as process #f) + (the-as (state target) target-flut-hit) + ) + ) + (if (and + (logtest? (-> self water flags) 512) + (zero? (mod (- (-> *display* base-frame-counter) (-> self state-time)) 21)) + ) + (dummy-13 + (-> self water) + (the-as float 0.6) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 37)) + 0 + (-> self control transv) + ) + ) + ) + (none) + ) + :code + (behavior () + (ja-channel-push! 1 6) + (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 0 0 1 #t) + (let ((gp-1 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-1 + (the-as art-joint-anim (-> self draw art-group data 150)) + num-func-identity + ) + (set! (-> gp-1 frame-num) 0.0) + ) + (set! (-> self control dynam gravity-max) 368640.0) + (set! (-> self control dynam gravity-length) 368640.0) + (let ((f28-0 0.0) + (f30-0 (the-as float (if (= (-> self control unknown-dword82) (-> *display* base-frame-counter)) + 0.2 + 0.8 + ) + ) + ) + ) + (until (or (ja-done? 0) (< f30-0 0.05)) + (TODO-RENAME-9 (-> self align)) + (when (not (ja-min? 0)) + (cond + ((and + (>= (ja-aframe-num 0) 20.0) + (and + (and + (zero? (logand (-> self control status) 1)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-39 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or + (not + (or + (= v1-39 (-> self draw art-group data 59)) + (= v1-39 (-> self draw art-group data 60)) + (= v1-39 (-> self draw art-group data 61)) + ) + ) + (< 4096.0 (target-height-above-ground)) + ) + ) + ) + (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) + (the-as uint 12) + ) + ) + ) + enter-state + (go target-flut-falling) + ) + ((and + (nonzero? (-> self control unknown-uint30)) + (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint30)))) + (the-as uint 12) + ) + ) + (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) + (set! f30-0 0.0) + ) + ((ja-done? 0) + (set-forward-vel f28-0) + ) + (else + (set! f28-0 + (* f30-0 (target-align-vel-z-adjust (-> self align delta trans z)) (-> *display* frames-per-second)) + ) + (set-forward-vel f28-0) + ) + ) + ) + (let ((gp-2 (new-stack-vector0))) + (vector-matrix*! gp-2 (-> self control transv) (-> self control unknown-matrix00)) + (set! (-> gp-2 y) 0.0) + (vector-matrix*! (-> self control unknown-vector120) gp-2 (-> self control unknown-matrix01)) + ) + (suspend) + (let ((a0-36 (-> self skel root-channel 0))) + (set! (-> a0-36 param 0) (the float (+ (-> a0-36 frame-group data 0 length) -1))) + (set! (-> a0-36 param 1) (-> self control unknown-surface01 align-speed)) + (joint-control-channel-group-eval! a0-36 (the-as art-joint-anim #f) num-func-seek!) + ) + (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) + (set! (-> *flut-run-attack-mods* turnvv) 0.0) + ) + (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) + (set! f30-0 (* f30-0 (the-as float (fmin 1.0 (the-as float (-> self control unknown-float140)))))) + ) + ) + (when (and + (zero? (logand (-> self control status) 1)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-105 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or + (not (or + (= v1-105 (-> self draw art-group data 59)) + (= v1-105 (-> self draw art-group data 60)) + (= v1-105 (-> self draw art-group data 61)) + ) + ) + (< 4096.0 (target-height-above-ground)) + ) + ) + ) + enter-state + (go target-flut-falling) + ) + (when (!= f30-0 0.0) + (set! (-> self trans-hook) (-> target-flut-hit-ground trans)) + (if (not (ja-done? 0)) + (ja-channel-push! 1 15) + ) + (let ((a0-59 (-> self skel root-channel 0))) + (set! (-> a0-59 frame-group) (the-as art-joint-anim (-> self draw art-group data 151))) + (set! (-> a0-59 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 151)) data 0 length) -1)) + ) + (set! (-> a0-59 param 1) 1.0) + (set! (-> a0-59 frame-num) 0.0) + (joint-control-channel-group! a0-59 (the-as art-joint-anim (-> self draw art-group data 151)) num-func-seek!) + ) + (until (ja-done? 0) + (TODO-RENAME-9 (-> self align)) + (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) f30-0) + (suspend) + (let ((a0-62 (-> self skel root-channel 0))) + (set! (-> a0-62 param 0) (the float (+ (-> a0-62 frame-group data 0 length) -1))) + (set! (-> a0-62 param 1) 1.0) + (joint-control-channel-group-eval! a0-62 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + (go target-flut-stance) + (none) + ) + :post + target-flut-post + ) + +(defstate target-flut-air-attack (target) + :event + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (if (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) + ) + (< 0.0 + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> self control trans-old)) (-> self control trans)) + ) + ) + ) + (send-event arg0 'bonk (-> arg3 param 0) (-> self control ground-impact-vel)) + ) + (case arg2 + (('jump) + (go target-flut-jump (the-as float (-> arg3 param 0)) (the-as float (-> arg3 param 0))) + ) + (else + (target-flut-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter + (behavior ((arg0 float)) + (set-forward-vel arg0) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (set! (-> self control status) (logand -8 (-> self control status))) + (set! (-> self control unknown-surface00) *flut-air-attack-mods*) + (target-start-attack) + (target-danger-set! 'flut-attack #f) + (let ((gp-0 (new-stack-vector0))) + (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! gp-0 (-> self control transv) (vector-float*! gp-0 (-> self control dynam gravity-normal) f0-1)) + ) + (let* ((f0-2 (vector-length gp-0)) + (f1-1 f0-2) + (f2-0 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! gp-0 gp-0 (/ f0-2 f1-1)) + ) + ) + ) + (none) + ) + :exit + (behavior () + (target-danger-set! 'harmless #f) + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad)) + (none) + ) + :trans + (behavior () + (let ((s5-0 (new-stack-vector0))) + (vector-z-quaternion! s5-0 (-> self control unknown-quaternion00)) + (let ((gp-0 (new-stack-vector0)) + (f30-0 (vector-dot s5-0 (-> self control transv))) + ) + 0.0 + (vector-! gp-0 (-> self control transv) (vector-float*! gp-0 s5-0 f30-0)) + (let* ((f0-3 (vector-length gp-0)) + (f1-0 f0-3) + ) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) s5-0 f30-0) + (vector-float*! gp-0 gp-0 (/ f0-3 f1-0)) + ) + ) + ) + ) + (when (logtest? (-> self control status) 1) + (logior! (-> self control status) 1) + (remove-exit) + (go target-flut-air-attack-hit-ground) + ) + (when (if (and + (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) 4096.0) + (and + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 150) + (not + (and + *cheat-mode* + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + ) + ) + ) + #t + ) + (logior! (-> self control status) 1) + (go target-flut-hit-ground) + ) + (none) + ) + :code + (behavior ((arg0 float)) + (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 -762 0 1 #t) + (ja-channel-push! 1 15) + (let ((gp-1 (-> self skel root-channel 0))) + (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 152))) + (set! (-> gp-1 param 0) (ja-aframe (the-as float 8.0) 0)) + (set! (-> gp-1 param 1) 1.0) + (set! (-> gp-1 frame-num) 0.0) + (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 152)) num-func-seek!) + ) + (until (ja-done? 0) + (TODO-RENAME-9 (-> self align)) + (TODO-RENAME-10 (-> self align) 6 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (suspend) + (let ((gp-2 (-> self skel root-channel 0))) + (set! (-> gp-2 param 0) (ja-aframe (the-as float 8.0) 0)) + (set! (-> gp-2 param 1) 1.0) + (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (let ((gp-3 (-> self skel root-channel 0))) + (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 152))) + (set! (-> gp-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 152)) data 0 length) -1)) + ) + (set! (-> gp-3 param 1) 1.0) + (set! (-> gp-3 frame-num) (ja-aframe (the-as float 8.0) 0)) + (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 152)) num-func-seek!) + ) + (until (ja-done? 0) + (TODO-RENAME-9 (-> self align)) + (TODO-RENAME-10 (-> self align) 6 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (suspend) + (let ((a0-14 (-> self skel root-channel 0))) + (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) + (set! (-> a0-14 param 1) 1.0) + (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (let ((gp-4 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-4 + (the-as art-joint-anim (-> self draw art-group data 153)) + num-func-identity + ) + (set! (-> gp-4 frame-num) 0.0) + ) + (while #t + (suspend) + ) + (none) + ) + :post + target-flut-post + ) + +(defstate target-flut-air-attack-hit-ground (target) + :event + target-flut-standard-event-handler + :enter + (behavior () + (target-land-effect) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 120) + (set! (-> self control unknown-dword31) 0) + (set! (-> self control unknown-dword33) 0) + (set! (-> self control unknown-surface00) *flut-air-attack-mods*) + (sound-play-by-name (static-sound-name "flop-land") (new-sound-id) 1024 -609 0 1 #t) + (dummy-10 (-> self skel effect) 'group-flut-attack-strike-ground (ja-frame-num 0) 0) + (let* ((s5-2 (get-process *default-dead-pool* touch-tracker #x4000)) + (gp-2 (when s5-2 + (let ((t9-7 (method-of-type touch-tracker activate))) + (t9-7 (the-as touch-tracker s5-2) self 'touch-tracker (the-as pointer #x70004000)) + ) + (run-now-in-process s5-2 touch-tracker-init (-> self control trans) 4096.0 30) + (-> s5-2 ppointer) + ) + ) + ) + (send-event (ppointer->process gp-2) 'event 'attack 'flut-attack) + (send-event + (ppointer->process gp-2) + 'function + (lambda :behavior target + ((arg0 nav-enemy)) + (set! (-> arg0 collide-info root-prim local-sphere w) (seek + (-> arg0 collide-info root-prim local-sphere w) + (the-as float 28672.0) + (* 286720.0 (-> *display* seconds-per-frame)) + ) + ) + (dummy-47 (-> arg0 collide-info)) + (none) + ) + ) + ) + (none) + ) + :exit + (-> target-flut-air-attack exit) + :trans + (-> target-flut-hit-ground trans) + :code + (behavior () + (ja-channel-set! 1) + (let ((gp-0 (-> self skel root-channel 0))) + (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 154))) + (set! (-> gp-0 param 0) (ja-aframe (the-as float 22.0) 0)) + (set! (-> gp-0 param 1) 1.0) + (set! (-> gp-0 frame-num) 0.0) + (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 154)) num-func-seek!) + ) + (until (ja-done? 0) + (TODO-RENAME-9 (-> self align)) + (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (suspend) + (let ((gp-1 (-> self skel root-channel 0))) + (set! (-> gp-1 param 0) (ja-aframe (the-as float 22.0) 0)) + (set! (-> gp-1 param 1) 1.0) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (target-danger-set! 'harmless #f) + (let ((gp-2 (-> self skel root-channel 0))) + (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 154))) + (set! (-> gp-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 154)) data 0 length) -1)) + ) + (set! (-> gp-2 param 1) 1.0) + (set! (-> gp-2 frame-num) (ja-aframe (the-as float 22.0) 0)) + (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 154)) num-func-seek!) + ) + (until (ja-done? 0) + (TODO-RENAME-9 (-> self align)) + (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (suspend) + (let ((a0-13 (-> self skel root-channel 0))) + (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) + (set! (-> a0-13 param 1) 1.0) + (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (go target-flut-stance) + (none) + ) + :post + target-flut-post + ) + +(defstate target-flut-hit (target) + :event + target-flut-standard-event-handler + :exit + (behavior () + (if (!= (-> self next-state name) 'target-flut-death) + (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + ) + (target-exit) + ((-> target-flut-start exit)) + (none) + ) + :trans + (behavior () + (when (= *cheat-mode* 'debug) + (when (and + (not *pause-lock*) + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + (pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) + (go target-flut-stance) + ) + ) + (none) + ) + :code + (behavior ((arg0 symbol) (arg1 attack-info)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (let ((gp-0 (-> self attack-info))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((v1-2 gp-0)) + (set! (-> v1-2 attacker) (the-as handle #f)) + (set! (-> v1-2 mode) 'generic) + (set! (-> v1-2 shove-back) 10240.0) + (set! (-> v1-2 shove-up) 9011.2) + (set! (-> v1-2 angle) #f) + (set! (-> v1-2 trans quad) (-> self control trans quad)) + (set! (-> v1-2 control) 0.0) + (set! (-> v1-2 invinc-time) (-> *TARGET-bank* hit-invulnerable-timeout)) + ) + (case arg0 + (('shove) + (let ((v1-5 gp-0)) + (set! (-> v1-5 shove-back) (-> *TARGET-bank* smack-surface-dist)) + (set! (-> v1-5 shove-up) (-> *TARGET-bank* smack-surface-height)) + (set! (-> v1-5 angle) 'shove) + ) + ) + ) + (dummy-9 gp-0 arg1) + (when (zero? (logand (-> gp-0 mask) 2)) + (vector-z-quaternion! (-> gp-0 vector) (-> self control unknown-quaternion00)) + (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) + (set! (-> gp-0 vector y) (-> gp-0 shove-up)) + ) + (set! (-> s5-0 quad) (-> gp-0 vector quad)) + (let ((f0-10 (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-0 (the-as float 1.0)) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)) + ) + ) + ) + (if (not (-> self attack-info angle)) + (set! (-> self attack-info angle) (if (>= 0.0 f0-10) + 'front + 'back + ) + ) + ) + ) + (when (= arg0 'attack) + (logior! (-> self state-flags) 8) + (set! (-> self game hit-time) (-> *display* base-frame-counter)) + (case (-> gp-0 mode) + (('endlessfall) + (cond + ((= (-> self game mode) 'debug) + (let ((s4-1 (new-stack-vector0))) + (set! (-> s4-1 quad) (-> self control unknown-vector54 quad)) + (ja-channel-set! 0) + (let ((s3-1 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) s3-1) 300) + (suspend) + ) + ) + (TODO-RENAME-30 (-> self control) s4-1) + ) + (set! (-> (&-> (-> self control) unknown-qword00) 0) (-> self control trans quad)) + (send-event *camera* 'teleport) + (go target-flut-stance) + ) + (else + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (the-as float -1000.0) + (the-as handle #f) + ) + (go target-flut-death (-> gp-0 mode)) + ) + ) + ) + (('water-vol 'sharkey) + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (the-as float -1000.0) + (the-as handle #f) + ) + (if (= (-> self game mode) 'play) + (go target-flut-death (-> gp-0 mode)) + ) + ) + (('death) + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (the-as float -1000.0) + (the-as handle #f) + ) + ) + (else + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (- (-> *FACT-bank* health-single-inc)) + (the-as handle #f) + ) + ) + ) + (target-hit-effect gp-0) + (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 -1524 0 1 #t) + ) + (set! (-> self control unknown-surface00) *smack-mods*) + (let ((f30-0 1.0)) + (case (-> gp-0 angle) + (('shove) + (when (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 158) + ) + ) + (ja-channel-set! 1) + (let ((s4-3 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + s4-3 + (the-as art-joint-anim (-> self draw art-group data 158)) + num-func-identity + ) + (set! (-> s4-3 frame-num) 0.0) + ) + ) + (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 1524 0 1 #t) + ) + (else + (when (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 157) + ) + ) + (ja-channel-push! 1 22) + (let ((s4-6 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + s4-6 + (the-as art-joint-anim (-> self draw art-group data 157)) + num-func-identity + ) + (set! (-> s4-6 frame-num) 0.0) + ) + ) + ) + ) + (target-hit-move gp-0 (target-hit-orient gp-0 s5-0) target-flut-falling-anim-trans f30-0) + ) + ) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + (go target-flut-death (-> gp-0 mode)) + ) + ) + (go target-flut-hit-ground) + (none) + ) + :post + target-flut-post + ) + +(defstate target-flut-death (target) + :event + (-> target-death event) + :exit + (behavior () + (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + (target-exit) + (clear-pending-settings-from-process *setting-control* self 'process-mask) + (copy-settings-from-target! *setting-control*) + (none) + ) + :trans + (-> target-hit trans) + :code + (behavior ((arg0 symbol)) + (local-vars (v1-104 symbol)) + (logior! (-> self state-flags) #x8000) + (set! (-> self neck flex-blend) 0.0) + (target-timed-invulnerable-off self) + (push-setting! *setting-control* self 'process-mask 'set (-> (new 'static 'array float 1 0.0) 0) #x14a0000) + (copy-settings-from-target! *setting-control*) + (set! (-> self control transv quad) (the-as uint128 0)) + (cond + ((or (= arg0 'none) (= arg0 'water-vol) (= arg0 'sharkey)) + ) + ((= arg0 'endlessfall) + (sound-play-by-name (static-sound-name "death-fall") (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 716 -2133 0 1 #t) + (camera-change-to (the-as string cam-endlessfall) 30 #f) + (set! (-> self control pat-ignore-mask unknown-bit) 1) + (set! (-> self water flags) (logand -17 (-> self water flags))) + (let ((f30-0 (fmin -4096.0 (- (-> self control ground-impact-vel))))) + (set! (-> self control unknown-uint20) (the-as uint f30-0)) + (let ((gp-3 (new-stack-vector0))) + (let ((f0-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! gp-3 (-> self control transv) (vector-float*! gp-3 (-> self control dynam gravity-normal) f0-3)) + ) + (let* ((f0-4 (vector-length gp-3)) + (f1-3 f0-4) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f30-0) + (vector-float*! gp-3 gp-3 (/ f0-4 f1-3)) + ) + ) + ) + ) + (let ((gp-4 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-4) 300) + (target-flut-falling-anim-trans) + (vector-seek! (-> self draw color-mult) *zero-vector* (-> *display* seconds-per-frame)) + (let ((s5-2 (new-stack-vector0)) + (f30-1 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + ) + 0.0 + (vector-! + s5-2 + (-> self control transv) + (vector-float*! s5-2 (-> self control dynam gravity-normal) (the-as float f30-1)) + ) + (let* ((f0-10 (vector-length s5-2)) + (f1-4 f0-10) + ) + (if (< (the-as float (-> self control unknown-uint20)) (the-as float f30-1)) + (set! f30-1 (-> self control unknown-uint20)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f30-1)) + (vector-float*! s5-2 s5-2 (/ f0-10 f1-4)) + ) + ) + ) + (target-flut-post-post) + (suspend) + ) + ) + (camera-change-to (the-as string 'base) 0 #f) + ) + (else + (set! (-> self control unknown-surface00) *neutral-mods*) + (ja-channel-push! 1 30) + (let ((a0-33 (-> self skel root-channel 0))) + (set! (-> a0-33 frame-group) (the-as art-joint-anim (-> self draw art-group data 160))) + (set! (-> a0-33 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 160)) data 0 length) -1)) + ) + (set! (-> a0-33 param 1) 1.0) + (set! (-> a0-33 frame-num) 0.0) + (joint-control-channel-group! a0-33 (the-as art-joint-anim (-> self draw art-group data 160)) num-func-seek!) + ) + (until (ja-done? 0) + (TODO-RENAME-9 (-> self align)) + (let ((gp-5 (new 'stack-no-clear 'vector))) + (when (zero? (logand (-> self align flags) 1)) + (vector-matrix*! gp-5 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) + (vector-float*! (-> self control transv) gp-5 (-> *display* frames-per-second)) + ) + ) + (suspend) + (let ((a0-37 (-> self skel root-channel 0))) + (set! (-> a0-37 param 0) (the float (+ (-> a0-37 frame-group data 0 length) -1))) + (set! (-> a0-37 param 1) 1.0) + (joint-control-channel-group-eval! a0-37 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + (set! (-> self control transv quad) (the-as uint128 0)) + (initialize! (-> self game) 'dead (the-as game-save #f) (the-as string #f)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (until v1-104 + (suspend) + (set! v1-104 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 300) (not (movie?)))) + ) + (go target-flut-stance) + (none) + ) + :post + target-no-stick-post + ) + +(defstate target-flut-get-on (target) + :event + target-generic-event-handler + :exit + (-> target-flut-start exit) + :code + (behavior ((arg0 handle)) + (set! (-> self control transv quad) (the-as uint128 0)) + (set! (-> self alt-cam-pos quad) (-> (&-> (-> self control) unknown-qword00) 0)) + (logior! (-> self state-flags) 1024) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control trans quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> self control trans quad)) + (quaternion-copy! (-> self control unknown-quaternion02) (-> self control quat)) + (quaternion-copy! (-> self control unknown-quaternion03) (-> self control unknown-quaternion00)) + (set! (-> self control unknown-uint20) (the-as uint (-> self control unknown-vector11 y))) + (let* ((s3-0 (handle->process arg0)) + (s4-1 (if (and (nonzero? s3-0) (type-type? (-> s3-0 type) process-drawable)) + s3-0 + ) + ) + ) + (when s4-1 + (set! (-> s5-0 quad) (-> (the-as process-drawable s4-1) root trans quad)) + (quaternion-copy! (-> self control unknown-quaternion03) (-> (the-as process-drawable s4-1) root quat)) + (send-event s4-1 'trans (-> self flut flut-trans)) + (quaternion-copy! (the-as quaternion (-> self flut flut-quat)) (-> (the-as process-drawable s4-1) root quat)) + (set! (-> self flut flut-scale quad) (-> (the-as process-drawable s4-1) root scale quad)) + (set! (-> self control unknown-int21) (the-as int (-> self flut flut-trans y))) + ) + ) + (set! (-> self control unknown-vector102 quad) (-> gp-0 quad)) + (set! (-> self control unknown-vector103 quad) (-> s5-0 quad)) + ) + ) + (let ((gp-1 #f)) + (sound-play-by-name (static-sound-name "uppercut") (new-sound-id) 1024 0 0 1 #t) + (ja-channel-push! 1 15) + (let ((s5-2 (-> self skel root-channel 0))) + (set! (-> s5-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 155))) + (set! (-> s5-2 param 0) (ja-aframe (the-as float 24.0) 0)) + (set! (-> s5-2 param 1) 1.0) + (set! (-> s5-2 frame-num) 0.0) + (joint-control-channel-group! s5-2 (the-as art-joint-anim (-> self draw art-group data 155)) num-func-seek!) + ) + (until (ja-done? 0) + (when (and (not gp-1) (= (-> self skel root-channel 0) (-> self skel channel))) + (send-event (ppointer->process (-> self manipy)) 'anim-mode 'clone-anim) + (set! gp-1 #t) + ) + (set! (-> self control transv quad) (the-as uint128 0)) + (suspend) + (let ((s5-3 (-> self skel root-channel 0))) + (set! (-> s5-3 param 0) (ja-aframe (the-as float 24.0) 0)) + (set! (-> s5-3 param 1) 1.0) + (joint-control-channel-group-eval! s5-3 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + (sound-play-by-name (static-sound-name "flut-coo") (new-sound-id) 1024 0 0 1 #t) + (set! (-> self state-flags) (logand -1025 (-> self state-flags))) + (set! (-> self control transv quad) (the-as uint128 0)) + (quaternion-copy! (-> self control quat) (-> self control unknown-quaternion00)) + (rot->dir-targ! (-> self control)) + (go target-flut-stance) + (none) + ) + :post + (behavior () + (let ((gp-0 (new 'stack-no-clear 'vector)) + (f30-0 (fmin 1.0 (* 0.0044444446 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) + ) + (vector-lerp! gp-0 (-> self control unknown-vector102) (-> self control unknown-vector103) f30-0) + (set! (-> gp-0 y) + (lerp + (-> self control unknown-vector102 y) + (-> self control unknown-vector103 y) + (fmax + 0.0 + (fmin 1.0 (* 0.006666667 (the float (+ (- (-> self state-time)) (-> *display* base-frame-counter))))) + ) + ) + ) + (TODO-RENAME-30 (-> self control) gp-0) + (quaternion-slerp! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion02) + (-> self control unknown-quaternion03) + f30-0 + ) + ) + (target-no-move-post) + (none) + ) + ) + +(defstate target-flut-get-off (target) + :event + target-generic-event-handler + :exit + (-> target-flut-start exit) + :code + (behavior ((arg0 handle)) + (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) + (let ((s5-0 0)) + (while (zero? (logand (-> self control status) 1)) + (target-flut-falling-anim-trans) + (+! s5-0 (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter))) + (suspend) + ) + ) + (go target-flut-get-off-jump arg0) + (none) + ) + :post + (behavior () (target-no-stick-post) (target-flut-post-post) (none)) + ) + +(defstate target-flut-get-off-jump (target) + :event + target-generic-event-handler + :exit + (-> target-flut-start exit) + :code + (behavior ((arg0 handle)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (set! (-> self control transv quad) (the-as uint128 0)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control trans quad)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> self control trans quad)) + (quaternion-copy! (-> self control unknown-quaternion02) (-> self control quat)) + (quaternion-copy! (-> self control unknown-quaternion03) (-> self control unknown-quaternion00)) + (set! (-> self control unknown-uint20) (the-as uint (-> self control unknown-vector11 y))) + (let* ((s2-0 (handle->process arg0)) + (s3-0 (if (and (nonzero? s2-0) (type-type? (-> s2-0 type) process-drawable)) + s2-0 + ) + ) + ) + (when s3-0 + (set! (-> s4-0 quad) (-> (the-as process-drawable s3-0) root trans quad)) + (set-yaw-angle-clear-roll-pitch! + (-> (the-as process-drawable s3-0) root) + (quaternion-y-angle (-> self control quat)) + ) + (quaternion-copy! (-> self control unknown-quaternion03) (-> (the-as process-drawable s3-0) root quat)) + (send-event s3-0 'trans (-> self flut flut-trans)) + (quaternion-copy! (the-as quaternion (-> self flut flut-quat)) (-> (the-as process-drawable s3-0) root quat)) + (set! (-> self flut flut-scale quad) (-> (the-as process-drawable s3-0) root scale quad)) + (set! (-> self control unknown-int21) (the-as int (-> self flut flut-trans y))) + ) + ) + (set! (-> self control unknown-vector102 quad) (-> gp-0 quad)) + (set! (-> self control unknown-vector103 quad) (-> s4-0 quad)) + ) + (sound-play-by-name (static-sound-name "flut-coo") (new-sound-id) 921 -762 0 1 #t) + (ja-channel-push! 1 15) + (let ((a0-23 (-> self skel root-channel 0))) + (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 156))) + (set! (-> a0-23 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 156)) data 0 length) -1)) + ) + (set! (-> a0-23 param 1) 1.0) + (set! (-> a0-23 frame-num) 0.0) + (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 156)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-24 (-> self skel root-channel 0))) + (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) + (set! (-> a0-24 param 1) 1.0) + (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (send-event (handle->process arg0) 'draw) + (set-yaw-angle-clear-roll-pitch! + (-> self control) + (quaternion-y-angle (-> self control unknown-quaternion03)) + ) + (rot->dir-targ! (-> self control)) + (ja-post) + (vector<-cspace! gp-0 (-> self node-list data 3)) + (set! (-> gp-0 y) (+ -5896.192 (-> gp-0 y))) + (TODO-RENAME-30 (-> self control) gp-0) + ) + (send-event *camera* 'ease-in) + (ja-channel-set! 0) + (go target-flut-get-off-hit-ground #f) + (none) + ) + :post + (behavior () + (let ((gp-0 (new 'stack-no-clear 'vector)) + (f30-0 + (fmax 0.0 (fmin 1.0 (* 0.006666667 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) + ) + ) + (fmax 0.0 (fmin 1.0 (* 0.006666667 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) + (vector-lerp! gp-0 (-> self control unknown-vector102) (-> self control unknown-vector103) f30-0) + (set! (-> gp-0 y) + (lerp + (-> self control unknown-vector102 y) + (-> self control unknown-vector103 y) + (fmax + 0.0 + (fmin 1.0 (* 0.0044444446 (the float (+ (- -150 (-> self state-time)) (-> *display* base-frame-counter))))) + ) + ) + ) + (TODO-RENAME-30 (-> self control) gp-0) + (quaternion-slerp! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion02) + (-> self control unknown-quaternion03) + f30-0 + ) + ) + (vector+! (-> self flut flut-trans) (-> self control trans) (-> self control unknown-vector12)) + (quaternion-copy! (the-as quaternion (-> self flut flut-quat)) (-> self control quat)) + (set! (-> self flut flut-scale quad) (-> self control scale quad)) + (target-no-move-post) + (none) + ) + ) + +(defstate target-flut-get-off-hit-ground (target) + :event + target-standard-event-handler + :enter + (-> target-hit-ground enter) + :trans + (behavior () (logior! (-> self control status) 7) ((-> target-hit-ground trans)) (none)) + :code + (behavior ((arg0 symbol)) + (ja-channel-set! 1) + (let ((gp-0 (-> self skel root-channel 0))) + (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) + (set! (-> gp-0 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) data 0 length) -1)) + ) + (set! (-> gp-0 param 1) 1.0) + (set! (-> gp-0 frame-num) (ja-aframe (the-as float 42.0) 0)) + (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-4 (-> self skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) + (set! (-> a0-4 param 1) 1.0) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (go target-stance) + (none) + ) + :post + (the-as (function none :behavior target) target-post) + ) + +(defstate target-flut-grab (target) + :event + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + (-> self state name) + ) + (else + (case arg2 + (('end-mode) + (go target-flut-stance) + ) + (('clone-anim) + (go target-flut-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + (else + (target-generic-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + :enter + (behavior () + (set! (-> self control unknown-surface00) *grab-mods*) + (set! (-> self neck flex-blend) 0.0) + (logior! (-> self state-flags) 272) + (none) + ) + :exit + (behavior () + (set! (-> self state-flags) (logand -273 (-> self state-flags))) + (target-exit) + ((-> target-flut-start exit)) + (none) + ) + :code + (-> target-flut-stance code) + :post + (behavior () (target-no-stick-post) (target-flut-post-post) (none)) + ) + +(defstate target-flut-clone-anim (target) + :event + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (if (and (= arg2 'trans) (= (-> arg3 param 0) 'restore)) + (set! (-> self control unknown-uint20) (the-as uint #f)) + ) + ((-> target-flut-grab event) arg0 arg1 arg2 arg3) + ) + :enter + (-> target-clone-anim enter) + :exit + (behavior () + (send-event (ppointer->process (-> self sidekick)) 'matrix #f) + ((-> target-clone-anim exit)) + ((-> target-flut-start exit)) + (none) + ) + :code + (behavior ((arg0 handle)) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) + (clone-anim arg0 33 #t "") + (go target-flut-stance) + (none) + ) + :post + (behavior () (target-no-ja-move-post) (target-flut-post-post) (none)) + ) + + + + diff --git a/test/decompiler/reference/engine/game/powerups_REF.gc b/test/decompiler/reference/engine/game/powerups_REF.gc new file mode 100644 index 0000000000..cb0596c028 --- /dev/null +++ b/test/decompiler/reference/engine/game/powerups_REF.gc @@ -0,0 +1,974 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function cloud-track +;; INFO: Return type mismatch symbol vs none. +;; Used lq/sq +(defbehavior cloud-track process ((arg0 process-tree) (arg1 process-tree) (arg2 (function vector none)) (arg3 int) (arg4 int) (arg5 int)) + (change-parent self arg0) + (let ((s1-1 (process->handle arg0)) + (s2-1 (process->handle arg1)) + ) + (let ((s0-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) s0-0) (+ arg3 arg4)) + (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) + (if v1-8 + (deactivate self) + ) + ) + (let* ((f0-1 + (fmax + 0.0 + (fmin 1.0 (/ (- (the float (- (-> *display* base-frame-counter) s0-0)) (the float arg3)) (the float arg4))) + ) + ) + (a0-18 (process-drawable-pair-random-point! + (the-as process-drawable (-> s1-1 process 0)) + (the-as process-drawable (-> s2-1 process 0)) + (new-stack-vector0) + f0-1 + ) + ) + ) + (arg2 a0-18) + ) + (suspend) + ) + ) + (cond + ((zero? arg5) + (while #t + (suspend) + ) + ) + (else + (let ((s4-1 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) s4-1) arg5) + (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) + (arg2 a0-21) + ) + (suspend) + ) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 255) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 192.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -1.0666667) + (sp-int spt-timer 60) + (sp-cpuinfo-flags bit2 bit3) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.5)) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 256) + (new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :page #x2)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 192.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -1.0666667) + (sp-int spt-timer 60) + (sp-cpuinfo-flags bit2 bit3) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.5)) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 257) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 16 + (sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + (sp-rnd-flt spt-num 1.0 3.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 90) + (sp-cpuinfo-flags bit2 bit3) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 258) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 259) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 16 + (sp-tex spt-texture (new 'static 'texture-id :index #x1f :page #x2)) + (sp-rnd-flt spt-num 0.0 3.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 91) + (sp-cpuinfo-flags bit2 bit3) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 258) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 258) + (new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 6 + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-fade-r -1.0) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -2.0) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 260) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.15) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 32.0) + (sp-rnd-flt spt-g 32.0 64.0 1.0) + (sp-rnd-flt spt-b 192.0 64.0 1.0) + (sp-rnd-flt spt-a 64.0 128.0 1.0) + (sp-flt spt-scalevel-x (meters -0.00033333333)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.2) + (sp-flt spt-accel-y -0.06826667) + (sp-int spt-timer 450) + (sp-cpuinfo-flags bit0 bit2 bit3) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-group-id-table* 70) (new 'static 'sparticle-launch-group + :length 5 + :duration #x5 + :linger-duration #x1c2 + :name "group-blue-hit-ground-effect" + :launcher + (new 'static 'inline-array sparticle-group-item 5 + (sp-item 261) + (sp-item 262) + (sp-item 263 :flags (is-3d)) + (sp-item 264) + (sp-item 265 :flags (is-3d)) + ) + :bounds (new 'static 'sphere :w 8192.0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 264) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 20 + (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + (sp-flt spt-num 32.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-scale-x (meters 1.0) (meters 3.0) 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 0.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 192.0 63.0 1.0) + (sp-rnd-int spt-a 0 63 1.0) + (sp-flt spt-vel-y (meters 0.093333334)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-int spt-timer 150) + (sp-cpuinfo-flags bit3) + (sp-int-plain-rnd spt-next-time 20 19 1) + (sp-launcher-by-id spt-next-launcher 266) + (sp-flt spt-conerot-x (degrees 90.0)) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.0)) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 266) + (new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 7 + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 192.0 63.0 1.0) + (sp-rnd-int spt-a 0 63 1.0) + (sp-int-plain-rnd spt-next-time 20 19 1) + (sp-launcher-by-id spt-next-launcher 266) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 265) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 16 + (sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-flt spt-scale-x (meters 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 192.0 63.0 1.0) + (sp-rnd-flt spt-a 96.0 32.0 1.0) + (sp-flt spt-scalevel-x (meters 0.21333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-timer 120) + (sp-cpuinfo-flags bit2 bit3 left-multiply-quat) + (sp-int spt-next-time 60) + (sp-launcher-by-id spt-next-launcher 267) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 267) + (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 2 (sp-flt spt-fade-a -2.1333334) (sp-end)) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 263) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 17 + (sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-flt spt-scale-x (meters 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 192.0 63.0 1.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-flt spt-scalevel-x (meters 0.22666667)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.7111111) + (sp-int spt-timer 90) + (sp-cpuinfo-flags bit2 bit3 left-multiply-quat) + (sp-int spt-next-time 45) + (sp-launcher-by-id spt-next-launcher 268) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 268) + (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 2 (sp-flt spt-fade-a -1.4222223) (sp-end)) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 261) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 21 + (sp-tex spt-texture (new 'static 'texture-id :page #x2)) + (sp-flt spt-num 32.0) + (sp-rnd-flt spt-scale-x (meters 1.0) (meters 1.0) 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 0.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 192.0 63.0 1.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.053333335) (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 bit2 bit12) + (sp-rnd-flt spt-conerot-x (degrees 60.0) (degrees 30.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 262) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 21 + (sp-tex spt-texture (new 'static 'texture-id :page #x2)) + (sp-flt spt-num 12.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 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 0.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 192.0 63.0 1.0) + (sp-rnd-flt spt-a 16.0 16.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.10666667) (meters 0.053333335) 1.0) + (sp-flt spt-scalevel-x (meters 0.0016666667)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.21333334) + (sp-flt spt-accel-y -1.3653333) + (sp-flt spt-friction 0.95) + (sp-int spt-timer 150) + (sp-cpuinfo-flags bit2 bit12) + (sp-rnd-flt spt-conerot-x (degrees 60.0) (degrees 30.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 269) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 92.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 92.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -1.0) + (sp-int spt-timer 60) + (sp-cpuinfo-flags bit2 bit3) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.5)) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 270) + (new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :page #x2)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 92.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 92.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -1.0) + (sp-int spt-timer 60) + (sp-cpuinfo-flags bit2 bit3) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.5)) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 271) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 24 + (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + (sp-rnd-flt spt-num 0.5 2.0 1.0) + (sp-flt spt-y (meters -0.05)) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 100.0 28.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.0023333333) (meters 0.0016666667) 1.0) + (sp-flt spt-scalevel-x (meters -0.00083333335)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -0.024242423) + (sp-rnd-flt spt-accel-y -0.40960002 -1.2288 1.0) + (sp-flt spt-friction 0.93) + (sp-int-plain-rnd spt-timer 30 209 1) + (sp-cpuinfo-flags bit2 bit3) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 272) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.05)) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 272) + (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 2 (sp-flt spt-fade-r 0.0) (sp-end)) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 273) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 92.0 32.0 1.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -1.0) + (sp-int spt-timer 60) + (sp-cpuinfo-flags bit2 bit3) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.5)) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 274) + (new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :page #x2)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 92.0 32.0 1.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -1.0) + (sp-int spt-timer 60) + (sp-cpuinfo-flags bit2 bit3) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.5)) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 275) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 24 + (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + (sp-rnd-flt spt-num 0.5 2.0 1.0) + (sp-flt spt-y (meters -0.05)) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 100.0 28.0 1.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.0023333333) (meters 0.0016666667) 1.0) + (sp-flt spt-scalevel-x (meters -0.00083333335)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -0.024242423) + (sp-rnd-flt spt-accel-y -0.40960002 -1.2288 1.0) + (sp-flt spt-friction 0.93) + (sp-int-plain-rnd spt-timer 30 209 1) + (sp-cpuinfo-flags bit2 bit3) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 276) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.05)) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 276) + (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 2 (sp-flt spt-fade-r 0.0) (sp-end)) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 277) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 92.0 32.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -1.0) + (sp-int spt-timer 60) + (sp-cpuinfo-flags bit2 bit3) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.5)) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 278) + (new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 15 + (sp-tex spt-texture (new 'static 'texture-id :page #x2)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 92.0 32.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -1.0) + (sp-int spt-timer 60) + (sp-cpuinfo-flags bit2 bit3) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.5)) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 279) (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 24 + (sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2)) + (sp-rnd-flt spt-num 0.5 2.0 1.0) + (sp-flt spt-y (meters -0.05)) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 100.0 28.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.0023333333) (meters 0.0016666667) 1.0) + (sp-flt spt-scalevel-x (meters -0.00083333335)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -0.024242423) + (sp-rnd-flt spt-accel-y -0.40960002 -1.2288 1.0) + (sp-flt spt-friction 0.93) + (sp-int-plain-rnd spt-timer 30 209 1) + (sp-cpuinfo-flags bit2 bit3) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 280) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.05)) + (sp-end) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 280) + (new 'static 'sparticle-launcher + :init-specs + (new 'static 'inline-array sp-field-init-spec 2 (sp-flt spt-fade-g 0.0) (sp-end)) + ) + ) + +;; definition for function eco-blue-glow +;; INFO: Return type mismatch int vs none. +(defun eco-blue-glow ((arg0 vector)) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 255) + arg0 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + (if (rand-vu-percent? 0.5) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 257) + arg0 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + 0 + (none) + ) + +;; definition for function target-powerup-process +;; INFO: Return type mismatch int vs none. +(defbehavior target-powerup-process target () + (dummy-10 (-> self water)) + (when (not *weather-off*) + (case (-> self current-level name) + (('swamp) + (update-rain self) + ) + (('snow) + (update-snow self) + ) + ) + ) + (cond + ((and + (= (-> self control ground-pat material) (pat-material ice)) + (and + (>= (-> self control unknown-float01) 204.8) + (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 15) + ) + ) + (let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 74)))) + (if (and + (< (fabs + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) gp-0 (-> self control trans)) + ) + ) + 819.2 + ) + (rand-vu-percent? 0.5) + ) + (sp-launch-particles-var + *sp-particle-system-3d* + (-> *part-id-table* 2391) + gp-0 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + ) + (let ((gp-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 70)))) + (if (and + (< (fabs + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) gp-1 (-> self control trans)) + ) + ) + 819.2 + ) + (rand-vu-percent? 0.5) + ) + (sp-launch-particles-var + *sp-particle-system-3d* + (-> *part-id-table* 2391) + gp-1 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + ) + (let ((f0-8 (lerp-scale 60.0 90.0 (-> self control unknown-float01) 0.0 81920.0))) + (if (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 104) + ) + ) + (set! f0-8 (* 0.75 f0-8)) + ) + (set! (-> self control unknown-float141) + (seek (-> self control unknown-float141) f0-8 (* 100.0 (-> *display* seconds-per-frame))) + ) + ) + (let ((f30-0 (-> self control unknown-float141)) + (f0-13 (lerp-scale -0.3 0.3 (-> self control unknown-float01) 0.0 81920.0)) + ) + (sound-play-by-name + (static-sound-name "ice-loop") + (-> self control unknown-soundid00) + (the int (* 10.24 f30-0)) + (the int (* 1524.0 f0-13)) + 0 + 1 + (the-as symbol (-> self control trans)) + ) + ) + ) + ((< 0.0 (-> self control unknown-float141)) + (set! (-> self control unknown-float141) 0.0) + (let ((v1-64 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-64 command) (sound-command set-param)) + (set! (-> v1-64 id) (-> self control unknown-soundid00)) + (set! (-> v1-64 parms volume) -4) + (set! (-> v1-64 auto-time) 48) + (set! (-> v1-64 auto-from) 2) + (set! (-> v1-64 parms mask) (the-as uint 17)) + (-> v1-64 id) + ) + ) + ) + (let ((v1-67 (-> *time-of-day-context* current-shadow)) + (a0-33 (-> self draw shadow-ctrl)) + ) + (set! (-> a0-33 settings shadow-dir x) (-> v1-67 x)) + (set! (-> a0-33 settings shadow-dir y) (-> v1-67 y)) + (set! (-> a0-33 settings shadow-dir z) (-> v1-67 z)) + ) + (when (and + (!= (-> self fact-info-target eco-level) 0.0) + (>= (- (-> *display* game-frame-counter) (the-as int (-> self fact-info-target eco-pickup-time))) + (the-as int (-> self fact-info-target eco-timeout)) + ) + ) + (set! (-> self fact-info-target eco-level) 0.0) + (set! (-> self fact-info-target eco-timeout) 0) + (set! (-> self state-flags) (logand -65 (-> self state-flags))) + (send-event self 'reset-collide) + (stop! (-> self sound)) + ) + (when (and + (< 0.0 (-> self fact-info-target eco-level)) + (zero? (logand (-> self state-flags) 512)) + (zero? (logand (-> self draw status) 6)) + (not (movie?)) + (rand-vu-percent? + (lerp-scale + 0.0 + 1.0 + (the float + (- (-> self fact-info-target eco-timeout) + (the-as uint (- (-> *display* game-frame-counter) (the-as int (-> self fact-info-target eco-pickup-time)))) + ) + ) + 0.0 + 900.0 + ) + ) + ) + (case (-> self fact-info-target eco-type) + ((1) + (change-sound! (-> self sound) (static-sound-name "yel-eco-jak")) + (let ((s4-0 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* (if (rand-vu-percent? 0.5) + 269 + 270 + ) + ) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-0)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + (dotimes (gp-4 2) + (let ((v1-111 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 271) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-111)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + ) + ) + ((2) + (target-danger-set! (-> self control unknown-symbol30) #t) + (dummy-47 (-> self control)) + (let ((a1-23 (new 'stack-no-clear 'touching-shapes-entry))) + (set! (-> a1-23 cshape1) (the-as collide-shape 0)) + (set! (-> a1-23 cshape2) (the-as collide-shape *touching-list*)) + (dummy-40 (-> self control) a1-23) + ) + (target-danger-set! (-> self control unknown-symbol30) #f) + (dummy-47 (-> self control)) + (change-sound! (-> self sound) (static-sound-name "red-eco-jak")) + (let ((s4-2 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* (if (rand-vu-percent? 0.5) + 273 + 274 + ) + ) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-2)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + (dotimes (gp-6 2) + (let ((v1-139 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 275) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-139)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + ) + ) + ((3) + (change-sound! (-> self sound) (static-sound-name "blue-eco-jak")) + (let ((v1-150 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (cond + ((and (logtest? (-> self control unknown-surface00 flags) 2048) (zero? (logand (-> self control status) 1))) + (set! (-> *part-id-table* 259 init-specs 4 initial-valuef) 0.0) + (set! (-> *part-id-table* 259 init-specs 4 random-rangef) 65536.0) + ) + (else + (set! (-> *part-id-table* 259 init-specs 4 initial-valuef) 40960.0) + (set! (-> *part-id-table* 259 init-specs 4 random-rangef) 16384.0) + ) + ) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 259) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-150)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + (let ((gp-8 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* (if (rand-vu-percent? 0.5) + 255 + 256 + ) + ) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-8)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + (if (rand-vu-percent? 0.5) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 257) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-8)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + ) + (let ((v1-168 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 260) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-168)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 1 30) + ) + ((4) + (change-sound! (-> self sound) (static-sound-name "green-eco-jak")) + (let ((s4-8 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* (if (rand-vu-percent? 0.5) + 277 + 278 + ) + ) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-8)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + (dotimes (gp-11 2) + (let ((v1-188 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 279) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-188)) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + ) + ) + ) + (update-trans! (-> self sound) (-> self control trans)) + (update! (-> self sound)) + ) + 0 + (none) + ) + +;; definition for function target-powerup-effect +;; INFO: Return type mismatch int vs none. +(defbehavior target-powerup-effect target ((arg0 symbol)) + (case arg0 + (('eco-blue) + (let ((v1-4 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (eco-blue-glow (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-4))) + ) + ) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/engine/target/target-death_REF.gc b/test/decompiler/reference/engine/target/target-death_REF.gc new file mode 100644 index 0000000000..3af009ae26 --- /dev/null +++ b/test/decompiler/reference/engine/target/target-death_REF.gc @@ -0,0 +1,1621 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup *deathcam-sg* deathcam + 0 + 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :longest-edge (meters 0) + :texture-level 2 + ) + +;; definition for symbol *auto-continue*, type symbol +(define *auto-continue* #f) + +;; definition for function next-level +;; INFO: Return type mismatch symbol vs level-load-info. +(defun next-level ((arg0 symbol)) + (let ((v1-0 (lookup-level-info arg0))) + (the-as level-load-info (when v1-0 + (let* ((a0-1 *level-load-list*) + (a1-0 (car a0-1)) + ) + (while (not (null? a0-1)) + (let ((a1-1 (the-as basic (-> (the-as level-load-info a1-0) name)))) + (if (= (-> (the-as level-load-info a1-1) index) (+ (-> v1-0 index) 1)) + (return (the-as level-load-info a1-1)) + ) + ) + (set! a0-1 (cdr a0-1)) + (set! a1-0 (car a0-1)) + ) + ) + #f + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate target-continue (target) + :event + target-generic-event-handler + :exit + (behavior () + (set! (-> *load-boundary-target* 0 quad) (-> (camera-pos) quad)) + (set! (-> *load-boundary-target* 1 quad) (-> (target-pos 0) quad)) + (set! (-> *load-boundary-target* 2 quad) (-> *load-boundary-target* 0 quad)) + (set! (-> *load-boundary-target* 3 quad) (-> *load-boundary-target* 1 quad)) + (when (zero? (logand (-> *game-info* current-continue flags) 176)) + (set! (-> *level* border?) (-> *level* play?)) + (set! (-> *setting-control* default border-mode) (-> *level* play?)) + ) + (clear-pending-settings-from-process *setting-control* self 'allow-pause) + (clear-pending-settings-from-process *setting-control* self 'allow-progress) + (clear-pending-settings-from-process *setting-control* self 'bg-a) + (clear-pending-settings-from-process *setting-control* self 'music-volume) + (clear-pending-settings-from-process *setting-control* self 'sfx-volume) + (clear-pending-settings-from-process *setting-control* self 'ambient-volume) + (clear-pending-settings-from-process *setting-control* self 'music) + (none) + ) + :code + (behavior ((arg0 continue-point)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (if (-> *art-control* reserve-buffer) + (reserve-free *art-control* (-> *art-control* reserve-buffer heap)) + ) + (push-setting! *setting-control* self 'bg-a 'abs 1.0 0) + (set! (-> *setting-control* current bg-a) 1.0) + (set-setting! *setting-control* self 'sfx-volume 'abs (the-as float 0.0) 0) + (set-setting! *setting-control* self 'ambient-volume 'abs (the-as float 0.0) 0) + (let ((v1-20 (lookup-level-info (-> arg0 level)))) + (when v1-20 + (set-setting! *setting-control* self 'music (-> v1-20 music-bank) (the-as float 0.0) 0) + (set-setting! *setting-control* self 'music-volume 'abs (the-as float 0.0) 0) + ) + ) + (set! (-> *level* border?) #f) + (set! (-> *setting-control* default border-mode) #f) + (reset-target-state #t) + (target-exit) + (ja-channel-set! 0) + (quaternion-copy! (-> self control unknown-quaternion00) (-> arg0 quat)) + (TODO-RENAME-30 (-> self control) (-> arg0 trans)) + (rot->dir-targ! (-> self control)) + (set! (-> (&-> (-> self control) unknown-qword00) 0) (-> self control trans quad)) + (cond + ((not (string= (-> arg0 name) "default")) + (set! *external-cam-mode* #f) + (cam-stop) + (suspend) + 0 + ) + (else + (send-event *camera* 'clear-entity) + (send-event *camera* 'change-state cam-fixed 0) + (suspend) + 0 + ) + ) + (set! (-> *load-state* vis-nick) (-> arg0 vis-nick)) + (set! (-> *load-state* want 0 name) (-> arg0 lev0)) + (set! (-> *load-state* want 0 display?) (-> arg0 disp0)) + (set! (-> *load-state* want 0 force-vis?) #f) + (set! (-> *load-state* want 0 force-inside?) #f) + (set! (-> *load-state* want 1 name) (-> arg0 lev1)) + (set! (-> *load-state* want 1 display?) (-> arg0 disp1)) + (set! (-> *load-state* want 1 force-vis?) #f) + (set! (-> *load-state* want 1 force-inside?) #f) + (when (not (string= (-> arg0 name) "default")) + (while (not + (and + (or (not (-> arg0 lev0)) (not (-> arg0 disp0)) (= (level-status *level* (-> arg0 lev0)) 'active)) + (or (not (-> arg0 lev1)) (not (-> arg0 disp1)) (= (level-status *level* (-> arg0 lev1)) 'active)) + ) + ) + (let ((v1-52 (lookup-level-info (-> arg0 level)))) + (if (and + v1-52 + (= (-> *setting-control* current music) (-> v1-52 music-bank)) + (zero? (logand (-> arg0 flags) 160)) + ) + (clear-pending-settings-from-process *setting-control* self 'music-volume) + ) + ) + (suspend) + ) + ) + (backup-load-state-and-set-cmds *load-state* '()) + (execute-command *load-state* '(teleport)) + (let* ((s5-0 (-> arg0 load-commands)) + (a1-18 (car s5-0)) + ) + (while (not (null? s5-0)) + (execute-command *load-state* (the-as pair a1-18)) + (set! s5-0 (cdr s5-0)) + (set! a1-18 (car s5-0)) + ) + ) + (restore-load-state *load-state*) + (set! (-> *ACTOR-bank* birth-max) 1000) + (new 'stack 'transformq) + (cond + ((not (string= (-> arg0 name) "default")) + (cam-start #t) + (suspend) + (suspend) + (set! (-> *camera-combiner* trans quad) (-> arg0 camera-trans quad)) + (let ((s5-1 (-> *camera-combiner* inv-camera-rot)) + (s4-0 (-> arg0 camera-rot)) + ) + (matrix-identity! s5-1) + (set! (-> s5-1 vector 0 x) (-> s4-0 0)) + (set! (-> s5-1 vector 0 y) (-> s4-0 1)) + (set! (-> s5-1 vector 0 z) (-> s4-0 2)) + (set! (-> s5-1 vector 1 x) (-> s4-0 3)) + (set! (-> s5-1 vector 1 y) (-> s4-0 4)) + (set! (-> s5-1 vector 1 z) (-> s4-0 5)) + (set! (-> s5-1 vector 2 x) (-> s4-0 6)) + (set! (-> s5-1 vector 2 y) (-> s4-0 7)) + (set! (-> s5-1 vector 2 z) (-> s4-0 8)) + ) + (send-event *camera* 'change-target self) + (send-event *camera* 'no-intro) + (send-event *camera* 'clear-entity) + (send-event *camera* 'force-blend 0) + (send-event *camera* 'change-state cam-fixed 0) + (send-event *camera* 'change-state cam-string 0) + ) + (else + (send-event *camera* 'change-target self) + (send-event *camera* 'change-state cam-string 0) + (send-event *camera* 'teleport) + (send-event *camera* 'no-intro) + (send-event *camera* 'clear-entity) + ) + ) + (send-event self 'level-enter (-> arg0 level)) + (dotimes (v1-124 (-> *level* length)) + (let ((a0-64 (-> *level* level v1-124))) + (if (= (-> a0-64 status) 'active) + (set! (-> a0-64 all-visible?) 'loading) + ) + ) + ) + (let ((s5-2 (level-get *level* (-> arg0 level)))) + (when s5-2 + (while (and (= (-> s5-2 all-visible?) 'loading) (-> *level* vis?)) + (suspend) + ) + ) + ) + (set! *spawn-actors* #t) + (set! *teleport* #t) + (set! (-> *ACTOR-bank* birth-max) 1000) + (set-blackout-frames 30) + (cond + ((logtest? (-> arg0 flags) 128) + (go target-title) + ) + ((logtest? (-> arg0 flags) 16) + (start-sequence-a) + ) + ((logtest? (-> arg0 flags) 32) + (let ((s5-3 (entity-by-name "sage-23"))) + (when s5-3 + (set-blackout-frames #x7530) + (entity-birth-no-kill s5-3) + (suspend) + (send-event + (if s5-3 + (-> s5-3 extra process) + ) + 'play-anim + ) + ) + ) + ) + ((and + (logtest? (-> arg0 flags) 2048) + (or + (= (get-task-status (game-task beach-ecorocks)) (task-status need-hint)) + (= (get-task-status (game-task beach-ecorocks)) (task-status need-introduction)) + ) + ) + (let ((s5-4 (entity-by-name "sage-23"))) + (when s5-4 + (set-blackout-frames #x7530) + (entity-birth-no-kill s5-4) + (suspend) + (set! arg0 (get-continue-by-name *game-info* "village1-hut")) + (send-event + (if s5-4 + (-> s5-4 extra process) + ) + 'play-anim + ) + ) + ) + ) + ((logtest? (-> arg0 flags) 8) + (go target-demo) + ) + ((logtest? (-> arg0 flags) 64) + (set-blackout-frames 300) + (let ((s5-5 (get-process *default-dead-pool* process #x4000))) + (when s5-5 + (let ((t9-60 (method-of-type process activate))) + (t9-60 s5-5 *default-pool* 'process (the-as pointer #x70004000)) + ) + (run-next-time-in-process + s5-5 + (lambda () + (local-vars (v1-10 basic)) + (let ((gp-0 (entity-by-name "sage-23"))) + (when gp-0 + (set-blackout-frames #x7530) + (entity-birth-no-kill gp-0) + (suspend) + (suspend) + (send-event + (if gp-0 + (-> gp-0 extra process) + ) + 'play-anim + ) + ) + ) + (let ((gp-1 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-1) 600) + (suspend) + ) + ) + (until (not v1-10) + (suspend) + (set! v1-10 (and *target* (logtest? (-> *target* state-flags) 256))) + ) + (set! (-> *cpad-list* cpads 0 change-time) (-> *display* base-frame-counter)) + (reset-actors 'dead) + (start 'play (get-continue-by-name *game-info* "misty-start")) + ) + ) + (-> s5-5 ppointer) + ) + ) + ) + ((logtest? (-> arg0 flags) 4) + (let ((s5-6 (new 'static 'vector))) + (cond + ((string= (-> arg0 name) "village1-warp") + (set! (-> s5-6 quad) (-> (entity-by-name "villagea-part-1") extra trans quad)) + (suspend) + (let ((s4-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-2 from) self) + (set! (-> s4-2 num-params) 0) + (set! (-> s4-2 message) 'hidden-other) + (let ((s3-0 send-event-function) + (v1-175 (entity-by-name "sage-23")) + ) + (s3-0 + (if v1-175 + (-> v1-175 extra process) + ) + s4-2 + ) + ) + ) + (let ((s4-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-3 from) self) + (set! (-> s4-3 num-params) 0) + (set! (-> s4-3 message) 'hidden-other) + (let ((s3-1 send-event-function) + (v1-179 (entity-by-name "assistant-11")) + ) + (s3-1 + (if v1-179 + (-> v1-179 extra process) + ) + s4-3 + ) + ) + ) + (set-continue! *game-info* "village1-hut") + ) + ((or (string= (-> arg0 name) "training-warp") (string= (-> arg0 name) "game-start")) + (if (logtest? (-> arg0 flags) 1024) + (close-specific-task! (game-task intro) (task-status need-resolution)) + ) + (set! (-> s5-6 quad) (-> (entity-by-name "training-part-1") extra trans quad)) + (set-continue! *game-info* "training-start") + ) + ((string= (-> arg0 name) "village2-warp") + (set! (-> s5-6 quad) (-> (entity-by-name "villageb-part-55") extra trans quad)) + (when (task-closed? (game-task village2-levitator) (task-status need-hint)) + (suspend) + (let ((s4-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-6 from) self) + (set! (-> s4-6 num-params) 0) + (set! (-> s4-6 message) 'hidden-other) + (let ((s3-2 send-event-function) + (v1-201 (entity-by-name "assistant-bluehut-1")) + ) + (s3-2 + (if v1-201 + (-> v1-201 extra process) + ) + s4-6 + ) + ) + ) + (let ((s4-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-7 from) self) + (set! (-> s4-7 num-params) 0) + (set! (-> s4-7 message) 'hidden-other) + (let ((s3-3 send-event-function) + (v1-205 (entity-by-name "sage-bluehut-1")) + ) + (s3-3 + (if v1-205 + (-> v1-205 extra process) + ) + s4-7 + ) + ) + ) + (let ((s4-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-8 from) self) + (set! (-> s4-8 num-params) 0) + (set! (-> s4-8 message) 'hidden-other) + (let ((s3-4 send-event-function) + (v1-209 (entity-by-name "flutflut-bluehut-1")) + ) + (s3-4 + (if v1-209 + (-> v1-209 extra process) + ) + s4-8 + ) + ) + ) + ) + (set-continue! *game-info* "village2-start") + ) + ((string= (-> arg0 name) "village3-warp") + (set! (-> s5-6 quad) (-> (entity-by-name "villagec-part-32") extra trans quad)) + (when (task-closed? (game-task village3-button) (task-status need-hint)) + (suspend) + (let ((s4-10 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-10 from) self) + (set! (-> s4-10 num-params) 0) + (set! (-> s4-10 message) 'hidden-other) + (let ((s3-5 send-event-function) + (v1-220 (entity-by-name "assistant-villagec-1")) + ) + (s3-5 + (if v1-220 + (-> v1-220 extra process) + ) + s4-10 + ) + ) + ) + (let ((s4-11 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-11 from) self) + (set! (-> s4-11 num-params) 0) + (set! (-> s4-11 message) 'hidden-other) + (let ((s3-6 send-event-function) + (v1-224 (entity-by-name "sage-villagec-1")) + ) + (s3-6 + (if v1-224 + (-> v1-224 extra process) + ) + s4-11 + ) + ) + ) + ) + (set-continue! *game-info* "village3-start") + ) + ((string= (-> arg0 name) "citadel-warp") + (set! (-> s5-6 quad) (-> (entity-by-name "citb-part-1") extra trans quad)) + (when (task-closed? (game-task village4-button) (task-status need-hint)) + (suspend) + (let ((s4-13 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-13 from) self) + (set! (-> s4-13 num-params) 0) + (set! (-> s4-13 message) 'hidden-other) + (let ((s3-7 send-event-function) + (v1-235 (entity-by-name "assistant-lavatube-end-3")) + ) + (s3-7 + (if v1-235 + (-> v1-235 extra process) + ) + s4-13 + ) + ) + ) + ) + (set-continue! *game-info* "lavatube-end") + ) + ) + ) + enter-state + (-> arg0 trans) + (go target-warp-in) + ) + (else + (let ((s5-7 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) s5-7) 15) + (suspend) + ) + ) + ) + ) + (set-continue! *game-info* arg0) + (when *auto-continue* + (let ((s5-8 (next-level (-> arg0 level)))) + (when (and s5-8 (not (null? (-> s5-8 continues)))) + (format 0 "~A ~A ~A~%" (-> arg0 level) (-> s5-8 name) (car (-> s5-8 continues))) + (inspect global) + (let ((gp-1 (get-process *default-dead-pool* process #x4000))) + (when gp-1 + (let ((t9-104 (method-of-type process activate))) + (t9-104 gp-1 *default-pool* 'process (the-as pointer #x70004000)) + ) + (run-next-time-in-process gp-1 (lambda ((arg0 continue-point)) (start 'play arg0)) (car (-> s5-8 continues))) + (-> gp-1 ppointer) + ) + ) + ) + ) + ) + (ja-channel-set! 1) + (let ((v1-264 (-> self skel root-channel 0))) + (set! (-> v1-264 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) + ) + (suspend) + (logior! (-> self control status) 7) + (go target-stance) + (none) + ) + :post + target-no-move-post + ) + +;; definition for symbol *smack-mods*, type surface +(define *smack-mods* (new 'static 'surface + :name 'jump + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook + (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (when (= arg3 1) + (let ((f30-0 (-> self control unknown-float40)) + (f28-0 (-> self control unknown-float41)) + ) + (set! (-> arg0 seek0) (lerp (-> arg0 seek0) (the-as float 409600.0) f28-0)) + (set! (-> arg0 seek90) (lerp (-> arg0 seek90) (the-as float 409600.0) f28-0)) + (set! (-> arg0 seek180) (lerp (-> arg0 seek180) (the-as float 409600.0) f28-0)) + (set! (-> arg0 target-speed) (lerp (-> arg0 target-speed) f30-0 f28-0)) + (set! (-> arg0 transv-max) (lerp (-> arg0 transv-max) f30-0 f28-0)) + ) + ) + (none) + ) + :mode 'air + :flags #x800 + ) + ) + +;; definition for symbol *smack-up-mods*, type surface +(define + *smack-up-mods* + (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 32768.0 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mult-hook + (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (when (= arg3 1) + (let ((f30-0 (-> self control unknown-float40)) + (f28-0 (-> self control unknown-float41)) + ) + (set! (-> arg0 seek0) (lerp (-> arg0 seek0) (the-as float 409600.0) f28-0)) + (set! (-> arg0 seek90) (lerp (-> arg0 seek90) (the-as float 409600.0) f28-0)) + (set! (-> arg0 seek180) (lerp (-> arg0 seek180) (the-as float 409600.0) f28-0)) + (set! (-> arg0 target-speed) (lerp (-> arg0 target-speed) f30-0 f28-0)) + (set! (-> arg0 transv-max) (lerp (-> arg0 transv-max) f30-0 f28-0)) + ) + ) + (none) + ) + :mode 'air + :flags #x818 + ) + ) + +;; definition for function velocity-set-to-target! +;; Used lq/sq +(defbehavior velocity-set-to-target! target ((arg0 vector) (arg1 float) (arg2 attack-info)) + (let* ((v1-1 (-> self control trans)) + (gp-1 (vector-! (new 'stack-no-clear 'vector) arg0 v1-1)) + ) + (set! (-> gp-1 y) 0.0) + (set! (-> self control unknown-vector40 quad) (-> gp-1 quad)) + (vector-xz-normalize! (-> self control unknown-vector40) (the-as float 1.0)) + (set! (-> self control unknown-float50) 1.0) + (set! (-> self control unknown-float40) arg1) + (set! (-> self control unknown-float41) (- 1.0 (-> arg2 control))) + gp-1 + ) + ) + +;; definition for function target-hit-effect +;; INFO: Return type mismatch int vs none. +(defbehavior target-hit-effect target ((arg0 attack-info)) + (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when s5-0 + (let ((t9-1 (method-of-type part-tracker activate))) + (t9-1 (the-as part-tracker s5-0) self 'part-tracker (the-as pointer #x70004000)) + ) + (run-now-in-process + s5-0 + part-tracker-init + (-> *part-group-id-table* 1) + -1 + #f + #f + #f + (if (logtest? (-> arg0 mask) 4) + (-> arg0 intersection) + (-> self control root-prim prim-core) + ) + ) + (-> s5-0 ppointer) + ) + ) + (let ((v1-9 (-> arg0 mode))) + (cond + ((or (= v1-9 'endlessfall) (= v1-9 'instant-death)) + ) + ((begin + (target-timed-invulnerable (-> arg0 invinc-time) self) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 150) + (let ((v1-13 (-> arg0 angle))) + (= v1-13 'up) + ) + ) + (sound-play-by-name (static-sound-name "hit-up") (new-sound-id) 1024 0 0 1 #t) + ) + (else + (sound-play-by-name (static-sound-name "oof") (new-sound-id) 1024 0 0 1 #t) + ) + ) + ) + (case (-> arg0 mode) + (('burn 'burnup) + (let ((gp-1 (get-process *default-dead-pool* process #x4000))) + (when gp-1 + (let ((t9-10 (method-of-type process activate))) + (t9-10 gp-1 self 'process (the-as pointer #x70004000)) + ) + (run-next-time-in-process gp-1 process-drawable-burn-effect 1200) + (-> gp-1 ppointer) + ) + ) + ) + (('tar) + (sound-play-by-name (static-sound-name "get-burned") (new-sound-id) 1024 0 0 1 #t) + ) + ) + 0 + (none) + ) + +;; definition for function target-hit-push +;; INFO: Return type mismatch symbol vs object. +;; Used lq/sq +(defbehavior target-hit-push target ((arg0 vector) (arg1 matrix) (arg2 float) (arg3 float) (arg4 attack-info)) + (case (-> arg4 angle) + (('jump 'up 'up-forward) + (when (and + (zero? (logand (-> self control root-prim prim-core action) #x4200)) + (not (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health)))) + ) + (if (and + (logtest? + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons circle) + ) + (can-feet?) + ) + (go target-attack-air #f) + ) + (if (and + (logtest? + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons square) + ) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 26624.0) + (and + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) + (the-as int (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) 4096)) + (zero? (logand (-> self control unknown-surface01 flags) 384)) + ) + ) + (go + target-flop + (the-as float 65502.96) + (the-as float -163840.0) + (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + 0.0 + 68812.8 + ) + ) + ) + ) + ) + ) + ) + (when (if (and + (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) + (and + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> *TARGET-bank* stuck-time))) + (not + (and + *cheat-mode* + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + ) + ) + ) + #t + ) + (logior! (-> self control status) 1) + (return (the-as object 'stuck)) + ) + (let ((s1-0 (new-stack-vector0))) + (set! (-> s1-0 z) arg2) + (vector-matrix*! s1-0 s1-0 arg1) + (vector+! s1-0 s1-0 arg0) + (cond + ((< (vector-vector-distance arg0 s1-0) (fabs (-> arg4 dist))) + (velocity-set-to-target! s1-0 (fabs arg3) arg4) + #t + ) + (else + (set! (-> self control unknown-float40) 0.0) + (set! (-> self control unknown-float41) (- 1.0 (-> arg4 control))) + #f + ) + ) + ) + ) + +;; definition for function target-hit-orient +(defbehavior target-hit-orient target ((arg0 attack-info) (arg1 vector)) + (let ((s5-0 #f)) + (if (and + (!= (-> arg0 angle) 'front) + (!= (-> arg0 angle) 'shove) + (logtest? (-> arg0 mask) 2) + (!= (-> arg0 shove-back) 0.0) + ) + (forward-up-nopitch->quaternion (-> self control dir-targ) arg1 (-> self control dynam gravity-normal)) + ) + (case (-> arg0 angle) + (('back 'air) + (set! s5-0 #t) + ) + (('up-forward) + (set! (-> self control unknown-surface00) *smack-up-mods*) + ) + (('front) + (if (and (logtest? (-> arg0 mask) 2) (!= (-> arg0 shove-back) 0.0)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-negate! (new 'stack-no-clear 'vector) arg1) + (-> self control dynam gravity-normal) + ) + ) + (set! s5-0 #t) + ) + (('jump) + (set! s5-0 #t) + (set! (-> self control unknown-surface00) *forward-high-jump-mods*) + ) + ) + s5-0 + ) + ) + +;; definition for function target-hit-setup-anim +(defbehavior target-hit-setup-anim target ((arg0 attack-info)) + (case (-> arg0 angle) + (('back) + (when (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 74) + ) + ) + (ja-channel-push! 1 22) + (let ((gp-1 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-1 + (the-as art-joint-anim (-> self draw art-group data 74)) + num-func-identity + ) + (let ((f0-0 0.0)) + (set! (-> gp-1 frame-num) f0-0) + f0-0 + ) + ) + ) + ) + (('up 'up-forward) + (when (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 75) + ) + ) + (ja-channel-push! 1 22) + (let ((gp-2 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-2 + (the-as art-joint-anim (-> self draw art-group data 75)) + num-func-identity + ) + (let ((f0-1 0.0)) + (set! (-> gp-2 frame-num) f0-1) + f0-1 + ) + ) + ) + ) + (('air 'jump) + (ja-channel-push! 1 15) + (let ((a0-21 (-> self skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> self draw art-group data 34))) + (set! (-> a0-21 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) data 0 length) -1)) + ) + (set! (-> a0-21 param 1) 1.0) + (set! (-> a0-21 frame-num) 0.0) + (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> self draw art-group data 34)) num-func-seek!) + ) + (when (= (-> arg0 angle) 'air) + (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + (dummy-10 (-> self skel effect) 'group-smack-surface (the-as float 0.0) 5) + (dummy-10 (-> self skel effect) 'group-smack-surface-dizzy (the-as float 0.0) 8) + ) + ) + (('shove) + (ja-channel-push! 1 15) + (let ((a0-30 (-> self skel root-channel 0))) + (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> self draw art-group data 78))) + (set! (-> a0-30 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 78)) data 0 length) -1)) + ) + (set! (-> a0-30 param 1) 1.0) + (set! (-> a0-30 frame-num) 0.0) + (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> self draw art-group data 78)) num-func-seek!) + ) + (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + ) + (else + (when (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 73) + ) + ) + (ja-channel-push! 1 22) + (let ((gp-5 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-5 + (the-as art-joint-anim (-> self draw art-group data 73)) + num-func-identity + ) + (let ((f0-10 0.0)) + (set! (-> gp-5 frame-num) f0-10) + f0-10 + ) + ) + ) + ) + ) + ) + +;; definition for function target-hit-move +;; INFO: Return type mismatch int vs none. +;; Used lq/sq +(defbehavior target-hit-move target ((arg0 attack-info) (arg1 symbol) (arg2 (function none :behavior target)) (arg3 float)) + (local-vars (v1-40 symbol) (s2-1 object)) + (vector-identity! (-> self control transv)) + (let ((s3-0 (new-stack-vector0))) + (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! s3-0 (-> self control transv) (vector-float*! s3-0 (-> self control dynam gravity-normal) f0-1)) + ) + (let* ((f0-2 (vector-length s3-0)) + (f1-1 f0-2) + (f2-1 (+ 2048.0 (sqrtf (* 491520.0 (-> arg0 shove-up))))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-1) + (vector-float*! s3-0 s3-0 (/ f0-2 f1-1)) + ) + ) + ) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (set! (-> s3-1 quad) (-> self control trans quad)) + (let ((s1-1 (matrix-rotate-y! (new 'stack-no-clear 'matrix) (+ 32768.0 (vector-y-angle (-> arg0 vector))))) + (f30-1 0.0) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + #t + (let ((f28-1 (* 1.05 (/ (* -60.0 arg3) (* (the float (+ (-> (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -1 + ) + ) + (ja-step 0) + ) + ) + ) + ) + ) + (until v1-40 + (+! f30-1 (* (-> arg0 shove-back) f28-1 (-> *display* seconds-per-frame))) + (set! s2-1 (target-hit-push s3-1 s1-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0)) + (suspend) + (let ((a0-14 (-> self skel root-channel 0))) + (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) + (set! (-> a0-14 param 1) 1.0) + (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) + ) + (set! v1-40 (or (ja-done? 0) (and arg1 (logtest? (-> self control status) 1)))) + ) + (while (and (or (zero? (logand (-> self control status) 1)) s2-1) (!= s2-1 'stuck)) + (arg2) + (+! f30-1 (* (-> arg0 shove-back) f28-1 (-> *display* seconds-per-frame))) + (set! s2-1 (target-hit-push s3-1 s1-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0)) + (if (not s2-1) + (set! (-> self state-flags) (logand -9 (-> self state-flags))) + ) + (suspend) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate target-hit (target) + :event + target-standard-event-handler + :exit + (behavior () + (let ((gp-0 (new-stack-vector0)) + (f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! gp-0 (-> self control transv) (vector-float*! gp-0 (-> self control dynam gravity-normal) f30-0)) + (let* ((f1-0 (vector-length gp-0)) + (f0-3 f1-0) + ) + (if (< 40960.0 f1-0) + (set! f1-0 40960.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f30-0) + (vector-float*! gp-0 gp-0 (/ f1-0 f0-3)) + ) + ) + ) + (if (!= (-> self next-state name) 'target-death) + (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + ) + (target-exit) + (none) + ) + :trans + (behavior () + (when (= *cheat-mode* 'debug) + (when (and + (not *pause-lock*) + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + (pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) + (go target-stance) + ) + ) + (none) + ) + :code + (behavior ((arg0 symbol) (arg1 attack-info)) + (set! (-> self water flags) (logand -65537 (-> self water flags))) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (let ((gp-0 (-> self attack-info))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 gp-0)) + (set! (-> v1-4 attacker) (the-as handle #f)) + (set! (-> v1-4 mode) 'generic) + (set! (-> v1-4 shove-back) 6144.0) + (set! (-> v1-4 shove-up) 4915.2) + (set! (-> v1-4 angle) #f) + (set! (-> v1-4 trans quad) (-> self control trans quad)) + (set! (-> v1-4 control) 0.0) + (set! (-> v1-4 invinc-time) (-> *TARGET-bank* hit-invulnerable-timeout)) + ) + (case arg0 + (('shove) + (let ((v1-7 gp-0)) + (set! (-> v1-7 shove-back) (-> *TARGET-bank* smack-surface-dist)) + (set! (-> v1-7 shove-up) (-> *TARGET-bank* smack-surface-height)) + (set! (-> v1-7 angle) 'shove) + ) + ) + ) + (dummy-9 gp-0 arg1) + (when (zero? (logand (-> gp-0 mask) 2)) + (vector-z-quaternion! (-> gp-0 vector) (-> self control unknown-quaternion00)) + (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) + (set! (-> gp-0 vector y) (-> gp-0 shove-up)) + ) + (set! (-> s5-0 quad) (-> gp-0 vector quad)) + (let ((f0-10 (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-0 (the-as float 1.0)) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)) + ) + ) + ) + (if (not (-> self attack-info angle)) + (set! (-> self attack-info angle) (if (>= 0.0 f0-10) + 'front + 'back + ) + ) + ) + ) + (when (= arg0 'attack) + (logior! (-> self state-flags) 8) + (set! (-> self game hit-time) (-> *display* base-frame-counter)) + (case (-> gp-0 mode) + (('endlessfall) + (cond + ((= (-> self game mode) 'debug) + (let ((s4-1 (new-stack-vector0))) + (set! (-> s4-1 quad) (-> self control unknown-vector54 quad)) + (ja-channel-set! 0) + (let ((s3-1 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) s3-1) 300) + (suspend) + ) + ) + (TODO-RENAME-30 (-> self control) s4-1) + ) + (set! (-> (&-> (-> self control) unknown-qword00) 0) (-> self control trans quad)) + (send-event *camera* 'teleport) + (go target-stance) + ) + (else + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (the-as float -1000.0) + (the-as handle #f) + ) + (go target-death (-> gp-0 mode)) + ) + ) + ) + (('drown-death 'sharkey 'lava 'dark-eco-pool 'ogreboss-super-boulder 'melt 'instant-death) + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (the-as float -1000.0) + (the-as handle #f) + ) + (if (= (-> self game mode) 'play) + (go target-death (-> gp-0 mode)) + ) + ) + (('death) + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (the-as float -1000.0) + (the-as handle #f) + ) + ) + (('plant-boss) + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (- (-> *FACT-bank* health-single-inc)) + (the-as handle #f) + ) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + (go target-death (-> gp-0 mode)) + ) + ) + (else + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (- (-> *FACT-bank* health-single-inc)) + (the-as handle #f) + ) + ) + ) + (target-hit-effect gp-0) + ) + (set! (-> self control unknown-surface00) *smack-mods*) + (target-hit-setup-anim gp-0) + (target-hit-move gp-0 (target-hit-orient gp-0 s5-0) target-falling-anim-trans (the-as float 1.0)) + ) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + (go target-death (-> gp-0 mode)) + ) + ) + (go target-hit-ground #f) + (none) + ) + :post + (the-as (function none :behavior target) target-post) + ) + +;; definition for symbol *death-spool-array*, type (array spool-anim) +(define + *death-spool-array* + (the-as (array spool-anim) + (new + 'static + 'boxed-array + :type spool-anim :length 11 :allocated-length 11 + (new 'static 'spool-anim :name "death-0181" :index 3 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0182" :index 4 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0184" :index 5 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0186" :index 6 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0187" :index 7 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0191" :index 8 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0193" :index 9 :parts 2 :command-list '()) + (new 'static 'spool-anim :name "death-0195" :index 10 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0197" :index 11 :parts 2 :command-list '()) + (new 'static 'spool-anim :name "death-0199" :index 12 :parts 2 :command-list '()) + (new 'static 'spool-anim :name "death-0202" :index 13 :parts 1 :command-list '()) + ) + ) + ) + +;; failed to figure out what this is: +(if (!= *kernel-boot-message* 'play) + (set! (-> *death-spool-array* length) 3) + ) + +;; definition for function death-movie-remap +(defun death-movie-remap ((arg0 int) (arg1 int)) + (let ((v1-0 (/ arg0 arg1))) + (mod + (if (zero? (logand v1-0 1)) + (logxor v1-0 arg0) + (logand #xfffffff (- (logxor v1-0 arg0))) + ) + arg1 + ) + ) + ) + +;; definition for function target-death-anim +;; INFO: Return type mismatch int vs none. +(defbehavior target-death-anim target ((arg0 spool-anim)) + (set! (-> self control unknown-surface00) *neutral-mods*) + (ja-channel-push! 1 30) + (let ((a0-3 (-> self skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 76))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 76)) data 0 length) -1)) + ) + (set! (-> a0-3 param 1) 1.0) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 76)) num-func-seek!) + ) + (until (ja-done? 0) + (if arg0 + (spool-push *art-control* (-> arg0 name) 0 self (the-as float -99.0)) + ) + (send-event *camera* 'joystick 0.0 -1.0) + (TODO-RENAME-9 (-> self align)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (when (zero? (logand (-> self align flags) 1)) + (vector-matrix*! s5-0 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) + (vector-float*! (-> self control transv) s5-0 (-> *display* frames-per-second)) + ) + ) + (suspend) + (let ((a0-9 (-> self skel root-channel 0))) + (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1))) + (set! (-> a0-9 param 1) 1.0) + (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate target-death (target) + :event + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('end-mode) + (let ((v0-0 (the-as object #t))) + (set! (-> self control unknown-uint20) (the-as uint v0-0)) + v0-0 + ) + ) + (('change-mode) + (case (-> arg3 param 0) + (('grab) + #t + ) + ) + ) + (('notify) + (when (type-type? (-> arg0 type) pov-camera) + (case (-> arg3 param 0) + (('die 'abort-request) + (set! (-> self control unknown-uint20) (the-as uint #t)) + (set-blackout-frames 60) + ) + ) + ) + ) + (('get-pickup) + #f + ) + (('touched) + #f + ) + (else + (target-generic-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :exit + (behavior () + (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + (target-exit) + (clear-pending-settings-from-process *setting-control* self 'process-mask) + (clear-pending-settings-from-process *setting-control* self 'allow-progress) + (restore-collide-with-as (-> self control)) + (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :skip #x1 :noentity #x1)) + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (none) + ) + :trans + (-> target-hit trans) + :code + (behavior ((arg0 symbol)) + (set! (-> self control unknown-uint20) (the-as uint #f)) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) self) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'target) + (set! (-> a1-0 param 0) (the-as uint 'die)) + (set! (-> a1-0 param 1) (the-as uint arg0)) + (set! (-> self control unknown-int21) + (the-as int (send-event-function (handle->process (-> self attack-info attacker)) a1-0)) + ) + ) + (set! (-> self neck flex-blend) 0.0) + (target-timed-invulnerable-off self) + (set-setting! *setting-control* self 'process-mask 'set (the-as float 0.0) #x14a0000) + (copy-settings-from-target! *setting-control*) + (set! (-> self control transv quad) (the-as uint128 0)) + (logior! (-> self state-flags) #x8000) + (case arg0 + (('none 'instant-death) + ) + (('ogreboss-super-boulder) + (set! (-> self post-hook) target-no-ja-move-post) + (-> self attack-info attacker) + (ja-channel-set! 0) + (ja-post) + (let ((gp-1 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-1) 300) + (suspend) + ) + ) + ) + (('drown 'drown-death) + (sound-play-by-name (static-sound-name "death-drown") (new-sound-id) 1024 0 0 1 #t) + (set! (-> self water flags) (logand -17 (-> self water flags))) + (clear-collide-with-as (-> self control)) + (set! (-> self control unknown-surface00) *dive-mods*) + (set! (-> self control dynam gravity-max) 6144.0) + (set! (-> self control dynam gravity-length) 6144.0) + (ja-channel-push! 1 30) + (let ((f30-0 0.7) + (gp-3 (-> self skel root-channel 0)) + ) + (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 93))) + (set! (-> gp-3 param 0) (ja-aframe (the-as float 73.0) 0)) + (let ((f30-1 (seek f30-0 (the-as float 0.05) (* 1.5 (-> *display* seconds-per-frame))))) + (set! (-> gp-3 param 1) f30-1) + (set! (-> gp-3 frame-num) 0.0) + (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 93)) num-func-seek!) + (until (ja-done? 0) + (suspend) + (let ((gp-4 (-> self skel root-channel 0))) + (set! (-> gp-4 param 0) (ja-aframe (the-as float 73.0) 0)) + (set! f30-1 (seek f30-1 (the-as float 0.05) (* 1.5 (-> *display* seconds-per-frame)))) + (set! (-> gp-4 param 1) f30-1) + (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + ) + (('lava 'dark-eco-pool 'melt) + (let ((s5-1 (handle->process (-> self attack-info attacker)))) + (when (if (and (nonzero? s5-1) (type-type? (-> s5-1 type) water-vol)) + s5-1 + ) + (set! (-> self state-flags) (logior #x80000 (-> self state-flags))) + (set! (-> self alt-cam-pos y) (+ 4096.0 (-> self water height))) + ) + ) + (cond + ((= arg0 'dark-eco-pool) + (sound-play-by-name (static-sound-name "death-darkeco") (new-sound-id) 1024 0 0 1 #t) + (let ((gp-6 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-6 + (let ((t9-21 (method-of-type part-tracker activate))) + (t9-21 (the-as part-tracker gp-6) *entity-pool* 'part-tracker (the-as pointer #x70004000)) + ) + (run-now-in-process gp-6 part-tracker-init (-> *part-group-id-table* 31) -1 #f #f #f (-> self control trans)) + (-> gp-6 ppointer) + ) + ) + ) + ((or (= arg0 'lava) (= arg0 'melt)) + (sound-play-by-name (static-sound-name "death-melt") (new-sound-id) 1024 0 0 1 #t) + (let ((gp-8 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-8 + (let ((t9-26 (method-of-type part-tracker activate))) + (t9-26 (the-as part-tracker gp-8) *entity-pool* 'part-tracker (the-as pointer #x70004000)) + ) + (run-now-in-process gp-8 part-tracker-init (-> *part-group-id-table* 32) -1 #f #f #f (-> self control trans)) + (-> gp-8 ppointer) + ) + ) + ) + ) + (clear-collide-with-as (-> self control)) + (set! (-> self post-hook) target-no-ja-move-post) + (ja-channel-set! 0) + (ja-post) + (let ((gp-9 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-9) 600) + (suspend) + ) + ) + ) + (('endlessfall) + (sound-play-by-name (static-sound-name "death-fall") (new-sound-id) 1024 0 0 1 #t) + (camera-change-to (the-as string cam-endlessfall) 30 #f) + (set! (-> self control pat-ignore-mask unknown-bit) 1) + (set! (-> self water flags) (logand -17 (-> self water flags))) + (let ((f30-2 (fmin -4096.0 (- (-> self control ground-impact-vel))))) + (set! (-> self control unknown-uint20) (the-as uint f30-2)) + (let ((gp-11 (new-stack-vector0))) + (let ((f0-14 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! gp-11 (-> self control transv) (vector-float*! gp-11 (-> self control dynam gravity-normal) f0-14)) + ) + (let* ((f0-15 (vector-length gp-11)) + (f1-6 f0-15) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f30-2) + (vector-float*! gp-11 gp-11 (/ f0-15 f1-6)) + ) + ) + ) + ) + (set! (-> self trans-hook) + (lambda :behavior target + () + (vector-seek! (-> self draw color-mult) *zero-vector* (-> *display* seconds-per-frame)) + (let ((gp-0 (new-stack-vector0)) + (f30-0 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + ) + 0.0 + (vector-! + gp-0 + (-> self control transv) + (vector-float*! gp-0 (-> self control dynam gravity-normal) (the-as float f30-0)) + ) + (let* ((f0-4 (vector-length gp-0)) + (f1-0 f0-4) + ) + (if (< (the-as float (-> self control unknown-uint20)) (the-as float f30-0)) + (set! f30-0 (-> self control unknown-uint20)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f30-0)) + (vector-float*! gp-0 gp-0 (/ f0-4 f1-0)) + ) + ) + ) + ((-> target-hit trans)) + (none) + ) + ) + (target-falling-anim 30 99) + (ja-channel-push! 1 90) + (let ((a0-75 (-> self skel root-channel 0))) + (set! (-> a0-75 frame-group) (the-as art-joint-anim (-> self draw art-group data 43))) + (set! (-> a0-75 param 0) 0.5) + (set! (-> a0-75 frame-num) 0.0) + (joint-control-channel-group! a0-75 (the-as art-joint-anim (-> self draw art-group data 43)) num-func-loop!) + ) + (let ((gp-12 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-12) 240) + (let ((a0-76 (-> self skel root-channel 0))) + (set! (-> a0-76 frame-group) (the-as art-joint-anim (-> self draw art-group data 43))) + (set! (-> a0-76 param 0) 0.5) + (joint-control-channel-group-eval! + a0-76 + (the-as art-joint-anim (-> self draw art-group data 43)) + num-func-loop! + ) + ) + (suspend) + ) + ) + (camera-change-to (the-as string 'base) 0 #f) + ) + (('target-hit-ground-hard) + (set! (-> self control unknown-surface00) *neutral-mods*) + (ja-channel-push! 1 30) + (let ((a0-81 (-> self skel root-channel 0))) + (set! (-> a0-81 frame-group) (the-as art-joint-anim (-> self draw art-group data 77))) + (set! (-> a0-81 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 77)) data 0 length) -1)) + ) + (set! (-> a0-81 param 1) 1.0) + (set! (-> a0-81 frame-num) 0.0) + (joint-control-channel-group! a0-81 (the-as art-joint-anim (-> self draw art-group data 77)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-82 (-> self skel root-channel 0))) + (set! (-> a0-82 param 0) (the float (+ (-> a0-82 frame-group data 0 length) -1))) + (set! (-> a0-82 param 1) 1.0) + (joint-control-channel-group-eval! a0-82 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + (('sharkey) + (send-event self 'dry) + (set! (-> self post-hook) target-no-ja-move-post) + (let ((gp-13 (-> self attack-info attacker))) + (ja-channel-set! 0) + (ja-post) + (while (and (handle->process gp-13) (not (-> self control unknown-spoolanim00))) + (send-event *camera* 'joystick 0.0 0.0) + (suspend) + ) + ) + ) + (('plant-boss) + (set! (-> self trans-hook) #f) + (let ((gp-14 (-> self attack-info attacker)) + (a1-44 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-44 from) self) + (set! (-> a1-44 num-params) 0) + (set! (-> a1-44 message) 'joint) + (let ((s5-5 (the-as int (send-event-function (handle->process gp-14) a1-44)))) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'copy-parent) + (set! (-> self post-hook) target-no-ja-move-post) + (let ((a0-98 (-> self node-list data))) + (set! (-> a0-98 0 param0) nothing) + (set! (-> a0-98 0 param1) #f) + (set! (-> a0-98 0 param2) #f) + ) + (while (and (handle->process gp-14) (not (-> self control unknown-spoolanim00)) (-> self control unknown-int21)) + (let* ((v1-205 (-> (the-as process-drawable (handle->process gp-14)) node-list data s5-5 bone transform)) + (a3-9 (-> self node-list data 0 bone transform)) + (a0-106 (-> v1-205 vector 0 quad)) + (a1-47 (-> v1-205 vector 1 quad)) + (a2-26 (-> v1-205 vector 2 quad)) + (v1-206 (-> v1-205 vector 3 quad)) + ) + (set! (-> a3-9 vector 0 quad) a0-106) + (set! (-> a3-9 vector 1 quad) a1-47) + (set! (-> a3-9 vector 2 quad) a2-26) + (set! (-> a3-9 vector 3 quad) v1-206) + ) + (clone-anim-once gp-14 33 #f "") + (suspend) + 0 + ) + ) + ) + ) + (('burn 'burnup) + (let ((gp-15 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-15 + (let ((t9-52 (method-of-type part-tracker activate))) + (t9-52 (the-as part-tracker gp-15) *entity-pool* 'part-tracker (the-as pointer #x70004000)) + ) + (run-now-in-process + gp-15 + part-tracker-init + (-> *part-group-id-table* 708) + -1 + #f + #f + #f + (-> self control trans) + ) + (-> gp-15 ppointer) + ) + ) + (target-death-anim (the-as spool-anim #f)) + ) + (else + (case arg0 + (('tar) + (sound-play-by-name (static-sound-name "death-drown") (new-sound-id) 1024 0 0 1 #t) + ) + ) + (+! (-> *game-info* death-movie-tick) 1) + (if (= (death-movie-remap (+ (-> *game-info* death-movie-tick) -1) (-> *death-spool-array* length)) + (death-movie-remap (-> *game-info* death-movie-tick) (-> *death-spool-array* length)) + ) + (+! (-> *game-info* death-movie-tick) 1) + ) + (let ((gp-18 + (-> *death-spool-array* (death-movie-remap (-> *game-info* death-movie-tick) (-> *death-spool-array* length))) + ) + ) + (set-setting! *setting-control* self 'allow-progress #f (the-as float 0.0) 0) + (target-death-anim gp-18) + (when (and + (< (rand-vu-int-count (-> *game-info* death-movie-tick)) (* (-> *death-spool-array* length) 2)) + (zero? (logand (-> self water flags) 512)) + (!= (-> self control ground-pat material) 9) + (!= (-> self control ground-pat material) 10) + ) + (iterate-process-tree + *entity-pool* + (lambda :behavior target + ((arg0 process)) + (if (and + (logtest? (process-mask enemy) (-> arg0 mask)) + (type-type? (-> arg0 type) process-drawable) + (nonzero? (-> (the-as process-drawable arg0) root)) + (< (vector-vector-distance (-> (the-as process-drawable arg0) root trans) (-> *target* control trans)) + 61440.0 + ) + ) + (process-entity-status! arg0 (entity-perm-status bit-9) #t) + ) + ) + *null-kernel-context* + ) + (set! (-> *ACTOR-bank* birth-max) 1000) + (set! (-> self trans-hook) #f) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) + (send-event (ppointer->process (-> self sidekick)) 'shadow #f) + (send-event self 'blend-shape #t) + (let* ((s5-7 (get-process *default-dead-pool* pov-camera #x4000)) + (s5-8 + (ppointer->handle + (when s5-7 + (let ((t9-68 (method-of-type pov-camera activate))) + (t9-68 (the-as pov-camera s5-7) *target-pool* 'pov-camera (the-as pointer #x70004000)) + ) + (run-now-in-process s5-7 pov-camera-init-by-other (-> self control trans) *deathcam-sg* gp-18 4 self '()) + (-> s5-7 ppointer) + ) + ) + ) + ) + (send-event (handle->process s5-8) 'music-movie-volume 0.0) + (send-event (handle->process s5-8) 'sfx-movie-volume 50.0) + (set! (-> self post-hook) target-no-ja-move-post) + (while (not (-> self control unknown-spoolanim00)) + (spool-push *art-control* (-> gp-18 name) 0 self (the-as float -99.0)) + (clone-anim-once s5-8 33 #f "") + (suspend) + ) + (let ((a0-155 (handle->process s5-8))) + (if a0-155 + (deactivate a0-155) + ) + ) + ) + (send-event (ppointer->process (-> self sidekick)) 'shadow #t) + (suspend) + 0 + ) + ) + ) + ) + (set! (-> self control transv quad) (the-as uint128 0)) + (initialize! (-> self game) 'dead (the-as game-save #f) (the-as string #f)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (anim-loop) + (none) + ) + :post + target-no-stick-post + ) diff --git a/test/decompiler/reference/levels/flut_common/target-flut_REF.gc b/test/decompiler/reference/levels/flut_common/target-flut_REF.gc new file mode 100644 index 0000000000..7dc6c74203 --- /dev/null +++ b/test/decompiler/reference/levels/flut_common/target-flut_REF.gc @@ -0,0 +1,2841 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type flut-info +(deftype flut-info (basic) + ((entity basic :offset-assert 4) + (flut-trans vector :inline :offset-assert 16) + (flut-quat vector :inline :offset-assert 32) + (flut-scale vector :inline :offset-assert 48) + (stick-lock basic :offset-assert 64) + (flap-sound-id sound-id :offset-assert 68) + ) + :method-count-assert 9 + :size-assert #x48 + :flag-assert #x900000048 + ) + +;; definition for method 3 of type flut-info +(defmethod inspect flut-info ((obj flut-info)) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~Tentity: ~A~%" (-> obj entity)) + (format #t "~Tflut-trans: ~`vector`P~%" (-> obj flut-trans)) + (format #t "~Tflut-quat: ~`vector`P~%" (-> obj flut-quat)) + (format #t "~Tflut-scale: ~`vector`P~%" (-> obj flut-scale)) + (format #t "~Tstick-lock: ~A~%" (-> obj stick-lock)) + (format #t "~Tflap-sound-id: ~D~%" (-> obj flap-sound-id)) + obj + ) + +;; definition of type flut-bank +(deftype flut-bank (basic) + ((jump-height-min meters :offset-assert 4) + (jump-height-max meters :offset-assert 8) + (double-jump-height-min meters :offset-assert 12) + (double-jump-height-max meters :offset-assert 16) + (air-attack-speed meters :offset-assert 20) + (ground-timeout int64 :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type flut-bank +(defmethod inspect flut-bank ((obj flut-bank)) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~Tjump-height-min: (meters ~m)~%" (-> obj jump-height-min)) + (format #t "~Tjump-height-max: (meters ~m)~%" (-> obj jump-height-max)) + (format #t "~Tdouble-jump-height-min: (meters ~m)~%" (-> obj double-jump-height-min)) + (format #t "~Tdouble-jump-height-max: (meters ~m)~%" (-> obj double-jump-height-max)) + (format #t "~Tair-attack-speed: (meters ~m)~%" (-> obj air-attack-speed)) + (format #t "~Tground-timeout: ~D~%" (-> obj ground-timeout)) + obj + ) + +;; definition for symbol *FLUT-bank*, type flut-bank +(define *FLUT-bank* (new 'static 'flut-bank + :jump-height-min (meters 5.0) + :jump-height-max (meters 7.0) + :double-jump-height-min (meters 1.0) + :double-jump-height-max (meters 2.0) + :air-attack-speed (meters 20.0) + :ground-timeout #x96 + ) + ) + +;; definition for symbol *flut-walk-mods*, type surface +(define *flut-walk-mods* (new 'static 'surface + :name 'run + :turnv 54613.332 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 131072.0 + :transv-max 81920.0 + :target-speed 81920.0 + :seek0 1.5 + :seek90 3.0 + :seek180 2.0 + :fric 1.0 + :nonlin-fric-dist 0.1 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :flags #x8 + ) + ) + +;; definition for symbol *flut-jump-mods*, type surface +(define *flut-jump-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 54613.332 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 81920.0 + :target-speed 81920.0 + :seek0 0.9 + :seek90 1.5 + :seek180 1.5 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags #x800 + ) + ) + +;; definition for symbol *flut-double-jump-mods*, type surface +(define *flut-double-jump-mods* (new 'static 'surface + :name 'jump-double + :turnv 131072.0 + :turnvv 54613.332 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 81920.0 + :target-speed 81920.0 + :seek0 0.9 + :seek90 1.5 + :seek180 1.5 + :fric 0.1 + :nonlin-fric-dist 10.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'air + :flags #x800 + ) + ) + +;; definition for symbol *flut-run-attack-mods*, type surface +(define *flut-run-attack-mods* (new 'static 'surface + :name 'wheel-flip + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 122880.0 + :target-speed 122880.0 + :seek90 0.5 + :seek180 0.15 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + :flags #x1018 + ) + ) + +;; definition for symbol *flut-air-attack-mods*, type surface +(define *flut-air-attack-mods* (new 'static 'surface + :name 'flop + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 122880.0 + :target-speed 122880.0 + :seek0 1.0 + :seek90 0.3 + :seek180 1.5 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :mode 'attack + :flags #x1800 + ) + ) + +;; definition for function target-flut-post-post +;; INFO: Return type mismatch int vs none. +;; Used lq/sq +(defbehavior target-flut-post-post target () + (vector+! (-> self flut flut-trans) (-> self control trans) (-> self control unknown-vector12)) + (quaternion-copy! (the-as quaternion (-> self flut flut-quat)) (-> self control quat)) + (set! (-> self flut flut-scale quad) (-> self control scale quad)) + (let ((v1-8 (-> *target-shadow-control* settings shadow-dir quad))) + (set! (-> *flutflut-shadow-control* settings shadow-dir quad) v1-8) + ) + 0 + (none) + ) + +;; definition for function target-flut-post +;; INFO: Return type mismatch int vs none. +(defbehavior target-flut-post target () + (target-post) + (target-flut-post-post) + 0 + (none) + ) + +;; definition for function target-flut-falling-anim-trans +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function target-flut-hit-ground-anim +(defbehavior target-flut-hit-ground-anim target () + (cond + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 144) + ) + (if (!= (-> self skel root-channel 0) (-> self skel channel)) + (ja-channel-push! 2 15) + (ja-channel-set! 2) + ) + (let ((gp-0 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-0 + (the-as art-joint-anim (-> self draw art-group data 145)) + num-func-identity + ) + (set! (-> gp-0 frame-num) 0.0) + ) + (let ((gp-1 (-> self skel root-channel 1))) + (joint-control-channel-group-eval! + gp-1 + (the-as art-joint-anim (-> self draw art-group data 148)) + num-func-identity + ) + (set! (-> gp-1 frame-num) 0.0) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-11 (-> self skel root-channel 0))) + (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) + (set! (-> a0-11 param 1) 1.0) + (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) + ) + (let ((a0-12 (-> self skel root-channel 1))) + (set! (-> a0-12 param 0) 0.0) + (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) + ) + ) + #f + ) + ((let ((v1-33 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or (= v1-33 (-> self draw art-group data 143)) (= v1-33 (-> self draw art-group data 145))) + ) + #f + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 149) + ) + (ja-channel-set! 1) + (let ((a0-26 (-> self skel root-channel 0))) + (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> self draw art-group data 145))) + (set! (-> a0-26 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 145)) data 0 length) -1)) + ) + (set! (-> a0-26 param 1) 1.0) + (set! (-> a0-26 frame-num) 0.0) + (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> self draw art-group data 145)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-27 (-> self skel root-channel 0))) + (set! (-> a0-27 param 0) (the float (+ (-> a0-27 frame-group data 0 length) -1))) + (set! (-> a0-27 param 1) 1.0) + (joint-control-channel-group-eval! a0-27 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + #f + ) + ((let ((v1-68 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or (= v1-68 (-> self draw art-group data 152)) (= v1-68 (-> self draw art-group data 153))) + ) + (ja-channel-set! 1) + (let ((a0-37 (-> self skel root-channel 0))) + (set! (-> a0-37 frame-group) (the-as art-joint-anim (-> self draw art-group data 154))) + (set! (-> a0-37 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 154)) data 0 length) -1)) + ) + (set! (-> a0-37 param 1) 1.0) + (set! (-> a0-37 frame-num) 0.0) + (joint-control-channel-group! a0-37 (the-as art-joint-anim (-> self draw art-group data 154)) num-func-seek!) + ) + (until (ja-done? 0) + (TODO-RENAME-9 (-> self align)) + (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (suspend) + (let ((a0-40 (-> self skel root-channel 0))) + (set! (-> a0-40 param 0) (the float (+ (-> a0-40 frame-group data 0 length) -1))) + (set! (-> a0-40 param 1) 1.0) + (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + #f + ) + ) + ) + +;; definition for function target-flut-standard-event-handler +;; Used lq/sq +(defbehavior target-flut-standard-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + 'flut + ) + (else + (case arg2 + (('end-mode) + (go target-flut-get-off (process->handle arg0)) + ) + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as process (-> arg3 param 0)) + (the-as (state handle attack-info target) target-flut-hit) + ) + ) + (('shove) + (when (!= (-> self next-state name) 'target-hit) + (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 104) + (when (zero? (logand (-> self attack-info-rec mask) 8)) + (set! (-> self attack-info-rec attacker) (process->handle arg0)) + (logior! (-> self attack-info-rec mask) 8) + ) + (go target-flut-hit 'shove (-> self attack-info-rec)) + ) + ) + (('falling) + (when #t + enter-state + (go target-flut-falling) + ) + ) + (('swim) + (let* ((gp-1 (-> self control unknown-vector54)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) gp-1 (-> self control trans))) + (f30-1 (fmax 8192.0 (fmin 40960.0 (vector-xz-length s3-1)))) + ) + (vector-xz-normalize! s3-1 f30-1) + (let ((s5-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> s5-0 from) self) + (set! (-> s5-0 num-params) 2) + (set! (-> s5-0 message) 'shove) + (set! (-> s5-0 param 0) (the-as uint #f)) + (let ((s4-0 (new 'static 'attack-info :mask #x882))) + (set! (-> s4-0 vector quad) (-> s3-1 quad)) + (set! (-> s4-0 shove-up) + (+ (lerp-scale (the-as float 4096.0) (the-as float 16384.0) f30-1 (the-as float 4096.0) (the-as float 40960.0)) + (fmax 0.0 (- (-> gp-1 y) (-> self control trans y))) + ) + ) + (set! (-> s4-0 angle) 'up) + (set! (-> s5-0 param 1) (the-as uint s4-0)) + ) + (send-event-function self s5-0) + ) + ) + ) + (('change-mode) + (case (-> arg3 param 0) + (('grab) + (go target-flut-grab) + ) + ) + ) + (('clone-anim) + (go target-flut-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + (else + (target-generic-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + +;; definition for function target-flut-dangerous-event-handler +(defbehavior target-flut-dangerous-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('touched) + (if ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 224) + ) + (target-send-attack + arg0 + (the-as uint (-> self control unknown-symbol30)) + (-> arg3 param 0) + (-> self control unknown-dword50) + (-> self control unknown-dword51) + ) + (target-flut-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as process (-> arg3 param 0)) + (the-as (state handle attack-info target) target-flut-hit) + ) + ) + (else + (target-flut-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + +;; failed to figure out what this is: +(defstate target-flut-start (target) + :event + target-flut-standard-event-handler + :exit + (behavior () + (when (not + (or + (= (-> self next-state name) 'target-flut-stance) + (= (-> self next-state name) 'target-flut-walk) + (= (-> self next-state name) 'target-flut-jump) + (= (-> self next-state name) 'target-flut-double-jump) + (= (-> self next-state name) 'target-flut-hit-ground) + (= (-> self next-state name) 'target-flut-falling) + (= (-> self next-state name) 'target-flut-running-attack) + (= (-> self next-state name) 'target-flut-air-attack) + (= (-> self next-state name) 'target-flut-air-attack-hit-ground) + (= (-> self next-state name) 'target-flut-hit) + (= (-> self next-state name) 'target-flut-death) + (= (-> self next-state name) 'target-flut-get-on) + (= (-> self next-state name) 'target-flut-get-off) + (= (-> self next-state name) 'target-flut-get-off-jump) + (= (-> self next-state name) 'target-flut-grab) + (= (-> self next-state name) 'target-flut-clone-anim) + ) + ) + (let ((v1-33 (-> self manipy))) + (when v1-33 + (deactivate (-> v1-33 0)) + (set! (-> self manipy) (the-as (pointer manipy) #f)) + ) + ) + (set! (-> self control root-prim prim-core action) + (logand -16385 (-> self control root-prim prim-core action)) + ) + (set! (-> self control unknown-surface00) *walk-mods*) + (set! (-> self state-flags) (logand -1025 (-> self state-flags))) + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (target-collide-set! 'normal (-> (new 'static 'array float 1 0.0) 0)) + (set! (-> self control reaction) target-collision-reaction) + (set! (-> self control unknown-vector12 quad) (the-as uint128 0)) + (clear-pending-settings-from-process *setting-control* self 'sound-flava) + (target-exit) + ) + (none) + ) + :code + (behavior ((arg0 handle)) + (target-exit) + (set! *display-profile* #f) + (set! *display-entity-errors* #f) + (set-setting! *setting-control* self 'sound-flava #f (the-as float 30.0) 2) + (if (zero? (-> self flut)) + (set! (-> self flut) (new 'process 'flut-info)) + ) + (set! (-> self flut stick-lock) #f) + (set! (-> self flut flap-sound-id) (new-sound-id)) + (set! (-> self flut entity) #f) + (let ((v1-11 (handle->process arg0))) + (if v1-11 + (set! (-> self flut entity) (-> v1-11 entity)) + ) + ) + (target-collide-set! 'flut (-> (new 'static 'array float 1 0.0) 0)) + (set! (-> self control transv quad) (the-as uint128 0)) + (set! (-> self control unknown-float01) 0.0) + (logior! (-> self control root-prim prim-core action) #x4000) + (let ((s5-0 (-> self entity))) + (set! (-> self entity) (the-as entity (-> self flut entity))) + (let ((s4-0 (get-process *default-dead-pool* manipy #x4000))) + (set! (-> self manipy) + (the-as (pointer manipy) (when s4-0 + (let ((t9-6 (method-of-type manipy activate))) + (t9-6 (the-as manipy s4-0) self 'manipy (the-as pointer #x70004000)) + ) + (run-now-in-process + s4-0 + manipy-init + (-> self control trans) + (-> self entity) + *flutflut-sg* + 'collide-shape-moving + ) + (-> s4-0 ppointer) + ) + ) + ) + ) + (set! (-> self entity) s5-0) + ) + (when (-> self manipy) + (send-event + (ppointer->process (-> self manipy)) + 'trans-hook + (lambda :behavior flutflut + () + (let* ((a0-0 (-> self parent-override)) + (v1-0 (if a0-0 + (-> a0-0 0 self-override) + ) + ) + ) + (set! (-> self root-override trans quad) (-> v1-0 flut flut-trans quad)) + (let ((a0-4 (-> v1-0 flut flut-quat quad))) + (set! (-> self root-override quat vec quad) a0-4) + ) + (set! (-> self root-override scale quad) (-> v1-0 flut flut-scale quad)) + (set! (-> self root-override ground-pat material) (the-as int (-> v1-0 control ground-pat material))) + (set! (-> self draw light-index) (the-as uint 255)) + (let ((a0-13 (-> v1-0 draw color-mult quad))) + (set! (-> self draw color-mult quad) a0-13) + ) + (let ((a0-15 (-> v1-0 draw color-emissive quad))) + (set! (-> self draw color-emissive quad) a0-15) + ) + (let ((f0-0 (-> v1-0 draw secondary-interp))) + (set! (-> self draw secondary-interp) f0-0) + f0-0 + ) + ) + ) + ) + (send-event (ppointer->process (-> self manipy)) 'anim-mode 'loop) + (send-event + (ppointer->process (-> self manipy)) + 'art-joint-anim + "flut-get-on" + (-> (new 'static 'array float 1 0.0) 0) + ) + (send-event (ppointer->process (-> self manipy)) 'blend-shape #t) + (send-event + (ppointer->process (-> self manipy)) + 'eval + (lambda :behavior target + () + (set! (-> self attack-info intersection z) (the-as float #f)) + (let ((v1-1 (-> *target-shadow-control* settings shadow-dir quad))) + (set! (-> *flutflut-shadow-control* settings shadow-dir quad) v1-1) + ) + (let ((v0-0 *flutflut-shadow-control*)) + (set! (-> self draw shadow-ctrl) v0-0) + v0-0 + ) + ) + ) + ) + (remove-exit) + (go target-flut-get-on arg0) + (none) + ) + :post + (the-as (function none :behavior target) target-post) + ) + +;; failed to figure out what this is: +(defstate target-flut-stance (target) + :event + target-flut-standard-event-handler + :enter + (behavior () (set! (-> self control unknown-surface00) *flut-walk-mods*) (none)) + :exit + (-> target-flut-start exit) + :trans + (behavior () + (if (move-legs?) + (go target-flut-walk) + ) + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (go target-flut-jump (-> *FLUT-bank* jump-height-min) (-> *FLUT-bank* jump-height-max)) + ) + (if (can-hands? #t) + (go target-flut-running-attack) + ) + (when (and + (zero? (logand (-> self control status) 1)) + (and + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-37 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or + (not (or + (= v1-37 (-> self draw art-group data 59)) + (= v1-37 (-> self draw art-group data 60)) + (= v1-37 (-> self draw art-group data 61)) + ) + ) + (< 4096.0 (target-height-above-ground)) + ) + ) + ) + ) + enter-state + (go target-flut-falling) + ) + (none) + ) + :code + (behavior () + (let ((gp-0 22)) + (let ((v1-2 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((or (= v1-2 (-> self draw art-group data 141)) (= v1-2 (-> self draw art-group data 161))) + (set! gp-0 60) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 155) + ) + (let ((a0-11 (-> self skel root-channel 0))) + (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) + (set! (-> a0-11 param 1) 1.0) + (joint-control-channel-group! a0-11 (the-as art-joint-anim #f) num-func-seek!) + ) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 158) + ) + (let ((a0-17 (-> self skel root-channel 0))) + (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 159))) + (set! (-> a0-17 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 159)) data 0 length) -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 159)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-18 (-> self skel root-channel 0))) + (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group data 0 length) -1))) + (set! (-> a0-18 param 1) 1.0) + (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 150) + ) + (let ((a0-24 (-> self skel root-channel 0))) + (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> self draw art-group data 151))) + (set! (-> a0-24 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 151)) data 0 length) -1)) + ) + (set! (-> a0-24 param 1) 1.0) + (set! (-> a0-24 frame-num) 0.0) + (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> self draw art-group data 151)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-25 (-> self skel root-channel 0))) + (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) + (set! (-> a0-25 param 1) 1.0) + (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + ) + (if (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 140) + ) + ) + (ja-channel-push! 1 gp-0) + ) + ) + (let ((v1-91 (-> self skel root-channel 0))) + (set! (-> v1-91 frame-group) (the-as art-joint-anim (-> self draw art-group data 140))) + ) + (while #t + (suspend) + (let ((a0-35 (-> self skel root-channel 0))) + (set! (-> a0-35 param 0) 1.0) + (joint-control-channel-group-eval! a0-35 (the-as art-joint-anim #f) num-func-loop!) + ) + ) + (none) + ) + :post + target-flut-post + ) + +;; failed to figure out what this is: +(defstate target-flut-walk (target) + :event + target-flut-standard-event-handler + :enter + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (set! (-> self control unknown-surface00) *flut-walk-mods*) + (set! (-> self control unknown-uint20) (the-as uint (-> self control unknown-surface00 turnv))) + (set! (-> self control unknown-int21) (the-as int (-> self control unknown-surface00 target-speed))) + (none) + ) + :exit + (behavior () + (set! (-> self control unknown-surface00 turnv) (the-as float (-> self control unknown-uint20))) + (set! (-> self control unknown-surface00 target-speed) (the-as float (-> self control unknown-uint30))) + ((-> target-flut-start exit)) + (none) + ) + :trans + (behavior () + (if (not (move-legs?)) + (go target-flut-stance) + ) + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (go target-flut-jump (-> *FLUT-bank* jump-height-min) (-> *FLUT-bank* jump-height-max)) + ) + (if (can-hands? #t) + (go target-flut-running-attack) + ) + (when (and + (zero? (logand (-> self control status) 1)) + (and + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-37 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or + (not (or + (= v1-37 (-> self draw art-group data 59)) + (= v1-37 (-> self draw art-group data 60)) + (= v1-37 (-> self draw art-group data 61)) + ) + ) + (< 4096.0 (target-height-above-ground)) + ) + ) + ) + ) + enter-state + (go target-flut-falling) + ) + (let ((f30-1 (fabs (deg-diff (quaternion-y-angle (-> self control dir-targ)) (y-angle (-> self control)))))) + (set! (-> self control unknown-surface00 turnv) (lerp-scale + (the-as float (-> self control unknown-uint20)) + (* 4.0 (the-as float (-> self control unknown-uint20))) + f30-1 + (the-as float 8192.0) + (the-as float 21845.334) + ) + ) + (if (and (= (-> self control surf name) '*tar-surface*) (< 8192.0 f30-1)) + (set! (-> self control unknown-surface00 target-speed) (seek + (-> self control unknown-surface00 target-speed) + (the-as float 4096.0) + (* 245760.0 (-> *display* seconds-per-frame)) + ) + ) + (set! (-> self control unknown-surface00 target-speed) (seek + (-> self control unknown-surface00 target-speed) + (the-as float (-> self control unknown-uint30)) + (* 81920.0 (-> *display* seconds-per-frame)) + ) + ) + ) + ) + (none) + ) + :code + (behavior () + (let ((f28-0 0.0) + (f30-0 0.0) + ) + (let ((gp-0 22)) + (cond + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 140) + ) + (set! gp-0 60) + ) + ((let ((v1-9 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or + (= v1-9 (-> self draw art-group data 143)) + (= v1-9 (-> self draw art-group data 144)) + (= v1-9 (-> self draw art-group data 152)) + (= v1-9 (-> self draw art-group data 154)) + ) + ) + (ja-channel-push! 1 24) + (let ((a0-18 (-> self skel root-channel 0))) + (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 161))) + (set! (-> a0-18 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 161)) data 0 length) -1)) + ) + (set! (-> a0-18 param 1) 1.0) + (set! (-> a0-18 frame-num) 0.0) + (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 161)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-19 (-> self skel root-channel 0))) + (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) + (set! (-> a0-19 param 1) 1.0) + (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + (set! f30-0 (cond + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 161) + ) + (ja-channel-set! 2) + 1.0 + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 141) + ) + (set! f28-0 (ja-frame-num 0)) + (-> self skel root-channel 1 frame-interp) + ) + (else + (ja-channel-push! 2 gp-0) + f30-0 + ) + ) + ) + ) + (let ((a0-32 (-> self skel root-channel 0))) + (set! (-> a0-32 dist) 49152.0) + (set! (-> a0-32 frame-group) (the-as art-joint-anim (-> self draw art-group data 141))) + (set! (-> a0-32 param 0) 1.0) + (set! (-> a0-32 frame-num) f28-0) + (joint-control-channel-group! a0-32 (the-as art-joint-anim (-> self draw art-group data 141)) num-func-loop!) + ) + (let ((gp-1 (-> self skel root-channel 1))) + (set! (-> gp-1 frame-interp) f30-0) + (set! (-> gp-1 dist) 40960.0) + (joint-control-channel-group! + gp-1 + (the-as art-joint-anim (-> self draw art-group data 142)) + num-func-identity + ) + (set! (-> gp-1 frame-num) (* 0.5 f28-0)) + ) + (while #t + (suspend) + (let ((f0-13 (lerp-scale + (-> (new 'static 'array float 1 0.0) 0) + (the-as float 1.0) + (-> self control unknown-float01) + (the-as float 49152.0) + (the-as float 77824.0) + ) + ) + ) + (set! f30-0 (seek f30-0 f0-13 (* 4.0 (-> *display* seconds-per-frame)))) + ) + (set! (-> self skel root-channel 1 frame-interp) f30-0) + (let* ((f0-16 (dummy-9 (-> self skel))) + (f0-18 (/ (* 58.0 (-> self control unknown-float01)) (* 60.0 f0-16))) + ) + (if (= (-> self control surf name) '*tar-surface*) + (set! f0-18 (* 0.4 (-> self control unknown-float12))) + ) + (let ((a0-40 (-> self skel root-channel 0))) + (set! (-> a0-40 param 0) f0-18) + (joint-control-channel-group-eval! a0-40 (the-as art-joint-anim #f) num-func-loop!) + ) + ) + (let ((gp-2 (-> self skel root-channel 1))) + (set! (-> gp-2 num-func) num-func-identity) + (set! (-> gp-2 frame-num) (* 0.5 (ja-frame-num 0))) + ) + (let ((f0-22 (ja-aframe-num 0))) + (cond + ((and (>= (-> self skel effect last-frame-num) 20.0) (< f0-22 20.0)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 51 120) + ) + ((and (< (-> self skel effect last-frame-num) 12.0) (>= f0-22 12.0)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 51 120) + ) + ) + ) + ) + ) + (none) + ) + :post + target-flut-post + ) + +;; failed to figure out what this is: +(defstate target-flut-jump (target) + :event + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (when (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) + ) + (< 0.0 + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> self control trans-old)) (-> self control trans)) + ) + ) + ) + (send-event arg0 'bonk (-> arg3 param 0) (-> self control ground-impact-vel)) + (when (target-send-attack + arg0 + (the-as uint 'flut-bonk) + (-> arg3 param 0) + (-> self control unknown-dword50) + (-> self control unknown-dword51) + ) + ) + ) + (case arg2 + (('jump) + (go target-flut-jump (the-as float (-> arg3 param 0)) (the-as float (-> arg3 param 0))) + ) + (else + (target-flut-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter + (behavior ((arg0 float) (arg1 float)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 -762 0 1 #t) + (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) + (set! (-> self control status) (logand -8 (-> self control status))) + (set! (-> self control unknown-surface00) *flut-jump-mods*) + (set! (-> self control unknown-float123) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float01))))) + ) + (set! (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + ) + (none) + ) + :exit + (behavior () (target-exit) ((-> target-flut-start exit)) (none)) + :trans + (behavior () + (set! (-> self control unknown-float123) + (fmax + (-> self control unknown-float123) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6))) + ) + ) + (if (logtest? (-> self control status) 1) + (go target-flut-hit-ground) + ) + (if (and + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (pad-buttons x)) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 40960.0) + (and + (zero? (logand (-> self water flags) 512)) + (zero? (logand (-> self state-flags) 2048)) + (< 4096.0 (target-height-above-ground)) + ) + ) + (go target-flut-double-jump (-> *FLUT-bank* double-jump-height-min) (-> *FLUT-bank* double-jump-height-max)) + ) + (if (and + (logtest? + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons square) + ) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 61440.0) + (and + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) + (the-as int (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) 4096)) + (zero? (logand (-> self control unknown-surface01 flags) 384)) + ) + ) + (go target-flut-air-attack (-> *FLUT-bank* air-attack-speed)) + ) + (when (if (and + (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) + (and + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) + (not + (and + *cheat-mode* + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + ) + ) + ) + #t + ) + (logior! (-> self control status) 1) + enter-state + 'stuck + (go target-flut-hit-ground) + ) + (mod-var-jump + #t + #t + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) + (-> self control transv) + ) + (set! (-> self control unknown-float122) + (seek + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) + ) + (none) + ) + :code + (behavior ((arg0 float) (arg1 float)) + (ja-channel-push! 2 36) + (let ((gp-0 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-0 + (the-as art-joint-anim (-> self draw art-group data 143)) + num-func-identity + ) + (set! (-> gp-0 frame-num) 0.0) + ) + (let ((a0-3 (-> self skel root-channel 1))) + (set! (-> a0-3 frame-interp) (-> self control unknown-float122)) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 146))) + (set! (-> a0-3 param 0) 0.0) + (joint-control-channel-group-eval! + a0-3 + (the-as art-joint-anim (-> self draw art-group data 146)) + num-func-chan + ) + ) + (suspend) + (let ((a0-4 (-> self skel root-channel 0))) + (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 143))) + (set! (-> a0-4 param 0) 1.0) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim (-> self draw art-group data 143)) num-func-+!) + ) + (let ((a0-5 (-> self skel root-channel 1))) + (set! (-> a0-5 frame-interp) (-> self control unknown-float122)) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 146))) + (set! (-> a0-5 param 0) 0.0) + (joint-control-channel-group-eval! + a0-5 + (the-as art-joint-anim (-> self draw art-group data 146)) + num-func-chan + ) + ) + (suspend) + (until (ja-done? 0) + (let ((f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f0-10 (/ (- 10.0 (ja-aframe-num 0)) (* (ja-step 0) (ja-speed 0)))) + (gp-1 (-> self skel root-channel 0)) + ) + (set! (-> gp-1 param 0) (the float (+ (-> gp-1 frame-group data 0 length) -1))) + (let ((v1-45 (and (< 0.0 f30-0) (< 0.0 f0-10)))) + (set! (-> gp-1 param 1) + (the-as + float + (if v1-45 + (fmin (fmin 3.0 f0-10) (/ (* 5.0 f0-10) (the float (time-to-apex f30-0 (the-as float -245760.0))))) + 1.0 + ) + ) + ) + ) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) + ) + (let ((a0-12 (-> self skel root-channel 1))) + (set! (-> a0-12 frame-interp) (-> self control unknown-float122)) + (set! (-> a0-12 param 0) 0.0) + (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) + ) + (suspend) + ) + (let ((a0-14 (-> self skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) + (set! (-> a0-14 param 0) 1.0) + (set! (-> a0-14 frame-num) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 144)) num-func-loop!) + ) + (let ((a0-15 (-> self skel root-channel 1))) + (set! (-> a0-15 frame-interp) (-> self control unknown-float122)) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 147))) + (set! (-> a0-15 param 0) 0.0) + (joint-control-channel-group-eval! + a0-15 + (the-as art-joint-anim (-> self draw art-group data 147)) + num-func-chan + ) + ) + (while #t + (suspend) + (let ((a0-16 (-> self skel root-channel 0))) + (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) + (set! (-> a0-16 param 0) 1.0) + (joint-control-channel-group-eval! + a0-16 + (the-as art-joint-anim (-> self draw art-group data 144)) + num-func-loop! + ) + ) + (let ((a0-17 (-> self skel root-channel 1))) + (set! (-> a0-17 frame-interp) (-> self control unknown-float122)) + (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 147))) + (set! (-> a0-17 param 0) 0.0) + (joint-control-channel-group-eval! + a0-17 + (the-as art-joint-anim (-> self draw art-group data 147)) + num-func-chan + ) + ) + ) + (none) + ) + :post + target-flut-post + ) + +;; failed to figure out what this is: +(defstate target-flut-double-jump (target) + :event + (-> target-flut-jump event) + :enter + (behavior ((arg0 float) (arg1 float)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) + (set! (-> self control dynam gravity-max) 40960.0) + (set! (-> self control dynam gravity-length) 245760.0) + (set! (-> self control status) (logand -8 (-> self control status))) + (set! (-> self control unknown-surface00) *flut-double-jump-mods*) + (none) + ) + :exit + (behavior () + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (target-exit) + ((-> target-flut-start exit)) + (none) + ) + :trans + (behavior () + (if (logtest? (-> self control status) 1) + (go target-flut-hit-ground) + ) + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons square) + ) + (and + (zero? (logand (-> self state-flags) 4096)) + (zero? (logand (-> self control unknown-surface01 flags) 384)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) + (the-as int (-> *TARGET-bank* stuck-timeout)) + ) + (< 4096.0 (target-height-above-ground)) + ) + ) + (go target-flut-air-attack (-> *FLUT-bank* air-attack-speed)) + ) + (if (!= (-> self state-time) (-> *display* base-frame-counter)) + (mod-var-jump + #t + #t + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) + (-> self control transv) + ) + ) + (if (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 149) + ) + (sound-play-by-name (static-sound-name "flut-flap") (-> self flut flap-sound-id) 1024 0 0 1 #t) + ) + (set! (-> self control unknown-float122) + (seek + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) + ) + (none) + ) + :code + (behavior ((arg0 float) (arg1 float)) + (ja-channel-push! 1 15) + (let ((a0-2 (-> self skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 149))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 149)) data 0 length) -1)) + ) + (set! (-> a0-2 param 1) 1.0) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 149)) num-func-seek!) + ) + (until (ja-done? 0) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 3 30) + (suspend) + (let ((a0-4 (-> self skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) + (set! (-> a0-4 param 1) 1.0) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (set! (-> self control unknown-surface00) *flut-jump-mods*) + (dotimes (gp-0 1) + (let ((s5-0 (-> self skel root-channel 0))) + (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 149))) + (set! (-> s5-0 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 149)) data 0 length) -1)) + ) + (set! (-> s5-0 param 1) 1.0) + (set! (-> s5-0 frame-num) (ja-aframe (the-as float 14.0) 0)) + (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 149)) num-func-seek!) + ) + (until (ja-done? 0) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 3 30) + (suspend) + (let ((a0-10 (-> self skel root-channel 0))) + (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) + (set! (-> a0-10 param 1) 1.0) + (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + (while (< 8192.0 (target-height-above-ground)) + (suspend) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 3 30) + (let ((a0-13 (-> self skel root-channel 0))) + (set! (-> a0-13 param 0) 1.0) + (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-loop!) + ) + (when (< (ja-aframe-num 0) 14.0) + (let ((gp-1 (-> self skel root-channel 0))) + (set! (-> gp-1 num-func) num-func-identity) + (set! (-> gp-1 frame-num) (ja-aframe (the-as float 14.0) 0)) + ) + ) + (set! (-> self control dynam gravity-max) (seek + (-> self control dynam gravity-max) + (-> self control unknown-dynamics00 gravity-max) + (* 163840.0 (-> *display* seconds-per-frame)) + ) + ) + (set! (-> self control dynam gravity-length) (seek + (-> self control dynam gravity-length) + (-> self control unknown-dynamics00 gravity-length) + (* 163840.0 (-> *display* seconds-per-frame)) + ) + ) + ) + (-> *display* base-frame-counter) + (ja-channel-push! 2 30) + (let ((a0-19 (-> self skel root-channel 0))) + (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) + (set! (-> a0-19 param 0) 1.0) + (set! (-> a0-19 frame-num) 0.0) + (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 144)) num-func-loop!) + ) + (let ((gp-2 (-> self skel root-channel 1))) + (set! (-> gp-2 frame-interp) (-> self control unknown-float122)) + (joint-control-channel-group-eval! + gp-2 + (the-as art-joint-anim (-> self draw art-group data 147)) + num-func-identity + ) + (set! (-> gp-2 frame-num) 0.0) + ) + (while #t + (suspend) + (set! (-> self control dynam gravity-max) (seek + (-> self control dynam gravity-max) + (-> self control unknown-dynamics00 gravity-max) + (* 163840.0 (-> *display* seconds-per-frame)) + ) + ) + (set! (-> self control dynam gravity-length) (seek + (-> self control dynam gravity-length) + (-> self control unknown-dynamics00 gravity-length) + (* 163840.0 (-> *display* seconds-per-frame)) + ) + ) + (let ((a0-23 (-> self skel root-channel 0))) + (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) + (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-loop!) + ) + (let ((a0-24 (-> self skel root-channel 1))) + (set! (-> a0-24 frame-interp) (-> self control unknown-float122)) + (set! (-> a0-24 param 0) 0.0) + (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (none) + ) + :post + target-flut-post + ) + +;; failed to figure out what this is: +(defstate target-flut-hit-ground (target) + :event + target-flut-standard-event-handler + :enter + (behavior () + (target-land-effect) + (if (< 40960.0 (-> self control ground-impact-vel)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 60) + ) + (set! (-> self control unknown-dword31) 0) + (set! (-> self control unknown-dword33) 0) + (set! (-> self control unknown-surface00) *flut-walk-mods*) + (none) + ) + :exit + (-> target-flut-start exit) + :trans + (behavior () + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (go target-flut-jump (-> *FLUT-bank* jump-height-min) (-> *FLUT-bank* jump-height-max)) + ) + (if (move-legs?) + (go target-flut-walk) + ) + (when (and + (zero? (logand (-> self control status) 1)) + (and + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-34 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or + (not (or + (= v1-34 (-> self draw art-group data 59)) + (= v1-34 (-> self draw art-group data 60)) + (= v1-34 (-> self draw art-group data 61)) + ) + ) + (< 4096.0 (target-height-above-ground)) + ) + ) + ) + ) + enter-state + (go target-flut-falling) + ) + (none) + ) + :code + (behavior () + (let ((t9-0 target-flut-hit-ground-anim)) + (t9-0) + ) + (go target-flut-stance) + (none) + ) + :post + target-flut-post + ) + +;; failed to figure out what this is: +(defstate target-flut-falling (target) + :event + (-> target-flut-jump event) + :enter + (behavior () + (set! (-> self control unknown-surface00) *flut-jump-mods*) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) + :exit + (-> target-flut-start exit) + :trans + (behavior () + (when (or + (logtest? (-> self control status) 1) + (if (and + (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) + (and + (>= (- (-> *display* base-frame-counter) (-> self state-time)) + (/ (the-as int (-> *TARGET-bank* stuck-time)) 2) + ) + (not + (and + *cheat-mode* + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + ) + ) + ) + #t + ) + ) + (logior! (-> self control status) 1) + (go target-flut-hit-ground) + ) + (set! (-> self control unknown-float122) + (seek + (-> self control unknown-float122) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) + (-> *display* seconds-per-frame) + ) + ) + (none) + ) + :code + (behavior () + (cond + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 144) + ) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 149) + ) + (ja-channel-push! 2 60) + ) + (else + (ja-channel-push! 2 150) + ) + ) + (let ((a0-10 (-> self skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 144))) + (set! (-> a0-10 param 0) 1.0) + (set! (-> a0-10 frame-num) 0.0) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 144)) num-func-loop!) + ) + (let ((gp-0 (-> self skel root-channel 1))) + (set! (-> gp-0 frame-interp) (-> self control unknown-float122)) + (joint-control-channel-group-eval! + gp-0 + (the-as art-joint-anim (-> self draw art-group data 147)) + num-func-identity + ) + (set! (-> gp-0 frame-num) 0.0) + ) + (while #t + (suspend) + (let ((a0-12 (-> self skel root-channel 0))) + (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) + (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-loop!) + ) + (let ((a0-13 (-> self skel root-channel 1))) + (set! (-> a0-13 frame-interp) (-> self control unknown-float122)) + (set! (-> a0-13 param 0) 0.0) + (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (none) + ) + :post + target-flut-post + ) + +;; failed to figure out what this is: +(defstate target-flut-running-attack (target) + :event + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('touched) + (cond + (((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 224) + ) + (let ((gp-1 + (target-send-attack + arg0 + (the-as uint (-> self control unknown-symbol30)) + (-> arg3 param 0) + (-> self control unknown-dword50) + (-> self control unknown-dword51) + ) + ) + ) + (when gp-1 + (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) + (let ((v1-9 (if (and (nonzero? arg0) (type-type? (-> arg0 type) process-drawable)) + arg0 + ) + ) + ) + (when v1-9 + (let* ((s5-1 (-> (the-as process-drawable v1-9) root)) + (v1-11 (if (and (nonzero? s5-1) (type-type? (-> s5-1 type) collide-shape)) + s5-1 + ) + ) + ) + (if (and + v1-11 + (or + (logtest? (-> (the-as collide-shape v1-11) root-prim prim-core collide-as) 256) + (logtest? (-> (the-as collide-shape v1-11) root-prim prim-core action) 1024) + ) + ) + (set! (-> self control unknown-uint31) (the-as uint 1)) + ) + ) + ) + ) + (when (or (= gp-1 'die) (= gp-1 'push)) + (let ((v0-2 (the-as object (-> *display* base-frame-counter)))) + (set! (-> self control unknown-int21) (the-as int v0-2)) + v0-2 + ) + ) + ) + ) + ) + (else + (target-flut-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + (else + (target-flut-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (set! (-> self control unknown-uint20) (the-as uint 0)) + (set! (-> self control unknown-int21) 0) + (set! (-> self control unknown-uint31) (the-as uint 0)) + (set! (-> self control unknown-surface00) *flut-run-attack-mods*) + (set! (-> *run-attack-mods* turnv) 655360.0) + (set! (-> *run-attack-mods* turnvv) 655360.0) + (target-start-attack) + (target-danger-set! 'flut-attack #f) + (when (and + (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) 75) + ) + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat))) + (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 32))) + ) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 (+ 81920.0 (-> *TARGET-bank* yellow-projectile-speed))) + (vector+! gp-0 gp-0 (-> self control transv)) + (let ((s4-0 (get-process *default-dead-pool* projectile-yellow #x4000))) + (when s4-0 + (let ((t9-6 (method-of-type projectile-yellow activate))) + (t9-6 (the-as projectile-yellow s4-0) self 'projectile-yellow (the-as pointer #x70004000)) + ) + (run-now-in-process + s4-0 + projectile-init-by-other + (-> self entity) + s5-0 + gp-0 + (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + 281 + 265 + ) + #f + ) + (-> s4-0 ppointer) + ) + ) + ) + (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) + ) + (none) + ) + :exit + (behavior () + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (set! (-> *run-attack-mods* turnv) 0.0) + (set! (-> *run-attack-mods* turnvv) 0.0) + (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) + (target-exit) + (none) + ) + :trans + (behavior () + (when (!= (-> self state-time) (-> *display* base-frame-counter)) + (if (and + (or + (smack-surface? #t) + (and (>= (-> self control unknown-float63) 0.7) (zero? (logand (-> self control status) 32))) + ) + (begin + (set! (-> self control unknown-int21) (-> *display* base-frame-counter)) + (set! (-> self control unknown-float81) 0.0) + (let ((gp-0 (new-stack-vector0)) + (f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! gp-0 (-> self control transv) (vector-float*! gp-0 (-> self control dynam gravity-normal) f30-0)) + (let* ((f0-5 (vector-length gp-0)) + (f1-1 f0-5) + (f2-1 (fmin 0.0 f30-0)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-1) + (vector-float*! gp-0 gp-0 (/ f0-5 f1-1)) + ) + ) + ) + #t + ) + (or + (zero? (-> self control unknown-uint20)) + (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) + (the-as uint 12) + ) + ) + (!= (-> self control unknown-uint31) 1) + ) + (target-shoved + (meters 2.0) + (-> *TARGET-bank* smack-surface-height) + (the-as process #f) + (the-as (state target) target-flut-hit) + ) + ) + (if (and + (logtest? (-> self water flags) 512) + (zero? (mod (- (-> *display* base-frame-counter) (-> self state-time)) 21)) + ) + (dummy-13 + (-> self water) + (the-as float 0.6) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 37)) + 0 + (-> self control transv) + ) + ) + ) + (none) + ) + :code + (behavior () + (ja-channel-push! 1 6) + (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 0 0 1 #t) + (let ((gp-1 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-1 + (the-as art-joint-anim (-> self draw art-group data 150)) + num-func-identity + ) + (set! (-> gp-1 frame-num) 0.0) + ) + (set! (-> self control dynam gravity-max) 368640.0) + (set! (-> self control dynam gravity-length) 368640.0) + (let ((f28-0 0.0) + (f30-0 (the-as float (if (= (-> self control unknown-dword82) (-> *display* base-frame-counter)) + 0.2 + 0.8 + ) + ) + ) + ) + (until (or (ja-done? 0) (< f30-0 0.05)) + (TODO-RENAME-9 (-> self align)) + (when (not (ja-min? 0)) + (cond + ((and + (>= (ja-aframe-num 0) 20.0) + (and + (and + (zero? (logand (-> self control status) 1)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-39 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or + (not + (or + (= v1-39 (-> self draw art-group data 59)) + (= v1-39 (-> self draw art-group data 60)) + (= v1-39 (-> self draw art-group data 61)) + ) + ) + (< 4096.0 (target-height-above-ground)) + ) + ) + ) + (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) + (the-as uint 12) + ) + ) + ) + enter-state + (go target-flut-falling) + ) + ((and + (nonzero? (-> self control unknown-uint30)) + (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint30)))) + (the-as uint 12) + ) + ) + (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) + (set! f30-0 0.0) + ) + ((ja-done? 0) + (set-forward-vel f28-0) + ) + (else + (set! f28-0 + (* f30-0 (target-align-vel-z-adjust (-> self align delta trans z)) (-> *display* frames-per-second)) + ) + (set-forward-vel f28-0) + ) + ) + ) + (let ((gp-2 (new-stack-vector0))) + (vector-matrix*! gp-2 (-> self control transv) (-> self control unknown-matrix00)) + (set! (-> gp-2 y) 0.0) + (vector-matrix*! (-> self control unknown-vector120) gp-2 (-> self control unknown-matrix01)) + ) + (suspend) + (let ((a0-36 (-> self skel root-channel 0))) + (set! (-> a0-36 param 0) (the float (+ (-> a0-36 frame-group data 0 length) -1))) + (set! (-> a0-36 param 1) (-> self control unknown-surface01 align-speed)) + (joint-control-channel-group-eval! a0-36 (the-as art-joint-anim #f) num-func-seek!) + ) + (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) + (set! (-> *flut-run-attack-mods* turnvv) 0.0) + ) + (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) + (set! f30-0 (* f30-0 (the-as float (fmin 1.0 (the-as float (-> self control unknown-float140)))))) + ) + ) + (when (and + (zero? (logand (-> self control status) 1)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-105 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or + (not (or + (= v1-105 (-> self draw art-group data 59)) + (= v1-105 (-> self draw art-group data 60)) + (= v1-105 (-> self draw art-group data 61)) + ) + ) + (< 4096.0 (target-height-above-ground)) + ) + ) + ) + enter-state + (go target-flut-falling) + ) + (when (!= f30-0 0.0) + (set! (-> self trans-hook) (-> target-flut-hit-ground trans)) + (if (not (ja-done? 0)) + (ja-channel-push! 1 15) + ) + (let ((a0-59 (-> self skel root-channel 0))) + (set! (-> a0-59 frame-group) (the-as art-joint-anim (-> self draw art-group data 151))) + (set! (-> a0-59 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 151)) data 0 length) -1)) + ) + (set! (-> a0-59 param 1) 1.0) + (set! (-> a0-59 frame-num) 0.0) + (joint-control-channel-group! a0-59 (the-as art-joint-anim (-> self draw art-group data 151)) num-func-seek!) + ) + (until (ja-done? 0) + (TODO-RENAME-9 (-> self align)) + (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) f30-0) + (suspend) + (let ((a0-62 (-> self skel root-channel 0))) + (set! (-> a0-62 param 0) (the float (+ (-> a0-62 frame-group data 0 length) -1))) + (set! (-> a0-62 param 1) 1.0) + (joint-control-channel-group-eval! a0-62 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + (go target-flut-stance) + (none) + ) + :post + target-flut-post + ) + +;; failed to figure out what this is: +(defstate target-flut-air-attack (target) + :event + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (if (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) + ) + (< 0.0 + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> self control trans-old)) (-> self control trans)) + ) + ) + ) + (send-event arg0 'bonk (-> arg3 param 0) (-> self control ground-impact-vel)) + ) + (case arg2 + (('jump) + (go target-flut-jump (the-as float (-> arg3 param 0)) (the-as float (-> arg3 param 0))) + ) + (else + (target-flut-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter + (behavior ((arg0 float)) + (set-forward-vel arg0) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (set! (-> self control status) (logand -8 (-> self control status))) + (set! (-> self control unknown-surface00) *flut-air-attack-mods*) + (target-start-attack) + (target-danger-set! 'flut-attack #f) + (let ((gp-0 (new-stack-vector0))) + (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! gp-0 (-> self control transv) (vector-float*! gp-0 (-> self control dynam gravity-normal) f0-1)) + ) + (let* ((f0-2 (vector-length gp-0)) + (f1-1 f0-2) + (f2-0 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! gp-0 gp-0 (/ f0-2 f1-1)) + ) + ) + ) + (none) + ) + :exit + (behavior () + (target-danger-set! 'harmless #f) + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad)) + (none) + ) + :trans + (behavior () + (let ((s5-0 (new-stack-vector0))) + (vector-z-quaternion! s5-0 (-> self control unknown-quaternion00)) + (let ((gp-0 (new-stack-vector0)) + (f30-0 (vector-dot s5-0 (-> self control transv))) + ) + 0.0 + (vector-! gp-0 (-> self control transv) (vector-float*! gp-0 s5-0 f30-0)) + (let* ((f0-3 (vector-length gp-0)) + (f1-0 f0-3) + ) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) s5-0 f30-0) + (vector-float*! gp-0 gp-0 (/ f0-3 f1-0)) + ) + ) + ) + ) + (when (logtest? (-> self control status) 1) + (logior! (-> self control status) 1) + (remove-exit) + (go target-flut-air-attack-hit-ground) + ) + (when (if (and + (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) 4096.0) + (and + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 150) + (not + (and + *cheat-mode* + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + ) + ) + ) + #t + ) + (logior! (-> self control status) 1) + (go target-flut-hit-ground) + ) + (none) + ) + :code + (behavior ((arg0 float)) + (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 -762 0 1 #t) + (ja-channel-push! 1 15) + (let ((gp-1 (-> self skel root-channel 0))) + (set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 152))) + (set! (-> gp-1 param 0) (ja-aframe (the-as float 8.0) 0)) + (set! (-> gp-1 param 1) 1.0) + (set! (-> gp-1 frame-num) 0.0) + (joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 152)) num-func-seek!) + ) + (until (ja-done? 0) + (TODO-RENAME-9 (-> self align)) + (TODO-RENAME-10 (-> self align) 6 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (suspend) + (let ((gp-2 (-> self skel root-channel 0))) + (set! (-> gp-2 param 0) (ja-aframe (the-as float 8.0) 0)) + (set! (-> gp-2 param 1) 1.0) + (joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (let ((gp-3 (-> self skel root-channel 0))) + (set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 152))) + (set! (-> gp-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 152)) data 0 length) -1)) + ) + (set! (-> gp-3 param 1) 1.0) + (set! (-> gp-3 frame-num) (ja-aframe (the-as float 8.0) 0)) + (joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 152)) num-func-seek!) + ) + (until (ja-done? 0) + (TODO-RENAME-9 (-> self align)) + (TODO-RENAME-10 (-> self align) 6 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (suspend) + (let ((a0-14 (-> self skel root-channel 0))) + (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) + (set! (-> a0-14 param 1) 1.0) + (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (let ((gp-4 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-4 + (the-as art-joint-anim (-> self draw art-group data 153)) + num-func-identity + ) + (set! (-> gp-4 frame-num) 0.0) + ) + (while #t + (suspend) + ) + (none) + ) + :post + target-flut-post + ) + +;; failed to figure out what this is: +(defstate target-flut-air-attack-hit-ground (target) + :event + target-flut-standard-event-handler + :enter + (behavior () + (target-land-effect) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 120) + (set! (-> self control unknown-dword31) 0) + (set! (-> self control unknown-dword33) 0) + (set! (-> self control unknown-surface00) *flut-air-attack-mods*) + (sound-play-by-name (static-sound-name "flop-land") (new-sound-id) 1024 -609 0 1 #t) + (dummy-10 (-> self skel effect) 'group-flut-attack-strike-ground (ja-frame-num 0) 0) + (let* ((s5-2 (get-process *default-dead-pool* touch-tracker #x4000)) + (gp-2 (when s5-2 + (let ((t9-7 (method-of-type touch-tracker activate))) + (t9-7 (the-as touch-tracker s5-2) self 'touch-tracker (the-as pointer #x70004000)) + ) + (run-now-in-process s5-2 touch-tracker-init (-> self control trans) 4096.0 30) + (-> s5-2 ppointer) + ) + ) + ) + (send-event (ppointer->process gp-2) 'event 'attack 'flut-attack) + (send-event + (ppointer->process gp-2) + 'function + (lambda :behavior target + ((arg0 nav-enemy)) + (set! (-> arg0 collide-info root-prim local-sphere w) (seek + (-> arg0 collide-info root-prim local-sphere w) + (the-as float 28672.0) + (* 286720.0 (-> *display* seconds-per-frame)) + ) + ) + (dummy-47 (-> arg0 collide-info)) + (none) + ) + ) + ) + (none) + ) + :exit + (-> target-flut-air-attack exit) + :trans + (-> target-flut-hit-ground trans) + :code + (behavior () + (ja-channel-set! 1) + (let ((gp-0 (-> self skel root-channel 0))) + (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 154))) + (set! (-> gp-0 param 0) (ja-aframe (the-as float 22.0) 0)) + (set! (-> gp-0 param 1) 1.0) + (set! (-> gp-0 frame-num) 0.0) + (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 154)) num-func-seek!) + ) + (until (ja-done? 0) + (TODO-RENAME-9 (-> self align)) + (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (suspend) + (let ((gp-1 (-> self skel root-channel 0))) + (set! (-> gp-1 param 0) (ja-aframe (the-as float 22.0) 0)) + (set! (-> gp-1 param 1) 1.0) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (target-danger-set! 'harmless #f) + (let ((gp-2 (-> self skel root-channel 0))) + (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 154))) + (set! (-> gp-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 154)) data 0 length) -1)) + ) + (set! (-> gp-2 param 1) 1.0) + (set! (-> gp-2 frame-num) (ja-aframe (the-as float 22.0) 0)) + (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 154)) num-func-seek!) + ) + (until (ja-done? 0) + (TODO-RENAME-9 (-> self align)) + (TODO-RENAME-10 (-> self align) 4 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0)) + (suspend) + (let ((a0-13 (-> self skel root-channel 0))) + (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) + (set! (-> a0-13 param 1) 1.0) + (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (go target-flut-stance) + (none) + ) + :post + target-flut-post + ) + +;; failed to figure out what this is: +(defstate target-flut-hit (target) + :event + target-flut-standard-event-handler + :exit + (behavior () + (if (!= (-> self next-state name) 'target-flut-death) + (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + ) + (target-exit) + ((-> target-flut-start exit)) + (none) + ) + :trans + (behavior () + (when (= *cheat-mode* 'debug) + (when (and + (not *pause-lock*) + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + (pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) + (go target-flut-stance) + ) + ) + (none) + ) + :code + (behavior ((arg0 symbol) (arg1 attack-info)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (let ((gp-0 (-> self attack-info))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((v1-2 gp-0)) + (set! (-> v1-2 attacker) (the-as handle #f)) + (set! (-> v1-2 mode) 'generic) + (set! (-> v1-2 shove-back) 10240.0) + (set! (-> v1-2 shove-up) 9011.2) + (set! (-> v1-2 angle) #f) + (set! (-> v1-2 trans quad) (-> self control trans quad)) + (set! (-> v1-2 control) 0.0) + (set! (-> v1-2 invinc-time) (-> *TARGET-bank* hit-invulnerable-timeout)) + ) + (case arg0 + (('shove) + (let ((v1-5 gp-0)) + (set! (-> v1-5 shove-back) (-> *TARGET-bank* smack-surface-dist)) + (set! (-> v1-5 shove-up) (-> *TARGET-bank* smack-surface-height)) + (set! (-> v1-5 angle) 'shove) + ) + ) + ) + (dummy-9 gp-0 arg1) + (when (zero? (logand (-> gp-0 mask) 2)) + (vector-z-quaternion! (-> gp-0 vector) (-> self control unknown-quaternion00)) + (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) + (set! (-> gp-0 vector y) (-> gp-0 shove-up)) + ) + (set! (-> s5-0 quad) (-> gp-0 vector quad)) + (let ((f0-10 (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-0 (the-as float 1.0)) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)) + ) + ) + ) + (if (not (-> self attack-info angle)) + (set! (-> self attack-info angle) (if (>= 0.0 f0-10) + 'front + 'back + ) + ) + ) + ) + (when (= arg0 'attack) + (logior! (-> self state-flags) 8) + (set! (-> self game hit-time) (-> *display* base-frame-counter)) + (case (-> gp-0 mode) + (('endlessfall) + (cond + ((= (-> self game mode) 'debug) + (let ((s4-1 (new-stack-vector0))) + (set! (-> s4-1 quad) (-> self control unknown-vector54 quad)) + (ja-channel-set! 0) + (let ((s3-1 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) s3-1) 300) + (suspend) + ) + ) + (TODO-RENAME-30 (-> self control) s4-1) + ) + (set! (-> (&-> (-> self control) unknown-qword00) 0) (-> self control trans quad)) + (send-event *camera* 'teleport) + (go target-flut-stance) + ) + (else + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (the-as float -1000.0) + (the-as handle #f) + ) + (go target-flut-death (-> gp-0 mode)) + ) + ) + ) + (('water-vol 'sharkey) + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (the-as float -1000.0) + (the-as handle #f) + ) + (if (= (-> self game mode) 'play) + (go target-flut-death (-> gp-0 mode)) + ) + ) + (('death) + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (the-as float -1000.0) + (the-as handle #f) + ) + ) + (else + (pickup-collectable! + (-> self fact-info-target) + (pickup-type eco-green) + (- (-> *FACT-bank* health-single-inc)) + (the-as handle #f) + ) + ) + ) + (target-hit-effect gp-0) + (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 -1524 0 1 #t) + ) + (set! (-> self control unknown-surface00) *smack-mods*) + (let ((f30-0 1.0)) + (case (-> gp-0 angle) + (('shove) + (when (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 158) + ) + ) + (ja-channel-set! 1) + (let ((s4-3 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + s4-3 + (the-as art-joint-anim (-> self draw art-group data 158)) + num-func-identity + ) + (set! (-> s4-3 frame-num) 0.0) + ) + ) + (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 1524 0 1 #t) + ) + (else + (when (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 157) + ) + ) + (ja-channel-push! 1 22) + (let ((s4-6 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + s4-6 + (the-as art-joint-anim (-> self draw art-group data 157)) + num-func-identity + ) + (set! (-> s4-6 frame-num) 0.0) + ) + ) + ) + ) + (target-hit-move gp-0 (target-hit-orient gp-0 s5-0) target-flut-falling-anim-trans f30-0) + ) + ) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + (go target-flut-death (-> gp-0 mode)) + ) + ) + (go target-flut-hit-ground) + (none) + ) + :post + target-flut-post + ) + +;; failed to figure out what this is: +(defstate target-flut-death (target) + :event + (-> target-death event) + :exit + (behavior () + (set! (-> self state-flags) (logand -32777 (-> self state-flags))) + (target-exit) + (clear-pending-settings-from-process *setting-control* self 'process-mask) + (copy-settings-from-target! *setting-control*) + (none) + ) + :trans + (-> target-hit trans) + :code + (behavior ((arg0 symbol)) + (local-vars (v1-104 symbol)) + (logior! (-> self state-flags) #x8000) + (set! (-> self neck flex-blend) 0.0) + (target-timed-invulnerable-off self) + (push-setting! *setting-control* self 'process-mask 'set (-> (new 'static 'array float 1 0.0) 0) #x14a0000) + (copy-settings-from-target! *setting-control*) + (set! (-> self control transv quad) (the-as uint128 0)) + (cond + ((or (= arg0 'none) (= arg0 'water-vol) (= arg0 'sharkey)) + ) + ((= arg0 'endlessfall) + (sound-play-by-name (static-sound-name "death-fall") (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 716 -2133 0 1 #t) + (camera-change-to (the-as string cam-endlessfall) 30 #f) + (set! (-> self control pat-ignore-mask unknown-bit) 1) + (set! (-> self water flags) (logand -17 (-> self water flags))) + (let ((f30-0 (fmin -4096.0 (- (-> self control ground-impact-vel))))) + (set! (-> self control unknown-uint20) (the-as uint f30-0)) + (let ((gp-3 (new-stack-vector0))) + (let ((f0-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! gp-3 (-> self control transv) (vector-float*! gp-3 (-> self control dynam gravity-normal) f0-3)) + ) + (let* ((f0-4 (vector-length gp-3)) + (f1-3 f0-4) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f30-0) + (vector-float*! gp-3 gp-3 (/ f0-4 f1-3)) + ) + ) + ) + ) + (let ((gp-4 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-4) 300) + (target-flut-falling-anim-trans) + (vector-seek! (-> self draw color-mult) *zero-vector* (-> *display* seconds-per-frame)) + (let ((s5-2 (new-stack-vector0)) + (f30-1 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + ) + 0.0 + (vector-! + s5-2 + (-> self control transv) + (vector-float*! s5-2 (-> self control dynam gravity-normal) (the-as float f30-1)) + ) + (let* ((f0-10 (vector-length s5-2)) + (f1-4 f0-10) + ) + (if (< (the-as float (-> self control unknown-uint20)) (the-as float f30-1)) + (set! f30-1 (-> self control unknown-uint20)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f30-1)) + (vector-float*! s5-2 s5-2 (/ f0-10 f1-4)) + ) + ) + ) + (target-flut-post-post) + (suspend) + ) + ) + (camera-change-to (the-as string 'base) 0 #f) + ) + (else + (set! (-> self control unknown-surface00) *neutral-mods*) + (ja-channel-push! 1 30) + (let ((a0-33 (-> self skel root-channel 0))) + (set! (-> a0-33 frame-group) (the-as art-joint-anim (-> self draw art-group data 160))) + (set! (-> a0-33 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 160)) data 0 length) -1)) + ) + (set! (-> a0-33 param 1) 1.0) + (set! (-> a0-33 frame-num) 0.0) + (joint-control-channel-group! a0-33 (the-as art-joint-anim (-> self draw art-group data 160)) num-func-seek!) + ) + (until (ja-done? 0) + (TODO-RENAME-9 (-> self align)) + (let ((gp-5 (new 'stack-no-clear 'vector))) + (when (zero? (logand (-> self align flags) 1)) + (vector-matrix*! gp-5 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) + (vector-float*! (-> self control transv) gp-5 (-> *display* frames-per-second)) + ) + ) + (suspend) + (let ((a0-37 (-> self skel root-channel 0))) + (set! (-> a0-37 param 0) (the float (+ (-> a0-37 frame-group data 0 length) -1))) + (set! (-> a0-37 param 1) 1.0) + (joint-control-channel-group-eval! a0-37 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + (set! (-> self control transv quad) (the-as uint128 0)) + (initialize! (-> self game) 'dead (the-as game-save #f) (the-as string #f)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (until v1-104 + (suspend) + (set! v1-104 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 300) (not (movie?)))) + ) + (go target-flut-stance) + (none) + ) + :post + target-no-stick-post + ) + +;; failed to figure out what this is: +(defstate target-flut-get-on (target) + :event + target-generic-event-handler + :exit + (-> target-flut-start exit) + :code + (behavior ((arg0 handle)) + (set! (-> self control transv quad) (the-as uint128 0)) + (set! (-> self alt-cam-pos quad) (-> (&-> (-> self control) unknown-qword00) 0)) + (logior! (-> self state-flags) 1024) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control trans quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> self control trans quad)) + (quaternion-copy! (-> self control unknown-quaternion02) (-> self control quat)) + (quaternion-copy! (-> self control unknown-quaternion03) (-> self control unknown-quaternion00)) + (set! (-> self control unknown-uint20) (the-as uint (-> self control unknown-vector11 y))) + (let* ((s3-0 (handle->process arg0)) + (s4-1 (if (and (nonzero? s3-0) (type-type? (-> s3-0 type) process-drawable)) + s3-0 + ) + ) + ) + (when s4-1 + (set! (-> s5-0 quad) (-> (the-as process-drawable s4-1) root trans quad)) + (quaternion-copy! (-> self control unknown-quaternion03) (-> (the-as process-drawable s4-1) root quat)) + (send-event s4-1 'trans (-> self flut flut-trans)) + (quaternion-copy! (the-as quaternion (-> self flut flut-quat)) (-> (the-as process-drawable s4-1) root quat)) + (set! (-> self flut flut-scale quad) (-> (the-as process-drawable s4-1) root scale quad)) + (set! (-> self control unknown-int21) (the-as int (-> self flut flut-trans y))) + ) + ) + (set! (-> self control unknown-vector102 quad) (-> gp-0 quad)) + (set! (-> self control unknown-vector103 quad) (-> s5-0 quad)) + ) + ) + (let ((gp-1 #f)) + (sound-play-by-name (static-sound-name "uppercut") (new-sound-id) 1024 0 0 1 #t) + (ja-channel-push! 1 15) + (let ((s5-2 (-> self skel root-channel 0))) + (set! (-> s5-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 155))) + (set! (-> s5-2 param 0) (ja-aframe (the-as float 24.0) 0)) + (set! (-> s5-2 param 1) 1.0) + (set! (-> s5-2 frame-num) 0.0) + (joint-control-channel-group! s5-2 (the-as art-joint-anim (-> self draw art-group data 155)) num-func-seek!) + ) + (until (ja-done? 0) + (when (and (not gp-1) (= (-> self skel root-channel 0) (-> self skel channel))) + (send-event (ppointer->process (-> self manipy)) 'anim-mode 'clone-anim) + (set! gp-1 #t) + ) + (set! (-> self control transv quad) (the-as uint128 0)) + (suspend) + (let ((s5-3 (-> self skel root-channel 0))) + (set! (-> s5-3 param 0) (ja-aframe (the-as float 24.0) 0)) + (set! (-> s5-3 param 1) 1.0) + (joint-control-channel-group-eval! s5-3 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + (sound-play-by-name (static-sound-name "flut-coo") (new-sound-id) 1024 0 0 1 #t) + (set! (-> self state-flags) (logand -1025 (-> self state-flags))) + (set! (-> self control transv quad) (the-as uint128 0)) + (quaternion-copy! (-> self control quat) (-> self control unknown-quaternion00)) + (rot->dir-targ! (-> self control)) + (go target-flut-stance) + (none) + ) + :post + (behavior () + (let ((gp-0 (new 'stack-no-clear 'vector)) + (f30-0 (fmin 1.0 (* 0.0044444446 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) + ) + (vector-lerp! gp-0 (-> self control unknown-vector102) (-> self control unknown-vector103) f30-0) + (set! (-> gp-0 y) + (lerp + (-> self control unknown-vector102 y) + (-> self control unknown-vector103 y) + (fmax + 0.0 + (fmin 1.0 (* 0.006666667 (the float (+ (- (-> self state-time)) (-> *display* base-frame-counter))))) + ) + ) + ) + (TODO-RENAME-30 (-> self control) gp-0) + (quaternion-slerp! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion02) + (-> self control unknown-quaternion03) + f30-0 + ) + ) + (target-no-move-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate target-flut-get-off (target) + :event + target-generic-event-handler + :exit + (-> target-flut-start exit) + :code + (behavior ((arg0 handle)) + (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) + (let ((s5-0 0)) + (while (zero? (logand (-> self control status) 1)) + (target-flut-falling-anim-trans) + (+! s5-0 (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter))) + (suspend) + ) + ) + (go target-flut-get-off-jump arg0) + (none) + ) + :post + (behavior () (target-no-stick-post) (target-flut-post-post) (none)) + ) + +;; failed to figure out what this is: +(defstate target-flut-get-off-jump (target) + :event + target-generic-event-handler + :exit + (-> target-flut-start exit) + :code + (behavior ((arg0 handle)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (set! (-> self control transv quad) (the-as uint128 0)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control trans quad)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> self control trans quad)) + (quaternion-copy! (-> self control unknown-quaternion02) (-> self control quat)) + (quaternion-copy! (-> self control unknown-quaternion03) (-> self control unknown-quaternion00)) + (set! (-> self control unknown-uint20) (the-as uint (-> self control unknown-vector11 y))) + (let* ((s2-0 (handle->process arg0)) + (s3-0 (if (and (nonzero? s2-0) (type-type? (-> s2-0 type) process-drawable)) + s2-0 + ) + ) + ) + (when s3-0 + (set! (-> s4-0 quad) (-> (the-as process-drawable s3-0) root trans quad)) + (set-yaw-angle-clear-roll-pitch! + (-> (the-as process-drawable s3-0) root) + (quaternion-y-angle (-> self control quat)) + ) + (quaternion-copy! (-> self control unknown-quaternion03) (-> (the-as process-drawable s3-0) root quat)) + (send-event s3-0 'trans (-> self flut flut-trans)) + (quaternion-copy! (the-as quaternion (-> self flut flut-quat)) (-> (the-as process-drawable s3-0) root quat)) + (set! (-> self flut flut-scale quad) (-> (the-as process-drawable s3-0) root scale quad)) + (set! (-> self control unknown-int21) (the-as int (-> self flut flut-trans y))) + ) + ) + (set! (-> self control unknown-vector102 quad) (-> gp-0 quad)) + (set! (-> self control unknown-vector103 quad) (-> s4-0 quad)) + ) + (sound-play-by-name (static-sound-name "flut-coo") (new-sound-id) 921 -762 0 1 #t) + (ja-channel-push! 1 15) + (let ((a0-23 (-> self skel root-channel 0))) + (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 156))) + (set! (-> a0-23 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 156)) data 0 length) -1)) + ) + (set! (-> a0-23 param 1) 1.0) + (set! (-> a0-23 frame-num) 0.0) + (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 156)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-24 (-> self skel root-channel 0))) + (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) + (set! (-> a0-24 param 1) 1.0) + (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (send-event (handle->process arg0) 'draw) + (set-yaw-angle-clear-roll-pitch! + (-> self control) + (quaternion-y-angle (-> self control unknown-quaternion03)) + ) + (rot->dir-targ! (-> self control)) + (ja-post) + (vector<-cspace! gp-0 (-> self node-list data 3)) + (set! (-> gp-0 y) (+ -5896.192 (-> gp-0 y))) + (TODO-RENAME-30 (-> self control) gp-0) + ) + (send-event *camera* 'ease-in) + (ja-channel-set! 0) + (go target-flut-get-off-hit-ground #f) + (none) + ) + :post + (behavior () + (let ((gp-0 (new 'stack-no-clear 'vector)) + (f30-0 + (fmax 0.0 (fmin 1.0 (* 0.006666667 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) + ) + ) + (fmax 0.0 (fmin 1.0 (* 0.006666667 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) + (vector-lerp! gp-0 (-> self control unknown-vector102) (-> self control unknown-vector103) f30-0) + (set! (-> gp-0 y) + (lerp + (-> self control unknown-vector102 y) + (-> self control unknown-vector103 y) + (fmax + 0.0 + (fmin 1.0 (* 0.0044444446 (the float (+ (- -150 (-> self state-time)) (-> *display* base-frame-counter))))) + ) + ) + ) + (TODO-RENAME-30 (-> self control) gp-0) + (quaternion-slerp! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion02) + (-> self control unknown-quaternion03) + f30-0 + ) + ) + (vector+! (-> self flut flut-trans) (-> self control trans) (-> self control unknown-vector12)) + (quaternion-copy! (the-as quaternion (-> self flut flut-quat)) (-> self control quat)) + (set! (-> self flut flut-scale quad) (-> self control scale quad)) + (target-no-move-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate target-flut-get-off-hit-ground (target) + :event + target-standard-event-handler + :enter + (-> target-hit-ground enter) + :trans + (behavior () (logior! (-> self control status) 7) ((-> target-hit-ground trans)) (none)) + :code + (behavior ((arg0 symbol)) + (ja-channel-set! 1) + (let ((gp-0 (-> self skel root-channel 0))) + (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 35))) + (set! (-> gp-0 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) data 0 length) -1)) + ) + (set! (-> gp-0 param 1) 1.0) + (set! (-> gp-0 frame-num) (ja-aframe (the-as float 42.0) 0)) + (joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-4 (-> self skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) + (set! (-> a0-4 param 1) 1.0) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (go target-stance) + (none) + ) + :post + (the-as (function none :behavior target) target-post) + ) + +;; failed to figure out what this is: +(defstate target-flut-grab (target) + :event + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + (-> self state name) + ) + (else + (case arg2 + (('end-mode) + (go target-flut-stance) + ) + (('clone-anim) + (go target-flut-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + (else + (target-generic-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + :enter + (behavior () + (set! (-> self control unknown-surface00) *grab-mods*) + (set! (-> self neck flex-blend) 0.0) + (logior! (-> self state-flags) 272) + (none) + ) + :exit + (behavior () + (set! (-> self state-flags) (logand -273 (-> self state-flags))) + (target-exit) + ((-> target-flut-start exit)) + (none) + ) + :code + (-> target-flut-stance code) + :post + (behavior () (target-no-stick-post) (target-flut-post-post) (none)) + ) + +;; failed to figure out what this is: +(defstate target-flut-clone-anim (target) + :event + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (if (and (= arg2 'trans) (= (-> arg3 param 0) 'restore)) + (set! (-> self control unknown-uint20) (the-as uint #f)) + ) + ((-> target-flut-grab event) arg0 arg1 arg2 arg3) + ) + :enter + (-> target-clone-anim enter) + :exit + (behavior () + (send-event (ppointer->process (-> self sidekick)) 'matrix #f) + ((-> target-clone-anim exit)) + ((-> target-flut-start exit)) + (none) + ) + :code + (behavior ((arg0 handle)) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) + (clone-anim arg0 33 #t "") + (go target-flut-stance) + (none) + ) + :post + (behavior () (target-no-ja-move-post) (target-flut-post-post) (none)) + ) + + + + diff --git a/test/offline/config.jsonc b/test/offline/config.jsonc index 47bd9a8c1e..fd8018db7c 100644 --- a/test/offline/config.jsonc +++ b/test/offline/config.jsonc @@ -198,6 +198,9 @@ ], "plant-boss-intro": [ "code" // cfg + ], + "energydoor-opened": [ + "trans" // cfg ] } }