diff --git a/.vs/launch.vs.json b/.vs/launch.vs.json index 4f445ef34..ba73055e0 100644 --- a/.vs/launch.vs.json +++ b/.vs/launch.vs.json @@ -28,6 +28,13 @@ "name" : "Tests - TypeConsistency - Verbose", "args" : ["--gtest_brief=0", "--gtest_filter=\"*TypeConsistency*\""] }, + { + "type" : "default", + "project" : "CMakeLists.txt", + "projectTarget" : "goalc-test.exe (bin\\goalc-test.exe)", + "name" : "Tests - WithGameTests - Verbose", + "args" : ["--gtest_brief=0", "--gtest_filter=\"*WithGameTests*\""] + }, { "type" : "default", "project" : "CMakeLists.txt", diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index c84b8e06a..e36eeca8d 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -1184,7 +1184,7 @@ (deftype state (protect-frame) ((code function :offset-assert 16) (trans (function none) :offset-assert 20) - (post function :offset-assert 24) + (post (function none) :offset-assert 24) (enter function :offset-assert 28) (event (function process int symbol event-message-block object) :offset-assert 32) ) @@ -4556,8 +4556,8 @@ (deftype spool-anim (basic) ((name string :offset 16) ;; why? (buf1 external-art-buffer :offset 16) ;; custom - (buf2 external-art-buffer :offset-assert 20) ;; custom (also what?) - (index int32 :offset 20) + (index int32 :score 100 :offset 20) + (buf2 external-art-buffer :offset 20) ;; custom (also what?) (parts int32 :offset-assert 24) (priority float :offset-assert 28) (owner handle :offset-assert 32) @@ -8657,7 +8657,7 @@ (deftype shadow-settings (structure) ((center vector :inline :offset-assert 0) - (flags int32 :offset 12) + (flags int32 :score 100 :offset 12) (shadow-dir vector :inline :offset-assert 16) (dist-to-locus float :offset 28) (bot-plane plane :inline :offset-assert 32) @@ -13323,7 +13323,7 @@ :size-assert #x30 :flag-assert #xa00000030 (:methods - (dummy-9 () none 9) + (dummy-9 (_type_ process) _type_ 9) ) ) @@ -16194,7 +16194,7 @@ (define-extern kill-all-particles-with-key function) (define-extern sp-relaunch-setup-fields function) (define-extern sp-init-fields! function) -(define-extern sp-launch-particles-var function) +(define-extern sp-launch-particles-var (function sparticle-system sparticle-launcher vector symbol symbol float none)) ;; asm - ret not confirmed (define-extern sp-get-particle function) (define-extern particle-adgif function) (define-extern lookup-part-group-by-name (function string basic)) @@ -16258,7 +16258,7 @@ (define-extern sp-free-particle function) (define-extern sp-particle-copy! function) (define-extern sp-get-block-size function) -(define-extern sp-kill-particle function) +(define-extern sp-kill-particle (function process sparticle-cpuinfo none)) ;; TODO - not confirmed (define-extern sp-orbiter function) (define-extern memcpy function) (define-extern kill-all-particles-in-level (function int)) @@ -16268,8 +16268,8 @@ ;; - Unknowns ;;(define-extern *particles-flag* object) ;; unknown type -;;(define-extern *sp-particle-system-2d* object) ;; unknown type -;;(define-extern *sp-particle-system-3d* object) ;; unknown type +(define-extern *sp-particle-system-2d* sparticle-system) ;; unknown type +(define-extern *sp-particle-system-3d* sparticle-system) ;; unknown type ;; ---------------------- @@ -16388,8 +16388,8 @@ :flag-assert #xc00000010 (:methods (dummy-9 (_type_ vector int float process-drawable) none 9) - (dummy-10 () none 10) - (dummy-11 () none 11) + (TODO-RENAME-10 (_type_ vector int float process-drawable) vector 10) + (dummy-11 (_type_ string symbol vector) none 11) ) ) @@ -16426,34 +16426,34 @@ :flag-assert #x350110017c (:methods (dummy-20 () none 20) - (give-cell () none 21) ;; state + (give-cell () _type_ :state 21) ;; state (dummy-22 () none 22) (enter-playing () none 23) ;; state (play-accept () none 24) ;; state (dummy-25 () none 25) (query () none 26) ;; state - (play-anim () none 27) ;; state - (hidden () none 28) ;; state + (play-anim () _type_ :state 27) ;; state + (hidden () _type_ :state 28) ;; state (dummy-29 () none 29) - (idle () none 30) ;; state - (dummy-31 (_type_) none 31) - (dummy-32 (_type_ symbol) spool-anim 32) + (idle () _type_ :state 30) ;; state + (get-art-elem (_type_) art-element 31) + (play-anim! (_type_ symbol) basic 32) (dummy-33 (_type_) none 33) (dummy-34 (_type_) none 34) (dummy-35 (_type_) none 35) (dummy-36 (_type_) none 36) (dummy-37 (_type_) none 37) (dummy-38 (_type_) none 38) - (dummy-39 (_type_) none 39) + (should-display? (_type_) symbol 39) (dummy-40 (_type_ object skeleton-group int int vector int) none 40) - (dummy-41 (_type_) none 41) + (initialize-collision (_type_ int) none 41) (dummy-42 (_type_) none 42) - (dummy-43 (_type_) none 43) + (TODO-RENAME-43 (_type_) none 43) (dummy-44 (_type_) none 44) (dummy-45 (_type_) none 45) (dummy-46 (_type_) none 46) - (dummy-47 (_type_) none 47) - (dummy-48 (_type_) none 48) + (target-above-threshold? (_type_) symbol 47) + (draw-shadow (_type_) none 48) (dummy-49 (_type_) none 49) (dummy-50 (_type_) none 50) (dummy-51 (_type_) none 51) @@ -18784,7 +18784,7 @@ (define-extern camera-look-at function) (define-extern camera-pov-from function) (define-extern command-get-trans function) -(define-extern manipy-init function) +(define-extern manipy-init (function trsqv vector entity skeleton-group symbol none)) ;; TODO - not confirmed yet (define-extern part-tracker-notify function) (define-extern clone-anim-once function) (define-extern convert-to-hud-object function) @@ -20223,7 +20223,7 @@ ;; - Functions (define-extern othercam-calc function) -(define-extern vector-for-ambient function) +(define-extern vector-for-ambient (function process-drawable vector vector)) (define-extern hide-hud function) (define-extern hud-hidden? function) (define-extern process-taskable-clean-up-after-talking function) @@ -22091,7 +22091,7 @@ (free-time uint64 :offset-assert 360) (touch-time uint64 :offset-assert 368) (nav-enemy-flags uint32 :offset-assert 376) - (incomming-attack-id uint64 :offset-assert 384) + (incomming-attack-id handle :offset-assert 384) (jump-return-state (state process) :offset-assert 392) (rand-gen random-generator :offset-assert 396) ) @@ -23546,60 +23546,13 @@ ;; - Types -; (deftype bird-lady (process-taskable) -; () -; :method-count-assert 53 -; :size-assert #x17c -; :heap-base #x110 -; :flag-assert #x350110017c -; ;; not enough basic ops -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; (dummy-21 () none 21) -; (dummy-22 () none 22) -; (dummy-23 () none 23) -; (dummy-24 () none 24) -; (dummy-25 () none 25) -; (dummy-26 () none 26) -; (dummy-27 () none 27) -; (dummy-28 () none 28) -; (dummy-29 () none 29) -; (dummy-30 () none 30) -; (dummy-31 () none 31) -; (dummy-32 () none 32) -; (dummy-33 () none 33) -; (dummy-34 () none 34) -; (dummy-35 () none 35) -; (dummy-36 () none 36) -; (dummy-37 () none 37) -; (dummy-38 () none 38) -; (dummy-39 () none 39) -; (dummy-40 () none 40) -; (dummy-41 () none 41) -; (dummy-42 () none 42) -; (dummy-43 () none 43) -; (dummy-44 () none 44) -; (dummy-45 () none 45) -; (dummy-46 () none 46) -; (dummy-47 () none 47) -; (dummy-48 () none 48) -; (dummy-49 () none 49) -; (dummy-50 () none 50) -; (dummy-51 () none 51) -; (dummy-52 () none 52) -; ) -; ) +(deftype bird-lady (process-taskable) + () + :method-count-assert 53 + :size-assert #x17c + :heap-base #x110 + :flag-assert #x350110017c + ) ;; - Unknowns @@ -23614,62 +23567,15 @@ ;; - Types -; (deftype bird-lady-beach (process-taskable) -; ((flutflut uint64 :offset-assert 384) -; (egg uint64 :offset-assert 392) -; ) -; :method-count-assert 53 -; :size-assert #x190 -; :heap-base #x120 -; :flag-assert #x3501200190 -; ;; inherited inspect of process-taskable -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; (dummy-21 () none 21) -; (dummy-22 () none 22) -; (dummy-23 () none 23) -; (dummy-24 () none 24) -; (dummy-25 () none 25) -; (dummy-26 () none 26) -; (dummy-27 () none 27) -; (dummy-28 () none 28) -; (dummy-29 () none 29) -; (dummy-30 () none 30) -; (dummy-31 () none 31) -; (dummy-32 () none 32) -; (dummy-33 () none 33) -; (dummy-34 () none 34) -; (dummy-35 () none 35) -; (dummy-36 () none 36) -; (dummy-37 () none 37) -; (dummy-38 () none 38) -; (dummy-39 () none 39) -; (dummy-40 () none 40) -; (dummy-41 () none 41) -; (dummy-42 () none 42) -; (dummy-43 () none 43) -; (dummy-44 () none 44) -; (dummy-45 () none 45) -; (dummy-46 () none 46) -; (dummy-47 () none 47) -; (dummy-48 () none 48) -; (dummy-49 () none 49) -; (dummy-50 () none 50) -; (dummy-51 () none 51) -; (dummy-52 () none 52) -; ) -; ) +(deftype bird-lady-beach (process-taskable) + ((flutflut handle :offset-assert 384) + (egg handle :offset-assert 392) + ) + :method-count-assert 53 + :size-assert #x190 + :heap-base #x120 + :flag-assert #x3501200190 + ) ;; - Unknowns @@ -23684,64 +23590,17 @@ ;; - Types -; (deftype mayor (process-taskable) -; () -; :method-count-assert 53 -; :size-assert #x17c -; :heap-base #x110 -; :flag-assert #x350110017c -; ;; not enough basic ops -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; (dummy-21 () none 21) -; (dummy-22 () none 22) -; (dummy-23 () none 23) -; (dummy-24 () none 24) -; (dummy-25 () none 25) -; (dummy-26 () none 26) -; (dummy-27 () none 27) -; (dummy-28 () none 28) -; (dummy-29 () none 29) -; (dummy-30 () none 30) -; (dummy-31 () none 31) -; (dummy-32 () none 32) -; (dummy-33 () none 33) -; (dummy-34 () none 34) -; (dummy-35 () none 35) -; (dummy-36 () none 36) -; (dummy-37 () none 37) -; (dummy-38 () none 38) -; (dummy-39 () none 39) -; (dummy-40 () none 40) -; (dummy-41 () none 41) -; (dummy-42 () none 42) -; (dummy-43 () none 43) -; (dummy-44 () none 44) -; (dummy-45 () none 45) -; (dummy-46 () none 46) -; (dummy-47 () none 47) -; (dummy-48 () none 48) -; (dummy-49 () none 49) -; (dummy-50 () none 50) -; (dummy-51 () none 51) -; (dummy-52 () none 52) -; ) -; ) +(deftype mayor (process-taskable) + ((root-override collide-shape :score 100 :offset 112)) + :method-count-assert 53 + :size-assert #x17c + :heap-base #x110 + :flag-assert #x350110017c + ) ;; - Functions -(define-extern mayor-lurkerm-reward-speech function) +(define-extern mayor-lurkerm-reward-speech (function mayor symbol spool-anim)) ;; - Unknowns @@ -23756,65 +23615,19 @@ ;; - Types -; (deftype sculptor (process-taskable) -; ((muse uint64 :offset-assert 384) -; ) -; :method-count-assert 53 -; :size-assert #x188 -; :heap-base #x120 -; :flag-assert #x3501200188 -; ;; inherited inspect of process-taskable -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; (dummy-21 () none 21) -; (dummy-22 () none 22) -; (dummy-23 () none 23) -; (dummy-24 () none 24) -; (dummy-25 () none 25) -; (dummy-26 () none 26) -; (dummy-27 () none 27) -; (dummy-28 () none 28) -; (dummy-29 () none 29) -; (dummy-30 () none 30) -; (dummy-31 () none 31) -; (dummy-32 () none 32) -; (dummy-33 () none 33) -; (dummy-34 () none 34) -; (dummy-35 () none 35) -; (dummy-36 () none 36) -; (dummy-37 () none 37) -; (dummy-38 () none 38) -; (dummy-39 () none 39) -; (dummy-40 () none 40) -; (dummy-41 () none 41) -; (dummy-42 () none 42) -; (dummy-43 () none 43) -; (dummy-44 () none 44) -; (dummy-45 () none 45) -; (dummy-46 () none 46) -; (dummy-47 () none 47) -; (dummy-48 () none 48) -; (dummy-49 () none 49) -; (dummy-50 () none 50) -; (dummy-51 () none 51) -; (dummy-52 () none 52) -; ) -; ) +(deftype sculptor (process-taskable) + ((muse handle :offset-assert 384) + ) + :method-count-assert 53 + :size-assert #x188 + :heap-base #x120 + :flag-assert #x3501200188 + ) ;; - Functions -(define-extern muse-to-idle function) +(declare-type muse nav-enemy) +(define-extern muse-to-idle (function muse object :behavior sculptor)) ;; - Unknowns @@ -24713,64 +24526,17 @@ ;; - Types -; (deftype oracle (process-taskable) -; ((first-task uint8 :offset-assert 380) -; (second-task uint8 :offset-assert 381) -; (left-eye-cell uint64 :offset-assert 384) -; (right-eye-cell uint64 :offset-assert 392) -; ) -; :method-count-assert 53 -; :size-assert #x190 -; :heap-base #x120 -; :flag-assert #x3501200190 -; ;; inherited inspect of process-taskable -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; (dummy-21 () none 21) -; (dummy-22 () none 22) -; (dummy-23 () none 23) -; (dummy-24 () none 24) -; (dummy-25 () none 25) -; (dummy-26 () none 26) -; (dummy-27 () none 27) -; (dummy-28 () none 28) -; (dummy-29 () none 29) -; (dummy-30 () none 30) -; (dummy-31 () none 31) -; (dummy-32 () none 32) -; (dummy-33 () none 33) -; (dummy-34 () none 34) -; (dummy-35 () none 35) -; (dummy-36 () none 36) -; (dummy-37 () none 37) -; (dummy-38 () none 38) -; (dummy-39 () none 39) -; (dummy-40 () none 40) -; (dummy-41 () none 41) -; (dummy-42 () none 42) -; (dummy-43 () none 43) -; (dummy-44 () none 44) -; (dummy-45 () none 45) -; (dummy-46 () none 46) -; (dummy-47 () none 47) -; (dummy-48 () none 48) -; (dummy-49 () none 49) -; (dummy-50 () none 50) -; (dummy-51 () none 51) -; (dummy-52 () none 52) -; ) -; ) +(deftype oracle (process-taskable) + ((first-task uint8 :offset-assert 380) + (second-task uint8 :offset-assert 381) + (left-eye-cell handle :offset-assert 384) + (right-eye-cell handle :offset-assert 392) + ) + :method-count-assert 53 + :size-assert #x190 + :heap-base #x120 + :flag-assert #x3501200190 + ) ;; - Unknowns @@ -31345,12 +31111,6 @@ :method-count-assert 53 :size-assert #x17c :flag-assert #x350110017c - (:methods - (dummy-31 (_type_) none 31) - (dummy-32 (_type_ symbol) spool-anim 32) - (dummy-41 (_type_) none 41) - (dummy-43 (_type_) none 43) - ) ) ;; - Unknowns @@ -31366,60 +31126,13 @@ ;; - Types -; (deftype explorer (process-taskable) -; () -; :method-count-assert 53 -; :size-assert #x17c -; :heap-base #x110 -; :flag-assert #x350110017c -; ;; not enough basic ops -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; (dummy-21 () none 21) -; (dummy-22 () none 22) -; (dummy-23 () none 23) -; (dummy-24 () none 24) -; (dummy-25 () none 25) -; (dummy-26 () none 26) -; (dummy-27 () none 27) -; (dummy-28 () none 28) -; (dummy-29 () none 29) -; (dummy-30 () none 30) -; (dummy-31 () none 31) -; (dummy-32 () none 32) -; (dummy-33 () none 33) -; (dummy-34 () none 34) -; (dummy-35 () none 35) -; (dummy-36 () none 36) -; (dummy-37 () none 37) -; (dummy-38 () none 38) -; (dummy-39 () none 39) -; (dummy-40 () none 40) -; (dummy-41 () none 41) -; (dummy-42 () none 42) -; (dummy-43 () none 43) -; (dummy-44 () none 44) -; (dummy-45 () none 45) -; (dummy-46 () none 46) -; (dummy-47 () none 47) -; (dummy-48 () none 48) -; (dummy-49 () none 49) -; (dummy-50 () none 50) -; (dummy-51 () none 51) -; (dummy-52 () none 52) -; ) -; ) +(deftype explorer (process-taskable) + () + :method-count-assert 53 + :size-assert #x17c + :heap-base #x110 + :flag-assert #x350110017c + ) ;; - Unknowns @@ -31434,65 +31147,18 @@ ;; - Types -; (deftype assistant (process-taskable) -; ((sound-id sound-id :offset-assert 380) -; ) -; :method-count-assert 53 -; :size-assert #x180 -; :heap-base #x110 -; :flag-assert #x3501100180 -; ;; inherited inspect of process-taskable -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; (dummy-21 () none 21) -; (dummy-22 () none 22) -; (dummy-23 () none 23) -; (dummy-24 () none 24) -; (dummy-25 () none 25) -; (dummy-26 () none 26) -; (dummy-27 () none 27) -; (dummy-28 () none 28) -; (dummy-29 () none 29) -; (dummy-30 () none 30) -; (dummy-31 () none 31) -; (dummy-32 () none 32) -; (dummy-33 () none 33) -; (dummy-34 () none 34) -; (dummy-35 () none 35) -; (dummy-36 () none 36) -; (dummy-37 () none 37) -; (dummy-38 () none 38) -; (dummy-39 () none 39) -; (dummy-40 () none 40) -; (dummy-41 () none 41) -; (dummy-42 () none 42) -; (dummy-43 () none 43) -; (dummy-44 () none 44) -; (dummy-45 () none 45) -; (dummy-46 () none 46) -; (dummy-47 () none 47) -; (dummy-48 () none 48) -; (dummy-49 () none 49) -; (dummy-50 () none 50) -; (dummy-51 () none 51) -; (dummy-52 () none 52) -; ) -; ) +(deftype assistant (process-taskable) + ((sound-id sound-id :offset-assert 380) + ) + :method-count-assert 53 + :size-assert #x180 + :heap-base #x110 + :flag-assert #x3501100180 + ) ;; - Functions -(define-extern check-drop-level-assistant function) +(define-extern check-drop-level-assistant (function assistant sparticle-cpuinfo vector none)) ;; - Unknowns @@ -31507,62 +31173,15 @@ ;; - Types -; (deftype sage (process-taskable) -; ((reminder-played basic :offset-assert 380) -; (assistant uint64 :offset-assert 384) -; ) -; :method-count-assert 53 -; :size-assert #x188 -; :heap-base #x120 -; :flag-assert #x3501200188 -; ;; inherited inspect of process-taskable -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; (dummy-21 () none 21) -; (dummy-22 () none 22) -; (dummy-23 () none 23) -; (dummy-24 () none 24) -; (dummy-25 () none 25) -; (dummy-26 () none 26) -; (dummy-27 () none 27) -; (dummy-28 () none 28) -; (dummy-29 () none 29) -; (dummy-30 () none 30) -; (dummy-31 () none 31) -; (dummy-32 () none 32) -; (dummy-33 () none 33) -; (dummy-34 () none 34) -; (dummy-35 () none 35) -; (dummy-36 () none 36) -; (dummy-37 () none 37) -; (dummy-38 () none 38) -; (dummy-39 () none 39) -; (dummy-40 () none 40) -; (dummy-41 () none 41) -; (dummy-42 () none 42) -; (dummy-43 () none 43) -; (dummy-44 () none 44) -; (dummy-45 () none 45) -; (dummy-46 () none 46) -; (dummy-47 () none 47) -; (dummy-48 () none 48) -; (dummy-49 () none 49) -; (dummy-50 () none 50) -; (dummy-51 () none 51) -; (dummy-52 () none 52) -; ) -; ) +(deftype sage (process-taskable) + ((reminder-played basic :offset-assert 380) + (assistant handle :offset-assert 384) + ) + :method-count-assert 53 + :size-assert #x188 + :heap-base #x120 + :flag-assert #x3501200188 + ) ;; - Unknowns @@ -33180,107 +32799,37 @@ ;; - Types -; (deftype muse (nav-enemy) -; ((current-path-index float :offset-assert 400) -; (prev-path-index float :offset-assert 404) -; (dest-path-index float :offset-assert 408) -; (player-path-index float :offset-assert 412) -; (max-path-index float :offset-assert 416) -; (sprint-distance float :offset-assert 420) -; (dest-point vector :inline :offset-assert 432) -; (anim basic :offset-assert 448) -; (victory-anim basic :offset-assert 452) -; (old-target-pos transformq :inline :offset-assert 464) -; ) -; :method-count-assert 76 -; :size-assert #x200 -; :heap-base #x190 -; :flag-assert #x4c01900200 -; ;; inherited inspect of nav-enemy -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; (dummy-21 () none 21) -; (dummy-22 () none 22) -; (dummy-23 () none 23) -; (dummy-24 () none 24) -; (dummy-25 () none 25) -; (dummy-26 () none 26) -; (dummy-27 () none 27) -; (dummy-28 () none 28) -; (dummy-29 () none 29) -; (dummy-30 () none 30) -; (dummy-31 () none 31) -; (dummy-32 () none 32) -; (dummy-33 () none 33) -; (dummy-34 () none 34) -; (dummy-35 () none 35) -; (dummy-36 () none 36) -; (dummy-37 () none 37) -; (dummy-38 () none 38) -; (dummy-39 () none 39) -; (dummy-40 () none 40) -; (dummy-41 () none 41) -; (dummy-42 () none 42) -; (dummy-43 () none 43) -; (dummy-44 () none 44) -; (dummy-45 () none 45) -; (dummy-46 () none 46) -; (dummy-47 () none 47) -; (dummy-48 () none 48) -; (dummy-49 () none 49) -; (dummy-50 () none 50) -; (dummy-51 () none 51) -; (dummy-52 () none 52) -; (dummy-53 () none 53) -; (dummy-54 () none 54) -; (dummy-55 () none 55) -; (dummy-56 () none 56) -; (dummy-57 () none 57) -; (dummy-58 () none 58) -; (dummy-59 () none 59) -; (dummy-60 () none 60) -; (dummy-61 () none 61) -; (dummy-62 () none 62) -; (dummy-63 () none 63) -; (dummy-64 () none 64) -; (dummy-65 () none 65) -; (dummy-66 () none 66) -; (dummy-67 () none 67) -; (dummy-68 () none 68) -; (dummy-69 () none 69) -; (dummy-70 () none 70) -; (dummy-71 () none 71) -; (dummy-72 () none 72) -; (dummy-73 () none 73) -; (dummy-74 () none 74) -; (dummy-75 () none 75) -; ) -; ) +(deftype muse (nav-enemy) + ((current-path-index float :offset-assert 400) + (prev-path-index float :offset-assert 404) + (dest-path-index float :offset-assert 408) + (player-path-index float :offset-assert 412) + (max-path-index float :offset-assert 416) + (sprint-distance float :offset-assert 420) + (dest-point vector :inline :offset-assert 432) + (anim spool-anim :offset-assert 448) ; TODO - guess + (victory-anim spool-anim :offset-assert 452) ; TODO - guess + (old-target-pos transformq :inline :offset-assert 464) + ) + :method-count-assert 76 + :size-assert #x200 + :heap-base #x190 + :flag-assert #x4c01900200 + ) -; (deftype point-on-path-segment-info (structure) -; ((point vector :inline :offset-assert 0) -; (segment UNKNOWN 2 :offset-assert 16) -; (dir vector :inline :offset-assert 48) -; (nearest-point vector :inline :offset-assert 64) -; (segment-length float :offset-assert 80) -; (distance-to-segment float :offset-assert 84) -; (parametric-index float :offset-assert 88) -; ) -; :method-count-assert 9 -; :size-assert #x5c -; :flag-assert #x90000005c -; ) +(deftype point-on-path-segment-info (structure) + ((point vector :inline :offset-assert 0) + (segment vector 2 :inline :offset-assert 16) ;; TODO - guess + (dir vector :inline :offset-assert 48) + (nearest-point vector :inline :offset-assert 64) + (segment-length float :offset-assert 80) + (distance-to-segment float :offset-assert 84) + (parametric-index float :offset-assert 88) + ) + :method-count-assert 9 + :size-assert #x5c + :flag-assert #x90000005c + ) ;; - Functions @@ -33912,28 +33461,14 @@ :flag-assert #x23029002f2 ) -; (deftype allpontoons (process-drawable) -; ((task uint8 :offset-assert 176) -; ) -; :method-count-assert 20 -; :size-assert #xb1 -; :heap-base #x50 -; :flag-assert #x14005000b1 -; ;; inherited inspect of process-drawable -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; ) -; ) +(deftype allpontoons (process-drawable) + ((task uint8 :offset-assert 176) + ) + :method-count-assert 20 + :size-assert #xb1 + :heap-base #x50 + :flag-assert #x14005000b1 + ) ; (deftype fireboulder (process-drawable) ; ((tracker uint64 :offset-assert 176) @@ -34144,60 +33679,13 @@ ;; - Types -; (deftype gambler (process-taskable) -; () -; :method-count-assert 53 -; :size-assert #x17c -; :heap-base #x110 -; :flag-assert #x350110017c -; ;; not enough basic ops -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; (dummy-21 () none 21) -; (dummy-22 () none 22) -; (dummy-23 () none 23) -; (dummy-24 () none 24) -; (dummy-25 () none 25) -; (dummy-26 () none 26) -; (dummy-27 () none 27) -; (dummy-28 () none 28) -; (dummy-29 () none 29) -; (dummy-30 () none 30) -; (dummy-31 () none 31) -; (dummy-32 () none 32) -; (dummy-33 () none 33) -; (dummy-34 () none 34) -; (dummy-35 () none 35) -; (dummy-36 () none 36) -; (dummy-37 () none 37) -; (dummy-38 () none 38) -; (dummy-39 () none 39) -; (dummy-40 () none 40) -; (dummy-41 () none 41) -; (dummy-42 () none 42) -; (dummy-43 () none 43) -; (dummy-44 () none 44) -; (dummy-45 () none 45) -; (dummy-46 () none 46) -; (dummy-47 () none 47) -; (dummy-48 () none 48) -; (dummy-49 () none 49) -; (dummy-50 () none 50) -; (dummy-51 () none 51) -; (dummy-52 () none 52) -; ) -; ) +(deftype gambler (process-taskable) + () + :method-count-assert 53 + :size-assert #x17c + :heap-base #x110 + :flag-assert #x350110017c + ) ;; - Unknowns @@ -34212,60 +33700,13 @@ ;; - Types -; (deftype warrior (process-taskable) -; () -; :method-count-assert 53 -; :size-assert #x17c -; :heap-base #x110 -; :flag-assert #x350110017c -; ;; not enough basic ops -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; (dummy-21 () none 21) -; (dummy-22 () none 22) -; (dummy-23 () none 23) -; (dummy-24 () none 24) -; (dummy-25 () none 25) -; (dummy-26 () none 26) -; (dummy-27 () none 27) -; (dummy-28 () none 28) -; (dummy-29 () none 29) -; (dummy-30 () none 30) -; (dummy-31 () none 31) -; (dummy-32 () none 32) -; (dummy-33 () none 33) -; (dummy-34 () none 34) -; (dummy-35 () none 35) -; (dummy-36 () none 36) -; (dummy-37 () none 37) -; (dummy-38 () none 38) -; (dummy-39 () none 39) -; (dummy-40 () none 40) -; (dummy-41 () none 41) -; (dummy-42 () none 42) -; (dummy-43 () none 43) -; (dummy-44 () none 44) -; (dummy-45 () none 45) -; (dummy-46 () none 46) -; (dummy-47 () none 47) -; (dummy-48 () none 48) -; (dummy-49 () none 49) -; (dummy-50 () none 50) -; (dummy-51 () none 51) -; (dummy-52 () none 52) -; ) -; ) +(deftype warrior (process-taskable) + () + :method-count-assert 53 + :size-assert #x17c + :heap-base #x110 + :flag-assert #x350110017c + ) ;; - Unknowns @@ -34280,60 +33721,13 @@ ;; - Types -; (deftype geologist (process-taskable) -; () -; :method-count-assert 53 -; :size-assert #x17c -; :heap-base #x110 -; :flag-assert #x350110017c -; ;; not enough basic ops -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; (dummy-21 () none 21) -; (dummy-22 () none 22) -; (dummy-23 () none 23) -; (dummy-24 () none 24) -; (dummy-25 () none 25) -; (dummy-26 () none 26) -; (dummy-27 () none 27) -; (dummy-28 () none 28) -; (dummy-29 () none 29) -; (dummy-30 () none 30) -; (dummy-31 () none 31) -; (dummy-32 () none 32) -; (dummy-33 () none 33) -; (dummy-34 () none 34) -; (dummy-35 () none 35) -; (dummy-36 () none 36) -; (dummy-37 () none 37) -; (dummy-38 () none 38) -; (dummy-39 () none 39) -; (dummy-40 () none 40) -; (dummy-41 () none 41) -; (dummy-42 () none 42) -; (dummy-43 () none 43) -; (dummy-44 () none 44) -; (dummy-45 () none 45) -; (dummy-46 () none 46) -; (dummy-47 () none 47) -; (dummy-48 () none 48) -; (dummy-49 () none 49) -; (dummy-50 () none 50) -; (dummy-51 () none 51) -; (dummy-52 () none 52) -; ) -; ) +(deftype geologist (process-taskable) + () + :method-count-assert 53 + :size-assert #x17c + :heap-base #x110 + :flag-assert #x350110017c + ) ;; - Unknowns @@ -40694,144 +40088,38 @@ ;; - Types -; (deftype minertall (process-taskable) -; () -; :method-count-assert 53 -; :size-assert #x17c -; :heap-base #x110 -; :flag-assert #x350110017c -; ;; not enough basic ops -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; (dummy-21 () none 21) -; (dummy-22 () none 22) -; (dummy-23 () none 23) -; (dummy-24 () none 24) -; (dummy-25 () none 25) -; (dummy-26 () none 26) -; (dummy-27 () none 27) -; (dummy-28 () none 28) -; (dummy-29 () none 29) -; (dummy-30 () none 30) -; (dummy-31 () none 31) -; (dummy-32 () none 32) -; (dummy-33 () none 33) -; (dummy-34 () none 34) -; (dummy-35 () none 35) -; (dummy-36 () none 36) -; (dummy-37 () none 37) -; (dummy-38 () none 38) -; (dummy-39 () none 39) -; (dummy-40 () none 40) -; (dummy-41 () none 41) -; (dummy-42 () none 42) -; (dummy-43 () none 43) -; (dummy-44 () none 44) -; (dummy-45 () none 45) -; (dummy-46 () none 46) -; (dummy-47 () none 47) -; (dummy-48 () none 48) -; (dummy-49 () none 49) -; (dummy-50 () none 50) -; (dummy-51 () none 51) -; (dummy-52 () none 52) -; ) -; ) +(deftype minertall (process-taskable) + () + :method-count-assert 53 + :size-assert #x17c + :heap-base #x110 + :flag-assert #x350110017c + ) -; (deftype minershort (process-taskable) -; ((other-miner basic :offset-assert 380) -; ) -; :method-count-assert 53 -; :size-assert #x180 -; :heap-base #x110 -; :flag-assert #x3501100180 -; ;; inherited inspect of process-taskable -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; (dummy-21 () none 21) -; (dummy-22 () none 22) -; (dummy-23 () none 23) -; (dummy-24 () none 24) -; (dummy-25 () none 25) -; (dummy-26 () none 26) -; (dummy-27 () none 27) -; (dummy-28 () none 28) -; (dummy-29 () none 29) -; (dummy-30 () none 30) -; (dummy-31 () none 31) -; (dummy-32 () none 32) -; (dummy-33 () none 33) -; (dummy-34 () none 34) -; (dummy-35 () none 35) -; (dummy-36 () none 36) -; (dummy-37 () none 37) -; (dummy-38 () none 38) -; (dummy-39 () none 39) -; (dummy-40 () none 40) -; (dummy-41 () none 41) -; (dummy-42 () none 42) -; (dummy-43 () none 43) -; (dummy-44 () none 44) -; (dummy-45 () none 45) -; (dummy-46 () none 46) -; (dummy-47 () none 47) -; (dummy-48 () none 48) -; (dummy-49 () none 49) -; (dummy-50 () none 50) -; (dummy-51 () none 51) -; (dummy-52 () none 52) -; ) -; ) +(deftype minershort (process-taskable) + ((other-miner minertall :offset-assert 380) + ) + :method-count-assert 53 + :size-assert #x180 + :heap-base #x110 + :flag-assert #x3501100180 + ) -; (deftype cavegem (process-drawable) -; () -; :method-count-assert 21 -; :size-assert #xb0 -; :heap-base #x40 -; :flag-assert #x15004000b0 -; ;; not enough basic ops -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; ) -; ) +(deftype cavegem (process-drawable) + () + :method-count-assert 21 + :size-assert #xb0 + :heap-base #x40 + :flag-assert #x15004000b0 + (:methods + (dummy-20 (_type_) none 20) + ) + ) ;; - Functions -(define-extern minershort-trans-hook function) -(define-extern miners-anim-loop function) +(define-extern minershort-trans-hook (function none :behavior minershort)) +(define-extern miners-anim-loop (function none :behavior minershort)) ;; - Unknowns diff --git a/decompiler/config/jak1_ntsc_black_label.jsonc b/decompiler/config/jak1_ntsc_black_label.jsonc index b346771a8..b15797889 100644 --- a/decompiler/config/jak1_ntsc_black_label.jsonc +++ b/decompiler/config/jak1_ntsc_black_label.jsonc @@ -3,7 +3,7 @@ // if you want to filter to only some object names. // it will make the decompiler much faster. - "allowed_objects": ["nav-enemy"], + "allowed_objects": [], //////////////////////////// // CODE ANALYSIS OPTIONS diff --git a/decompiler/config/jak1_ntsc_black_label/anonymous_function_types.jsonc b/decompiler/config/jak1_ntsc_black_label/anonymous_function_types.jsonc index 07cb99057..549699a81 100644 --- a/decompiler/config/jak1_ntsc_black_label/anonymous_function_types.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/anonymous_function_types.jsonc @@ -661,5 +661,15 @@ [62, "(function int :behavior nav-enemy)"] ], + "oracle": [ + [1, "(function sparticle-launch-group :behavior oracle)"], + [2, "(function sparticle-launch-group :behavior oracle)"], + [3, "(function none :behavior oracle)"] + ], + + "miners": [ + [1, "(function none :behavior minershort)"] + ], + "placeholder-do-not-add-below": [] } diff --git a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc index e6c74f94d..c7f3d1c7b 100644 --- a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc @@ -1250,8 +1250,6 @@ ["L149", "float", true] ], - "farmer": [["L50", "float", true]], - "bsp": [ ["L54", "rgba", true], ["L85", "rgba", true], @@ -1698,6 +1696,215 @@ ["L56", "uint64", true] ], + "mayor": [ + ["L2", "_lambda_", true], + ["L4", "_lambda_", true], + ["L57", "vector", true], + ["L58", "state", true], + ["L69", "spool-anim", true], + ["L372", "spool-anim", true], + ["L674", "spool-anim", true], + ["L976", "spool-anim", true], + ["L1279", "spool-anim", true], + ["L1582", "spool-anim", true], + ["L1971", "spool-anim", true], + ["L1973", "spool-anim", true], + ["L1975", "skeleton-group", true], + ["L1985", "float", true] + ], + + "bird-lady": [ + ["L29", "vector", true], + ["L34", "spool-anim", true], + ["L36", "spool-anim", true], + ["L38", "spool-anim", true], + ["L134", "skeleton-group", true], + ["L138", "float", true] + ], + + "bird-lady-beach": [ + ["L17", "_lambda_", true], + ["L26", "vector", true], + ["L28", "spool-anim", true], + ["L52", "state", true], + ["L53", "skeleton-group", true] + ], + + "sculptor": [ + ["L2", "_lambda_", true], + ["L89", "vector", true], + ["L65", "_lambda_", true], + ["L90", "state", true], + ["L99", "spool-anim", true], + ["L109", "spool-anim", true], + ["L111", "spool-anim", true], + ["L193", "state", true], + ["L195", "skeleton-group", true], + ["L197", "skeleton-group", true], + ["L202", "float", true] + ], + + "geologist": [ + ["L38", "vector", true], + ["L50", "spool-anim", true], + ["L52", "spool-anim", true], + ["L54", "spool-anim", true], + ["L55", "spool-anim", true], + ["L56", "spool-anim", true], + ["L58", "spool-anim", true], + ["L60", "spool-anim", true], + ["L102", "skeleton-group", true], + ["L112", "float", true] + ], + + "oracle": [ + ["L14", "_lambda_", true], + ["L15", "_lambda_", true], + ["L16", "_lambda_", true], + ["L21", "_lambda_", true], + ["L22", "_lambda_", true], + ["L55", "vector", true], + ["L56", "vector", true], + ["L57", "sound-spec", true], + ["L58", "vector", true], + ["L59", "state", true], + ["L61", "spool-anim", true], + ["L63", "spool-anim", true], + ["L65", "spool-anim", true], + ["L67", "spool-anim", true], + ["L69", "spool-anim", true], + ["L71", "spool-anim", true], + ["L73", "spool-anim", true], + ["L75", "spool-anim", true], + ["L77", "spool-anim", true], + ["L79", "spool-anim", true], + ["L81", "spool-anim", true], + ["L492", "spool-anim", true], + ["L494", "skeleton-group", true], + ["L496", "float", true] + ], + + "farmer": [ + ["L28", "vector", true], + ["L34", "spool-anim", true], + ["L36", "spool-anim", true], + ["L38", "spool-anim", true], + ["L40", "spool-anim", true], + ["L42", "skeleton-group", true], + ["L50", "float", true] + ], + + "explorer": [ + ["L2", "_lambda_", true], + ["L78", "state", true], + ["L77", "vector", true], + ["L87", "spool-anim", true], + ["L97", "spool-anim", true], + ["L99", "spool-anim", true], + ["L133", "spool-anim", true], + ["L159", "skeleton-group", true], + ["L166", "float", true] + ], + + "assistant": [ + ["L7", "_lambda_", true], + // ["L72", "sparticle-launcher", true], + // ["L74", "sparticle-launcher", true], + // ["L76", "sparticle-launcher", true], + // ["L78", "sparticle-launch-group", true], + ["L81", "state", true], + ["L88", "spool-anim", true], + ["L89", "spool-anim", true], + ["L90", "spool-anim", true], + ["L92", "spool-anim", true], + ["L94", "spool-anim", true], + ["L96", "spool-anim", true], + ["L115", "spool-anim", true], + ["L229", "skeleton-group", true], + ["L236", "float", true], + ["L241", "float", true], + ["L244", "uint64", true], + ["L245", "uint64", true] + ], + + "sage": [ + ["L5", "_lambda_", true], + ["L10", "_lambda_", true], + ["L12", "_lambda_", true], + ["L26", "_lambda_", true], + ["L91", "vector", true], + ["L92", "state", true], + ["L94", "state", true], + ["L101", "spool-anim", true], + ["L401", "spool-anim", true], + ["L476", "spool-anim", true], + ["L486", "spool-anim", true], + ["L488", "spool-anim", true], + ["L490", "spool-anim", true], + ["L520", "spool-anim", true], + ["L673", "spool-anim", true], + ["L889", "spool-anim", true], + ["L933", "skeleton-group", true], + ["L941", "float", true], + ["L950", "float", true], + ["L951", "float", true] + ], + + "gambler": [ + ["L2", "_lambda_", true], + ["L52", "vector", true], + ["L53", "state", true], + ["L68", "spool-anim", true], + ["L70", "spool-anim", true], + ["L72", "spool-anim", true], + ["L73", "spool-anim", true], + ["L74", "spool-anim", true], + ["L76", "spool-anim", true], + ["L78", "spool-anim", true], + ["L159", "skeleton-group", true], + ["L170", "float", true] + ], + + "warrior": [ + ["L7", "_lambda_", true], + ["L30", "vector", true], + ["L34", "state", true], + ["L36", "spool-anim", true], + ["L46", "spool-anim", true], + ["L48", "spool-anim", true], + ["L98", "skeleton-group", true], + ["L107", "float", true] + ], + + "miners": [ + ["L2", "_lambda_", true], + ["L40", "_lambda_", true], + ["L93", "_lambda_", true], + ["L108", "state", true], + ["L109", "skeleton-group", true], + ["L111", "vector", true], + ["L112", "state", true], + ["L142", "state", true], + ["L143", "spool-anim", true], + ["L153", "spool-anim", true], + ["L155", "spool-anim", true], + ["L167", "spool-anim", true], + ["L169", "spool-anim", true], + ["L171", "spool-anim", true], + ["L173", "spool-anim", true], + ["L186", "spool-anim", true], + ["L224", "spool-anim", true], + // ["L270", "sparticle-launcher", true], + // ["L272", "sparticle-launcher", true], + // ["L274", "sparticle-launcher", true], + // ["L276", "sparticle-launch-group", true], + ["L279", "skeleton-group", true], + ["L281", "vector", true], + ["L282", "state", true], + ["L284", "skeleton-group", true], + ["L298", "float", true] + ], + // please do not add things after this entry! git is dumb. "object-file-that-doesnt-actually-exist-and-i-just-put-this-here-to-prevent-merge-conflicts-with-this-file": [] } diff --git a/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc b/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc index edff55d9f..33b2c9fe2 100644 --- a/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc @@ -820,6 +820,14 @@ "draw-ocean-transition-seams": [ [16, "sphere"] ], + + "(method 32 mayor)": [ + [16, "event-message-block"] + ], + + "(method 43 mayor)": [ + [16, "vector"] + ], "(method 10 tippy)": [ [16, "vector"] @@ -1027,5 +1035,115 @@ [16, ["array", "int16", 128]] ], + "(method 43 bird-lady)": [ + [16, "vector"] + ], + + "(method 32 bird-lady-beach)": [ + [16, "event-message-block"] + ], + + "muse-to-idle": [ + [16, "event-message-block"] + ], + + "(method 32 sculptor)": [ + [16, "event-message-block"] + ], + + "(method 43 sculptor)": [ + [16, "vector"] + ], + + "(method 32 geologist)": [ + [16, "event-message-block"] + ], + + "(method 43 geologist)": [ + [16, "vector"] + ], + + "(method 32 oracle)": [ + [16, "event-message-block"] + ], + + "(method 11 oracle)": [ + [16, "vector"], + [32, "event-message-block"] + ], + + "(method 32 explorer)": [ + [16, "event-message-block"] + ], + + "(method 43 explorer)": [ + [16, "vector"] + ], + + "(method 32 assistant)": [ + [16, "event-message-block"] + ], + + "(method 43 assistant)": [ + [16, "vector"] + ], + + "(code idle assistant)": [ + [16, "vector"], + [32, "vector"] + ], + + "check-drop-level-assistant": [ + [16, "vector"] + ], + + "(method 32 sage)": [ + [16, "event-message-block"] + ], + + "(method 43 sage)": [ + [16, "vector"] + ], + + "(trans idle sage)": [ + [16, "event-message-block"] + ], + + "(method 32 gambler)": [ + [16, "event-message-block"] + ], + + "(method 43 gambler)": [ + [16, "vector"] + ], + + "(method 32 warrior)": [ + [16, "event-message-block"] + ], + + "(method 43 warrior)": [ + [16, "vector"] + ], + + "(exit play-anim warrior)": [ + [16, "event-message-block"] + ], + + "minershort-trans-hook": [ + [16, "vector"] + ], + + "(method 32 minershort)": [ + [16, "event-message-block"] + ], + + "(exit play-anim minershort)": [ + [16, "event-message-block"] + ], + + "(method 43 minershort)": [ + [16, "vector"] + ], + "placeholder-do-not-add-below!": [] } diff --git a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc index fbbb28f19..2eb7da93a 100644 --- a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc @@ -2087,5 +2087,168 @@ [[33, 35], "v1", "merc-ctrl"] ], + "(method 48 mayor)": [ + [32, "a0", "int"] + ], + + "(method 43 mayor)": [ + [19, "v1", "float"] + ], + + "(method 43 bird-lady)": [ + [19, "v1", "float"] + ], + + "(method 32 bird-lady-beach)": [ + [44, "t9", "(function process function object object object object object)"], + [119, "t9", "(function process function object object object object object)"] + ], + + "muse-to-idle": [ + [36, "t9", "(function process function object object object object object)"], + [57, "v1", "muse"] + ], + + "(method 32 sculptor)": [ + [66, "t9", "(function process function object object object object object)"], + [87, "v1", "muse"] + ], + + "(method 43 sculptor)": [ + [19, "v1", "float"] + ], + + "(code idle sculptor)": [ + [71, "v1", "art-joint-anim"], + [135, "v1", "art-joint-anim"], + [184, "v1", "float"], + [204, "v1", "art-joint-anim"], + [255, "v1", "float"], + [269, "v1", "art-joint-anim"], + [319, "v1", "art-joint-anim"], + [369, "v1", "art-joint-anim"], + [421, "v1", "art-joint-anim"], + [470, "v1", "float"], + [490, "v1", "art-joint-anim"], + [543, "v1", "art-joint-anim"], + [593, "v1", "art-joint-anim"], + [643, "v1", "art-joint-anim"], + [698, "v1", "float"], + [718, "v1", "art-joint-anim"], + [769, "v1", "float"], + [785, "v1", "art-joint-anim"], + [836, "v1", "art-joint-anim"], + [886, "v1", "art-joint-anim"], + [936, "v1", "art-joint-anim"] + ], + + "(method 43 geologist)": [ + [19, "v1", "float"] + ], + + "(anon-function 3 oracle)": [ + [11, "v1", "collide-shape"] + ], + + "(method 11 oracle)": [ + [83, "t9", "(function process function object object object object object)"], + [166, "t9", "(function process function object object object object object)"] + ], + + "(method 43 farmer)": [ + [19, "v1", "float"] + ], + + "(method 43 explorer)": [ + [19, "v1", "float"] + ], + + "(code idle explorer)": [ + [36, "v1", "float"], + [56, "v1", "art-joint-anim"], + [107, "v1", "float"], + [123, "v1", "art-joint-anim"], + [180, "v1", "float"], + [200, "v1", "float"], + [216, "v1", "art-joint-anim"], + [273, "v1", "float"], + [347, "v1", "float"], + [363, "v1", "art-joint-anim"], + [420, "v1", "float"], + [500, "v1", "art-joint-anim"], + [542, "v1", "art-joint-anim"], + [599, "v1", "float"], + [621, "v1", "art-joint-anim"], + [678, "v1", "float"], + [761, "v1", "float"], + [783, "v1", "art-joint-anim"] + ], + + "(method 32 assistant)": [ + [39, "v1", "float"] + ], + + "(method 43 assistant)": [ + [19, "v1", "float"] + ], + + "(code idle assistant)": [ + [35, "v1", "float"], + [114, "v1", "float"], + [130, "v1", "art-joint-anim"], + [207, "v1", "float"], + [376, "v1", "art-joint-anim"], + [415, "v1", "float"], + [431, "v1", "art-joint-anim"], + [482, "v1", "art-joint-anim"], + [530, "v1", "float"], + [549, "v1", "art-joint-anim"], + [602, "v1", "art-joint-anim"] + ], + + "check-drop-level-assistant": [ + [17, "v1", "float"] + ], + + "(method 32 sage)": [ + [76, "v1", "float"], + [175, "t9", "(function process function object object object object object)"], + [262, "v1", "assistant"] + ], + + "(method 43 sage)": [ + [19, "v1", "float"] + ], + + "(code idle sage)": [ + [35, "v1", "float"], + [155, "v1", "art-joint-anim"] + ], + + "(method 43 gambler)": [ + [19, "v1", "float"] + ], + + "(code idle gambler)": [ + [93, "v1", "float"] + ], + + "(method 32 warrior)": [ + [75, "v1", "handle"] + ], + + "(method 43 warrior)": [ + [19, "v1", "float"] + ], + + "(method 32 minershort)": [ + [44, "v1", "float"], + [112, "v1", "float"] + ], + + "(method 43 minershort)": [ + [19, "v1", "float"] + ], + "placeholder-do-not-add-below": [] } diff --git a/goal_src/engine/draw/process-drawable.gc b/goal_src/engine/draw/process-drawable.gc index 9002ee461..892e4b130 100644 --- a/goal_src/engine/draw/process-drawable.gc +++ b/goal_src/engine/draw/process-drawable.gc @@ -20,3 +20,5 @@ (define-extern process-drawable-fuel-cell-handler (function process int symbol event-message-block none)) (define-extern ja-aframe-num (function int float)) (define-extern ja-aframe (function float int float)) +;; TODO - for sculptor +(define-extern ja-eval (function int)) diff --git a/goal_src/engine/entity/entity.gc b/goal_src/engine/entity/entity.gc index 2c9f2eb01..c80d7a40b 100644 --- a/goal_src/engine/entity/entity.gc +++ b/goal_src/engine/entity/entity.gc @@ -122,3 +122,5 @@ (define-extern process-drawable-from-entity! (function process-drawable object none)) ;; TODO - for misty-warehouse (define-extern process-entity-status! (function process entity-perm-status symbol int)) +;; TODO - for warrior +(define-extern entity-birth-no-kill (function entity none)) diff --git a/goal_src/engine/game/collectables.gc b/goal_src/engine/game/collectables.gc index e1cbcfa7c..626e074f1 100644 --- a/goal_src/engine/game/collectables.gc +++ b/goal_src/engine/game/collectables.gc @@ -7,3 +7,5 @@ ;; TODO - for nav-enemy (define-extern birth-pickup-at-point (function vector int float symbol process symbol basic)) ;; TODO - not confirmed at all! (the symbols are wrong) +;; TODO - for oracle +(define-extern *fuel-cell-sg* skeleton-group) ;; unknown type diff --git a/goal_src/engine/game/generic-obs.gc b/goal_src/engine/game/generic-obs.gc index 75efd7267..00927652b 100644 --- a/goal_src/engine/game/generic-obs.gc +++ b/goal_src/engine/game/generic-obs.gc @@ -18,3 +18,5 @@ (define-extern process-grab? (function process symbol)) (define-extern camera-change-to (function string int symbol none)) ;; TODO - not confirmed yet (define-extern process-release? (function process symbol)) +;; TODO - for bird-lady-beach +(define-extern manipy-init (function trsqv vector entity skeleton-group symbol none)) ;; TODO - not confirmed yet diff --git a/goal_src/engine/game/task/task-control-h.gc b/goal_src/engine/game/task/task-control-h.gc index 21dd1cbeb..34dae29a2 100644 --- a/goal_src/engine/game/task/task-control-h.gc +++ b/goal_src/engine/game/task/task-control-h.gc @@ -95,8 +95,8 @@ :flag-assert #xc00000010 (:methods (dummy-9 (_type_ vector int float process-drawable) none 9) - (dummy-10 () none 10) - (dummy-11 () none 11) + (TODO-RENAME-10 (_type_ vector int float process-drawable) vector 10) + (dummy-11 (_type_ string symbol vector) none 11) ) ) @@ -133,34 +133,34 @@ :flag-assert #x350110017c (:methods (dummy-20 () none 20) - (give-cell () none 21) ;; state + (give-cell () _type_ :state 21) ;; state (dummy-22 () none 22) (enter-playing () none 23) ;; state (play-accept () none 24) ;; state (dummy-25 () none 25) (query () none 26) ;; state - (play-anim () none 27) ;; state - (hidden () none 28) ;; state + (play-anim () _type_ :state 27) ;; state + (hidden () _type_ :state 28) ;; state (dummy-29 () none 29) - (idle () none 30) ;; state - (dummy-31 (_type_) none 31) - (dummy-32 (_type_ symbol) spool-anim 32) + (idle () _type_ :state 30) ;; state + (get-art-elem (_type_) art-element 31) + (play-anim! (_type_ symbol) basic 32) (dummy-33 (_type_) none 33) (dummy-34 (_type_) none 34) (dummy-35 (_type_) none 35) (dummy-36 (_type_) none 36) (dummy-37 (_type_) none 37) (dummy-38 (_type_) none 38) - (dummy-39 (_type_) none 39) + (should-display? (_type_) symbol 39) (dummy-40 (_type_ object skeleton-group int int vector int) none 40) - (dummy-41 (_type_) none 41) + (initialize-collision (_type_ int) none 41) (dummy-42 (_type_) none 42) - (dummy-43 (_type_) none 43) + (TODO-RENAME-43 (_type_) none 43) (dummy-44 (_type_) none 44) (dummy-45 (_type_) none 45) (dummy-46 (_type_) none 46) - (dummy-47 (_type_) none 47) - (dummy-48 (_type_) none 48) + (target-above-threshold? (_type_) symbol 47) + (draw-shadow (_type_) none 48) (dummy-49 (_type_) none 49) (dummy-50 (_type_) none 50) (dummy-51 (_type_) none 51) diff --git a/goal_src/engine/load/loader-h.gc b/goal_src/engine/load/loader-h.gc index 7029ac3be..aa83901fc 100644 --- a/goal_src/engine/load/loader-h.gc +++ b/goal_src/engine/load/loader-h.gc @@ -132,8 +132,8 @@ (deftype spool-anim (basic) ((name string :offset 16) ;; why? (buf1 external-art-buffer :offset 16) ;; custom - (buf2 external-art-buffer :offset-assert 20) ;; custom (also what?) - (index int32 :offset 20) + (index int32 :score 100 :offset 20) + (buf2 external-art-buffer :offset 20) ;; custom (also what?) (parts int32 :offset-assert 24) (priority float :offset-assert 28) (owner handle :offset-assert 32) diff --git a/goal_src/engine/nav/navigate-h.gc b/goal_src/engine/nav/navigate-h.gc index 9f3d8ed36..5fdf657ef 100644 --- a/goal_src/engine/nav/navigate-h.gc +++ b/goal_src/engine/nav/navigate-h.gc @@ -402,7 +402,7 @@ (defmethod should-display? nav-control ((obj nav-control)) (and *display-nav-marks* - (nonzero? (logand (-> obj flags) (nav-control-flags display-marks))) + (nonzero? (logand (-> obj flags) (nav-control-flags bit0 display-marks))) ) ) diff --git a/goal_src/engine/sparticle/sparticle-launcher-h.gc b/goal_src/engine/sparticle/sparticle-launcher-h.gc index 4bf418916..b84013d03 100644 --- a/goal_src/engine/sparticle/sparticle-launcher-h.gc +++ b/goal_src/engine/sparticle/sparticle-launcher-h.gc @@ -85,7 +85,7 @@ :size-assert #x30 :flag-assert #xa00000030 (:methods - (dummy-9 () none 9) + (dummy-9 (_type_ process) _type_ 9) ) ) diff --git a/goal_src/kernel/gkernel-h.gc b/goal_src/kernel/gkernel-h.gc index 9bf41061d..f546de2bb 100644 --- a/goal_src/kernel/gkernel-h.gc +++ b/goal_src/kernel/gkernel-h.gc @@ -440,7 +440,7 @@ (deftype state (protect-frame) ((code function :offset-assert 16) (trans (function none) :offset-assert 20) - (post function :offset-assert 24) + (post (function none) :offset-assert 24) (enter function :offset-assert 28) (event (function process int symbol event-message-block object) :offset-assert 32) ) diff --git a/goal_src/levels/beach/beach-obs.gc b/goal_src/levels/beach/beach-obs.gc index 0ad802721..39d323dff 100644 --- a/goal_src/levels/beach/beach-obs.gc +++ b/goal_src/levels/beach/beach-obs.gc @@ -5,3 +5,5 @@ ;; name in dgo: beach-obs ;; dgos: BEA, L1 +(define-extern *flutflut-naked-sg* skeleton-group) +(define-extern *flutflutegg-sg* skeleton-group) diff --git a/goal_src/levels/beach/bird-lady-beach.gc b/goal_src/levels/beach/bird-lady-beach.gc index 23fe397ee..710c15a74 100644 --- a/goal_src/levels/beach/bird-lady-beach.gc +++ b/goal_src/levels/beach/bird-lady-beach.gc @@ -5,3 +5,219 @@ ;; name in dgo: bird-lady-beach ;; dgos: BEA, L1 +(define-extern *bird-lady-beach-sg* skeleton-group) + +;; definition of type bird-lady-beach +(deftype bird-lady-beach (process-taskable) + ((flutflut handle :offset-assert 384) + (egg handle :offset-assert 392) + ) + :heap-base #x120 + :method-count-assert 53 + :size-assert #x190 + :flag-assert #x3501200190 + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "bird-lady-beach" + :bounds (new 'static 'vector :w 16384.0) + :version #x6 + :shadow 2 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 3) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 4095996000.0) + (set! *bird-lady-beach-sg* v1-1) + ) + +;; failed to figure out what this is: +(defstate idle (bird-lady-beach) + :virtual #t + :enter + (behavior () + (when (not (should-display? self)) + (let ((a0-2 (handle->process (-> self flutflut)))) + (if a0-2 + (deactivate a0-2) + ) + ) + (let ((a0-6 (handle->process (-> self egg)))) + (if a0-6 + (deactivate a0-6) + ) + ) + (go-virtual hidden) + ) + ((-> (method-of-type process-taskable idle) enter)) + (none) + ) + ) + +;; definition for method 32 of type bird-lady-beach +(defmethod play-anim! bird-lady-beach ((obj bird-lady-beach) (arg0 symbol)) + (with-pp + (case (current-status (-> obj tasks)) + ((6) + (when arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + (let* ((s5-1 (get-process *default-dead-pool* manipy #x4000)) + (v1-8 (when s5-1 + (let ((t9-4 (method-of-type manipy activate))) + (t9-4 + (the-as manipy s5-1) + obj + 'manipy + (the-as pointer #x70004000) + ) + ) + ((the-as + (function process function object object object object object) + run-function-in-process + ) + s5-1 + manipy-init + (-> obj root trans) + (-> obj entity) + *flutflut-naked-sg* + #f + ) + (-> s5-1 ppointer) + ) + ) + ) + (set! + (-> obj flutflut) + (new 'static 'handle :process v1-8 :pid (-> v1-8 0 pid)) + ) + ) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) pp) + (set! (-> a1-4 num-params) 1) + (set! (-> a1-4 message) 'anim-mode) + (set! (-> a1-4 param 0) (the-as uint 'clone-anim)) + (send-event-function (handle->process (-> obj flutflut)) a1-4) + ) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) pp) + (set! (-> a1-5 num-params) 1) + (set! (-> a1-5 message) 'blend-shape) + (set! (-> a1-5 param 0) (the-as uint #t)) + (send-event-function (handle->process (-> obj flutflut)) a1-5) + ) + (let* ((s5-2 (get-process *default-dead-pool* manipy #x4000)) + (v1-28 (when s5-2 + (let ((t9-9 (method-of-type manipy activate))) + (t9-9 + (the-as manipy s5-2) + obj + 'manipy + (the-as pointer #x70004000) + ) + ) + ((the-as + (function process function object object object object object) + run-function-in-process + ) + s5-2 + manipy-init + (-> obj root trans) + (-> obj entity) + *flutflutegg-sg* + #f + ) + (-> s5-2 ppointer) + ) + ) + ) + (set! + (-> obj egg) + (new 'static 'handle :process v1-28 :pid (-> v1-28 0 pid)) + ) + ) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) pp) + (set! (-> a1-9 num-params) 1) + (set! (-> a1-9 message) 'anim-mode) + (set! (-> a1-9 param 0) (the-as uint 'clone-anim)) + (send-event-function (handle->process (-> obj egg)) a1-9) + ) + ) + (new 'static 'spool-anim + :name "bird-lady-beach-resolution" + :index 4 + :parts 10 + :command-list + '( + ((the binteger 141) + joint + "cameraB" + ) + ((the binteger 535) + joint + "camera" + ) + ((the binteger 696) + joint + "cameraB" + ) + ((the binteger 758) + joint + "camera" + ) + ((the binteger 813) joint "cameraB") + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (-> obj draw art-group data 3) + ) + ) + ) + ) + +;; definition for method 31 of type bird-lady-beach +(defmethod get-art-elem bird-lady-beach ((obj bird-lady-beach)) + (-> obj draw art-group data 3) + ) + +;; definition for method 39 of type bird-lady-beach +(defmethod should-display? bird-lady-beach ((obj bird-lady-beach)) + (= (current-status (-> obj tasks)) 6) + ) + +;; definition for method 11 of type bird-lady-beach +(defmethod copy-defaults! bird-lady-beach ((obj bird-lady-beach) (arg0 res-lump)) + (dummy-40 + obj + arg0 + *bird-lady-beach-sg* + 3 + 51 + (new 'static 'vector :y 4096.0 :w 4096.0) + 5 + ) + (set! (-> obj tasks) (get-task-control (game-task beach-flutflut))) + (set! (-> obj sound-flava) (the-as uint 7)) + (dummy-42 obj) + (none) + ) diff --git a/goal_src/levels/beach/bird-lady.gc b/goal_src/levels/beach/bird-lady.gc index 8b0387c61..d48e7254d 100644 --- a/goal_src/levels/beach/bird-lady.gc +++ b/goal_src/levels/beach/bird-lady.gc @@ -5,3 +5,284 @@ ;; name in dgo: bird-lady ;; dgos: BEA, L1 +(define-extern *bird-lady-sg* skeleton-group) + +;; definition of type bird-lady +(deftype bird-lady (process-taskable) + () + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "bird-lady" + :bounds + (new 'static 'vector :y 4096.0 :w 10240.0) + :version #x6 + :shadow 2 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 3) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 4095996000.0) + (set! *bird-lady-sg* v1-1) + ) + +;; definition for method 52 of type bird-lady +;; INFO: Return type mismatch int vs none. +(defmethod dummy-52 bird-lady ((obj bird-lady)) + (let ((v1-1 (-> obj draw shadow-ctrl))) + (when v1-1 + (let ((f0-0 (-> obj root trans y))) + (let ((a0-2 v1-1)) + (set! (-> a0-2 settings bot-plane w) (- (+ -1024.0 f0-0))) + ) + 0 + (let ((a0-4 v1-1)) + (set! (-> a0-4 settings top-plane w) (- (+ 4096.0 f0-0))) + ) + ) + 0 + (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + ) + ) + (none) + ) + +;; definition for method 48 of type bird-lady +(defmethod draw-shadow bird-lady ((obj bird-lady)) + (-> obj draw shadow-ctrl) + (cond + ((and + (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (nonzero? (logand (-> obj draw status) 8)) + ) + (let ((v1-9 (-> obj draw shadow-ctrl))) + (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + ) + 0 + ((method-of-object (-> obj draw shadow-ctrl) dummy-14)) + ) + (else + (let ((v1-14 (-> obj draw shadow-ctrl))) + (logior! (-> v1-14 settings flags) 32) + ) + 0 + ) + ) + (none) + ) + +;; definition for method 32 of type bird-lady +(defmethod play-anim! bird-lady ((obj bird-lady) (arg0 symbol)) + (case (current-status (-> obj tasks)) + ((2 3) + (if arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "bird-lady-introduction" + :index 4 + :parts 11 + :command-list + '( + (0 + want-levels + village1 + beach + ) + ((the binteger 49) + joint + "cameraB" + ) + ((the binteger 101) + display-level + beach + special + ) + ((the binteger 101) + kill + "yakow-8" + ) + ((the binteger 101) + kill + "yakow-9" + ) + ((the binteger 101) + kill + "yakow-10" + ) + ((the binteger 101) + kill + "yakow-11" + ) + ((the binteger 101) + kill + "yakow-12" + ) + ((the binteger 102) + joint + "camera" + ) + ((the binteger 125) + joint + "cameraB" + ) + ((the binteger 251) + joint + "camera" + ) + ((the binteger 326) + joint + "cameraB" + ) + ((the binteger 649) + display-level + beach + movie + ) + ((the binteger 649) + want-force-vis + beach + #t + ) + ((the binteger 650) + alive + "flutflutegg-1" + ) + ((the binteger 651) + joint + "camera" + ) + ((the binteger 1041) + joint + "cameraB" + ) + ((the binteger 1046) + dead + "flutflutegg-1" + ) + ((the binteger 1046) + display-level + beach + display + ) + ((the binteger 1046) want-force-vis beach #f) + ) + ) + ) + ((5) + (set! (-> obj skippable) #t) + (cond + ((zero? (get-reminder (-> obj tasks) 0)) + (if arg0 + (save-reminder (-> obj tasks) 1 0) + ) + (new 'static 'spool-anim + :name "bird-lady-reminder-1" + :index 5 + :parts 4 + :command-list '() + ) + ) + (else + (if arg0 + (save-reminder (-> obj tasks) 0 0) + ) + (new 'static 'spool-anim + :name "bird-lady-reminder-2" + :index 6 + :parts 5 + :command-list '() + ) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (the-as task-status (current-status (-> obj tasks)))) + ) + ) + (-> obj draw art-group data 3) + ) + ) + ) + +;; definition for method 31 of type bird-lady +(defmethod get-art-elem bird-lady ((obj bird-lady)) + (-> obj draw art-group data 3) + ) + +;; definition for method 43 of type bird-lady +(defmethod TODO-RENAME-43 bird-lady ((obj bird-lady)) + (when + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 9000 + 122880.0 + obj + ) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f0-2 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.66 f0-2) + (dummy-11 (-> obj ambient) "BIR-LO02" #f (-> obj root trans)) + ) + ((< 0.33 f0-2) + (dummy-11 (-> obj ambient) "BIR-LO03" #f (-> obj root trans)) + ) + (else + (dummy-11 (-> obj ambient) "BIR-am08" #f (-> obj root trans)) + ) + ) + ) + ) + (none) + ) + +;; definition for method 47 of type bird-lady +;; INFO: Return type mismatch basic vs symbol. +(defmethod target-above-threshold? bird-lady ((obj bird-lady)) + (the-as symbol (and *target* (< (-> (target-pos 0) z) -81920.0))) + ) + +;; definition for method 11 of type bird-lady +(defmethod copy-defaults! bird-lady ((obj bird-lady) (arg0 res-lump)) + (dummy-40 + obj + arg0 + *bird-lady-sg* + 3 + 51 + (new 'static 'vector :y 4096.0 :w 4096.0) + 5 + ) + (set! (-> obj tasks) (get-task-control (game-task beach-flutflut))) + (set! (-> obj sound-flava) (the-as uint 7)) + (set! (-> obj draw light-index) (the-as uint 4)) + (if + (closed? + (-> obj tasks) + (game-task beach-flutflut) + (task-status need-reminder) + ) + (dummy-18 obj) + (go (method-of-object obj idle)) + ) + (none) + ) diff --git a/goal_src/levels/beach/mayor.gc b/goal_src/levels/beach/mayor.gc index 99aa0ba4e..1892acafd 100644 --- a/goal_src/levels/beach/mayor.gc +++ b/goal_src/levels/beach/mayor.gc @@ -5,3 +5,2189 @@ ;; name in dgo: mayor ;; dgos: BEA, L1 +(define-extern *mayor-sg* skeleton-group) + +;; definition of type mayor +(deftype mayor (process-taskable) + ((root-override collide-shape :offset 112) + ) + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "mayor" + :bounds (new 'static 'vector :w 10240.0) + :version #x6 + :shadow 2 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 3) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 4095996000.0) + (set! *mayor-sg* v1-1) + ) + +;; definition for method 52 of type mayor +;; INFO: Return type mismatch int vs none. +(defmethod dummy-52 mayor ((obj mayor)) + (let ((v1-1 (-> obj draw shadow-ctrl))) + (when v1-1 + (let ((f0-0 (-> obj root-override trans y))) + (let ((a0-2 v1-1)) + (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) + ) + 0 + (set! (-> v1-1 settings top-plane w) (- (+ 2048.0 f0-0))) + ) + 0 + ) + ) + (none) + ) + +;; definition for method 48 of type mayor +(defmethod draw-shadow mayor ((obj mayor)) + (-> obj draw shadow-ctrl) + (cond + ((and + (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (nonzero? (logand (-> obj draw status) 8)) + ) + (let ((v1-9 (-> obj draw shadow-ctrl))) + (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + ) + 0 + ((method-of-object (-> obj draw shadow-ctrl) dummy-14)) + ) + (else + (let ((v1-14 (-> obj draw shadow-ctrl))) + (set! + (-> v1-14 settings flags) + (logior (the-as int (-> v1-14 settings flags)) 32) + ) + ) + 0 + ) + ) + (none) + ) + +;; definition for function mayor-lurkerm-reward-speech +(defun mayor-lurkerm-reward-speech ((arg0 mayor) (arg1 symbol)) + (when arg1 + (set! (-> arg0 cell-for-task) (game-task jungle-lurkerm)) + (close-specific-task! + (game-task jungle-lurkerm) + (task-status need-reward-speech) + ) + (first-any (-> arg0 tasks) #t) + ) + (new 'static 'spool-anim + :name "mayor-resolution-beams" + :index 7 + :parts 6 + :command-list '() + ) + ) + +;; definition for method 32 of type mayor +(defmethod play-anim! mayor ((obj mayor) (arg0 symbol)) + (with-pp + (set! (-> obj talk-message) (the-as uint 260)) + (case (current-status (-> obj tasks)) + ((2 3) + (when arg0 + (close-specific-task! + (game-task jungle-lurkerm) + (task-status need-introduction) + ) + (close-specific-task! + (game-task village1-mayor-money) + (task-status need-introduction) + ) + ) + (cond + ((closed? + (-> obj tasks) + (game-task jungle-lurkerm) + (task-status need-reminder) + ) + (mayor-lurkerm-reward-speech obj arg0) + ) + (else + (new 'static 'spool-anim + :name "mayor-introduction" + :index 4 + :parts 16 + :command-list '() + ) + (new 'static 'spool-anim + :name "mayor-introduction" + :index 4 + :parts 16 + :command-list + '( + (0 + kill + "villagea-part-65" + ) + (0 + kill + "villagea-part-70" + ) + (0 + kill + "med-res-level-2" + ) + (0 + kill + "med-res-level-3" + ) + (0 + kill + "med-res-level-4" + ) + (0 + kill + "med-res-level-6" + ) + (0 + kill + "med-res-level-7" + ) + (0 + kill + "med-res-level-8" + ) + (0 + kill + "med-res-level-11" + ) + (0 + kill + "med-res-level-14" + ) + (0 + kill + "fishermans-boat-2" + ) + (0 + kill + "windspinner-9" + ) + (0 + kill + "sagesail-6" + ) + (0 + kill + "sharkey-12" + ) + (0 + kill + "windmill-sail-4" + ) + (0 + kill + "water-vol-7" + ) + (0 + kill + "windspinner-8" + ) + (0 + kill + "villagea-part-32" + ) + (0 + kill + "water-vol-10" + ) + (0 + kill + "ropebridge-4" + ) + (0 + kill + "ropebridge-5" + ) + (0 + kill + "reflector-end-1" + ) + (0 + kill + "eco-10" + ) + (0 + kill + "eco-11" + ) + (0 + kill + "warp-gate-switch-3" + ) + (0 + kill + "reflector-middle-2" + ) + (0 + kill + "evilplant-2" + ) + (0 + kill + "crate-3147" + ) + (0 + kill + "villagea-water-2" + ) + (0 + kill + "med-res-level-22" + ) + (0 + kill + "med-res-level-23" + ) + (0 + kill + "villagea-part-50" + ) + (0 + kill + "water-vol-9" + ) + (0 + kill + "crate-3144" + ) + (0 + kill + "orb-cache-top-4" + ) + (0 + kill + "village-cam-2" + ) + (0 + kill + "villagea-part-18" + ) + (0 + kill + "villagea-part-24" + ) + (0 + kill + "money-2676" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "villagea-part-13" + ) + (0 + kill + "villagea-part-17" + ) + (0 + kill + "money-2689" + ) + (0 + kill + "money-2690" + ) + (0 + kill + "farmer-3" + ) + (0 + kill + "villagea-part-26" + ) + (0 + kill + "money-2692" + ) + (0 + kill + "villagea-part-37" + ) + (0 + kill + "villagea-part-38" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "crate-3142" + ) + (0 + kill + "crate-3143" + ) + (0 + kill + "money-2688" + ) + (0 + kill + "villagea-part-14" + ) + (0 + kill + "money-2691" + ) + (0 + kill + "villagea-part-62" + ) + (0 + kill + "villagea-part-63" + ) + (0 + kill + "sharkey-1" + ) + (0 + kill + "eco-82" + ) + (0 + kill + "eco-83" + ) + (0 + kill + "crate-2470" + ) + (0 + kill + "villagea-part-3" + ) + (0 + kill + "villagea-part-15" + ) + (0 + kill + "villagea-part-22" + ) + (0 + kill + "villagea-part-28" + ) + (0 + kill + "explorer-4" + ) + (0 + kill + "oracle-1" + ) + (0 + kill + "crate-3141" + ) + (0 + kill + "crate-3145" + ) + (0 + kill + "water-vol-8" + ) + (0 + kill + "water-vol-63" + ) + (0 + kill + "lrocklrg-1" + ) + (0 + kill + "crate-2469" + ) + (0 + kill + "villagea-part-69" + ) + (0 + display-level + beach + special + ) + ((the binteger 565) + joint + "cameraB" + ) + ((the binteger 850) + joint + "camera" + ) + ((the binteger 915) joint "cameraB") + ) + ) + ) + ) + ) + ((4 5) + (set! (-> obj skippable) #t) + (cond + ((closed? + (-> obj tasks) + (game-task jungle-lurkerm) + (task-status need-reward-speech) + ) + (new 'static 'spool-anim + :name "mayor-reminder-donation" + :index 6 + :parts 3 + :command-list + '( + (0 + kill + "villagea-part-65" + ) + (0 + kill + "villagea-part-70" + ) + (0 + kill + "med-res-level-2" + ) + (0 + kill + "med-res-level-3" + ) + (0 + kill + "med-res-level-4" + ) + (0 + kill + "med-res-level-6" + ) + (0 + kill + "med-res-level-7" + ) + (0 + kill + "med-res-level-8" + ) + (0 + kill + "med-res-level-11" + ) + (0 + kill + "med-res-level-14" + ) + (0 + kill + "fishermans-boat-2" + ) + (0 + kill + "windspinner-9" + ) + (0 + kill + "sagesail-6" + ) + (0 + kill + "sharkey-12" + ) + (0 + kill + "windmill-sail-4" + ) + (0 + kill + "water-vol-7" + ) + (0 + kill + "windspinner-8" + ) + (0 + kill + "villagea-part-32" + ) + (0 + kill + "water-vol-10" + ) + (0 + kill + "ropebridge-4" + ) + (0 + kill + "ropebridge-5" + ) + (0 + kill + "reflector-end-1" + ) + (0 + kill + "eco-10" + ) + (0 + kill + "eco-11" + ) + (0 + kill + "warp-gate-switch-3" + ) + (0 + kill + "reflector-middle-2" + ) + (0 + kill + "evilplant-2" + ) + (0 + kill + "crate-3147" + ) + (0 + kill + "villagea-water-2" + ) + (0 + kill + "med-res-level-22" + ) + (0 + kill + "med-res-level-23" + ) + (0 + kill + "villagea-part-50" + ) + (0 + kill + "water-vol-9" + ) + (0 + kill + "crate-3144" + ) + (0 + kill + "orb-cache-top-4" + ) + (0 + kill + "village-cam-2" + ) + (0 + kill + "villagea-part-18" + ) + (0 + kill + "villagea-part-24" + ) + (0 + kill + "money-2676" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "villagea-part-13" + ) + (0 + kill + "villagea-part-17" + ) + (0 + kill + "money-2689" + ) + (0 + kill + "money-2690" + ) + (0 + kill + "farmer-3" + ) + (0 + kill + "villagea-part-26" + ) + (0 + kill + "money-2692" + ) + (0 + kill + "villagea-part-37" + ) + (0 + kill + "villagea-part-38" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "crate-3142" + ) + (0 + kill + "crate-3143" + ) + (0 + kill + "money-2688" + ) + (0 + kill + "villagea-part-14" + ) + (0 + kill + "money-2691" + ) + (0 + kill + "villagea-part-62" + ) + (0 + kill + "villagea-part-63" + ) + (0 + kill + "sharkey-1" + ) + (0 + kill + "eco-82" + ) + (0 + kill + "eco-83" + ) + (0 + kill + "crate-2470" + ) + (0 + kill + "villagea-part-3" + ) + (0 + kill + "villagea-part-15" + ) + (0 + kill + "villagea-part-22" + ) + (0 + kill + "villagea-part-28" + ) + (0 + kill + "explorer-4" + ) + (0 + kill + "oracle-1" + ) + (0 + kill + "crate-3141" + ) + (0 + kill + "crate-3145" + ) + (0 + kill + "water-vol-8" + ) + (0 + kill + "water-vol-63" + ) + (0 + kill + "lrocklrg-1" + ) + (0 + kill + "crate-2469" + ) + (0 kill "villagea-part-69") (0 display-level beach special) + ) + ) + ) + ((closed? + (-> obj tasks) + (game-task village1-mayor-money) + (task-status need-reward-speech) + ) + (new 'static 'spool-anim + :name "mayor-reminder-beams" + :index 5 + :parts 3 + :command-list + '( + (0 + kill + "villagea-part-65" + ) + (0 + kill + "villagea-part-70" + ) + (0 + kill + "med-res-level-2" + ) + (0 + kill + "med-res-level-3" + ) + (0 + kill + "med-res-level-4" + ) + (0 + kill + "med-res-level-6" + ) + (0 + kill + "med-res-level-7" + ) + (0 + kill + "med-res-level-8" + ) + (0 + kill + "med-res-level-11" + ) + (0 + kill + "med-res-level-14" + ) + (0 + kill + "fishermans-boat-2" + ) + (0 + kill + "windspinner-9" + ) + (0 + kill + "sagesail-6" + ) + (0 + kill + "sharkey-12" + ) + (0 + kill + "windmill-sail-4" + ) + (0 + kill + "water-vol-7" + ) + (0 + kill + "windspinner-8" + ) + (0 + kill + "villagea-part-32" + ) + (0 + kill + "water-vol-10" + ) + (0 + kill + "ropebridge-4" + ) + (0 + kill + "ropebridge-5" + ) + (0 + kill + "reflector-end-1" + ) + (0 + kill + "eco-10" + ) + (0 + kill + "eco-11" + ) + (0 + kill + "warp-gate-switch-3" + ) + (0 + kill + "reflector-middle-2" + ) + (0 + kill + "evilplant-2" + ) + (0 + kill + "crate-3147" + ) + (0 + kill + "villagea-water-2" + ) + (0 + kill + "med-res-level-22" + ) + (0 + kill + "med-res-level-23" + ) + (0 + kill + "villagea-part-50" + ) + (0 + kill + "water-vol-9" + ) + (0 + kill + "crate-3144" + ) + (0 + kill + "orb-cache-top-4" + ) + (0 + kill + "village-cam-2" + ) + (0 + kill + "villagea-part-18" + ) + (0 + kill + "villagea-part-24" + ) + (0 + kill + "money-2676" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "villagea-part-13" + ) + (0 + kill + "villagea-part-17" + ) + (0 + kill + "money-2689" + ) + (0 + kill + "money-2690" + ) + (0 + kill + "farmer-3" + ) + (0 + kill + "villagea-part-26" + ) + (0 + kill + "money-2692" + ) + (0 + kill + "villagea-part-37" + ) + (0 + kill + "villagea-part-38" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "crate-3142" + ) + (0 + kill + "crate-3143" + ) + (0 + kill + "money-2688" + ) + (0 + kill + "villagea-part-14" + ) + (0 + kill + "money-2691" + ) + (0 + kill + "villagea-part-62" + ) + (0 + kill + "villagea-part-63" + ) + (0 + kill + "sharkey-1" + ) + (0 + kill + "eco-82" + ) + (0 + kill + "eco-83" + ) + (0 + kill + "crate-2470" + ) + (0 + kill + "villagea-part-3" + ) + (0 + kill + "villagea-part-15" + ) + (0 + kill + "villagea-part-22" + ) + (0 + kill + "villagea-part-28" + ) + (0 + kill + "explorer-4" + ) + (0 + kill + "oracle-1" + ) + (0 + kill + "crate-3141" + ) + (0 + kill + "crate-3145" + ) + (0 + kill + "water-vol-8" + ) + (0 + kill + "water-vol-63" + ) + (0 + kill + "lrocklrg-1" + ) + (0 + kill + "crate-2469" + ) + (0 kill "villagea-part-69") (0 display-level beach special) + ) + ) + ) + ((zero? (get-reminder (-> obj tasks) 0)) + (if arg0 + (save-reminder (-> obj tasks) 1 0) + ) + (new 'static 'spool-anim + :name "mayor-reminder-beams" + :index 5 + :parts 3 + :command-list + '( + (0 + kill + "villagea-part-65" + ) + (0 + kill + "villagea-part-70" + ) + (0 + kill + "med-res-level-2" + ) + (0 + kill + "med-res-level-3" + ) + (0 + kill + "med-res-level-4" + ) + (0 + kill + "med-res-level-6" + ) + (0 + kill + "med-res-level-7" + ) + (0 + kill + "med-res-level-8" + ) + (0 + kill + "med-res-level-11" + ) + (0 + kill + "med-res-level-14" + ) + (0 + kill + "fishermans-boat-2" + ) + (0 + kill + "windspinner-9" + ) + (0 + kill + "sagesail-6" + ) + (0 + kill + "sharkey-12" + ) + (0 + kill + "windmill-sail-4" + ) + (0 + kill + "water-vol-7" + ) + (0 + kill + "windspinner-8" + ) + (0 + kill + "villagea-part-32" + ) + (0 + kill + "water-vol-10" + ) + (0 + kill + "ropebridge-4" + ) + (0 + kill + "ropebridge-5" + ) + (0 + kill + "reflector-end-1" + ) + (0 + kill + "eco-10" + ) + (0 + kill + "eco-11" + ) + (0 + kill + "warp-gate-switch-3" + ) + (0 + kill + "reflector-middle-2" + ) + (0 + kill + "evilplant-2" + ) + (0 + kill + "crate-3147" + ) + (0 + kill + "villagea-water-2" + ) + (0 + kill + "med-res-level-22" + ) + (0 + kill + "med-res-level-23" + ) + (0 + kill + "villagea-part-50" + ) + (0 + kill + "water-vol-9" + ) + (0 + kill + "crate-3144" + ) + (0 + kill + "orb-cache-top-4" + ) + (0 + kill + "village-cam-2" + ) + (0 + kill + "villagea-part-18" + ) + (0 + kill + "villagea-part-24" + ) + (0 + kill + "money-2676" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "villagea-part-13" + ) + (0 + kill + "villagea-part-17" + ) + (0 + kill + "money-2689" + ) + (0 + kill + "money-2690" + ) + (0 + kill + "farmer-3" + ) + (0 + kill + "villagea-part-26" + ) + (0 + kill + "money-2692" + ) + (0 + kill + "villagea-part-37" + ) + (0 + kill + "villagea-part-38" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "crate-3142" + ) + (0 + kill + "crate-3143" + ) + (0 + kill + "money-2688" + ) + (0 + kill + "villagea-part-14" + ) + (0 + kill + "money-2691" + ) + (0 + kill + "villagea-part-62" + ) + (0 + kill + "villagea-part-63" + ) + (0 + kill + "sharkey-1" + ) + (0 + kill + "eco-82" + ) + (0 + kill + "eco-83" + ) + (0 + kill + "crate-2470" + ) + (0 + kill + "villagea-part-3" + ) + (0 + kill + "villagea-part-15" + ) + (0 + kill + "villagea-part-22" + ) + (0 + kill + "villagea-part-28" + ) + (0 + kill + "explorer-4" + ) + (0 + kill + "oracle-1" + ) + (0 + kill + "crate-3141" + ) + (0 + kill + "crate-3145" + ) + (0 + kill + "water-vol-8" + ) + (0 + kill + "water-vol-63" + ) + (0 + kill + "lrocklrg-1" + ) + (0 + kill + "crate-2469" + ) + (0 kill "villagea-part-69") (0 display-level beach special) + ) + ) + ) + (else + (if arg0 + (save-reminder (-> obj tasks) 0 0) + ) + (new 'static 'spool-anim + :name "mayor-reminder-donation" + :index 6 + :parts 3 + :command-list + '( + (0 + kill + "villagea-part-65" + ) + (0 + kill + "villagea-part-70" + ) + (0 + kill + "med-res-level-2" + ) + (0 + kill + "med-res-level-3" + ) + (0 + kill + "med-res-level-4" + ) + (0 + kill + "med-res-level-6" + ) + (0 + kill + "med-res-level-7" + ) + (0 + kill + "med-res-level-8" + ) + (0 + kill + "med-res-level-11" + ) + (0 + kill + "med-res-level-14" + ) + (0 + kill + "fishermans-boat-2" + ) + (0 + kill + "windspinner-9" + ) + (0 + kill + "sagesail-6" + ) + (0 + kill + "sharkey-12" + ) + (0 + kill + "windmill-sail-4" + ) + (0 + kill + "water-vol-7" + ) + (0 + kill + "windspinner-8" + ) + (0 + kill + "villagea-part-32" + ) + (0 + kill + "water-vol-10" + ) + (0 + kill + "ropebridge-4" + ) + (0 + kill + "ropebridge-5" + ) + (0 + kill + "reflector-end-1" + ) + (0 + kill + "eco-10" + ) + (0 + kill + "eco-11" + ) + (0 + kill + "warp-gate-switch-3" + ) + (0 + kill + "reflector-middle-2" + ) + (0 + kill + "evilplant-2" + ) + (0 + kill + "crate-3147" + ) + (0 + kill + "villagea-water-2" + ) + (0 + kill + "med-res-level-22" + ) + (0 + kill + "med-res-level-23" + ) + (0 + kill + "villagea-part-50" + ) + (0 + kill + "water-vol-9" + ) + (0 + kill + "crate-3144" + ) + (0 + kill + "orb-cache-top-4" + ) + (0 + kill + "village-cam-2" + ) + (0 + kill + "villagea-part-18" + ) + (0 + kill + "villagea-part-24" + ) + (0 + kill + "money-2676" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "villagea-part-13" + ) + (0 + kill + "villagea-part-17" + ) + (0 + kill + "money-2689" + ) + (0 + kill + "money-2690" + ) + (0 + kill + "farmer-3" + ) + (0 + kill + "villagea-part-26" + ) + (0 + kill + "money-2692" + ) + (0 + kill + "villagea-part-37" + ) + (0 + kill + "villagea-part-38" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "crate-3142" + ) + (0 + kill + "crate-3143" + ) + (0 + kill + "money-2688" + ) + (0 + kill + "villagea-part-14" + ) + (0 + kill + "money-2691" + ) + (0 + kill + "villagea-part-62" + ) + (0 + kill + "villagea-part-63" + ) + (0 + kill + "sharkey-1" + ) + (0 + kill + "eco-82" + ) + (0 + kill + "eco-83" + ) + (0 + kill + "crate-2470" + ) + (0 + kill + "villagea-part-3" + ) + (0 + kill + "villagea-part-15" + ) + (0 + kill + "villagea-part-22" + ) + (0 + kill + "villagea-part-28" + ) + (0 + kill + "explorer-4" + ) + (0 + kill + "oracle-1" + ) + (0 + kill + "crate-3141" + ) + (0 + kill + "crate-3145" + ) + (0 + kill + "water-vol-8" + ) + (0 + kill + "water-vol-63" + ) + (0 + kill + "lrocklrg-1" + ) + (0 + kill + "crate-2469" + ) + (0 kill "villagea-part-69") (0 display-level beach special) + ) + ) + ) + ) + ) + ((6) + (if (not arg0) + (set! (-> obj will-talk) #t) + ) + (case (current-task (-> obj tasks)) + ((3) + (mayor-lurkerm-reward-speech obj arg0) + ) + (else + (cond + (arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + (let ((a1-15 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-15 from) pp) + (set! (-> a1-15 num-params) 2) + (set! (-> a1-15 message) 'get-pickup) + (set! (-> a1-15 param 0) (the-as uint 5)) + (set! + (-> a1-15 param 1) + (the-as uint (- (-> *GAME-bank* money-task-inc))) + ) + (send-event-function *target* a1-15) + ) + ) + (else + (set! (-> obj talk-message) (the-as uint 282)) + ) + ) + (new 'static 'spool-anim + :name "mayor-resolution-donation" + :index 8 + :parts 5 + :command-list + '( + (0 + kill + "villagea-part-65" + ) + (0 + kill + "villagea-part-70" + ) + (0 + kill + "med-res-level-2" + ) + (0 + kill + "med-res-level-3" + ) + (0 + kill + "med-res-level-4" + ) + (0 + kill + "med-res-level-6" + ) + (0 + kill + "med-res-level-7" + ) + (0 + kill + "med-res-level-8" + ) + (0 + kill + "med-res-level-11" + ) + (0 + kill + "med-res-level-14" + ) + (0 + kill + "fishermans-boat-2" + ) + (0 + kill + "windspinner-9" + ) + (0 + kill + "sagesail-6" + ) + (0 + kill + "sharkey-12" + ) + (0 + kill + "windmill-sail-4" + ) + (0 + kill + "water-vol-7" + ) + (0 + kill + "windspinner-8" + ) + (0 + kill + "villagea-part-32" + ) + (0 + kill + "water-vol-10" + ) + (0 + kill + "ropebridge-4" + ) + (0 + kill + "ropebridge-5" + ) + (0 + kill + "reflector-end-1" + ) + (0 + kill + "eco-10" + ) + (0 + kill + "eco-11" + ) + (0 + kill + "warp-gate-switch-3" + ) + (0 + kill + "reflector-middle-2" + ) + (0 + kill + "evilplant-2" + ) + (0 + kill + "crate-3147" + ) + (0 + kill + "villagea-water-2" + ) + (0 + kill + "med-res-level-22" + ) + (0 + kill + "med-res-level-23" + ) + (0 + kill + "villagea-part-50" + ) + (0 + kill + "water-vol-9" + ) + (0 + kill + "crate-3144" + ) + (0 + kill + "orb-cache-top-4" + ) + (0 + kill + "village-cam-2" + ) + (0 + kill + "villagea-part-18" + ) + (0 + kill + "villagea-part-24" + ) + (0 + kill + "money-2676" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "villagea-part-13" + ) + (0 + kill + "villagea-part-17" + ) + (0 + kill + "money-2689" + ) + (0 + kill + "money-2690" + ) + (0 + kill + "farmer-3" + ) + (0 + kill + "villagea-part-26" + ) + (0 + kill + "money-2692" + ) + (0 + kill + "villagea-part-37" + ) + (0 + kill + "villagea-part-38" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "crate-3142" + ) + (0 + kill + "crate-3143" + ) + (0 + kill + "money-2688" + ) + (0 + kill + "villagea-part-14" + ) + (0 + kill + "money-2691" + ) + (0 + kill + "villagea-part-62" + ) + (0 + kill + "villagea-part-63" + ) + (0 + kill + "sharkey-1" + ) + (0 + kill + "eco-82" + ) + (0 + kill + "eco-83" + ) + (0 + kill + "crate-2470" + ) + (0 + kill + "villagea-part-3" + ) + (0 + kill + "villagea-part-15" + ) + (0 + kill + "villagea-part-22" + ) + (0 + kill + "villagea-part-28" + ) + (0 + kill + "explorer-4" + ) + (0 + kill + "oracle-1" + ) + (0 + kill + "crate-3141" + ) + (0 + kill + "crate-3145" + ) + (0 + kill + "water-vol-8" + ) + (0 + kill + "water-vol-63" + ) + (0 + kill + "lrocklrg-1" + ) + (0 + kill + "crate-2469" + ) + (0 kill "villagea-part-69") (0 display-level beach special) + ) + ) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (-> obj draw art-group data 3) + ) + ) + ) + ) + +;; definition for method 31 of type mayor +(defmethod get-art-elem mayor ((obj mayor)) + (-> obj draw art-group data 3) + ) + +;; definition for method 39 of type mayor +(defmethod should-display? mayor ((obj mayor)) + (if *target* + (< (- (-> (target-pos 0) z) (-> obj root-override trans z)) 57344.0) + (< (- (-> (camera-pos) z) (-> obj root-override trans z)) 57344.0) + ) + ) + +;; definition for method 43 of type mayor +(defmethod TODO-RENAME-43 mayor ((obj mayor)) + (when + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 9000 + 122880.0 + obj + ) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f0-2 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.8888889 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task jungle-lurkerm) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "CHI-LO01" #f (-> obj root-override trans)) + ) + ) + ((< 0.7777778 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task jungle-lurkerm) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "CHI-LO02" #f (-> obj root-override trans)) + ) + ) + ((< 0.6666667 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task jungle-lurkerm) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "CHI-AM07" #f (-> obj root-override trans)) + ) + ) + ((< 0.5555556 f0-2) + (dummy-11 (-> obj ambient) "CHI-AM06" #f (-> obj root-override trans)) + ) + ((< 0.44444445 f0-2) + (dummy-11 (-> obj ambient) "CHI-AM05" #f (-> obj root-override trans)) + ) + ((< 0.33333334 f0-2) + (dummy-11 (-> obj ambient) "CHI-AM04" #f (-> obj root-override trans)) + ) + ((< 0.22222222 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task jungle-lurkerm) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "CHI-AM03" #f (-> obj root-override trans)) + ) + ) + ((< 0.11111111 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task jungle-lurkerm) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "CHI-AM02" #f (-> obj root-override trans)) + ) + ) + (else + (if + (not + (closed? + (-> obj tasks) + (game-task jungle-lurkerm) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "CHI-AM01" #f (-> obj root-override trans)) + ) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (mayor) + :virtual #t + :trans + (behavior () + (if (not (should-display? self)) + (go-virtual hidden) + ) + ((-> (method-of-type process-taskable idle) trans)) + (none) + ) + :post + (behavior () + (let ((t9-0 (-> (method-of-type process-taskable idle) post))) + (if t9-0 + (t9-0) + ) + ) + (dummy-45 (-> self root-override)) + (none) + ) + ) + +;; definition for method 11 of type mayor +(defmethod copy-defaults! mayor ((obj mayor) (arg0 res-lump)) + (dummy-40 + obj + arg0 + *mayor-sg* + 3 + 51 + (new 'static 'vector :y 4096.0 :w 4096.0) + 5 + ) + (set! (-> obj bounce-away) #f) + (set! (-> obj tasks) (get-task-control (game-task jungle-lurkerm))) + (set! (-> obj sound-flava) (the-as uint 8)) + (set! (-> obj draw light-index) (the-as uint 2)) + (dummy-42 obj) + (none) + ) diff --git a/goal_src/levels/beach/sculptor.gc b/goal_src/levels/beach/sculptor.gc index aa8c73e68..28db3e37d 100644 --- a/goal_src/levels/beach/sculptor.gc +++ b/goal_src/levels/beach/sculptor.gc @@ -5,3 +5,1228 @@ ;; name in dgo: sculptor ;; dgos: BEA, L1 +(define-extern *sculptor-sg* skeleton-group) +(define-extern *sculptor-muse-sg* skeleton-group) + +;; TODO - for sculptor +(deftype muse (nav-enemy) + ((current-path-index float :offset-assert 400) + (prev-path-index float :offset-assert 404) + (dest-path-index float :offset-assert 408) + (player-path-index float :offset-assert 412) + (max-path-index float :offset-assert 416) + (sprint-distance float :offset-assert 420) + (dest-point vector :inline :offset-assert 432) + (anim spool-anim :offset-assert 448) ; TODO - guess + (victory-anim spool-anim :offset-assert 452) ; TODO - guess + (old-target-pos transformq :inline :offset-assert 464) + ) + :method-count-assert 76 + :size-assert #x200 + :heap-base #x190 + :flag-assert #x4c01900200 + ) + +(deftype point-on-path-segment-info (structure) + ((point vector :inline :offset-assert 0) + (segment vector 2 :inline :offset-assert 16) ;; TODO - guess + (dir vector :inline :offset-assert 48) + (nearest-point vector :inline :offset-assert 64) + (segment-length float :offset-assert 80) + (distance-to-segment float :offset-assert 84) + (parametric-index float :offset-assert 88) + ) + :method-count-assert 9 + :size-assert #x5c + :flag-assert #x90000005c + ) + +;; definition of type sculptor +(deftype sculptor (process-taskable) + ((muse handle :offset-assert 384) + ) + :heap-base #x120 + :method-count-assert 53 + :size-assert #x188 + :flag-assert #x3501200188 + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "sculptor-muse" + :bounds (new 'static 'vector :w 10240.0) + :version #x6 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 2) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 4095996000.0) + (set! *sculptor-muse-sg* v1-1) + ) + +;; failed to figure out what this is: +(let + ((v1-2 + (new 'static 'skeleton-group + :art-group-name "sculptor" + :bounds (new 'static 'vector :w 10240.0) + :version #x6 + :shadow 2 + ) + ) + ) + (set! (-> v1-2 jgeo) 0) + (set! (-> v1-2 janim) 4) + (set! (-> v1-2 mgeo 0) (the-as uint 1)) + (set! (-> v1-2 lod-dist 0) 4095996000.0) + (set! *sculptor-sg* v1-2) + ) + +;; definition for method 52 of type sculptor +;; INFO: Return type mismatch int vs none. +(defmethod dummy-52 sculptor ((obj sculptor)) + (let ((v1-1 (-> obj draw shadow-ctrl))) + (when v1-1 + (let ((f0-0 (-> obj root trans y))) + (let ((a0-2 v1-1)) + (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) + ) + 0 + (set! (-> v1-1 settings top-plane w) (- (+ 2048.0 f0-0))) + ) + 0 + ) + ) + (none) + ) + +;; definition for method 48 of type sculptor +(defmethod draw-shadow sculptor ((obj sculptor)) + (-> obj draw shadow-ctrl) + (cond + ((and + (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (nonzero? (logand (-> obj draw status) 8)) + ) + (let ((v1-9 (-> obj draw shadow-ctrl))) + (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + ) + 0 + ((method-of-object (-> obj draw shadow-ctrl) dummy-14)) + ) + (else + (let ((v1-14 (-> obj draw shadow-ctrl))) + (logior! (-> v1-14 settings flags) 32) + ) + 0 + ) + ) + (none) + ) + +;; definition for function muse-to-idle +(defbehavior muse-to-idle sculptor ((arg0 muse)) + (when (not (handle->process (-> arg0 incomming-attack-id))) + (let* ((s5-0 (get-process *default-dead-pool* manipy #x4000)) + (v1-5 (when s5-0 + (let ((t9-1 (method-of-type manipy activate))) + (t9-1 + (the-as manipy s5-0) + arg0 + 'manipy + (the-as pointer #x70004000) + ) + ) + ((the-as + (function process function object object object object object) + run-function-in-process + ) + s5-0 + manipy-init + (-> arg0 collide-info trans) + (-> arg0 entity) + *sculptor-muse-sg* + #f + ) + (-> s5-0 ppointer) + ) + ) + ) + (set! + (-> arg0 incomming-attack-id) + (new 'static 'handle :process v1-5 :pid (-> v1-5 0 pid)) + ) + ) + ) + (let ((v1-11 (handle->process (-> arg0 incomming-attack-id)))) + (if v1-11 + (set! (-> (the-as muse v1-11) draw light-index) (the-as uint 3)) + ) + ) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) self) + (set! (-> a1-5 num-params) 1) + (set! (-> a1-5 message) 'anim-mode) + (set! (-> a1-5 param 0) (the-as uint 'loop)) + (send-event-function (handle->process (-> arg0 incomming-attack-id)) a1-5) + ) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) self) + (set! (-> a1-6 num-params) 2) + (set! (-> a1-6 message) 'art-joint-anim) + (set! (-> a1-6 param 0) (the-as uint "idle")) + (set! (-> a1-6 param 1) (the-as uint 0)) + (send-event-function (handle->process (-> arg0 incomming-attack-id)) a1-6) + ) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) self) + (set! (-> a1-7 num-params) 1) + (set! (-> a1-7 message) 'draw) + (set! (-> a1-7 param 0) (the-as uint #t)) + (send-event-function (handle->process (-> arg0 incomming-attack-id)) a1-7) + ) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) self) + (set! (-> a1-8 num-params) 1) + (set! (-> a1-8 message) 'origin-joint-index) + (set! (-> a1-8 param 0) (the-as uint 26)) + (send-event-function (handle->process (-> arg0 incomming-attack-id)) a1-8) + ) + ) + +;; failed to figure out what this is: +(defstate give-cell (sculptor) + :virtual #t + :enter + (behavior () + (muse-to-idle (the-as muse self)) + (none) + ) + ) + +;; definition for method 32 of type sculptor +(defmethod play-anim! sculptor ((obj sculptor) (arg0 symbol)) + (with-pp + (case (current-status (-> obj tasks)) + ((2 3) + (if arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "sculptor-introduction" + :index 16 + :parts 14 + :command-list + '( + (0 + display-level + beach + special + ) + (0 + kill + "med-res-level-2" + ) + (0 + kill + "med-res-level-4" + ) + (0 + kill + "med-res-level-6" + ) + (0 + kill + "med-res-level-7" + ) + (0 + kill + "med-res-level-8" + ) + (0 + kill + "med-res-level-11" + ) + (0 + kill + "med-res-level-14" + ) + (0 + kill + "med-res-level-22" + ) + (0 + kill + "med-res-level-23" + ) + ((the binteger 285) + joint + "cameraB" + ) + ((the binteger 331) + joint + "camera" + ) + ((the binteger 614) + joint + "cameraB" + ) + ((the binteger 760) + joint + "camera" + ) + ((the binteger 1183) + joint + "cameraB" + ) + ((the binteger 1278) + joint + "camera" + ) + ((the binteger 1433) joint "cameraB") + ) + ) + ) + ((5) + (set! (-> obj skippable) #t) + (new 'static 'spool-anim + :name "sculptor-reminder-1" + :index 17 + :parts 2 + :command-list '() + ) + ) + ((6) + (when arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + (let* ((s5-1 (get-process *default-dead-pool* manipy #x4000)) + (v1-12 (when s5-1 + (let ((t9-5 (method-of-type manipy activate))) + (t9-5 + (the-as manipy s5-1) + obj + 'manipy + (the-as pointer #x70004000) + ) + ) + ((the-as + (function process function object object object object object) + run-function-in-process + ) + s5-1 + manipy-init + (-> obj root trans) + (-> obj entity) + *sculptor-muse-sg* + #f + ) + (-> s5-1 ppointer) + ) + ) + ) + (set! + (-> obj muse) + (new 'static 'handle :process v1-12 :pid (-> v1-12 0 pid)) + ) + ) + (let ((v1-18 (handle->process (-> obj muse)))) + (if v1-18 + (set! (-> (the-as muse v1-18) draw light-index) (the-as uint 3)) + ) + ) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) pp) + (set! (-> a1-8 num-params) 1) + (set! (-> a1-8 message) 'center-joint) + (set! (-> a1-8 param 0) (the-as uint 4)) + (send-event-function (handle->process (-> obj muse)) a1-8) + ) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) pp) + (set! (-> a1-9 num-params) 1) + (set! (-> a1-9 message) 'anim-mode) + (set! (-> a1-9 param 0) (the-as uint 'clone-anim)) + (send-event-function (handle->process (-> obj muse)) a1-9) + ) + ) + (new 'static 'spool-anim + :name "sculptor-resolution" + :index 18 + :parts 4 + :command-list + '( + ((the binteger 51) joint "cameraB") ((the binteger 87) joint "camera") + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (-> obj draw art-group data 4) + ) + ) + ) + ) + +;; definition for method 31 of type sculptor +(defmethod get-art-elem sculptor ((obj sculptor)) + (let ((v1-1 (current-status (-> obj tasks)))) + (if (or (zero? v1-1) (= v1-1 7)) + (-> obj draw art-group data 11) + (-> obj draw art-group data 3) + ) + ) + ) + +;; definition for method 43 of type sculptor +(defmethod TODO-RENAME-43 sculptor ((obj sculptor)) + (when + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 9000 + 122880.0 + obj + ) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f0-2 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.85714287 f0-2) + (dummy-11 (-> obj ambient) "SCU-LO01" #f (-> obj root trans)) + ) + ((< 0.71428573 f0-2) + (dummy-11 (-> obj ambient) "SCU-AM05" #f (-> obj root trans)) + ) + ((< 0.5714286 f0-2) + (dummy-11 (-> obj ambient) "SCU-AM06" #f (-> obj root trans)) + ) + ((< 0.42857143 f0-2) + (dummy-11 (-> obj ambient) "SCU-AM03" #f (-> obj root trans)) + ) + ((< 0.2857143 f0-2) + (dummy-11 (-> obj ambient) "SCU-AM04" #f (-> obj root trans)) + ) + ((< 0.14285715 f0-2) + (dummy-11 (-> obj ambient) "SCU-AM01" #f (-> obj root trans)) + ) + (else + (dummy-11 (-> obj ambient) "SCU-AM02" #f (-> obj root trans)) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (sculptor) + :virtual #t + :code + (behavior () + (when (!= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (get-art-elem self) + ) + (ja-channel-push! 1 60) + (let ((gp-0 (-> self skel root-channel 0))) + (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) + ) + ) + (let ((a0-8 (-> self skel root-channel 0))) + (set! + (-> a0-8 param 0) + (the float (+ (-> a0-8 frame-group data 0 length) -1)) + ) + (set! (-> a0-8 param 1) 1.0) + (joint-control-channel-group! + a0-8 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (let ((v1-16 (current-status (-> self tasks)))) + (when (or (zero? v1-16) (= v1-16 7)) + (let ((a0-12 (-> self skel root-channel 0))) + (set! + (-> a0-12 frame-group) + (the-as art-joint-anim (-> self draw art-group data 12)) + ) + (set! + (-> a0-12 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 12)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-12 param 1) 1.0) + (set! (-> a0-12 frame-num) 0.0) + (joint-control-channel-group! + a0-12 + (the-as art-joint-anim (-> self draw art-group data 12)) + num-func-seek! + ) + ) + (until (ja-done? 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! + ) + ) + ) + (muse-to-idle (the-as muse self)) + ) + ) + (while #t + (let ((v1-43 (current-status (-> self tasks)))) + (cond + ((or (zero? v1-43) (= v1-43 7)) + (let ((a0-18 (-> self skel root-channel 0))) + (set! + (-> a0-18 frame-group) + (the-as art-joint-anim (-> self draw art-group data 8)) + ) + (set! + (-> a0-18 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 8)) + 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 8)) + 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! + ) + ) + ) + (let* ((f30-0 4.0) + (v1-68 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-69 (the-as number (logior #x3f800000 v1-68))) + ) + (countdown + (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-69)))) 4)) + (let ((a0-23 (-> self skel root-channel 0))) + (set! + (-> a0-23 frame-group) + (the-as art-joint-anim (-> self draw art-group data 9)) + ) + (set! + (-> a0-23 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 9)) + 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 9)) + 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! + ) + ) + ) + ) + ) + (let* ((v1-97 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-98 (the-as number (logior #x3f800000 v1-97))) + (f30-1 (+ -1.0 (the-as float v1-98))) + ) + (let ((a0-28 (-> self skel root-channel 0))) + (set! + (-> a0-28 frame-group) + (the-as art-joint-anim (-> self draw art-group data 10)) + ) + (set! + (-> a0-28 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 10)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-28 param 1) 1.0) + (set! (-> a0-28 frame-num) 0.0) + (joint-control-channel-group! + a0-28 + (the-as art-joint-anim (-> self draw art-group data 10)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-29 (-> self skel root-channel 0))) + (set! + (-> a0-29 param 0) + (the float (+ (-> a0-29 frame-group data 0 length) -1)) + ) + (set! (-> a0-29 param 1) 1.0) + (joint-control-channel-group-eval! + a0-29 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((a0-31 (-> self skel root-channel 0))) + (set! + (-> a0-31 frame-group) + (the-as art-joint-anim (-> self draw art-group data 11)) + ) + (set! + (-> a0-31 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 11)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-31 param 1) 1.0) + (set! (-> a0-31 frame-num) 0.0) + (joint-control-channel-group! + a0-31 + (the-as art-joint-anim (-> self draw art-group data 11)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-32 (-> self skel root-channel 0))) + (set! + (-> a0-32 param 0) + (the float (+ (-> a0-32 frame-group data 0 length) -1)) + ) + (set! (-> a0-32 param 1) 1.0) + (joint-control-channel-group-eval! + a0-32 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((a0-34 (-> self skel root-channel 0))) + (set! + (-> a0-34 frame-group) + (the-as art-joint-anim (-> self draw art-group data 12)) + ) + (set! + (-> a0-34 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 12)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-34 param 1) 1.0) + (set! (-> a0-34 frame-num) 0.0) + (joint-control-channel-group! + a0-34 + (the-as art-joint-anim (-> self draw art-group data 12)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-35 (-> self skel root-channel 0))) + (set! + (-> a0-35 param 0) + (the float (+ (-> a0-35 frame-group data 0 length) -1)) + ) + (set! (-> a0-35 param 1) 1.0) + (joint-control-channel-group-eval! + a0-35 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (when (< f30-1 0.5) + (let ((a0-37 (-> self skel root-channel 0))) + (set! + (-> a0-37 frame-group) + (the-as art-joint-anim (-> self draw art-group data 13)) + ) + (set! + (-> a0-37 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 13)) + 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 13)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-38 (-> self skel root-channel 0))) + (set! + (-> a0-38 param 0) + (the float (+ (-> a0-38 frame-group data 0 length) -1)) + ) + (set! (-> a0-38 param 1) 1.0) + (joint-control-channel-group-eval! + a0-38 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let* ((f30-2 2.0) + (v1-190 + (/ (the-as int (rand-uint31-gen *random-generator*)) 256) + ) + (v1-191 (the-as number (logior #x3f800000 v1-190))) + ) + (countdown + (gp-2 (+ (the int (* f30-2 (+ -1.0 (the-as float v1-191)))) 2)) + (let ((a0-42 (-> self skel root-channel 0))) + (set! + (-> a0-42 frame-group) + (the-as art-joint-anim (-> self draw art-group data 14)) + ) + (set! + (-> a0-42 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 14)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-42 param 1) 1.0) + (set! (-> a0-42 frame-num) 0.0) + (joint-control-channel-group! + a0-42 + (the-as art-joint-anim (-> self draw art-group data 14)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-43 (-> self skel root-channel 0))) + (set! + (-> a0-43 param 0) + (the float (+ (-> a0-43 frame-group data 0 length) -1)) + ) + (set! (-> a0-43 param 1) 1.0) + (joint-control-channel-group-eval! + a0-43 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + ) + (let ((a0-45 (-> self skel root-channel 0))) + (set! + (-> a0-45 frame-group) + (the-as art-joint-anim (-> self draw art-group data 15)) + ) + (set! + (-> a0-45 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 15)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-45 param 1) 1.0) + (set! (-> a0-45 frame-num) 0.0) + (joint-control-channel-group! + a0-45 + (the-as art-joint-anim (-> self draw art-group data 15)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-46 (-> self skel root-channel 0))) + (set! + (-> a0-46 param 0) + (the float (+ (-> a0-46 frame-group data 0 length) -1)) + ) + (set! (-> a0-46 param 1) 1.0) + (joint-control-channel-group-eval! + a0-46 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((a0-48 (-> self skel root-channel 0))) + (set! + (-> a0-48 frame-group) + (the-as art-joint-anim (-> self draw art-group data 11)) + ) + (set! + (-> a0-48 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 11)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-48 param 1) 1.0) + (set! (-> a0-48 frame-num) 0.0) + (joint-control-channel-group! + a0-48 + (the-as art-joint-anim (-> self draw art-group data 11)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-49 (-> self skel root-channel 0))) + (set! + (-> a0-49 param 0) + (the float (+ (-> a0-49 frame-group data 0 length) -1)) + ) + (set! (-> a0-49 param 1) 1.0) + (joint-control-channel-group-eval! + a0-49 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((a0-51 (-> self skel root-channel 0))) + (set! + (-> a0-51 frame-group) + (the-as art-joint-anim (-> self draw art-group data 12)) + ) + (set! + (-> a0-51 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 12)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-51 param 1) 1.0) + (set! (-> a0-51 frame-num) 0.0) + (joint-control-channel-group! + a0-51 + (the-as art-joint-anim (-> self draw art-group data 12)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-52 (-> self skel root-channel 0))) + (set! + (-> a0-52 param 0) + (the float (+ (-> a0-52 frame-group data 0 length) -1)) + ) + (set! (-> a0-52 param 1) 1.0) + (joint-control-channel-group-eval! + a0-52 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + ) + ) + ((begin + (TODO-RENAME-43 self) + (let* ((f30-3 4.0) + (v1-287 + (/ (the-as int (rand-uint31-gen *random-generator*)) 256) + ) + (v1-288 (the-as number (logior #x3f800000 v1-287))) + ) + (countdown + (gp-3 (+ (the int (* f30-3 (+ -1.0 (the-as float v1-288)))) 4)) + (let ((a0-57 (-> self skel root-channel 0))) + (set! + (-> a0-57 frame-group) + (the-as art-joint-anim (-> self draw art-group data 3)) + ) + (set! + (-> a0-57 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 3)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-57 param 1) 1.0) + (set! (-> a0-57 frame-num) 0.0) + (joint-control-channel-group! + a0-57 + (the-as art-joint-anim (-> self draw art-group data 3)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-58 (-> self skel root-channel 0))) + (set! + (-> a0-58 param 0) + (the float (+ (-> a0-58 frame-group data 0 length) -1)) + ) + (set! (-> a0-58 param 1) 1.0) + (joint-control-channel-group-eval! + a0-58 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + ) + (let* + ((v1-316 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-317 (the-as number (logior #x3f800000 v1-316))) + ) + (< (+ -1.0 (the-as float v1-317)) 0.5) + ) + ) + (let ((a0-62 (-> self skel root-channel 0))) + (set! + (-> a0-62 frame-group) + (the-as art-joint-anim (-> self draw art-group data 4)) + ) + (set! + (-> a0-62 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 4)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-62 param 1) 1.0) + (set! (-> a0-62 frame-num) 0.0) + (joint-control-channel-group! + a0-62 + (the-as art-joint-anim (-> self draw art-group data 4)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-63 (-> self skel root-channel 0))) + (set! + (-> a0-63 param 0) + (the float (+ (-> a0-63 frame-group data 0 length) -1)) + ) + (set! (-> a0-63 param 1) 1.0) + (joint-control-channel-group-eval! + a0-63 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + (else + (let ((a0-65 (-> self skel root-channel 0))) + (set! + (-> a0-65 frame-group) + (the-as art-joint-anim (-> self draw art-group data 5)) + ) + (set! + (-> a0-65 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 5)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-65 param 1) 1.0) + (set! (-> a0-65 frame-num) 0.0) + (joint-control-channel-group! + a0-65 + (the-as art-joint-anim (-> self draw art-group data 5)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-66 (-> self skel root-channel 0))) + (set! + (-> a0-66 param 0) + (the float (+ (-> a0-66 frame-group data 0 length) -1)) + ) + (set! (-> a0-66 param 1) 1.0) + (joint-control-channel-group-eval! + a0-66 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((a0-68 (-> self skel root-channel 0))) + (set! + (-> a0-68 frame-group) + (the-as art-joint-anim (-> self draw art-group data 6)) + ) + (set! + (-> a0-68 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 6)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-68 param 1) 1.0) + (set! (-> a0-68 frame-num) 0.0) + (joint-control-channel-group! + a0-68 + (the-as art-joint-anim (-> self draw art-group data 6)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-69 (-> self skel root-channel 0))) + (set! + (-> a0-69 param 0) + (the float (+ (-> a0-69 frame-group data 0 length) -1)) + ) + (set! (-> a0-69 param 1) 1.0) + (joint-control-channel-group-eval! + a0-69 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((a0-71 (-> self skel root-channel 0))) + (set! + (-> a0-71 frame-group) + (the-as art-joint-anim (-> self draw art-group data 7)) + ) + (set! + (-> a0-71 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 7)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-71 param 1) 1.0) + (set! (-> a0-71 frame-num) 0.0) + (joint-control-channel-group! + a0-71 + (the-as art-joint-anim (-> self draw art-group data 7)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-72 (-> self skel root-channel 0))) + (set! + (-> a0-72 param 0) + (the float (+ (-> a0-72 frame-group data 0 length) -1)) + ) + (set! (-> a0-72 param 1) 1.0) + (joint-control-channel-group-eval! + a0-72 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 11 of type sculptor +(defmethod copy-defaults! sculptor ((obj sculptor) (arg0 res-lump)) + (dummy-40 obj arg0 *sculptor-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> obj tasks) (get-task-control (game-task misty-muse))) + (set! (-> obj muse) (the-as handle #f)) + (set! (-> obj sound-flava) (the-as uint 9)) + (set! (-> obj draw light-index) (the-as uint 3)) + (dummy-42 obj) + (none) + ) diff --git a/goal_src/levels/common/nav-enemy-h.gc b/goal_src/levels/common/nav-enemy-h.gc index ceed0010b..c2f4bf69a 100644 --- a/goal_src/levels/common/nav-enemy-h.gc +++ b/goal_src/levels/common/nav-enemy-h.gc @@ -87,7 +87,7 @@ (free-time uint64 :offset-assert 360) (touch-time uint64 :offset-assert 368) (nav-enemy-flags uint32 :offset-assert 376) - (incomming-attack-id uint64 :offset-assert 384) + (incomming-attack-id handle :offset-assert 384) (jump-return-state (state process) :offset-assert 392) (rand-gen random-generator :offset-assert 396) ) diff --git a/goal_src/levels/village1/assistant.gc b/goal_src/levels/village1/assistant.gc index 4e35ef421..776e3f5b7 100644 --- a/goal_src/levels/village1/assistant.gc +++ b/goal_src/levels/village1/assistant.gc @@ -5,3 +5,14 @@ ;; name in dgo: assistant ;; dgos: L1, VI1 +;; TODO - for sage +(define-extern *assistant-sg* skeleton-group) + +(deftype assistant (process-taskable) + ((sound-id sound-id :offset-assert 380) + ) + :method-count-assert 53 + :size-assert #x180 + :heap-base #x110 + :flag-assert #x3501100180 + ) diff --git a/goal_src/levels/village1/explorer.gc b/goal_src/levels/village1/explorer.gc index b13b7bf3a..f67ba8cc8 100644 --- a/goal_src/levels/village1/explorer.gc +++ b/goal_src/levels/village1/explorer.gc @@ -5,3 +5,1035 @@ ;; name in dgo: explorer ;; dgos: L1, VI1 +(define-extern *explorer-sg* skeleton-group) + +;; definition of type explorer +(deftype explorer (process-taskable) + () + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "explorer" + :bounds (new 'static 'vector :w 10240.0) + :version #x6 + :shadow 2 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 3) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 4095996000.0) + (set! *explorer-sg* v1-1) + ) + +;; definition for method 52 of type explorer +;; INFO: Return type mismatch int vs none. +(defmethod dummy-52 explorer ((obj explorer)) + (let ((v1-1 (-> obj draw shadow-ctrl))) + (when v1-1 + (let ((f0-0 (-> obj root trans y))) + (let ((a0-2 v1-1)) + (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) + ) + 0 + (let ((a0-4 v1-1)) + (set! (-> a0-4 settings top-plane w) (- (+ 4096.0 f0-0))) + ) + ) + 0 + (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + ) + ) + (none) + ) + +;; definition for method 48 of type explorer +(defmethod draw-shadow explorer ((obj explorer)) + (-> obj draw shadow-ctrl) + (cond + ((and + (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (nonzero? (logand (-> obj draw status) 8)) + ) + (let ((v1-9 (-> obj draw shadow-ctrl))) + (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + ) + 0 + ((method-of-object (-> obj draw shadow-ctrl) dummy-14)) + ) + (else + (let ((v1-14 (-> obj draw shadow-ctrl))) + (logior! (-> v1-14 settings flags) 32) + ) + 0 + ) + ) + (none) + ) + +;; definition for method 32 of type explorer +(defmethod play-anim! explorer ((obj explorer) (arg0 symbol)) + (with-pp + (set! (-> obj talk-message) (the-as uint 260)) + (case (current-status (-> obj tasks)) + ((2 3) + (if arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "explorer-introduction" + :index 9 + :parts 11 + :command-list + '( + ((the binteger 418) + joint + "cameraB" + ) + ((the binteger 695) + shadow + self + #f + ) + ((the binteger 695) + joint + "camera" + ) + ((the binteger 838) + shadow + self + #t + ) + ((the binteger 838) joint "cameraB") + ) + ) + ) + ((5) + (set! (-> obj skippable) #t) + (cond + ((zero? (get-reminder (-> obj tasks) 0)) + (if arg0 + (save-reminder (-> obj tasks) 1 0) + ) + (new 'static 'spool-anim + :name "explorer-reminder-1" + :index 10 + :parts 5 + :command-list + '( + (0 + send-event + target + draw + #f + ) + ((the binteger 148) + send-event + target + draw + #t + ) + ((the binteger 148) + joint + "cameraB" + ) + ((the binteger 390) + send-event + target + draw + #f + ) + ((the binteger 390) + joint + "camera" + ) + ((the binteger 505) send-event target draw #t) + ) + ) + ) + (else + (if arg0 + (save-reminder (-> obj tasks) 0 0) + ) + (new 'static 'spool-anim + :name "explorer-reminder-2" + :index 11 + :parts 3 + :command-list '() + ) + ) + ) + ) + ((6) + (cond + (arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) pp) + (set! (-> a1-7 num-params) 2) + (set! (-> a1-7 message) 'get-pickup) + (set! (-> a1-7 param 0) (the-as uint 5)) + (set! + (-> a1-7 param 1) + (the-as uint (- (-> *GAME-bank* money-task-inc))) + ) + (send-event-function *target* a1-7) + ) + ) + (else + (set! (-> obj will-talk) #t) + (set! (-> obj talk-message) (the-as uint 282)) + ) + ) + (new 'static 'spool-anim + :name "explorer-resolution" + :index 12 + :parts 5 + :command-list + '( + ((the binteger 167) joint "cameraB") ((the binteger 310) joint "camera") + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (-> obj draw art-group data 3) + ) + ) + ) + ) + +;; definition for method 31 of type explorer +(defmethod get-art-elem explorer ((obj explorer)) + (-> obj draw art-group data 3) + ) + +;; definition for method 43 of type explorer +(defmethod TODO-RENAME-43 explorer ((obj explorer)) + (when + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 9000 + 122880.0 + obj + ) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f0-2 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.85714287 f0-2) + (dummy-11 (-> obj ambient) "EXP-AM05" #f (-> obj root trans)) + ) + ((< 0.71428573 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task village1-uncle-money) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "EXP-LO02" #f (-> obj root trans)) + ) + ) + ((< 0.5714286 f0-2) + (dummy-11 (-> obj ambient) "EXP-AM04" #f (-> obj root trans)) + ) + ((< 0.42857143 f0-2) + (dummy-11 (-> obj ambient) "EXP-AM03" #f (-> obj root trans)) + ) + ((< 0.2857143 f0-2) + (dummy-11 (-> obj ambient) "EXP-AM02" #f (-> obj root trans)) + ) + ((< 0.14285715 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task village1-uncle-money) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "EXP-AM01" #f (-> obj root trans)) + ) + ) + (else + (dummy-11 (-> obj ambient) "EXP-LO1A" #f (-> obj root trans)) + ) + ) + ) + ) + (none) + ) + +;; definition for method 47 of type explorer +;; INFO: Return type mismatch basic vs symbol. +(defmethod target-above-threshold? explorer ((obj explorer)) + (the-as + symbol + (and + *target* + (< (-> (target-pos 0) x) -202752.0) + (< 98304.0 (-> (target-pos 0) z)) + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (explorer) + :virtual #t + :code + (behavior () + (if (!= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 3) + ) + (ja-channel-push! 1 60) + ) + (while #t + (TODO-RENAME-43 self) + (let ((v1-9 (-> self skel root-channel 0))) + (set! + (-> v1-9 frame-group) + (the-as art-joint-anim (-> self draw art-group data 3)) + ) + ) + (let* ((f30-0 2.0) + (v1-11 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-12 (the-as number (logior #x3f800000 v1-11))) + ) + (countdown (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-12)))) 1)) + (let ((a0-12 (-> self skel root-channel 0))) + (set! + (-> a0-12 frame-group) + (the-as art-joint-anim (-> self draw art-group data 3)) + ) + (set! + (-> a0-12 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 3)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-12 param 1) 1.0) + (set! (-> a0-12 frame-num) 0.0) + (joint-control-channel-group! + a0-12 + (the-as art-joint-anim (-> self draw art-group data 3)) + num-func-seek! + ) + ) + (until (ja-done? 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! + ) + ) + ) + ) + ) + (let* ((v1-40 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-41 (the-as number (logior #x3f800000 v1-40))) + ) + (cond + ((< (+ -1.0 (the-as float v1-41)) 0.5) + (let ((a0-17 (-> self skel root-channel 0))) + (set! + (-> a0-17 frame-group) + (the-as art-joint-anim (-> self draw art-group data 4)) + ) + (set! + (-> a0-17 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 4)) + 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 4)) + 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! + ) + ) + ) + (let ((gp-1 (-> *display* base-frame-counter))) + (while (let* ((s5-0 (-> *display* base-frame-counter)) + (f30-1 300.0) + (f28-0 0.5) + (f26-0 0.5) + (v1-68 + (/ (the-as int (rand-uint31-gen *random-generator*)) 256) + ) + (v1-69 (the-as number (logior #x3f800000 v1-68))) + ) + (< + (the-as + int + (- + s5-0 + (the-as + uint + (the + int + (* f30-1 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-69))))) + ) + ) + ) + ) + (the-as int gp-1) + ) + ) + (suspend) + ) + ) + (let* ((v1-75 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-76 (the-as number (logior #x3f800000 v1-75))) + ) + (when (< (+ -1.0 (the-as float v1-76)) 0.75) + (let ((a0-24 (-> self skel root-channel 0))) + (set! + (-> a0-24 frame-group) + (the-as art-joint-anim (-> self draw art-group data 5)) + ) + (set! + (-> a0-24 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 5)) + 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 5)) + 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! + ) + ) + ) + (let ((gp-2 (-> *display* base-frame-counter))) + (while (let* ((s5-1 (-> *display* base-frame-counter)) + (f30-2 300.0) + (f28-1 0.5) + (f26-1 0.5) + (v1-104 + (/ + (the-as int (rand-uint31-gen *random-generator*)) + 256 + ) + ) + (v1-105 (the-as number (logior #x3f800000 v1-104))) + ) + (< + (the-as + int + (- + s5-1 + (the-as + uint + (the + int + (* + f30-2 + (+ f28-1 (* f26-1 (+ -1.0 (the-as float v1-105)))) + ) + ) + ) + ) + ) + (the-as int gp-2) + ) + ) + (suspend) + ) + ) + (let ((a0-29 (-> self skel root-channel 0))) + (set! (-> a0-29 frame-group) (if (> (-> self skel active-channels) 0) + (-> + self + skel + root-channel + 0 + frame-group + ) + ) + ) + (set! (-> a0-29 param 0) 0.0) + (set! (-> a0-29 param 1) 1.0) + (set! + (-> a0-29 frame-num) + (the float (+ (-> (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -1 + ) + ) + ) + (joint-control-channel-group! + a0-29 + (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-30 (-> self skel root-channel 0))) + (set! (-> a0-30 param 0) 0.0) + (set! (-> a0-30 param 1) 1.0) + (joint-control-channel-group-eval! + a0-30 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let* + ((v1-135 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-136 (the-as number (logior #x3f800000 v1-135))) + ) + (when (< (+ -1.0 (the-as float v1-136)) 0.5) + (let ((a0-34 (-> self skel root-channel 0))) + (set! + (-> a0-34 frame-group) + (the-as art-joint-anim (-> self draw art-group data 5)) + ) + (set! + (-> a0-34 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 5)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-34 param 1) 1.0) + (set! (-> a0-34 frame-num) 0.0) + (joint-control-channel-group! + a0-34 + (the-as art-joint-anim (-> self draw art-group data 5)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-35 (-> self skel root-channel 0))) + (set! + (-> a0-35 param 0) + (the float (+ (-> a0-35 frame-group data 0 length) -1)) + ) + (set! (-> a0-35 param 1) 1.0) + (joint-control-channel-group-eval! + a0-35 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((gp-3 (-> *display* base-frame-counter))) + (while (let* ((s5-2 (-> *display* base-frame-counter)) + (f30-3 300.0) + (f28-2 0.5) + (f26-2 0.5) + (v1-164 + (/ + (the-as int (rand-uint31-gen *random-generator*)) + 256 + ) + ) + (v1-165 (the-as number (logior #x3f800000 v1-164))) + ) + (< + (the-as + int + (- + s5-2 + (the-as + uint + (the + int + (* + f30-3 + (+ f28-2 (* f26-2 (+ -1.0 (the-as float v1-165)))) + ) + ) + ) + ) + ) + (the-as int gp-3) + ) + ) + (suspend) + ) + ) + (let ((a0-39 (-> self skel root-channel 0))) + (set! + (-> a0-39 frame-group) + (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-39 param 0) 0.0) + (set! (-> a0-39 param 1) 1.0) + (set! + (-> a0-39 frame-num) + (the float (+ (-> (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -1 + ) + ) + ) + (joint-control-channel-group! + a0-39 + (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-40 (-> self skel root-channel 0))) + (set! (-> a0-40 param 0) 0.0) + (set! (-> a0-40 param 1) 1.0) + (joint-control-channel-group-eval! + a0-40 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + ) + ) + ) + (let ((a0-42 (-> self skel root-channel 0))) + (set! + (-> a0-42 frame-group) + (the-as art-joint-anim (-> self draw art-group data 4)) + ) + (set! (-> a0-42 param 0) 0.0) + (set! (-> a0-42 param 1) 1.0) + (set! + (-> a0-42 frame-num) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 4)) + data + 0 + length + ) + -1 + ) + ) + ) + (joint-control-channel-group! + a0-42 + (the-as art-joint-anim (-> self draw art-group data 4)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-43 (-> self skel root-channel 0))) + (set! (-> a0-43 param 0) 0.0) + (set! (-> a0-43 param 1) 1.0) + (joint-control-channel-group-eval! + a0-43 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + (else + (let ((a0-45 (-> self skel root-channel 0))) + (set! + (-> a0-45 frame-group) + (the-as art-joint-anim (-> self draw art-group data 6)) + ) + (set! + (-> a0-45 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 6)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-45 param 1) 1.0) + (set! (-> a0-45 frame-num) 0.0) + (joint-control-channel-group! + a0-45 + (the-as art-joint-anim (-> self draw art-group data 6)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-46 (-> self skel root-channel 0))) + (set! + (-> a0-46 param 0) + (the float (+ (-> a0-46 frame-group data 0 length) -1)) + ) + (set! (-> a0-46 param 1) 1.0) + (joint-control-channel-group-eval! + a0-46 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((gp-4 (-> *display* base-frame-counter))) + (while (let* ((s5-3 (-> *display* base-frame-counter)) + (f30-4 300.0) + (f28-3 0.5) + (f26-3 0.5) + (v1-237 + (/ (the-as int (rand-uint31-gen *random-generator*)) 256) + ) + (v1-238 (the-as number (logior #x3f800000 v1-237))) + ) + (< + (the-as + int + (- + s5-3 + (the-as + uint + (the + int + (* + f30-4 + (+ f28-3 (* f26-3 (+ -1.0 (the-as float v1-238)))) + ) + ) + ) + ) + ) + (the-as int gp-4) + ) + ) + (suspend) + ) + ) + (let ((a0-50 (-> self skel root-channel 0))) + (set! + (-> a0-50 frame-group) + (the-as art-joint-anim (-> self draw art-group data 7)) + ) + (set! + (-> a0-50 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 7)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-50 param 1) 1.0) + (set! (-> a0-50 frame-num) 0.0) + (joint-control-channel-group! + a0-50 + (the-as art-joint-anim (-> self draw art-group data 7)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-51 (-> self skel root-channel 0))) + (set! + (-> a0-51 param 0) + (the float (+ (-> a0-51 frame-group data 0 length) -1)) + ) + (set! (-> a0-51 param 1) 1.0) + (joint-control-channel-group-eval! + a0-51 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((gp-5 (-> *display* base-frame-counter))) + (while (let* ((s5-4 (-> *display* base-frame-counter)) + (f30-5 300.0) + (f28-4 0.5) + (f26-4 0.5) + (v1-268 + (/ (the-as int (rand-uint31-gen *random-generator*)) 256) + ) + (v1-269 (the-as number (logior #x3f800000 v1-268))) + ) + (< + (the-as + int + (- + s5-4 + (the-as + uint + (the + int + (* + f30-5 + (+ f28-4 (* f26-4 (+ -1.0 (the-as float v1-269)))) + ) + ) + ) + ) + ) + (the-as int gp-5) + ) + ) + (suspend) + ) + ) + (let ((a0-55 (-> self skel root-channel 0))) + (set! (-> a0-55 frame-group) (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-55 param 0) 0.0) + (set! (-> a0-55 param 1) 1.0) + (set! + (-> a0-55 frame-num) + (the float (+ (-> (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -1 + ) + ) + ) + (joint-control-channel-group! + a0-55 + (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-56 (-> self skel root-channel 0))) + (set! (-> a0-56 param 0) 0.0) + (set! (-> a0-56 param 1) 1.0) + (joint-control-channel-group-eval! + a0-56 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((gp-6 (-> *display* base-frame-counter))) + (while (let* ((s5-5 (-> *display* base-frame-counter)) + (f30-6 300.0) + (f28-5 0.5) + (f26-5 0.5) + (v1-301 + (/ (the-as int (rand-uint31-gen *random-generator*)) 256) + ) + (v1-302 (the-as number (logior #x3f800000 v1-301))) + ) + (< + (the-as + int + (- + s5-5 + (the-as + uint + (the + int + (* + f30-6 + (+ f28-5 (* f26-5 (+ -1.0 (the-as float v1-302)))) + ) + ) + ) + ) + ) + (the-as int gp-6) + ) + ) + (suspend) + ) + ) + (let ((a0-60 (-> self skel root-channel 0))) + (set! + (-> a0-60 frame-group) + (the-as art-joint-anim (-> self draw art-group data 8)) + ) + (set! + (-> a0-60 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 8)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-60 param 1) 1.0) + (set! (-> a0-60 frame-num) 0.0) + (joint-control-channel-group! + a0-60 + (the-as art-joint-anim (-> self draw art-group data 8)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-61 (-> self skel root-channel 0))) + (set! + (-> a0-61 param 0) + (the float (+ (-> a0-61 frame-group data 0 length) -1)) + ) + (set! (-> a0-61 param 1) 1.0) + (joint-control-channel-group-eval! + a0-61 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 11 of type explorer +(defmethod copy-defaults! explorer ((obj explorer) (arg0 res-lump)) + (dummy-40 obj arg0 *explorer-sg* 3 42 (new 'static 'vector :w 4096.0) 5) + (set! (-> obj tasks) (get-task-control (game-task village1-uncle-money))) + (set! (-> obj sound-flava) (the-as uint 10)) + (set! (-> obj draw light-index) (the-as uint 5)) + (dummy-42 obj) + (none) + ) diff --git a/goal_src/levels/village1/farmer.gc b/goal_src/levels/village1/farmer.gc index a6331a690..fd1fc065f 100644 --- a/goal_src/levels/village1/farmer.gc +++ b/goal_src/levels/village1/farmer.gc @@ -5,3 +5,198 @@ ;; name in dgo: farmer ;; dgos: L1, VI1 +(define-extern *farmer-sg* skeleton-group) + +;; definition of type farmer +(deftype farmer (process-taskable) + () + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "farmer" + :bounds (new 'static 'vector :w 16384.0) + :max-lod 1 + :version #x6 + :shadow 3 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 4) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 81920.0) + (set! (-> v1-1 mgeo 1) (the-as uint 2)) + (set! (-> v1-1 lod-dist 1) 4095996000.0) + (set! *farmer-sg* v1-1) + ) + +;; definition for method 32 of type farmer +(defmethod play-anim! farmer ((obj farmer) (arg0 symbol)) + (case (current-status (-> obj tasks)) + ((2 3) + (if arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "farmer-introduction" + :index 6 + :parts 5 + :command-list '() + ) + ) + ((5) + (set! (-> obj skippable) #t) + (cond + ((zero? (get-reminder (-> obj tasks) 0)) + (if arg0 + (save-reminder (-> obj tasks) 1 0) + ) + (new 'static 'spool-anim + :name "farmer-reminder-1" + :index 7 + :parts 2 + :command-list '() + ) + ) + (else + (if arg0 + (save-reminder (-> obj tasks) 0 0) + ) + (new 'static 'spool-anim + :name "farmer-reminder-2" + :index 8 + :parts 2 + :command-list '() + ) + ) + ) + ) + ((6) + (when arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + ) + (new 'static 'spool-anim + :name "farmer-resolution" + :index 9 + :parts 4 + :command-list '() + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (the-as task-status (current-status (-> obj tasks)))) + ) + ) + (-> obj draw art-group data 4) + ) + ) + ) + +;; definition for method 31 of type farmer +(defmethod get-art-elem farmer ((obj farmer)) + (let ((v1-1 (current-status (-> obj tasks)))) + (if (or (= v1-1 2) (= v1-1 3) (= v1-1 7) (zero? v1-1)) + (-> obj draw art-group data 4) + (-> obj draw art-group data 5) + ) + ) + ) + +;; definition for method 43 of type farmer +(defmethod TODO-RENAME-43 farmer ((obj farmer)) + (when + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 9000 + 122880.0 + obj + ) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f0-2 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.8333333 f0-2) + (dummy-11 (-> obj ambient) "FAR-LO1A" #f (-> obj root trans)) + ) + ((< 0.6666667 f0-2) + (dummy-11 (-> obj ambient) "FAR-AM01" #f (-> obj root trans)) + ) + ((< 0.5 f0-2) + ) + ((< 0.33333334 f0-2) + (dummy-11 (-> obj ambient) "FAR-AM2A" #f (-> obj root trans)) + ) + ((< 0.16666667 f0-2) + (dummy-11 (-> obj ambient) "FAR-AM02" #f (-> obj root trans)) + ) + (else + ) + ) + ) + ) + (none) + ) + +;; definition for method 41 of type farmer +;; INFO: Return type mismatch int vs none. +(defmethod initialize-collision farmer ((obj farmer) (arg0 int)) + (let + ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s4-0 prim-core collide-as) (the-as uint 256)) + (set! (-> s4-0 collide-with) (the-as uint 16)) + (set! (-> s4-0 prim-core action) (the-as uint 1)) + (set! (-> s4-0 prim-core offense) 4) + (set-vector! (-> s4-0 local-sphere) 4096.0 8192.0 -4096.0 12288.0) + ((method-of-object s5-0 dummy-46)) + (let ((s3-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> s3-0 prim-core collide-as) (the-as uint 256)) + (set! (-> s3-0 collide-with) (the-as uint 16)) + (set! (-> s3-0 prim-core action) (the-as uint 1)) + (set! (-> s3-0 prim-core offense) 4) + (set-vector! (-> s3-0 local-sphere) 4096.0 6144.0 -4096.0 8192.0) + ) + ((method-of-object s4-0 dummy-28)) + (let ((s3-1 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> s3-1 prim-core collide-as) (the-as uint 256)) + (set! (-> s3-1 collide-with) (the-as uint 16)) + (set! (-> s3-1 prim-core action) (the-as uint 1)) + (set! (-> s3-1 prim-core offense) 4) + (set-vector! (-> s3-1 local-sphere) 4096.0 10240.0 -4096.0 8192.0) + ) + ((method-of-object s4-0 dummy-28)) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + ((method-of-object s5-0 dummy-50)) + (set! (-> obj root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type farmer +(defmethod copy-defaults! farmer ((obj farmer) (arg0 res-lump)) + (dummy-40 obj arg0 *farmer-sg* 3 25 (new 'static 'vector :w 4096.0) 5) + (set! (-> obj root nav-radius) 40960.0) + (nav-mesh-connect obj (-> obj root) (the-as nav-control #f)) + (set! (-> obj tasks) (get-task-control (game-task village1-yakow))) + (dummy-42 obj) + (none) + ) diff --git a/goal_src/levels/village1/sage.gc b/goal_src/levels/village1/sage.gc index d9c177044..842a7d1c7 100644 --- a/goal_src/levels/village1/sage.gc +++ b/goal_src/levels/village1/sage.gc @@ -5,3 +5,1389 @@ ;; name in dgo: sage ;; dgos: L1, VI1 +(define-extern *sage-sg* skeleton-group) + +;; definition of type sage +(deftype sage (process-taskable) + ((reminder-played basic :offset-assert 380) + (assistant handle :offset-assert 384) + ) + :heap-base #x120 + :method-count-assert 53 + :size-assert #x188 + :flag-assert #x3501200188 + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "sage" + :bounds (new 'static 'vector :w 10240.0) + :version #x6 + :shadow 2 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 4) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 4095996000.0) + (set! *sage-sg* v1-1) + ) + +;; definition for method 32 of type sage +(defmethod play-anim! sage ((obj sage) (arg0 symbol)) + (with-pp + (when (!= *kernel-boot-message* 'play) + (close-specific-task! (game-task intro) (task-status need-resolution)) + (return + (new 'static 'spool-anim + :name "sage-introduction-misty-cannon" + :index 8 + :parts 12 + :command-list + '( + ((the binteger 1) + blackout + 0 + ) + ((the binteger 100) + want-levels + village1 + misty + ) + ((the binteger 261) + joint + "cameraB" + ) + ((the binteger 521) + joint + "camera" + ) + ((the binteger 776) + joint + "cameraB" + ) + ((the binteger 810) + joint + "camera" + ) + ((the binteger 1171) + joint + "cameraB" + ) + ((the binteger 1235) + joint + "camera" + ) + ((the binteger 1235) + save + ) + ((the binteger 1418) blackout (the binteger 30)) + ) + ) + ) + ) + (case (current-status (-> obj tasks)) + ((2 3) + (case (current-task (-> obj tasks)) + ((109) + (when arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + (set-setting! *setting-control* pp 'music-volume-movie 'abs 0.0 0) + (copy-settings-from-target! *setting-control*) + ) + (new 'static 'spool-anim + :name "sage-intro-sequence-d1" + :index 16 + :parts 17 + :command-list + '( + (0 + display-level + misty + #f + ) + (0 + display-level + village1 + display + ) + (0 + want-vis + vi1 + ) + (0 + save + ) + (0 + want-force-inside + village1 + #t + ) + (0 + want-force-vis + village1 + #t + ) + (0 + kill + "assistant-11" + ) + (0 + kill + "reflector-middle-2" + ) + (0 + kill + "eco-11" + ) + (0 + kill + "eco-10" + ) + (0 + kill + "sharkey-12" + ) + (0 + kill + "reflector-end-1" + ) + (0 + kill + "water-vol-10" + ) + (0 + kill + "water-vol-8" + ) + (0 + kill + "water-vol-7" + ) + (0 + kill + "fishermans-boat-2" + ) + (0 + kill + "revcycleprop-2" + ) + (0 + kill + "revcycle-8" + ) + (0 + kill + "ropebridge-5" + ) + (0 + kill + "ropebridge-4" + ) + (0 + kill + "villagea-water-2" + ) + (0 + time-of-day + (the binteger 7) + ) + ((the binteger 1) + time-of-day + (the binteger -1) + ) + ((the binteger 3) + blackout + 0 + ) + ((the binteger 25) + blackout + 0 + ) + ((the binteger 25) + want-force-vis + village1 + #f + ) + ((the binteger 56) + joint + "cameraB" + ) + ((the binteger 100) + want-force-inside + village1 + #f + ) + ((the binteger 107) + joint + "camera" + ) + ((the binteger 137) + joint + "cameraB" + ) + ((the binteger 202) + joint + "camera" + ) + ((the binteger 286) + joint + "cameraB" + ) + ((the binteger 554) + joint + "camera" + ) + ((the binteger 633) + joint + "cameraB" + ) + ((the binteger 711) + joint + "camera" + ) + ((the binteger 796) + joint + "cameraB" + ) + ((the binteger 921) + joint + "camera" + ) + ((the binteger 1021) + shadow + self + #f + ) + ((the binteger 1021) + joint + "cameraB" + ) + ((the binteger 1081) + joint + "camera" + ) + ((the binteger 1183) + joint + "cameraB" + ) + ((the binteger 1221) + joint + "camera" + ) + ((the binteger 1496) + shadow + self + #t + ) + ((the binteger 1496) + joint + "cameraB" + ) + ((the binteger 1496) + time-of-day + (the binteger 18) + ) + ((the binteger 1721) + joint + "camera" + ) + ((the binteger 1721) + time-of-day + (the binteger 7) + ) + ((the binteger 1722) time-of-day (the binteger -1)) + ) + ) + ) + ((15) + (when arg0 + (let* ((s5-1 (-> obj tasks)) + (s4-0 (method-of-object s5-1 save-reminder)) + (a1-6 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-6 from) pp) + (set! (-> a1-6 num-params) 2) + (set! (-> a1-6 message) 'query) + (set! (-> a1-6 param 0) (the-as uint 'pickup)) + (set! (-> a1-6 param 1) (the-as uint 6)) + (s4-0 + s5-1 + (the int (the-as float (send-event-function *target* a1-6))) + 1 + ) + ) + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "sage-intro-sequence-e" + :index 14 + :parts 13 + :command-list + '( + (0 + want-levels + village1 + beach + ) + (0 + blackout + 0 + ) + ((the binteger 197) + joint + "cameraB" + ) + ((the binteger 361) + joint + "camera" + ) + ((the binteger 660) + joint + "cameraB" + ) + ((the binteger 937) + display-level + beach + movie + ) + ((the binteger 937) + want-force-vis + beach + #t + ) + ((the binteger 938) + alive + "ecoventrock-3" + ) + ((the binteger 938) + alive + "ecoventrock-4" + ) + ((the binteger 938) + alive + "ecoventrock-5" + ) + ((the binteger 938) + alive + "ecoventrock-6" + ) + ((the binteger 938) + alive + "ecoventrock-7" + ) + ((the binteger 938) + alive + "harvester-87" + ) + ((the binteger 938) + alive + "harvester-88" + ) + ((the binteger 938) + alive + "harvester-89" + ) + ((the binteger 938) + alive + "harvester-90" + ) + ((the binteger 938) + alive + "harvester-91" + ) + ((the binteger 940) + joint + "camera" + ) + ((the binteger 1160) + joint + "cameraB" + ) + ((the binteger 1162) + dead + "ecoventrock-3" + ) + ((the binteger 1162) + dead + "ecoventrock-4" + ) + ((the binteger 1162) + dead + "ecoventrock-5" + ) + ((the binteger 1162) + dead + "ecoventrock-6" + ) + ((the binteger 1162) + dead + "ecoventrock-7" + ) + ((the binteger 1162) + dead + "harvester-87" + ) + ((the binteger 1162) + dead + "harvester-88" + ) + ((the binteger 1162) + dead + "harvester-89" + ) + ((the binteger 1162) + dead + "harvester-90" + ) + ((the binteger 1162) + dead + "harvester-91" + ) + ((the binteger 1310) + joint + "camera" + ) + ((the binteger 1313) + want-force-vis + beach + #f + ) + ((the binteger 1313) + display-level + beach + #f + ) + ((the binteger 1313) send-event "warp-gate-switch-3" 'hide) + ) + ) + ) + (else + (if arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "sage-introduction-misty-cannon" + :index 8 + :parts 12 + :command-list + '( + (0 + want-levels + village1 + beach + ) + ((the binteger 261) + joint + "cameraB" + ) + ((the binteger 521) + joint + "camera" + ) + ((the binteger 776) + joint + "cameraB" + ) + ((the binteger 810) + joint + "camera" + ) + ((the binteger 1171) + joint + "cameraB" + ) + ((the binteger 1235) joint "camera") + ) + ) + ) + ) + ) + ((5) + (set! (-> obj skippable) #t) + (if arg0 + (set! (-> obj reminder-played) #t) + ) + (case (get-reminder (-> obj tasks) 0) + ((3) + (new 'static 'spool-anim + :name "sage-reminder-2-generic" + :index 13 + :parts 4 + :command-list '() + ) + ) + ((2) + (new 'static 'spool-anim + :name "sage-reminder-1-generic" + :index 12 + :parts 3 + :command-list '() + ) + ) + ((1) + (new 'static 'spool-anim + :name "sage-reminder-1-misty-cannon" + :index 9 + :parts 5 + :command-list + '( + ((the binteger 86) joint "cameraB") ((the binteger 320) joint "camera") + ) + ) + ) + (else + (new 'static 'spool-anim + :name "sage-reminder-1-ecorocks" + :index 11 + :parts 4 + :command-list + '( + (0 + want-levels + village1 + beach + ) + ((the binteger 245) + display-level + beach + movie + ) + ((the binteger 245) + want-force-vis + beach + #t + ) + ((the binteger 246) + alive + "ecoventrock-3" + ) + ((the binteger 246) + alive + "ecoventrock-4" + ) + ((the binteger 246) + alive + "ecoventrock-5" + ) + ((the binteger 246) + alive + "ecoventrock-6" + ) + ((the binteger 246) + alive + "ecoventrock-7" + ) + ((the binteger 246) + alive + "harvester-87" + ) + ((the binteger 246) + alive + "harvester-88" + ) + ((the binteger 246) + alive + "harvester-89" + ) + ((the binteger 246) + alive + "harvester-90" + ) + ((the binteger 246) + alive + "harvester-91" + ) + ((the binteger 246) + joint + "cameraB" + ) + ((the binteger 365) + want-force-vis + beach + #f + ) + ((the binteger 365) + display-level + beach + #f + ) + ((the binteger 366) joint "camera") + ) + ) + ) + ) + ) + ((6) + (when arg0 + (set-setting! *setting-control* pp 'music-volume-movie 'abs 0.0 0) + (copy-settings-from-target! *setting-control*) + (close-status! (-> obj tasks) (task-status need-reward-speech)) + (let* ((s5-2 (get-process *default-dead-pool* manipy #x4000)) + (v1-41 (when s5-2 + (let ((t9-15 (method-of-type manipy activate))) + (t9-15 + (the-as manipy s5-2) + obj + 'manipy + (the-as pointer #x70004000) + ) + ) + ((the-as + (function process function object object object object object) + run-function-in-process + ) + s5-2 + manipy-init + (-> obj root trans) + (-> obj entity) + *assistant-sg* + #f + ) + (-> s5-2 ppointer) + ) + ) + ) + (set! + (-> obj assistant) + (new 'static 'handle :process v1-41 :pid (-> v1-41 0 pid)) + ) + ) + (let ((a1-16 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-16 from) pp) + (set! (-> a1-16 num-params) 1) + (set! (-> a1-16 message) 'anim-mode) + (set! (-> a1-16 param 0) (the-as uint 'clone-anim)) + (send-event-function (handle->process (-> obj assistant)) a1-16) + ) + (let ((a1-17 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-17 from) pp) + (set! (-> a1-17 num-params) 1) + (set! (-> a1-17 message) 'blend-shape) + (set! (-> a1-17 param 0) (the-as uint #t)) + (send-event-function (handle->process (-> obj assistant)) a1-17) + ) + (let ((a1-18 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-18 from) pp) + (set! (-> a1-18 num-params) 1) + (set! (-> a1-18 message) 'center-joint) + (set! (-> a1-18 param 0) (the-as uint 3)) + (send-event-function (handle->process (-> obj assistant)) a1-18) + ) + (let ((v1-68 (handle->process (-> obj assistant)))) + (if v1-68 + (set! (-> (the-as assistant v1-68) draw light-index) (the-as uint 1)) + ) + ) + (set! (-> obj draw bounds w) 40960.0) + ) + (new 'static 'spool-anim + :name "sage-intro-sequence-d2" + :index 15 + :parts 20 + :command-list + '( + (0 + want-levels + village1 + beach + ) + (0 + kill + "assistant-11" + ) + (0 + kill + "reflector-middle-2" + ) + (0 + kill + "eco-11" + ) + (0 + kill + "eco-10" + ) + (0 + kill + "sharkey-12" + ) + (0 + kill + "reflector-end-1" + ) + (0 + kill + "water-vol-10" + ) + (0 + kill + "water-vol-8" + ) + (0 + kill + "water-vol-7" + ) + (0 + kill + "fishermans-boat-2" + ) + (0 + kill + "revcycleprop-2" + ) + (0 + kill + "revcycle-8" + ) + ((the binteger 113) + joint + "cameraB" + ) + ((the binteger 232) + joint + "camera" + ) + ((the binteger 289) + joint + "cameraB" + ) + ((the binteger 338) + joint + "camera" + ) + ((the binteger 405) + joint + "cameraB" + ) + ((the binteger 560) + joint + "camera" + ) + ((the binteger 660) + joint + "cameraB" + ) + ((the binteger 699) + joint + "camera" + ) + ((the binteger 837) + joint + "cameraB" + ) + ((the binteger 837) + shadow + self + #f + ) + ((the binteger 910) + joint + "camera" + ) + ((the binteger 945) + alive + "farmer-3" + ) + ((the binteger 945) + alive + "hutlamp-2" + ) + ((the binteger 950) + joint + "cameraB" + ) + ((the binteger 974) + display-level + beach + movie + ) + ((the binteger 974) + want-force-vis + beach + #t + ) + ((the binteger 1011) + alive + "bird-lady-4" + ) + ((the binteger 1015) + joint + "camera" + ) + ((the binteger 1018) + dead + "farmer-3" + ) + ((the binteger 1018) + dead + "hutlamp-2" + ) + ((the binteger 1075) + alive + "explorer-4" + ) + ((the binteger 1080) + joint + "cameraB" + ) + ((the binteger 1080) + want-force-vis + beach + #f + ) + ((the binteger 1080) + display-level + beach + #f + ) + ((the binteger 1082) + dead + "bird-lady-4" + ) + ((the binteger 1133) + joint + "camera" + ) + ((the binteger 1135) + dead + "explorer-4" + ) + ((the binteger 1244) + display-level + beach + movie + ) + ((the binteger 1244) + want-force-vis + beach + #t + ) + ((the binteger 1245) + alive + "fuel-cell-42" + ) + ((the binteger 1246) + joint + "cameraB" + ) + ((the binteger 1369) + joint + "camera" + ) + ((the binteger 1438) + alive + "fuel-cell-42" + ) + ((the binteger 1438) + want-force-vis + beach + #f + ) + ((the binteger 1438) + dead + "fuel-cell-42" + ) + ((the binteger 1438) + kill + "villagea-water-2" + ) + ((the binteger 1438) + kill + "crate-3147" + ) + ((the binteger 1438) + kill + "crate-3146" + ) + ((the binteger 1438) + kill + "crate-3143" + ) + ((the binteger 1438) + kill + "sagesail-6" + ) + ((the binteger 1438) + kill + "windmill-sail-4" + ) + ((the binteger 1438) + kill + "ropebridge-4" + ) + ((the binteger 1438) + kill + "ropebridge-5" + ) + ((the binteger 1438) + kill + "windspinner-8" + ) + ((the binteger 1438) + kill + "windspinner-9" + ) + ((the binteger 1438) + joint + "cameraB" + ) + ((the binteger 1439) + want-levels + village1 + training + ) + ((the binteger 1439) + save + ) + ((the binteger 1529) + joint + "camera" + ) + ((the binteger 1691) + joint + "cameraB" + ) + ((the binteger 1753) + joint + "camera" + ) + ((the binteger 1874) + joint + "cameraB" + ) + ((the binteger 2057) + joint + "camera" + ) + ((the binteger 2176) + joint + "cameraB" + ) + ((the binteger 2226) + joint + "camera" + ) + ((the binteger 2226) shadow self #t) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (get-art-elem obj) + ) + ) + ) + ) + +;; definition for method 45 of type sage +;; INFO: Return type mismatch symbol vs none. +(defmethod dummy-45 sage ((obj sage)) + (cond + ((and + (closed? + (-> obj tasks) + (game-task beach-ecorocks) + (task-status need-reminder) + ) + (= (get-reminder (-> obj tasks) 0) 0) + ) + #t + ) + ((and + (closed? + (-> obj tasks) + (game-task misty-cannon) + (task-status need-reminder) + ) + (= (get-reminder (-> obj tasks) 0) 1) + ) + #t + ) + ((and + (-> obj reminder-played) + (< 81920.0 (vector-vector-distance (-> obj root trans) (camera-pos))) + ) + #t + ) + (else + ) + ) + (none) + ) + +;; definition for method 31 of type sage +(defmethod get-art-elem sage ((obj sage)) + (cond + ((and + (= (current-task (-> obj tasks)) 15) + (or + (= (current-status (-> obj tasks)) 2) + (= (current-status (-> obj tasks)) 3) + ) + ) + (save-reminder (-> obj tasks) 0 0) + ) + ((and + (= (current-task (-> obj tasks)) 26) + (or + (= (current-status (-> obj tasks)) 2) + (= (current-status (-> obj tasks)) 3) + ) + ) + (save-reminder (-> obj tasks) 1 0) + ) + ((dummy-45 obj) + (set! (-> obj reminder-played) #f) + (cond + ((zero? (current-task (-> obj tasks))) + (case (get-reminder (-> obj tasks) 0) + ((2) + (save-reminder (-> obj tasks) 3 0) + ) + (else + (save-reminder (-> obj tasks) 2 0) + ) + ) + ) + ((closed? + (-> obj tasks) + (game-task beach-ecorocks) + (task-status need-reminder) + ) + (save-reminder (-> obj tasks) 1 0) + ) + ((or + (closed? + (-> obj tasks) + (game-task misty-cannon) + (task-status need-reminder) + ) + (not + (closed? + (-> obj tasks) + (game-task misty-cannon) + (task-status need-introduction) + ) + ) + ) + (save-reminder (-> obj tasks) 0 0) + ) + ((zero? (get-reminder (-> obj tasks) 0)) + (save-reminder (-> obj tasks) 1 0) + ) + (else + (save-reminder (-> obj tasks) 0 0) + ) + ) + ) + ) + (case (get-reminder (-> obj tasks) 0) + ((3) + (-> obj draw art-group data 7) + ) + ((2) + (-> obj draw art-group data 6) + ) + ((1) + (-> obj draw art-group data 3) + ) + (else + (-> obj draw art-group data 4) + ) + ) + ) + +;; definition for method 43 of type sage +(defmethod TODO-RENAME-43 sage ((obj sage)) + (let + ((s5-0 + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 9000 + 122880.0 + obj + ) + ) + ) + (when s5-0 + (let* ((v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-3 (the-as number (logior #x3f800000 v1-2))) + (f0-2 (+ -1.0 (the-as float v1-3))) + ) + (cond + ((< (-> s5-0 y) -12288.0) + ) + ((< 0.8 f0-2) + (dummy-11 (-> obj ambient) "SAGELP03" #f (-> obj root trans)) + ) + ((< 0.6 f0-2) + (dummy-11 (-> obj ambient) "SAGELP04" #f (-> obj root trans)) + ) + ((< 0.4 f0-2) + (dummy-11 (-> obj ambient) "SAGELP05" #f (-> obj root trans)) + ) + ((< 0.2 f0-2) + (dummy-11 (-> obj ambient) "SAGELP06" #f (-> obj root trans)) + ) + (else + (dummy-11 (-> obj ambient) "SAGELP11" #f (-> obj root trans)) + ) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (sage) + :virtual #t + :trans + (behavior () + (case (get-task-status (game-task intro)) + (((task-status need-reward-speech)) + (when (process-grab? *target*) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) self) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'play-anim) + (send-event-function self a1-0) + ) + ) + ) + ) + ((-> (method-of-type process-taskable idle) trans)) + (none) + ) + :code + (behavior () + (if (!= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (get-art-elem self) + ) + (ja-channel-push! 1 60) + ) + (while #t + (let ((gp-0 (-> self skel root-channel 0))) + (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) + ) + (let* ((f30-0 3.0) + (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-10 (the-as number (logior #x3f800000 v1-9))) + ) + (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-10)))) 5)) + (TODO-RENAME-43 self) + (let ((a0-11 (-> self skel root-channel 0))) + (set! (-> a0-11 frame-group) (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + (set! + (-> a0-11 param 0) + (the float (+ (-> (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-11 param 1) 1.0) + (set! (-> a0-11 frame-num) 0.0) + (joint-control-channel-group! + a0-11 + (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + num-func-seek! + ) + ) + (until (ja-done? 0) + (if + (and + (-> self reminder-played) + (< 81920.0 (vector-vector-distance (-> self root trans) (camera-pos))) + ) + (go-virtual idle) + ) + (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! + ) + ) + ) + ) + ) + (when (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 4) + ) + (let ((a0-20 (-> self skel root-channel 0))) + (set! + (-> a0-20 frame-group) + (the-as art-joint-anim (-> self draw art-group data 5)) + ) + (set! + (-> a0-20 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 5)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-20 param 1) 1.0) + (set! (-> a0-20 frame-num) 0.0) + (joint-control-channel-group! + a0-20 + (the-as art-joint-anim (-> self draw art-group data 5)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-21 (-> self skel root-channel 0))) + (set! + (-> a0-21 param 0) + (the float (+ (-> a0-21 frame-group data 0 length) -1)) + ) + (set! (-> a0-21 param 1) 1.0) + (joint-control-channel-group-eval! + a0-21 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate play-anim (sage) + :virtual #t + :exit + (behavior () + (set! (-> self draw bounds w) 10240.0) + (let ((a0-1 (handle->process (-> self assistant)))) + (if a0-1 + (deactivate a0-1) + ) + ) + ((-> (method-of-type process-taskable play-anim) exit)) + (case (get-task-status (game-task intro)) + (((task-status need-resolution)) + (clear-pending-settings-from-process + *setting-control* + self + 'music-volume-movie + ) + (close-specific-task! (game-task intro) (task-status need-resolution)) + (start 'play (get-continue-by-name *game-info* "game-start")) + ) + ) + (none) + ) + :trans + (behavior () + (case (get-task-status (game-task intro)) + (((task-status need-reward-speech)) + (spool-push *art-control* "sage-intro-sequence-d2" 0 self -1.0) + ) + ) + ((-> (method-of-type process-taskable play-anim) trans)) + (none) + ) + ) + +;; definition for method 39 of type sage +(defmethod should-display? sage ((obj sage)) + (not (sages-kidnapped?)) + ) + +;; definition for method 41 of type sage +;; INFO: Return type mismatch int vs none. +(defmethod initialize-collision sage ((obj sage) (arg0 int)) + (let + ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s4-0 prim-core collide-as) (the-as uint 256)) + (set! (-> s4-0 collide-with) (the-as uint 16)) + (set! (-> s4-0 prim-core action) (the-as uint 1)) + (set! (-> s4-0 prim-core offense) 4) + (set! (-> s4-0 transform-index) arg0) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 10240.0) + ((method-of-object s5-0 dummy-46)) + (let ((s2-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> s2-0 prim-core collide-as) (the-as uint 256)) + (set! (-> s2-0 collide-with) (the-as uint 16)) + (set! (-> s2-0 prim-core action) (the-as uint 1)) + (set! (-> s2-0 prim-core offense) 4) + (set! (-> s2-0 transform-index) arg0) + (set-vector! (-> s2-0 local-sphere) 0.0 -2048.0 0.0 5324.8) + ) + ((method-of-object s4-0 dummy-28)) + (let ((s2-1 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> s2-1 prim-core collide-as) (the-as uint 256)) + (set! (-> s2-1 collide-with) (the-as uint 16)) + (set! (-> s2-1 prim-core action) (the-as uint 1)) + (set! (-> s2-1 prim-core offense) 4) + (set! (-> s2-1 transform-index) arg0) + (set-vector! (-> s2-1 local-sphere) 0.0 2048.0 0.0 5324.8) + ) + ((method-of-object s4-0 dummy-28)) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + ((method-of-object s5-0 dummy-50)) + (set! (-> obj root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type sage +(defmethod copy-defaults! sage ((obj sage) (arg0 res-lump)) + (dummy-40 obj arg0 *sage-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> obj tasks) (get-task-control (game-task misty-cannon))) + (set! (-> obj reminder-played) #f) + (set! (-> obj sound-flava) (the-as uint 5)) + (set! (-> obj assistant) (the-as handle #f)) + (set! (-> obj draw light-index) (the-as uint 1)) + (dummy-42 obj) + (none) + ) diff --git a/goal_src/levels/village2/gambler.gc b/goal_src/levels/village2/gambler.gc index 4b1e4bc3e..cd4588022 100644 --- a/goal_src/levels/village2/gambler.gc +++ b/goal_src/levels/village2/gambler.gc @@ -5,3 +5,453 @@ ;; name in dgo: gambler ;; dgos: L1, VI2 +(define-extern *gambler-sg* skeleton-group) + +;; definition of type gambler +(deftype gambler (process-taskable) + () + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "gambler" + :bounds (new 'static 'vector :w 16384.0) + :max-lod 2 + :version #x6 + :shadow 4 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 5) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 81920.0) + (set! (-> v1-1 mgeo 1) (the-as uint 2)) + (set! (-> v1-1 lod-dist 1) 163840.0) + (set! (-> v1-1 mgeo 2) (the-as uint 3)) + (set! (-> v1-1 lod-dist 2) 4095996000.0) + (set! *gambler-sg* v1-1) + ) + +;; definition for method 32 of type gambler +(defmethod play-anim! gambler ((obj gambler) (arg0 symbol)) + (with-pp + (set! (-> obj talk-message) (the-as uint 260)) + (case (current-status (-> obj tasks)) + ((2 3) + (when arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + (close-specific-task! + (game-task village2-gambler-money) + (task-status need-introduction) + ) + ) + (new 'static 'spool-anim + :name "gambler-introduction-1" + :index 11 + :parts 9 + :command-list + '( + (0 + want-levels + village2 + rolling + ) + (0 + display-level + rolling + #f + ) + ((the binteger 29) + joint + "cameraB" + ) + ((the binteger 103) + joint + "camera" + ) + ((the binteger 231) + joint + "cameraB" + ) + ((the binteger 730) + display-level + rolling + display + ) + ((the binteger 730) + want-force-vis + rolling + #t + ) + ((the binteger 732) + alive + "gorge-pusher-5" + ) + ((the binteger 732) + alive + "gorge-pusher-6" + ) + ((the binteger 732) + alive + "gorge-start-1" + ) + ((the binteger 732) + joint + "camera" + ) + ((the binteger 945) + joint + "cameraB" + ) + ((the binteger 950) + dead + "gorge-pusher-5" + ) + ((the binteger 950) + dead + "gorge-pusher-6" + ) + ((the binteger 950) + dead + "gorge-start-1" + ) + ((the binteger 950) + display-level + rolling + #f + ) + ((the binteger 950) want-force-vis rolling #f) + ) + ) + ) + ((5) + (set! (-> obj skippable) #t) + (cond + ((closed? + (-> obj tasks) + (game-task rolling-race) + (task-status need-reward-speech) + ) + (new 'static 'spool-anim + :name "gambler-reminder-money" + :index 13 + :parts 2 + :command-list '() + ) + ) + ((closed? + (-> obj tasks) + (game-task village2-gambler-money) + (task-status need-reward-speech) + ) + (new 'static 'spool-anim + :name "gambler-reminder-race" + :index 12 + :parts 2 + :command-list '() + ) + ) + ((zero? (get-reminder (-> obj tasks) 5)) + (if arg0 + (save-reminder (-> obj tasks) 1 5) + ) + (new 'static 'spool-anim + :name "gambler-reminder-race" + :index 12 + :parts 2 + :command-list '() + ) + ) + (else + (if arg0 + (save-reminder (-> obj tasks) 0 5) + ) + (new 'static 'spool-anim + :name "gambler-reminder-money" + :index 13 + :parts 2 + :command-list '() + ) + ) + ) + ) + ((6) + (if (not arg0) + (set! (-> obj will-talk) #t) + ) + (case (current-task (-> obj tasks)) + ((52) + (when arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + ) + (new 'static 'spool-anim + :name "gambler-resolution-race" + :index 14 + :parts 3 + :command-list '() + ) + ) + (else + (cond + (arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + (let ((a1-10 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-10 from) pp) + (set! (-> a1-10 num-params) 2) + (set! (-> a1-10 message) 'get-pickup) + (set! (-> a1-10 param 0) (the-as uint 5)) + (set! + (-> a1-10 param 1) + (the-as uint (- (-> *GAME-bank* money-task-inc))) + ) + (send-event-function *target* a1-10) + ) + ) + (else + (set! (-> obj talk-message) (the-as uint 282)) + ) + ) + (new 'static 'spool-anim + :name "gambler-resolution-money" + :index 15 + :parts 2 + :command-list '() + ) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (-> obj draw art-group data 7) + ) + ) + ) + ) + +;; definition for method 31 of type gambler +(defmethod get-art-elem gambler ((obj gambler)) + (-> obj draw art-group data 7) + ) + +;; definition for method 43 of type gambler +(defmethod TODO-RENAME-43 gambler ((obj gambler)) + (when + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 9000 + 61440.0 + obj + ) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f0-2 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.9230769 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM01" #f (-> obj root trans)) + ) + ((< 0.84615386 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM02" #f (-> obj root trans)) + ) + ((< 0.7692308 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM03" #f (-> obj root trans)) + ) + ((< 0.6923077 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM04" #f (-> obj root trans)) + ) + ((< 0.61538464 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM05" #f (-> obj root trans)) + ) + ((< 0.53846157 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM06" #f (-> obj root trans)) + ) + ((< 0.46153846 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM07" #f (-> obj root trans)) + ) + ((< 0.3846154 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM08" #f (-> obj root trans)) + ) + ((< 0.30769232 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM09" #f (-> obj root trans)) + ) + ((< 0.23076923 f0-2) + (if (not (task-closed? (game-task ogre-boss) (task-status need-reminder))) + (dummy-11 (-> obj ambient) "GAM-AM10" #f (-> obj root trans)) + ) + ) + ((< 0.15384616 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM11" #f (-> obj root trans)) + ) + ((< 0.07692308 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM12" #f (-> obj root trans)) + ) + (else + (dummy-11 (-> obj ambient) "GAM-AM13" #f (-> obj root trans)) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (gambler) + :virtual #t + :code + (behavior () + (when (!= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 7) + ) + (ja-channel-push! 1 60) + (let ((v1-6 (-> self skel root-channel 0))) + (set! + (-> v1-6 frame-group) + (the-as art-joint-anim (-> self draw art-group data 7)) + ) + ) + ) + (while #t + (let ((a0-9 (-> self skel root-channel 0))) + (set! (-> a0-9 frame-group) (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + (set! + (-> a0-9 param 0) + (the float (+ (-> (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-9 param 1) 1.0) + (set! (-> a0-9 frame-num) 0.0) + (joint-control-channel-group! a0-9 (if (> (-> self skel active-channels) 0) + (-> + self + skel + root-channel + 0 + frame-group + ) + ) + num-func-seek! + ) + ) + (until (ja-done? 0) + (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! + ) + ) + ) + (TODO-RENAME-43 self) + (let* ((v1-38 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-39 (the-as number (logior #x3f800000 v1-38))) + (f0-9 (+ -1.0 (the-as float v1-39))) + ) + (cond + ((< f0-9 0.16666667) + (let ((a0-15 (-> self skel root-channel 0))) + (set! + (-> a0-15 frame-group) + (the-as art-joint-anim (-> self draw art-group data 5)) + ) + ) + ) + ((< f0-9 0.33333334) + (let ((a0-16 (-> self skel root-channel 0))) + (set! + (-> a0-16 frame-group) + (the-as art-joint-anim (-> self draw art-group data 6)) + ) + ) + ) + ((< f0-9 0.5) + (let ((a0-17 (-> self skel root-channel 0))) + (set! + (-> a0-17 frame-group) + (the-as art-joint-anim (-> self draw art-group data 7)) + ) + ) + ) + ((< f0-9 0.6666667) + (let ((a0-18 (-> self skel root-channel 0))) + (set! + (-> a0-18 frame-group) + (the-as art-joint-anim (-> self draw art-group data 8)) + ) + ) + ) + ((< f0-9 0.8333333) + (let ((a0-19 (-> self skel root-channel 0))) + (set! + (-> a0-19 frame-group) + (the-as art-joint-anim (-> self draw art-group data 9)) + ) + ) + ) + (else + (let ((a0-20 (-> self skel root-channel 0))) + (set! + (-> a0-20 frame-group) + (the-as art-joint-anim (-> self draw art-group data 10)) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 11 of type gambler +(defmethod copy-defaults! gambler ((obj gambler) (arg0 res-lump)) + (dummy-40 obj arg0 *gambler-sg* 3 32 (new 'static 'vector :w 4096.0) 5) + (set! (-> obj tasks) (get-task-control (game-task rolling-race))) + (set! (-> obj sound-flava) (the-as uint 17)) + (set! (-> obj draw light-index) (the-as uint 4)) + (dummy-42 obj) + (none) + ) diff --git a/goal_src/levels/village2/geologist.gc b/goal_src/levels/village2/geologist.gc index df5811873..7ef5cc074 100644 --- a/goal_src/levels/village2/geologist.gc +++ b/goal_src/levels/village2/geologist.gc @@ -5,3 +5,308 @@ ;; name in dgo: geologist ;; dgos: L1, VI2 +(define-extern *geologist-sg* skeleton-group) + +;; definition of type geologist +(deftype geologist (process-taskable) + () + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "geologist" + :bounds (new 'static 'vector :w 16384.0) + :max-lod 2 + :version #x6 + :shadow 4 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 5) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 81920.0) + (set! (-> v1-1 mgeo 1) (the-as uint 2)) + (set! (-> v1-1 lod-dist 1) 163840.0) + (set! (-> v1-1 mgeo 2) (the-as uint 3)) + (set! (-> v1-1 lod-dist 2) 4095996000.0) + (set! *geologist-sg* v1-1) + ) + +;; definition for method 32 of type geologist +(defmethod play-anim! geologist ((obj geologist) (arg0 symbol)) + (with-pp + (set! (-> obj talk-message) (the-as uint 260)) + (case (current-status (-> obj tasks)) + ((2 3) + (when arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + (close-specific-task! + (game-task village2-geologist-money) + (task-status need-introduction) + ) + ) + (new 'static 'spool-anim + :name "geologist-introduction" + :index 6 + :parts 13 + :command-list + '( + (0 + want-levels + village2 + rolling + ) + ((the binteger 199) + joint + "cameraB" + ) + ((the binteger 325) + joint + "camera" + ) + ((the binteger 520) + alive + "racer-2" + ) + ((the binteger 544) + joint + "cameraB" + ) + ((the binteger 546) + dead + "racer-2" + ) + ((the binteger 809) + joint + "camera" + ) + ((the binteger 1031) + joint + "cameraB" + ) + ((the binteger 1229) joint "camera") + ) + ) + ) + ((5) + (set! (-> obj skippable) #t) + (cond + ((closed? + (-> obj tasks) + (game-task rolling-moles) + (task-status need-reward-speech) + ) + (new 'static 'spool-anim + :name "geologist-reminder-money" + :index 8 + :parts 2 + :command-list '() + ) + ) + ((closed? + (-> obj tasks) + (game-task village2-geologist-money) + (task-status need-reward-speech) + ) + (new 'static 'spool-anim + :name "geologist-reminder-moles" + :index 7 + :parts 3 + :command-list '() + ) + ) + ((zero? (get-reminder (-> obj tasks) 0)) + (if arg0 + (save-reminder (-> obj tasks) 1 0) + ) + (new 'static 'spool-anim + :name "geologist-reminder-moles" + :index 7 + :parts 3 + :command-list '() + ) + ) + (else + (if arg0 + (save-reminder (-> obj tasks) 0 0) + ) + (new 'static 'spool-anim + :name "geologist-reminder-money" + :index 8 + :parts 2 + :command-list '() + ) + ) + ) + ) + ((6) + (if (not arg0) + (set! (-> obj will-talk) #t) + ) + (case (current-task (-> obj tasks)) + ((54) + (when arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + ) + (new 'static 'spool-anim + :name "geologist-resolution-moles" + :index 9 + :parts 3 + :command-list '() + ) + ) + (else + (cond + (arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + (let ((a1-10 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-10 from) pp) + (set! (-> a1-10 num-params) 2) + (set! (-> a1-10 message) 'get-pickup) + (set! (-> a1-10 param 0) (the-as uint 5)) + (set! + (-> a1-10 param 1) + (the-as uint (- (-> *GAME-bank* money-task-inc))) + ) + (send-event-function *target* a1-10) + ) + ) + (else + (set! (-> obj talk-message) (the-as uint 282)) + ) + ) + (new 'static 'spool-anim + :name "geologist-resolution-money" + :index 10 + :parts 2 + :command-list '() + ) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (-> obj draw art-group data 5) + ) + ) + ) + ) + +;; definition for method 31 of type geologist +(defmethod get-art-elem geologist ((obj geologist)) + (-> obj draw art-group data 5) + ) + +;; definition for method 43 of type geologist +(defmethod TODO-RENAME-43 geologist ((obj geologist)) + (when + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 9000 + 122880.0 + obj + ) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f0-2 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.8888889 f0-2) + (dummy-11 (-> obj ambient) "GEO-AM01" #f (-> obj root trans)) + ) + ((< 0.7777778 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task rolling-moles) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "GEO-AM02" #f (-> obj root trans)) + ) + ) + ((< 0.6666667 f0-2) + (dummy-11 (-> obj ambient) "GEO-AM03" #f (-> obj root trans)) + ) + ((< 0.5555556 f0-2) + (if + (closed? + (-> obj tasks) + (game-task village2-geologist-money) + (task-status need-introduction) + ) + (dummy-11 (-> obj ambient) "GEO-AM04" #f (-> obj root trans)) + ) + ) + ((< 0.44444445 f0-2) + (dummy-11 (-> obj ambient) "GEO-AM05" #f (-> obj root trans)) + ) + ((< 0.33333334 f0-2) + (dummy-11 (-> obj ambient) "GEO-AM06" #f (-> obj root trans)) + ) + ((< 0.22222222 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task rolling-moles) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "GEO-AM07" #f (-> obj root trans)) + ) + ) + ((< 0.11111111 f0-2) + (dummy-11 (-> obj ambient) "GEO-LO02" #f (-> obj root trans)) + ) + ((closed? + (-> obj tasks) + (game-task village2-geologist-money) + (task-status need-resolution) + ) + (dummy-11 (-> obj ambient) "GEO-AM08" #f (-> obj root trans)) + ) + (else + (dummy-11 (-> obj ambient) "GEO-LO01" #f (-> obj root trans)) + ) + ) + ) + ) + (none) + ) + +;; definition for method 11 of type geologist +(defmethod copy-defaults! geologist ((obj geologist) (arg0 res-lump)) + (dummy-40 obj arg0 *geologist-sg* 3 45 (new 'static 'vector :w 4096.0) 5) + (set! (-> obj tasks) (get-task-control (game-task rolling-moles))) + (set! (-> obj sound-flava) (the-as uint 16)) + (set! (-> obj draw light-index) (the-as uint 2)) + (dummy-42 obj) + (none) + ) diff --git a/goal_src/levels/village2/village2-obs.gc b/goal_src/levels/village2/village2-obs.gc index e36c42bd1..77fc7c21e 100644 --- a/goal_src/levels/village2/village2-obs.gc +++ b/goal_src/levels/village2/village2-obs.gc @@ -15,3 +15,13 @@ :flag-assert #x1e008000e8 ) (define-extern *village2cam-sg* skeleton-group) + +;; TODO - for warrior +(deftype allpontoons (process-drawable) + ((task uint8 :offset-assert 176) + ) + :method-count-assert 20 + :size-assert #xb1 + :heap-base #x50 + :flag-assert #x14005000b1 + ) diff --git a/goal_src/levels/village2/warrior.gc b/goal_src/levels/village2/warrior.gc index b859b0bd6..7b9685b47 100644 --- a/goal_src/levels/village2/warrior.gc +++ b/goal_src/levels/village2/warrior.gc @@ -5,3 +5,356 @@ ;; name in dgo: warrior ;; dgos: L1, VI2 +(define-extern *warrior-sg* skeleton-group) + +;; definition of type warrior +(deftype warrior (process-taskable) + () + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "warrior" + :bounds (new 'static 'vector :w 16384.0) + :max-lod 2 + :version #x6 + :shadow 4 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 5) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 81920.0) + (set! (-> v1-1 mgeo 1) (the-as uint 2)) + (set! (-> v1-1 lod-dist 1) 163840.0) + (set! (-> v1-1 mgeo 2) (the-as uint 3)) + (set! (-> v1-1 lod-dist 2) 4095996000.0) + (set! *warrior-sg* v1-1) + ) + +;; definition for method 52 of type warrior +;; INFO: Return type mismatch int vs none. +(defmethod dummy-52 warrior ((obj warrior)) + (let ((v1-1 (-> obj draw shadow-ctrl))) + (when v1-1 + (let ((f0-0 (-> obj root trans y))) + (let ((a0-2 v1-1)) + (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) + ) + 0 + (set! (-> v1-1 settings top-plane w) (- (+ 3072.0 f0-0))) + ) + 0 + ) + ) + (none) + ) + +;; definition for method 48 of type warrior +(defmethod draw-shadow warrior ((obj warrior)) + (-> obj draw shadow-ctrl) + (cond + ((and + (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (nonzero? (logand (-> obj draw status) 8)) + ) + (let ((v1-9 (-> obj draw shadow-ctrl))) + (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + ) + 0 + ((method-of-object (-> obj draw shadow-ctrl) dummy-14)) + ) + (else + (let ((v1-14 (-> obj draw shadow-ctrl))) + (logior! (-> v1-14 settings flags) 32) + ) + 0 + ) + ) + (none) + ) + +;; definition for method 32 of type warrior +(defmethod play-anim! warrior ((obj warrior) (arg0 symbol)) + (with-pp + (set! (-> obj talk-message) (the-as uint 260)) + (case (current-status (-> obj tasks)) + ((2 3) + (if arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "warrior-introduction" + :index 6 + :parts 29 + :command-list + '( + ((the binteger 125) + joint + "cameraB" + ) + ((the binteger 260) + joint + "camera" + ) + ((the binteger 574) + joint + "cameraB" + ) + ((the binteger 918) + joint + "camera" + ) + ((the binteger 1174) + joint + "cameraB" + ) + ((the binteger 1174) + shadow + self + #f + ) + ((the binteger 1301) + joint + "camera" + ) + ((the binteger 1301) + shadow + self + #t + ) + ((the binteger 2025) + joint + "cameraB" + ) + ((the binteger 2322) + joint + "camera" + ) + ((the binteger 2560) joint "cameraB") + ) + ) + ) + ((5) + (set! (-> obj skippable) #t) + (new 'static 'spool-anim + :name "warrior-reminder-1" + :index 7 + :parts 3 + :command-list '() + ) + ) + ((6) + (cond + (arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) pp) + (set! (-> a1-4 num-params) 2) + (set! (-> a1-4 message) 'get-pickup) + (set! (-> a1-4 param 0) (the-as uint 5)) + (set! + (-> a1-4 param 1) + (the-as uint (- (-> *GAME-bank* money-task-inc))) + ) + (send-event-function *target* a1-4) + ) + (let ((s5-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> s5-1 from) pp) + (set! (-> s5-1 num-params) 1) + (set! (-> s5-1 message) 'clone) + (let* ((a0-10 obj) + (v1-19 (if a0-10 + (-> a0-10 ppointer) + ) + ) + ) + (set! + (-> s5-1 param 0) + (the-as + uint + (logior + (shl (-> v1-19 0 pid) 32) + (new 'static 'handle :process v1-19) + ) + ) + ) + ) + (send-event-function + (-> (entity-by-type allpontoons) extra process) + s5-1 + ) + ) + (dotimes (s5-2 (entity-actor-count (-> obj entity) 'alt-actor)) + (entity-birth-no-kill + (entity-actor-lookup (-> obj entity) 'alt-actor s5-2) + ) + (let ((s4-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-2 from) pp) + (set! (-> s4-2 num-params) 0) + (set! (-> s4-2 message) 'die) + (let ((s3-0 send-event-function) + (v1-25 (entity-actor-lookup (-> obj entity) 'alt-actor s5-2)) + ) + (s3-0 (if v1-25 + (-> v1-25 extra process) + ) + s4-2 + ) + ) + ) + ) + ) + (else + (set! (-> obj will-talk) #t) + (set! (-> obj talk-message) (the-as uint 282)) + ) + ) + (new 'static 'spool-anim + :name "warrior-resolution" + :index 8 + :parts 6 + :command-list + '( + ((the binteger 508) + blackout + (the binteger 10) + ) + ((the binteger 511) blackout 0) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (-> obj draw art-group data 5) + ) + ) + ) + ) + +;; definition for method 31 of type warrior +(defmethod get-art-elem warrior ((obj warrior)) + (-> obj draw art-group data 5) + ) + +;; failed to figure out what this is: +(defstate play-anim (warrior) + :virtual #t + :exit + (behavior () + (let ((gp-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-0 from) self) + (set! (-> gp-0 num-params) 0) + (set! (-> gp-0 message) 'end-mode) + (send-event-function (-> (entity-by-type allpontoons) extra process) gp-0) + ) + ((-> (method-of-type process-taskable play-anim) exit)) + (none) + ) + ) + +;; definition for method 43 of type warrior +(defmethod TODO-RENAME-43 warrior ((obj warrior)) + (when + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 600 + 61440.0 + obj + ) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f0-2 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.66 f0-2) + (dummy-11 (-> obj ambient) "WAR-LO1A" #f (-> obj root trans)) + ) + ((< 0.33 f0-2) + (dummy-11 (-> obj ambient) "WAR-LO1B" #f (-> obj root trans)) + ) + (else + (dummy-11 (-> obj ambient) "WAR-LO1C" #f (-> obj root trans)) + ) + ) + ) + ) + (none) + ) + +;; definition for method 41 of type warrior +;; INFO: Return type mismatch int vs none. +(defmethod initialize-collision warrior ((obj warrior) (arg0 int)) + (let + ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s4-0 prim-core collide-as) (the-as uint 256)) + (set! (-> s4-0 collide-with) (the-as uint 16)) + (set! (-> s4-0 prim-core action) (the-as uint 1)) + (set! (-> s4-0 prim-core offense) 4) + (set-vector! (-> s4-0 local-sphere) -3072.0 8192.0 0.0 11264.0) + ((method-of-object s5-0 dummy-46)) + (let ((s3-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> s3-0 prim-core collide-as) (the-as uint 256)) + (set! (-> s3-0 collide-with) (the-as uint 16)) + (set! (-> s3-0 prim-core action) (the-as uint 1)) + (set! (-> s3-0 prim-core offense) 4) + (set-vector! (-> s3-0 local-sphere) -2048.0 9216.0 0.0 8192.0) + ) + ((method-of-object s4-0 dummy-28)) + (let ((s3-1 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> s3-1 prim-core collide-as) (the-as uint 256)) + (set! (-> s3-1 collide-with) (the-as uint 16)) + (set! (-> s3-1 prim-core action) (the-as uint 1)) + (set! (-> s3-1 prim-core offense) 4) + (set-vector! (-> s3-1 local-sphere) 0.0 2048.0 0.0 4096.0) + ) + ((method-of-object s4-0 dummy-28)) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + ((method-of-object s5-0 dummy-50)) + (set! (-> obj root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type warrior +(defmethod copy-defaults! warrior ((obj warrior) (arg0 res-lump)) + (dummy-40 + obj + arg0 + *warrior-sg* + 3 + 33 + (new 'static 'vector :y -4096.0 :w 10240.0) + 5 + ) + (set! (-> obj tasks) (get-task-control (game-task village2-warrior-money))) + (set! (-> obj sound-flava) (the-as uint 15)) + (set! (-> obj draw light-index) (the-as uint 3)) + (dummy-42 obj) + (none) + ) diff --git a/goal_src/levels/village_common/oracle.gc b/goal_src/levels/village_common/oracle.gc index bf2f1fbdf..02375c574 100644 --- a/goal_src/levels/village_common/oracle.gc +++ b/goal_src/levels/village_common/oracle.gc @@ -5,3 +5,809 @@ ;; name in dgo: oracle ;; dgos: CIT, L1, VI1, VI2, VI3, VILLAGEP +(define-extern *oracle-sg* skeleton-group) + +;; definition of type oracle +(deftype oracle (process-taskable) + ((first-task uint8 :offset-assert 380) + (second-task uint8 :offset-assert 381) + (left-eye-cell handle :offset-assert 384) + (right-eye-cell handle :offset-assert 392) + ) + :heap-base #x120 + :method-count-assert 53 + :size-assert #x190 + :flag-assert #x3501200190 + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "oracle" + :bounds (new 'static 'vector :w 16384.0) + :version #x6 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 2) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 4095996000.0) + (set! *oracle-sg* v1-1) + ) + +;; definition for method 32 of type oracle +(defmethod play-anim! oracle ((obj oracle) (arg0 symbol)) + (with-pp + (set! (-> obj talk-message) (the-as uint 260)) + (case (current-status (-> obj tasks)) + ((2 3) + (when arg0 + (close-specific-task! + (the-as game-task (-> obj first-task)) + (task-status need-introduction) + ) + (close-specific-task! + (the-as game-task (-> obj second-task)) + (task-status need-introduction) + ) + ) + (case (-> (level-get-target-inside *level*) name) + (('village1) + (new 'static 'spool-anim + :name "oracle-intro-1" + :index 9 + :parts 5 + :command-list '() + ) + ) + (('village2) + (new 'static 'spool-anim + :name "oracle-intro-2" + :index 11 + :parts 4 + :command-list + '( + (0 + kill + "pontoonten-20" + ) + (0 + kill + "pontoonten-19" + ) + (0 + kill + "pontoonten-18" + ) + (0 + kill + "pontoonten-15" + ) + (0 + kill + "pontoonten-14" + ) + (0 + kill + "pontoonfive-14" + ) + (0 + kill + "pontoonfive-15" + ) + (0 + kill + "pontoonfive-19" + ) + (0 + kill + "pontoonfive-20" + ) + (0 + kill + "med-res-level-12" + ) + (0 + kill + "med-res-level-13" + ) + (0 + kill + "med-res-level-15" + ) + (0 + kill + "money-2844" + ) + (0 + kill + "money-2845" + ) + (0 + kill + "money-2846" + ) + (0 + kill + "money-2847" + ) + (0 + kill + "money-2848" + ) + (0 + kill + "money-2849" + ) + (0 + kill + "money-2850" + ) + (0 + kill + "money-2854" + ) + (0 + kill + "money-2855" + ) + (0 + kill + "money-2856" + ) + (0 + kill + "money-2860" + ) + (0 + kill + "money-2861" + ) + (0 + kill + "money-2862" + ) + (0 + kill + "eco-27" + ) + (0 + kill + "eco-26" + ) + (0 + kill + "sharkey-25" + ) + (0 + kill + "barrel-13" + ) + (0 + kill + "barrel-14" + ) + (0 + kill + "barrel-15" + ) + (0 + kill + "barrel-16" + ) + (0 + kill + "barrel-17" + ) + (0 + kill + "barrel-18" + ) + (0 + kill + "barrel-19" + ) + (0 + kill + "barrel-20" + ) + (0 + kill + "barrel-21" + ) + (0 + kill + "barrel-22" + ) + (0 + kill + "barrel-23" + ) + (0 + kill + "villageb-part-18" + ) + (0 + kill + "villageb-part-19" + ) + (0 + kill + "villageb-part-20" + ) + (0 + kill + "villageb-part-21" + ) + (0 + kill + "villageb-part-28" + ) + (0 + kill + "villageb-part-29" + ) + (0 + kill + "villageb-part-30" + ) + (0 + kill + "villageb-part-31" + ) + (0 + kill + "villageb-part-32" + ) + (0 + kill + "villageb-part-33" + ) + (0 + kill + "villageb-part-35" + ) + (0 + kill + "villageb-part-37" + ) + (0 + kill + "villageb-part-38" + ) + (0 + kill + "villageb-part-47" + ) + (0 + kill + "villageb-part-48" + ) + (0 + kill + "villageb-part-49" + ) + (0 + kill + "villageb-part-50" + ) + (0 + kill + "villageb-part-56" + ) + (0 + kill + "villageb-part-62" + ) + (0 + kill + "villageb-part-63" + ) + (0 + kill + "villageb-ogreboss-1" + ) + (0 + kill + "crate-3127" + ) + (0 + kill + "crate-3128" + ) + (0 + kill + "crate-3129" + ) + (0 + kill + "crate-3133" + ) + (0 + kill + "geologist-1" + ) + (0 + kill + "fireboulder-2" + ) + (0 + kill + "fireboulder-3" + ) + (0 + kill + "fireboulder-4" + ) + (0 + kill + "water-vol-100" + ) + (0 + kill + "water-vol-101" + ) + (0 + kill + "water-vol-102" + ) + (0 + kill + "water-vol-103" + ) + (0 + kill + "water-vol-284" + ) + (0 + kill + "water-vol-285" + ) + (0 + kill + "water-vol-286" + ) + (0 + kill + "ceilingflag-6" + ) + (0 + kill + "ceilingflag-7" + ) + (0 + kill + "ceilingflag-8" + ) + (0 + kill + "ceilingflag-9" + ) + (0 + kill + "orb-cache-top-14" + ) + (0 + setting-reset + ocean-off + near + ) + ((the binteger 399) setting-unset ocean-off) + ) + ) + ) + (('village3) + (new 'static 'spool-anim + :name "oracle-intro-3" + :index 13 + :parts 4 + :command-list '() + ) + ) + ) + ) + ((5) + (set! (-> obj skippable) #t) + (case (-> (level-get-target-inside *level*) name) + (('village1) + (new 'static 'spool-anim + :name "oracle-reminder-1" + :index 10 + :parts 4 + :command-list '() + ) + ) + (('village2) + (new 'static 'spool-anim + :name "oracle-reminder-2" + :index 12 + :parts 2 + :command-list '() + ) + ) + (('village3) + (new 'static 'spool-anim + :name "oracle-reminder-3" + :index 14 + :parts 2 + :command-list '() + ) + ) + ) + ) + ((6) + (cond + (arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) pp) + (set! (-> a1-5 num-params) 2) + (set! (-> a1-5 message) 'get-pickup) + (set! (-> a1-5 param 0) (the-as uint 5)) + (set! + (-> a1-5 param 1) + (the-as uint (- (-> *GAME-bank* money-oracle-inc))) + ) + (send-event-function *target* a1-5) + ) + (cond + ((= (current-task (-> obj tasks)) (-> obj first-task)) + (let ((a0-25 (handle->process (-> obj right-eye-cell)))) + (if a0-25 + (deactivate a0-25) + ) + ) + ) + (else + (let ((a0-29 (handle->process (-> obj left-eye-cell)))) + (if a0-29 + (deactivate a0-29) + ) + ) + ) + ) + ) + (else + (set! (-> obj will-talk) #t) + (set! (-> obj talk-message) (the-as uint 283)) + ) + ) + (cond + ((= (current-task (-> obj tasks)) (-> obj first-task)) + (case (-> (level-get-target-inside *level*) name) + (('village1) + (new 'static 'spool-anim + :name "oracle-right-eye-1" + :index 3 + :parts 2 + :command-list '() + ) + ) + (('village2) + (new 'static 'spool-anim + :name "oracle-right-eye-2" + :index 5 + :parts 2 + :command-list '() + ) + ) + (('village3) + (new 'static 'spool-anim + :name "oracle-right-eye-3" + :index 7 + :parts 2 + :command-list '() + ) + ) + ) + ) + (else + (case (-> (level-get-target-inside *level*) name) + (('village1) + (new 'static 'spool-anim + :name "oracle-left-eye-1" + :index 4 + :parts 2 + :command-list '() + ) + ) + (('village2) + (new 'static 'spool-anim + :name "oracle-left-eye-2" + :index 6 + :parts 2 + :command-list '() + ) + ) + (('village3) + (new 'static 'spool-anim + :name "oracle-left-eye-3" + :index 8 + :parts 2 + :command-list '() + ) + ) + ) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (-> obj draw art-group data 2) + ) + ) + ) + ) + +;; definition for method 31 of type oracle +(defmethod get-art-elem oracle ((obj oracle)) + (-> obj draw art-group data 2) + ) + +;; failed to figure out what this is: +(defstate idle (oracle) + :virtual #t + :exit + (behavior () + (stop! (-> self sound)) + ((-> (method-of-type process-taskable idle) exit)) + (none) + ) + :trans + (behavior () + (update! (-> self sound)) + ((-> (method-of-type process-taskable idle) trans)) + (none) + ) + ) + +;; definition for method 11 of type oracle +(defmethod copy-defaults! oracle ((obj oracle) (arg0 res-lump)) + (with-pp + (dummy-40 + obj + arg0 + *oracle-sg* + 3 + 4 + (new 'static 'vector :y -4096.0 :w 4096.0) + -1 + ) + (set! + (-> obj sound) + (new + 'process + 'ambient-sound + (new 'static 'sound-spec + :mask #x80 + :num 1.0 + :group #x1 + :sound-name-char + (new 'static 'array uint8 16 + #x6f + #x72 + #x61 + #x63 + #x6c + #x65 + #x2d + #x73 + #x6c + #x65 + #x65 + #x70 + #x0 + #x0 + #x0 + #x0 + ) + :volume #x400 + :fo-max 50 + ) + (-> obj root trans) + ) + ) + (set! (-> obj first-task) (the-as uint (-> arg0 extra perm task))) + (set! + (-> obj second-task) + (the-as + uint + (get-property-value + arg0 + 'alt-task + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (set! + (-> obj tasks) + (get-task-control (the-as game-task (-> obj first-task))) + ) + (set! (-> obj right-eye-cell) (the-as handle #f)) + (set! (-> obj left-eye-cell) (the-as handle #f)) + (logior! (-> obj draw status) 32) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-1 (lambda :behavior oracle () (let* ((gp-0 (-> self root)) + (v1-1 + (if + (and + (nonzero? gp-0) + (type-type? + (-> gp-0 type) + collide-shape + ) + ) + gp-0 + ) + ) + ) + (if v1-1 + (-> + (the-as collide-shape v1-1) + root-prim + prim-core + ) + (-> self root trans) + ) + ) + ((method-of-object (-> self part) dummy-11)) + 0 + (none) + ) + ) + ) + (ja-post) + (when + (not + (task-closed? + (the-as game-task (-> obj first-task)) + (task-status need-resolution) + ) + ) + (vector<-cspace! s4-0 (-> obj node-list data 5)) + (let* ((s3-0 (get-process *default-dead-pool* manipy #x4000)) + (v1-13 (when s3-0 + (let ((t9-8 (method-of-type manipy activate))) + (t9-8 + (the-as manipy s3-0) + obj + 'manipy + (the-as pointer #x70004000) + ) + ) + ((the-as + (function process function object object object object object) + run-function-in-process + ) + s3-0 + manipy-init + s4-0 + (-> obj entity) + *fuel-cell-sg* + (new 'static 'vector :w 4915.2) + ) + (-> s3-0 ppointer) + ) + ) + ) + (set! + (-> obj right-eye-cell) + (new 'static 'handle :process v1-13 :pid (-> v1-13 0 pid)) + ) + ) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) pp) + (set! (-> a1-9 num-params) 1) + (set! (-> a1-9 message) 'eval) + (set! + (-> a1-9 param 0) + (the-as + uint + (lambda :behavior oracle + () + (let ((v0-0 (dummy-9 (-> *part-group-id-table* 63) self))) + (set! (-> self part) (the-as sparticle-launch-control v0-0)) + v0-0 + ) + ) + ) + ) + (send-event-function (handle->process (-> obj right-eye-cell)) a1-9) + ) + (let ((a1-10 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-10 from) pp) + (set! (-> a1-10 num-params) 1) + (set! (-> a1-10 message) 'trans-hook) + (set! (-> a1-10 param 0) (the-as uint s5-1)) + (send-event-function (handle->process (-> obj right-eye-cell)) a1-10) + ) + ) + (when + (not + (task-closed? + (the-as game-task (-> obj second-task)) + (task-status need-resolution) + ) + ) + (vector<-cspace! s4-0 (-> obj node-list data 6)) + (let* ((s3-1 (get-process *default-dead-pool* manipy #x4000)) + (v1-33 (when s3-1 + (let ((t9-15 (method-of-type manipy activate))) + (t9-15 + (the-as manipy s3-1) + obj + 'manipy + (the-as pointer #x70004000) + ) + ) + ((the-as + (function process function object object object object object) + run-function-in-process + ) + s3-1 + manipy-init + s4-0 + (-> obj entity) + *fuel-cell-sg* + (new 'static 'vector :w 4915.2) + ) + (-> s3-1 ppointer) + ) + ) + ) + (set! + (-> obj left-eye-cell) + (new 'static 'handle :process v1-33 :pid (-> v1-33 0 pid)) + ) + ) + (let ((a1-16 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-16 from) pp) + (set! (-> a1-16 num-params) 1) + (set! (-> a1-16 message) 'eval) + (set! + (-> a1-16 param 0) + (the-as + uint + (lambda :behavior oracle + () + (let ((v0-0 (dummy-9 (-> *part-group-id-table* 63) self))) + (set! (-> self part) (the-as sparticle-launch-control v0-0)) + v0-0 + ) + ) + ) + ) + (send-event-function (handle->process (-> obj left-eye-cell)) a1-16) + ) + (let ((a1-17 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-17 from) pp) + (set! (-> a1-17 num-params) 1) + (set! (-> a1-17 message) 'trans-hook) + (set! (-> a1-17 param 0) (the-as uint s5-1)) + (send-event-function (handle->process (-> obj left-eye-cell)) a1-17) + ) + ) + ) + (dummy-42 obj) + (none) + ) + ) diff --git a/scripts/find-label-types.py b/scripts/find-label-types.py index 38f7f65db..101faee5a 100644 --- a/scripts/find-label-types.py +++ b/scripts/find-label-types.py @@ -23,10 +23,19 @@ with open(file_path) as f: # Find all content = f.readlines() prev_line = "" + next_label_will_be_lambda = False for i, line in enumerate(content): + if ".function (anon-function" in line: + next_label_will_be_lambda = True if line.startswith("L"): for label in labels_with_no_type: if line.startswith("{}:".format(label)): + # If we were expecting a lambda + if next_label_will_be_lambda: + label_lines.append("[\"{}\", \"_lambda_\", true]".format(label)) + labels_with_no_type.remove(label) + next_label_will_be_lambda = False + break # Check if the previous line has a `.type` prev_line = content[i-1] if ".type" in prev_line: @@ -34,17 +43,6 @@ with open(file_path) as f: label_lines.append("[\"{}\", \"{}\", true]".format(label, the_type)) labels_with_no_type.remove(label) break - # Otherwise, lets see if it's a lambda, check the last 10 lines (hopefully this is enough) - found_it = False - for j in range(20): - temp_line = content[i-j] - if "anon-function" in temp_line: - label_lines.append("[\"{}\", \"_lambda_\", true]".format(label)) - labels_with_no_type.remove(label) - found_it = True - break - if found_it: - break # Print out the labels print("Here are the labels I couldn't find a type for:") diff --git a/test/decompiler/reference/engine/game/task/task-control-h_REF.gc b/test/decompiler/reference/engine/game/task/task-control-h_REF.gc index 791da31df..244bce2a7 100644 --- a/test/decompiler/reference/engine/game/task/task-control-h_REF.gc +++ b/test/decompiler/reference/engine/game/task/task-control-h_REF.gc @@ -73,8 +73,8 @@ :flag-assert #xc00000010 (:methods (dummy-9 (_type_ vector int float process-drawable) none 9) - (dummy-10 () none 10) - (dummy-11 () none 11) + (TODO-RENAME-10 (_type_ vector int float process-drawable) vector 10) + (dummy-11 (_type_ string symbol vector) none 11) ) ) @@ -121,34 +121,34 @@ :flag-assert #x350110017c (:methods (dummy-20 () none 20) - (give-cell () none 21) + (give-cell () _type_ :state 21) (dummy-22 () none 22) (enter-playing () none 23) (play-accept () none 24) (dummy-25 () none 25) (query () none 26) - (play-anim () none 27) - (hidden () none 28) + (play-anim () _type_ :state 27) + (hidden () _type_ :state 28) (dummy-29 () none 29) - (idle () none 30) - (dummy-31 (_type_) none 31) - (dummy-32 (_type_ symbol) spool-anim 32) + (idle () _type_ :state 30) + (get-art-elem (_type_) art-element 31) + (play-anim! (_type_ symbol) basic 32) (dummy-33 (_type_) none 33) (dummy-34 (_type_) none 34) (dummy-35 (_type_) none 35) (dummy-36 (_type_) none 36) (dummy-37 (_type_) none 37) (dummy-38 (_type_) none 38) - (dummy-39 (_type_) none 39) + (should-display? (_type_) symbol 39) (dummy-40 (_type_ object skeleton-group int int vector int) none 40) - (dummy-41 (_type_) none 41) + (initialize-collision (_type_ int) none 41) (dummy-42 (_type_) none 42) - (dummy-43 (_type_) none 43) + (TODO-RENAME-43 (_type_) none 43) (dummy-44 (_type_) none 44) (dummy-45 (_type_) none 45) (dummy-46 (_type_) none 46) - (dummy-47 (_type_) none 47) - (dummy-48 (_type_) none 48) + (target-above-threshold? (_type_) symbol 47) + (draw-shadow (_type_) none 48) (dummy-49 (_type_) none 49) (dummy-50 (_type_) none 50) (dummy-51 (_type_) none 51) diff --git a/test/decompiler/reference/engine/gfx/sparticle/sparticle-launcher-h_REF.gc b/test/decompiler/reference/engine/gfx/sparticle/sparticle-launcher-h_REF.gc index c188f40ef..d4858b220 100644 --- a/test/decompiler/reference/engine/gfx/sparticle/sparticle-launcher-h_REF.gc +++ b/test/decompiler/reference/engine/gfx/sparticle/sparticle-launcher-h_REF.gc @@ -153,7 +153,7 @@ :size-assert #x30 :flag-assert #xa00000030 (:methods - (dummy-9 () none 9) + (dummy-9 (_type_ process) _type_ 9) ) ) diff --git a/test/decompiler/reference/engine/load/loader-h_REF.gc b/test/decompiler/reference/engine/load/loader-h_REF.gc index ef119193e..d04326348 100644 --- a/test/decompiler/reference/engine/load/loader-h_REF.gc +++ b/test/decompiler/reference/engine/load/loader-h_REF.gc @@ -166,8 +166,8 @@ (deftype spool-anim (basic) ((name string :offset 16) (buf1 external-art-buffer :offset 16) - (buf2 external-art-buffer :offset-assert 20) (index int32 :offset 20) + (buf2 external-art-buffer :offset 20) (parts int32 :offset-assert 24) (priority float :offset-assert 28) (owner handle :offset-assert 32) @@ -183,7 +183,7 @@ (defmethod inspect spool-anim ((obj spool-anim)) (format #t "[~8x] ~A~%" obj (-> obj type)) (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tindex: ~D~%" (-> obj buf2)) + (format #t "~Tindex: ~D~%" (-> obj index)) (format #t "~Tparts: ~D~%" (-> obj parts)) (format #t "~Tpriority: ~f~%" (-> obj priority)) (format #t "~Towner: ~D~%" (-> obj owner)) diff --git a/test/decompiler/reference/engine/load/loader_REF.gc b/test/decompiler/reference/engine/load/loader_REF.gc index ae2723349..a274b3706 100644 --- a/test/decompiler/reference/engine/load/loader_REF.gc +++ b/test/decompiler/reference/engine/load/loader_REF.gc @@ -646,7 +646,7 @@ (set! (-> obj buffer v1-5 frame-lock) #f) ) (dotimes (v1-8 3) - (set! (-> obj rec v1-8 buf2) #f) + (set! (-> obj rec v1-8 index) (the-as int #f)) ) (dotimes (s4-0 2) (let ((s3-0 (-> obj rec s4-0))) @@ -658,7 +658,7 @@ (not (-> obj buffer s2-0 frame-lock)) ) (set! (-> obj buffer s2-0 frame-lock) #t) - (set! (-> s3-0 buf2) (-> obj buffer s2-0)) + (set! (-> s3-0 index) (the-as int (-> obj buffer s2-0))) (set! (-> obj buffer s2-0 pending-load-file-owner) (-> s3-0 owner)) (set! (-> obj buffer s2-0 load-file-owner) (-> s3-0 owner)) (set! (-> obj buffer s2-0 pending-load-file-priority) (-> s3-0 priority)) @@ -686,7 +686,7 @@ (-> s3-1 owner) (-> s3-1 priority) ) - (set! (-> s3-1 buf2) (-> obj buffer s2-1)) + (set! (-> s3-1 index) (the-as int (-> obj buffer s2-1))) (goto cfg-46) ) ) diff --git a/test/decompiler/reference/engine/nav/navigate-h_REF.gc b/test/decompiler/reference/engine/nav/navigate-h_REF.gc index 99a56c392..59f91c16e 100644 --- a/test/decompiler/reference/engine/nav/navigate-h_REF.gc +++ b/test/decompiler/reference/engine/nav/navigate-h_REF.gc @@ -591,7 +591,7 @@ (defmethod should-display? nav-control ((obj nav-control)) (and *display-nav-marks* - (nonzero? (logand (-> obj flags) (nav-control-flags bit0 display-marks))) + (nonzero? (logand (-> obj flags) (nav-control-flags display-marks bit0))) ) ) diff --git a/test/decompiler/reference/kernel/gkernel-h_REF.gc b/test/decompiler/reference/kernel/gkernel-h_REF.gc index 7dda7abf1..f3ddedaa6 100644 --- a/test/decompiler/reference/kernel/gkernel-h_REF.gc +++ b/test/decompiler/reference/kernel/gkernel-h_REF.gc @@ -302,7 +302,7 @@ (deftype state (protect-frame) ((code function :offset-assert 16) (trans (function none) :offset-assert 20) - (post function :offset-assert 24) + (post (function none) :offset-assert 24) (enter function :offset-assert 28) (event (function process int symbol event-message-block object) :offset-assert 32) ) diff --git a/test/decompiler/reference/levels/beach/bird-lady-beach_REF.gc b/test/decompiler/reference/levels/beach/bird-lady-beach_REF.gc new file mode 100644 index 000000000..5b12b40b5 --- /dev/null +++ b/test/decompiler/reference/levels/beach/bird-lady-beach_REF.gc @@ -0,0 +1,227 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type bird-lady-beach +(deftype bird-lady-beach (process-taskable) + ((flutflut handle :offset-assert 384) + (egg handle :offset-assert 392) + ) + :heap-base #x120 + :method-count-assert 53 + :size-assert #x190 + :flag-assert #x3501200190 + ) + +;; definition for method 3 of type bird-lady-beach +(defmethod inspect bird-lady-beach ((obj bird-lady-beach)) + (let ((t9-0 (method-of-type process-taskable inspect))) + (t9-0 obj) + ) + (format #t "~T~Tflutflut: ~D~%" (-> obj flutflut)) + (format #t "~T~Tegg: ~D~%" (-> obj egg)) + obj + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "bird-lady-beach" + :bounds (new 'static 'vector :w 16384.0) + :version #x6 + :shadow 2 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 3) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 4095996000.0) + (set! *bird-lady-beach-sg* v1-1) + ) + +;; failed to figure out what this is: +(defstate idle (bird-lady-beach) + :virtual #t + :enter + (behavior () + (when (not (should-display? self)) + (let ((a0-2 (handle->process (-> self flutflut)))) + (if a0-2 + (deactivate a0-2) + ) + ) + (let ((a0-6 (handle->process (-> self egg)))) + (if a0-6 + (deactivate a0-6) + ) + ) + (go-virtual hidden) + ) + ((-> (method-of-type process-taskable idle) enter)) + (none) + ) + ) + +;; definition for method 32 of type bird-lady-beach +(defmethod play-anim! bird-lady-beach ((obj bird-lady-beach) (arg0 symbol)) + (with-pp + (case (current-status (-> obj tasks)) + ((6) + (when arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + (let* ((s5-1 (get-process *default-dead-pool* manipy #x4000)) + (v1-8 (when s5-1 + (let ((t9-4 (method-of-type manipy activate))) + (t9-4 + (the-as manipy s5-1) + obj + 'manipy + (the-as pointer #x70004000) + ) + ) + ((the-as + (function process function object object object object object) + run-function-in-process + ) + s5-1 + manipy-init + (-> obj root trans) + (-> obj entity) + *flutflut-naked-sg* + #f + ) + (-> s5-1 ppointer) + ) + ) + ) + (set! + (-> obj flutflut) + (new 'static 'handle :process v1-8 :pid (-> v1-8 0 pid)) + ) + ) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) pp) + (set! (-> a1-4 num-params) 1) + (set! (-> a1-4 message) 'anim-mode) + (set! (-> a1-4 param 0) (the-as uint 'clone-anim)) + (send-event-function (handle->process (-> obj flutflut)) a1-4) + ) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) pp) + (set! (-> a1-5 num-params) 1) + (set! (-> a1-5 message) 'blend-shape) + (set! (-> a1-5 param 0) (the-as uint #t)) + (send-event-function (handle->process (-> obj flutflut)) a1-5) + ) + (let* ((s5-2 (get-process *default-dead-pool* manipy #x4000)) + (v1-28 (when s5-2 + (let ((t9-9 (method-of-type manipy activate))) + (t9-9 + (the-as manipy s5-2) + obj + 'manipy + (the-as pointer #x70004000) + ) + ) + ((the-as + (function process function object object object object object) + run-function-in-process + ) + s5-2 + manipy-init + (-> obj root trans) + (-> obj entity) + *flutflutegg-sg* + #f + ) + (-> s5-2 ppointer) + ) + ) + ) + (set! + (-> obj egg) + (new 'static 'handle :process v1-28 :pid (-> v1-28 0 pid)) + ) + ) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) pp) + (set! (-> a1-9 num-params) 1) + (set! (-> a1-9 message) 'anim-mode) + (set! (-> a1-9 param 0) (the-as uint 'clone-anim)) + (send-event-function (handle->process (-> obj egg)) a1-9) + ) + ) + (new 'static 'spool-anim + :name "bird-lady-beach-resolution" + :index 4 + :parts 10 + :command-list + '( + ((the binteger 141) + joint + "cameraB" + ) + ((the binteger 535) + joint + "camera" + ) + ((the binteger 696) + joint + "cameraB" + ) + ((the binteger 758) + joint + "camera" + ) + ((the binteger 813) joint "cameraB") + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (-> obj draw art-group data 3) + ) + ) + ) + ) + +;; definition for method 31 of type bird-lady-beach +(defmethod get-art-elem bird-lady-beach ((obj bird-lady-beach)) + (-> obj draw art-group data 3) + ) + +;; definition for method 39 of type bird-lady-beach +(defmethod should-display? bird-lady-beach ((obj bird-lady-beach)) + (= (current-status (-> obj tasks)) 6) + ) + +;; definition for method 11 of type bird-lady-beach +(defmethod copy-defaults! bird-lady-beach ((obj bird-lady-beach) (arg0 res-lump)) + (dummy-40 + obj + arg0 + *bird-lady-beach-sg* + 3 + 51 + (new 'static 'vector :y 4096.0 :w 4096.0) + 5 + ) + (set! (-> obj tasks) (get-task-control (game-task beach-flutflut))) + (set! (-> obj sound-flava) (the-as uint 7)) + (dummy-42 obj) + (none) + ) diff --git a/test/decompiler/reference/levels/beach/bird-lady_REF.gc b/test/decompiler/reference/levels/beach/bird-lady_REF.gc new file mode 100644 index 000000000..6800a771c --- /dev/null +++ b/test/decompiler/reference/levels/beach/bird-lady_REF.gc @@ -0,0 +1,290 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type bird-lady +(deftype bird-lady (process-taskable) + () + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + ) + +;; definition for method 3 of type bird-lady +(defmethod inspect bird-lady ((obj bird-lady)) + (let ((t9-0 (method-of-type process-taskable inspect))) + (t9-0 obj) + ) + obj + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "bird-lady" + :bounds + (new 'static 'vector :y 4096.0 :w 10240.0) + :version #x6 + :shadow 2 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 3) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 4095996000.0) + (set! *bird-lady-sg* v1-1) + ) + +;; definition for method 52 of type bird-lady +;; INFO: Return type mismatch int vs none. +(defmethod dummy-52 bird-lady ((obj bird-lady)) + (let ((v1-1 (-> obj draw shadow-ctrl))) + (when v1-1 + (let ((f0-0 (-> obj root trans y))) + (let ((a0-2 v1-1)) + (set! (-> a0-2 settings bot-plane w) (- (+ -1024.0 f0-0))) + ) + 0 + (let ((a0-4 v1-1)) + (set! (-> a0-4 settings top-plane w) (- (+ 4096.0 f0-0))) + ) + ) + 0 + (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + ) + ) + (none) + ) + +;; definition for method 48 of type bird-lady +(defmethod draw-shadow bird-lady ((obj bird-lady)) + (-> obj draw shadow-ctrl) + (cond + ((and + (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (nonzero? (logand (-> obj draw status) 8)) + ) + (let ((v1-9 (-> obj draw shadow-ctrl))) + (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + ) + 0 + ((method-of-object (-> obj draw shadow-ctrl) dummy-14)) + ) + (else + (let ((v1-14 (-> obj draw shadow-ctrl))) + (logior! (-> v1-14 settings flags) 32) + ) + 0 + ) + ) + (none) + ) + +;; definition for method 32 of type bird-lady +(defmethod play-anim! bird-lady ((obj bird-lady) (arg0 symbol)) + (case (current-status (-> obj tasks)) + ((2 3) + (if arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "bird-lady-introduction" + :index 4 + :parts 11 + :command-list + '( + (0 + want-levels + village1 + beach + ) + ((the binteger 49) + joint + "cameraB" + ) + ((the binteger 101) + display-level + beach + special + ) + ((the binteger 101) + kill + "yakow-8" + ) + ((the binteger 101) + kill + "yakow-9" + ) + ((the binteger 101) + kill + "yakow-10" + ) + ((the binteger 101) + kill + "yakow-11" + ) + ((the binteger 101) + kill + "yakow-12" + ) + ((the binteger 102) + joint + "camera" + ) + ((the binteger 125) + joint + "cameraB" + ) + ((the binteger 251) + joint + "camera" + ) + ((the binteger 326) + joint + "cameraB" + ) + ((the binteger 649) + display-level + beach + movie + ) + ((the binteger 649) + want-force-vis + beach + #t + ) + ((the binteger 650) + alive + "flutflutegg-1" + ) + ((the binteger 651) + joint + "camera" + ) + ((the binteger 1041) + joint + "cameraB" + ) + ((the binteger 1046) + dead + "flutflutegg-1" + ) + ((the binteger 1046) + display-level + beach + display + ) + ((the binteger 1046) want-force-vis beach #f) + ) + ) + ) + ((5) + (set! (-> obj skippable) #t) + (cond + ((zero? (get-reminder (-> obj tasks) 0)) + (if arg0 + (save-reminder (-> obj tasks) 1 0) + ) + (new 'static 'spool-anim + :name "bird-lady-reminder-1" + :index 5 + :parts 4 + :command-list '() + ) + ) + (else + (if arg0 + (save-reminder (-> obj tasks) 0 0) + ) + (new 'static 'spool-anim + :name "bird-lady-reminder-2" + :index 6 + :parts 5 + :command-list '() + ) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (the-as task-status (current-status (-> obj tasks)))) + ) + ) + (-> obj draw art-group data 3) + ) + ) + ) + +;; definition for method 31 of type bird-lady +(defmethod get-art-elem bird-lady ((obj bird-lady)) + (-> obj draw art-group data 3) + ) + +;; definition for method 43 of type bird-lady +(defmethod TODO-RENAME-43 bird-lady ((obj bird-lady)) + (when + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 9000 + 122880.0 + obj + ) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f0-2 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.66 f0-2) + (dummy-11 (-> obj ambient) "BIR-LO02" #f (-> obj root trans)) + ) + ((< 0.33 f0-2) + (dummy-11 (-> obj ambient) "BIR-LO03" #f (-> obj root trans)) + ) + (else + (dummy-11 (-> obj ambient) "BIR-am08" #f (-> obj root trans)) + ) + ) + ) + ) + (none) + ) + +;; definition for method 47 of type bird-lady +;; INFO: Return type mismatch basic vs symbol. +(defmethod target-above-threshold? bird-lady ((obj bird-lady)) + (the-as symbol (and *target* (< (-> (target-pos 0) z) -81920.0))) + ) + +;; definition for method 11 of type bird-lady +(defmethod copy-defaults! bird-lady ((obj bird-lady) (arg0 res-lump)) + (dummy-40 + obj + arg0 + *bird-lady-sg* + 3 + 51 + (new 'static 'vector :y 4096.0 :w 4096.0) + 5 + ) + (set! (-> obj tasks) (get-task-control (game-task beach-flutflut))) + (set! (-> obj sound-flava) (the-as uint 7)) + (set! (-> obj draw light-index) (the-as uint 4)) + (if + (closed? + (-> obj tasks) + (game-task beach-flutflut) + (task-status need-reminder) + ) + (dummy-18 obj) + (go (method-of-object obj idle)) + ) + (none) + ) diff --git a/test/decompiler/reference/levels/beach/mayor_REF.gc b/test/decompiler/reference/levels/beach/mayor_REF.gc new file mode 100644 index 000000000..79ec438bc --- /dev/null +++ b/test/decompiler/reference/levels/beach/mayor_REF.gc @@ -0,0 +1,2195 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type mayor +(deftype mayor (process-taskable) + ((root-override collide-shape :offset 112) + ) + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + ) + +;; definition for method 3 of type mayor +(defmethod inspect mayor ((obj mayor)) + (let ((t9-0 (method-of-type process-taskable inspect))) + (t9-0 obj) + ) + obj + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "mayor" + :bounds (new 'static 'vector :w 10240.0) + :version #x6 + :shadow 2 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 3) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 4095996000.0) + (set! *mayor-sg* v1-1) + ) + +;; definition for method 52 of type mayor +;; INFO: Return type mismatch int vs none. +(defmethod dummy-52 mayor ((obj mayor)) + (let ((v1-1 (-> obj draw shadow-ctrl))) + (when v1-1 + (let ((f0-0 (-> obj root-override trans y))) + (let ((a0-2 v1-1)) + (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) + ) + 0 + (set! (-> v1-1 settings top-plane w) (- (+ 2048.0 f0-0))) + ) + 0 + ) + ) + (none) + ) + +;; definition for method 48 of type mayor +(defmethod draw-shadow mayor ((obj mayor)) + (-> obj draw shadow-ctrl) + (cond + ((and + (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (nonzero? (logand (-> obj draw status) 8)) + ) + (let ((v1-9 (-> obj draw shadow-ctrl))) + (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + ) + 0 + ((method-of-object (-> obj draw shadow-ctrl) dummy-14)) + ) + (else + (let ((v1-14 (-> obj draw shadow-ctrl))) + (set! + (-> v1-14 settings flags) + (logior (the-as int (-> v1-14 settings flags)) 32) + ) + ) + 0 + ) + ) + (none) + ) + +;; definition for function mayor-lurkerm-reward-speech +(defun mayor-lurkerm-reward-speech ((arg0 mayor) (arg1 symbol)) + (when arg1 + (set! (-> arg0 cell-for-task) (game-task jungle-lurkerm)) + (close-specific-task! + (game-task jungle-lurkerm) + (task-status need-reward-speech) + ) + (first-any (-> arg0 tasks) #t) + ) + (new 'static 'spool-anim + :name "mayor-resolution-beams" + :index 7 + :parts 6 + :command-list '() + ) + ) + +;; definition for method 32 of type mayor +(defmethod play-anim! mayor ((obj mayor) (arg0 symbol)) + (with-pp + (set! (-> obj talk-message) (the-as uint 260)) + (case (current-status (-> obj tasks)) + ((2 3) + (when arg0 + (close-specific-task! + (game-task jungle-lurkerm) + (task-status need-introduction) + ) + (close-specific-task! + (game-task village1-mayor-money) + (task-status need-introduction) + ) + ) + (cond + ((closed? + (-> obj tasks) + (game-task jungle-lurkerm) + (task-status need-reminder) + ) + (mayor-lurkerm-reward-speech obj arg0) + ) + (else + (new 'static 'spool-anim + :name "mayor-introduction" + :index 4 + :parts 16 + :command-list '() + ) + (new 'static 'spool-anim + :name "mayor-introduction" + :index 4 + :parts 16 + :command-list + '( + (0 + kill + "villagea-part-65" + ) + (0 + kill + "villagea-part-70" + ) + (0 + kill + "med-res-level-2" + ) + (0 + kill + "med-res-level-3" + ) + (0 + kill + "med-res-level-4" + ) + (0 + kill + "med-res-level-6" + ) + (0 + kill + "med-res-level-7" + ) + (0 + kill + "med-res-level-8" + ) + (0 + kill + "med-res-level-11" + ) + (0 + kill + "med-res-level-14" + ) + (0 + kill + "fishermans-boat-2" + ) + (0 + kill + "windspinner-9" + ) + (0 + kill + "sagesail-6" + ) + (0 + kill + "sharkey-12" + ) + (0 + kill + "windmill-sail-4" + ) + (0 + kill + "water-vol-7" + ) + (0 + kill + "windspinner-8" + ) + (0 + kill + "villagea-part-32" + ) + (0 + kill + "water-vol-10" + ) + (0 + kill + "ropebridge-4" + ) + (0 + kill + "ropebridge-5" + ) + (0 + kill + "reflector-end-1" + ) + (0 + kill + "eco-10" + ) + (0 + kill + "eco-11" + ) + (0 + kill + "warp-gate-switch-3" + ) + (0 + kill + "reflector-middle-2" + ) + (0 + kill + "evilplant-2" + ) + (0 + kill + "crate-3147" + ) + (0 + kill + "villagea-water-2" + ) + (0 + kill + "med-res-level-22" + ) + (0 + kill + "med-res-level-23" + ) + (0 + kill + "villagea-part-50" + ) + (0 + kill + "water-vol-9" + ) + (0 + kill + "crate-3144" + ) + (0 + kill + "orb-cache-top-4" + ) + (0 + kill + "village-cam-2" + ) + (0 + kill + "villagea-part-18" + ) + (0 + kill + "villagea-part-24" + ) + (0 + kill + "money-2676" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "villagea-part-13" + ) + (0 + kill + "villagea-part-17" + ) + (0 + kill + "money-2689" + ) + (0 + kill + "money-2690" + ) + (0 + kill + "farmer-3" + ) + (0 + kill + "villagea-part-26" + ) + (0 + kill + "money-2692" + ) + (0 + kill + "villagea-part-37" + ) + (0 + kill + "villagea-part-38" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "crate-3142" + ) + (0 + kill + "crate-3143" + ) + (0 + kill + "money-2688" + ) + (0 + kill + "villagea-part-14" + ) + (0 + kill + "money-2691" + ) + (0 + kill + "villagea-part-62" + ) + (0 + kill + "villagea-part-63" + ) + (0 + kill + "sharkey-1" + ) + (0 + kill + "eco-82" + ) + (0 + kill + "eco-83" + ) + (0 + kill + "crate-2470" + ) + (0 + kill + "villagea-part-3" + ) + (0 + kill + "villagea-part-15" + ) + (0 + kill + "villagea-part-22" + ) + (0 + kill + "villagea-part-28" + ) + (0 + kill + "explorer-4" + ) + (0 + kill + "oracle-1" + ) + (0 + kill + "crate-3141" + ) + (0 + kill + "crate-3145" + ) + (0 + kill + "water-vol-8" + ) + (0 + kill + "water-vol-63" + ) + (0 + kill + "lrocklrg-1" + ) + (0 + kill + "crate-2469" + ) + (0 + kill + "villagea-part-69" + ) + (0 + display-level + beach + special + ) + ((the binteger 565) + joint + "cameraB" + ) + ((the binteger 850) + joint + "camera" + ) + ((the binteger 915) joint "cameraB") + ) + ) + ) + ) + ) + ((4 5) + (set! (-> obj skippable) #t) + (cond + ((closed? + (-> obj tasks) + (game-task jungle-lurkerm) + (task-status need-reward-speech) + ) + (new 'static 'spool-anim + :name "mayor-reminder-donation" + :index 6 + :parts 3 + :command-list + '( + (0 + kill + "villagea-part-65" + ) + (0 + kill + "villagea-part-70" + ) + (0 + kill + "med-res-level-2" + ) + (0 + kill + "med-res-level-3" + ) + (0 + kill + "med-res-level-4" + ) + (0 + kill + "med-res-level-6" + ) + (0 + kill + "med-res-level-7" + ) + (0 + kill + "med-res-level-8" + ) + (0 + kill + "med-res-level-11" + ) + (0 + kill + "med-res-level-14" + ) + (0 + kill + "fishermans-boat-2" + ) + (0 + kill + "windspinner-9" + ) + (0 + kill + "sagesail-6" + ) + (0 + kill + "sharkey-12" + ) + (0 + kill + "windmill-sail-4" + ) + (0 + kill + "water-vol-7" + ) + (0 + kill + "windspinner-8" + ) + (0 + kill + "villagea-part-32" + ) + (0 + kill + "water-vol-10" + ) + (0 + kill + "ropebridge-4" + ) + (0 + kill + "ropebridge-5" + ) + (0 + kill + "reflector-end-1" + ) + (0 + kill + "eco-10" + ) + (0 + kill + "eco-11" + ) + (0 + kill + "warp-gate-switch-3" + ) + (0 + kill + "reflector-middle-2" + ) + (0 + kill + "evilplant-2" + ) + (0 + kill + "crate-3147" + ) + (0 + kill + "villagea-water-2" + ) + (0 + kill + "med-res-level-22" + ) + (0 + kill + "med-res-level-23" + ) + (0 + kill + "villagea-part-50" + ) + (0 + kill + "water-vol-9" + ) + (0 + kill + "crate-3144" + ) + (0 + kill + "orb-cache-top-4" + ) + (0 + kill + "village-cam-2" + ) + (0 + kill + "villagea-part-18" + ) + (0 + kill + "villagea-part-24" + ) + (0 + kill + "money-2676" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "villagea-part-13" + ) + (0 + kill + "villagea-part-17" + ) + (0 + kill + "money-2689" + ) + (0 + kill + "money-2690" + ) + (0 + kill + "farmer-3" + ) + (0 + kill + "villagea-part-26" + ) + (0 + kill + "money-2692" + ) + (0 + kill + "villagea-part-37" + ) + (0 + kill + "villagea-part-38" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "crate-3142" + ) + (0 + kill + "crate-3143" + ) + (0 + kill + "money-2688" + ) + (0 + kill + "villagea-part-14" + ) + (0 + kill + "money-2691" + ) + (0 + kill + "villagea-part-62" + ) + (0 + kill + "villagea-part-63" + ) + (0 + kill + "sharkey-1" + ) + (0 + kill + "eco-82" + ) + (0 + kill + "eco-83" + ) + (0 + kill + "crate-2470" + ) + (0 + kill + "villagea-part-3" + ) + (0 + kill + "villagea-part-15" + ) + (0 + kill + "villagea-part-22" + ) + (0 + kill + "villagea-part-28" + ) + (0 + kill + "explorer-4" + ) + (0 + kill + "oracle-1" + ) + (0 + kill + "crate-3141" + ) + (0 + kill + "crate-3145" + ) + (0 + kill + "water-vol-8" + ) + (0 + kill + "water-vol-63" + ) + (0 + kill + "lrocklrg-1" + ) + (0 + kill + "crate-2469" + ) + (0 kill "villagea-part-69") (0 display-level beach special) + ) + ) + ) + ((closed? + (-> obj tasks) + (game-task village1-mayor-money) + (task-status need-reward-speech) + ) + (new 'static 'spool-anim + :name "mayor-reminder-beams" + :index 5 + :parts 3 + :command-list + '( + (0 + kill + "villagea-part-65" + ) + (0 + kill + "villagea-part-70" + ) + (0 + kill + "med-res-level-2" + ) + (0 + kill + "med-res-level-3" + ) + (0 + kill + "med-res-level-4" + ) + (0 + kill + "med-res-level-6" + ) + (0 + kill + "med-res-level-7" + ) + (0 + kill + "med-res-level-8" + ) + (0 + kill + "med-res-level-11" + ) + (0 + kill + "med-res-level-14" + ) + (0 + kill + "fishermans-boat-2" + ) + (0 + kill + "windspinner-9" + ) + (0 + kill + "sagesail-6" + ) + (0 + kill + "sharkey-12" + ) + (0 + kill + "windmill-sail-4" + ) + (0 + kill + "water-vol-7" + ) + (0 + kill + "windspinner-8" + ) + (0 + kill + "villagea-part-32" + ) + (0 + kill + "water-vol-10" + ) + (0 + kill + "ropebridge-4" + ) + (0 + kill + "ropebridge-5" + ) + (0 + kill + "reflector-end-1" + ) + (0 + kill + "eco-10" + ) + (0 + kill + "eco-11" + ) + (0 + kill + "warp-gate-switch-3" + ) + (0 + kill + "reflector-middle-2" + ) + (0 + kill + "evilplant-2" + ) + (0 + kill + "crate-3147" + ) + (0 + kill + "villagea-water-2" + ) + (0 + kill + "med-res-level-22" + ) + (0 + kill + "med-res-level-23" + ) + (0 + kill + "villagea-part-50" + ) + (0 + kill + "water-vol-9" + ) + (0 + kill + "crate-3144" + ) + (0 + kill + "orb-cache-top-4" + ) + (0 + kill + "village-cam-2" + ) + (0 + kill + "villagea-part-18" + ) + (0 + kill + "villagea-part-24" + ) + (0 + kill + "money-2676" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "villagea-part-13" + ) + (0 + kill + "villagea-part-17" + ) + (0 + kill + "money-2689" + ) + (0 + kill + "money-2690" + ) + (0 + kill + "farmer-3" + ) + (0 + kill + "villagea-part-26" + ) + (0 + kill + "money-2692" + ) + (0 + kill + "villagea-part-37" + ) + (0 + kill + "villagea-part-38" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "crate-3142" + ) + (0 + kill + "crate-3143" + ) + (0 + kill + "money-2688" + ) + (0 + kill + "villagea-part-14" + ) + (0 + kill + "money-2691" + ) + (0 + kill + "villagea-part-62" + ) + (0 + kill + "villagea-part-63" + ) + (0 + kill + "sharkey-1" + ) + (0 + kill + "eco-82" + ) + (0 + kill + "eco-83" + ) + (0 + kill + "crate-2470" + ) + (0 + kill + "villagea-part-3" + ) + (0 + kill + "villagea-part-15" + ) + (0 + kill + "villagea-part-22" + ) + (0 + kill + "villagea-part-28" + ) + (0 + kill + "explorer-4" + ) + (0 + kill + "oracle-1" + ) + (0 + kill + "crate-3141" + ) + (0 + kill + "crate-3145" + ) + (0 + kill + "water-vol-8" + ) + (0 + kill + "water-vol-63" + ) + (0 + kill + "lrocklrg-1" + ) + (0 + kill + "crate-2469" + ) + (0 kill "villagea-part-69") (0 display-level beach special) + ) + ) + ) + ((zero? (get-reminder (-> obj tasks) 0)) + (if arg0 + (save-reminder (-> obj tasks) 1 0) + ) + (new 'static 'spool-anim + :name "mayor-reminder-beams" + :index 5 + :parts 3 + :command-list + '( + (0 + kill + "villagea-part-65" + ) + (0 + kill + "villagea-part-70" + ) + (0 + kill + "med-res-level-2" + ) + (0 + kill + "med-res-level-3" + ) + (0 + kill + "med-res-level-4" + ) + (0 + kill + "med-res-level-6" + ) + (0 + kill + "med-res-level-7" + ) + (0 + kill + "med-res-level-8" + ) + (0 + kill + "med-res-level-11" + ) + (0 + kill + "med-res-level-14" + ) + (0 + kill + "fishermans-boat-2" + ) + (0 + kill + "windspinner-9" + ) + (0 + kill + "sagesail-6" + ) + (0 + kill + "sharkey-12" + ) + (0 + kill + "windmill-sail-4" + ) + (0 + kill + "water-vol-7" + ) + (0 + kill + "windspinner-8" + ) + (0 + kill + "villagea-part-32" + ) + (0 + kill + "water-vol-10" + ) + (0 + kill + "ropebridge-4" + ) + (0 + kill + "ropebridge-5" + ) + (0 + kill + "reflector-end-1" + ) + (0 + kill + "eco-10" + ) + (0 + kill + "eco-11" + ) + (0 + kill + "warp-gate-switch-3" + ) + (0 + kill + "reflector-middle-2" + ) + (0 + kill + "evilplant-2" + ) + (0 + kill + "crate-3147" + ) + (0 + kill + "villagea-water-2" + ) + (0 + kill + "med-res-level-22" + ) + (0 + kill + "med-res-level-23" + ) + (0 + kill + "villagea-part-50" + ) + (0 + kill + "water-vol-9" + ) + (0 + kill + "crate-3144" + ) + (0 + kill + "orb-cache-top-4" + ) + (0 + kill + "village-cam-2" + ) + (0 + kill + "villagea-part-18" + ) + (0 + kill + "villagea-part-24" + ) + (0 + kill + "money-2676" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "villagea-part-13" + ) + (0 + kill + "villagea-part-17" + ) + (0 + kill + "money-2689" + ) + (0 + kill + "money-2690" + ) + (0 + kill + "farmer-3" + ) + (0 + kill + "villagea-part-26" + ) + (0 + kill + "money-2692" + ) + (0 + kill + "villagea-part-37" + ) + (0 + kill + "villagea-part-38" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "crate-3142" + ) + (0 + kill + "crate-3143" + ) + (0 + kill + "money-2688" + ) + (0 + kill + "villagea-part-14" + ) + (0 + kill + "money-2691" + ) + (0 + kill + "villagea-part-62" + ) + (0 + kill + "villagea-part-63" + ) + (0 + kill + "sharkey-1" + ) + (0 + kill + "eco-82" + ) + (0 + kill + "eco-83" + ) + (0 + kill + "crate-2470" + ) + (0 + kill + "villagea-part-3" + ) + (0 + kill + "villagea-part-15" + ) + (0 + kill + "villagea-part-22" + ) + (0 + kill + "villagea-part-28" + ) + (0 + kill + "explorer-4" + ) + (0 + kill + "oracle-1" + ) + (0 + kill + "crate-3141" + ) + (0 + kill + "crate-3145" + ) + (0 + kill + "water-vol-8" + ) + (0 + kill + "water-vol-63" + ) + (0 + kill + "lrocklrg-1" + ) + (0 + kill + "crate-2469" + ) + (0 kill "villagea-part-69") (0 display-level beach special) + ) + ) + ) + (else + (if arg0 + (save-reminder (-> obj tasks) 0 0) + ) + (new 'static 'spool-anim + :name "mayor-reminder-donation" + :index 6 + :parts 3 + :command-list + '( + (0 + kill + "villagea-part-65" + ) + (0 + kill + "villagea-part-70" + ) + (0 + kill + "med-res-level-2" + ) + (0 + kill + "med-res-level-3" + ) + (0 + kill + "med-res-level-4" + ) + (0 + kill + "med-res-level-6" + ) + (0 + kill + "med-res-level-7" + ) + (0 + kill + "med-res-level-8" + ) + (0 + kill + "med-res-level-11" + ) + (0 + kill + "med-res-level-14" + ) + (0 + kill + "fishermans-boat-2" + ) + (0 + kill + "windspinner-9" + ) + (0 + kill + "sagesail-6" + ) + (0 + kill + "sharkey-12" + ) + (0 + kill + "windmill-sail-4" + ) + (0 + kill + "water-vol-7" + ) + (0 + kill + "windspinner-8" + ) + (0 + kill + "villagea-part-32" + ) + (0 + kill + "water-vol-10" + ) + (0 + kill + "ropebridge-4" + ) + (0 + kill + "ropebridge-5" + ) + (0 + kill + "reflector-end-1" + ) + (0 + kill + "eco-10" + ) + (0 + kill + "eco-11" + ) + (0 + kill + "warp-gate-switch-3" + ) + (0 + kill + "reflector-middle-2" + ) + (0 + kill + "evilplant-2" + ) + (0 + kill + "crate-3147" + ) + (0 + kill + "villagea-water-2" + ) + (0 + kill + "med-res-level-22" + ) + (0 + kill + "med-res-level-23" + ) + (0 + kill + "villagea-part-50" + ) + (0 + kill + "water-vol-9" + ) + (0 + kill + "crate-3144" + ) + (0 + kill + "orb-cache-top-4" + ) + (0 + kill + "village-cam-2" + ) + (0 + kill + "villagea-part-18" + ) + (0 + kill + "villagea-part-24" + ) + (0 + kill + "money-2676" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "villagea-part-13" + ) + (0 + kill + "villagea-part-17" + ) + (0 + kill + "money-2689" + ) + (0 + kill + "money-2690" + ) + (0 + kill + "farmer-3" + ) + (0 + kill + "villagea-part-26" + ) + (0 + kill + "money-2692" + ) + (0 + kill + "villagea-part-37" + ) + (0 + kill + "villagea-part-38" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "crate-3142" + ) + (0 + kill + "crate-3143" + ) + (0 + kill + "money-2688" + ) + (0 + kill + "villagea-part-14" + ) + (0 + kill + "money-2691" + ) + (0 + kill + "villagea-part-62" + ) + (0 + kill + "villagea-part-63" + ) + (0 + kill + "sharkey-1" + ) + (0 + kill + "eco-82" + ) + (0 + kill + "eco-83" + ) + (0 + kill + "crate-2470" + ) + (0 + kill + "villagea-part-3" + ) + (0 + kill + "villagea-part-15" + ) + (0 + kill + "villagea-part-22" + ) + (0 + kill + "villagea-part-28" + ) + (0 + kill + "explorer-4" + ) + (0 + kill + "oracle-1" + ) + (0 + kill + "crate-3141" + ) + (0 + kill + "crate-3145" + ) + (0 + kill + "water-vol-8" + ) + (0 + kill + "water-vol-63" + ) + (0 + kill + "lrocklrg-1" + ) + (0 + kill + "crate-2469" + ) + (0 kill "villagea-part-69") (0 display-level beach special) + ) + ) + ) + ) + ) + ((6) + (if (not arg0) + (set! (-> obj will-talk) #t) + ) + (case (current-task (-> obj tasks)) + ((3) + (mayor-lurkerm-reward-speech obj arg0) + ) + (else + (cond + (arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + (let ((a1-15 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-15 from) pp) + (set! (-> a1-15 num-params) 2) + (set! (-> a1-15 message) 'get-pickup) + (set! (-> a1-15 param 0) (the-as uint 5)) + (set! + (-> a1-15 param 1) + (the-as uint (- (-> *GAME-bank* money-task-inc))) + ) + (send-event-function *target* a1-15) + ) + ) + (else + (set! (-> obj talk-message) (the-as uint 282)) + ) + ) + (new 'static 'spool-anim + :name "mayor-resolution-donation" + :index 8 + :parts 5 + :command-list + '( + (0 + kill + "villagea-part-65" + ) + (0 + kill + "villagea-part-70" + ) + (0 + kill + "med-res-level-2" + ) + (0 + kill + "med-res-level-3" + ) + (0 + kill + "med-res-level-4" + ) + (0 + kill + "med-res-level-6" + ) + (0 + kill + "med-res-level-7" + ) + (0 + kill + "med-res-level-8" + ) + (0 + kill + "med-res-level-11" + ) + (0 + kill + "med-res-level-14" + ) + (0 + kill + "fishermans-boat-2" + ) + (0 + kill + "windspinner-9" + ) + (0 + kill + "sagesail-6" + ) + (0 + kill + "sharkey-12" + ) + (0 + kill + "windmill-sail-4" + ) + (0 + kill + "water-vol-7" + ) + (0 + kill + "windspinner-8" + ) + (0 + kill + "villagea-part-32" + ) + (0 + kill + "water-vol-10" + ) + (0 + kill + "ropebridge-4" + ) + (0 + kill + "ropebridge-5" + ) + (0 + kill + "reflector-end-1" + ) + (0 + kill + "eco-10" + ) + (0 + kill + "eco-11" + ) + (0 + kill + "warp-gate-switch-3" + ) + (0 + kill + "reflector-middle-2" + ) + (0 + kill + "evilplant-2" + ) + (0 + kill + "crate-3147" + ) + (0 + kill + "villagea-water-2" + ) + (0 + kill + "med-res-level-22" + ) + (0 + kill + "med-res-level-23" + ) + (0 + kill + "villagea-part-50" + ) + (0 + kill + "water-vol-9" + ) + (0 + kill + "crate-3144" + ) + (0 + kill + "orb-cache-top-4" + ) + (0 + kill + "village-cam-2" + ) + (0 + kill + "villagea-part-18" + ) + (0 + kill + "villagea-part-24" + ) + (0 + kill + "money-2676" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "villagea-part-13" + ) + (0 + kill + "villagea-part-17" + ) + (0 + kill + "money-2689" + ) + (0 + kill + "money-2690" + ) + (0 + kill + "farmer-3" + ) + (0 + kill + "villagea-part-26" + ) + (0 + kill + "money-2692" + ) + (0 + kill + "villagea-part-37" + ) + (0 + kill + "villagea-part-38" + ) + (0 + kill + "villagea-part-64" + ) + (0 + kill + "crate-3142" + ) + (0 + kill + "crate-3143" + ) + (0 + kill + "money-2688" + ) + (0 + kill + "villagea-part-14" + ) + (0 + kill + "money-2691" + ) + (0 + kill + "villagea-part-62" + ) + (0 + kill + "villagea-part-63" + ) + (0 + kill + "sharkey-1" + ) + (0 + kill + "eco-82" + ) + (0 + kill + "eco-83" + ) + (0 + kill + "crate-2470" + ) + (0 + kill + "villagea-part-3" + ) + (0 + kill + "villagea-part-15" + ) + (0 + kill + "villagea-part-22" + ) + (0 + kill + "villagea-part-28" + ) + (0 + kill + "explorer-4" + ) + (0 + kill + "oracle-1" + ) + (0 + kill + "crate-3141" + ) + (0 + kill + "crate-3145" + ) + (0 + kill + "water-vol-8" + ) + (0 + kill + "water-vol-63" + ) + (0 + kill + "lrocklrg-1" + ) + (0 + kill + "crate-2469" + ) + (0 kill "villagea-part-69") (0 display-level beach special) + ) + ) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (-> obj draw art-group data 3) + ) + ) + ) + ) + +;; definition for method 31 of type mayor +(defmethod get-art-elem mayor ((obj mayor)) + (-> obj draw art-group data 3) + ) + +;; definition for method 39 of type mayor +(defmethod should-display? mayor ((obj mayor)) + (if *target* + (< (- (-> (target-pos 0) z) (-> obj root-override trans z)) 57344.0) + (< (- (-> (camera-pos) z) (-> obj root-override trans z)) 57344.0) + ) + ) + +;; definition for method 43 of type mayor +(defmethod TODO-RENAME-43 mayor ((obj mayor)) + (when + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 9000 + 122880.0 + obj + ) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f0-2 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.8888889 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task jungle-lurkerm) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "CHI-LO01" #f (-> obj root-override trans)) + ) + ) + ((< 0.7777778 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task jungle-lurkerm) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "CHI-LO02" #f (-> obj root-override trans)) + ) + ) + ((< 0.6666667 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task jungle-lurkerm) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "CHI-AM07" #f (-> obj root-override trans)) + ) + ) + ((< 0.5555556 f0-2) + (dummy-11 (-> obj ambient) "CHI-AM06" #f (-> obj root-override trans)) + ) + ((< 0.44444445 f0-2) + (dummy-11 (-> obj ambient) "CHI-AM05" #f (-> obj root-override trans)) + ) + ((< 0.33333334 f0-2) + (dummy-11 (-> obj ambient) "CHI-AM04" #f (-> obj root-override trans)) + ) + ((< 0.22222222 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task jungle-lurkerm) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "CHI-AM03" #f (-> obj root-override trans)) + ) + ) + ((< 0.11111111 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task jungle-lurkerm) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "CHI-AM02" #f (-> obj root-override trans)) + ) + ) + (else + (if + (not + (closed? + (-> obj tasks) + (game-task jungle-lurkerm) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "CHI-AM01" #f (-> obj root-override trans)) + ) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (mayor) + :virtual #t + :trans + (behavior () + (if (not (should-display? self)) + (go-virtual hidden) + ) + ((-> (method-of-type process-taskable idle) trans)) + (none) + ) + :post + (behavior () + (let ((t9-0 (-> (method-of-type process-taskable idle) post))) + (if t9-0 + (t9-0) + ) + ) + (dummy-45 (-> self root-override)) + (none) + ) + ) + +;; definition for method 11 of type mayor +(defmethod copy-defaults! mayor ((obj mayor) (arg0 res-lump)) + (dummy-40 + obj + arg0 + *mayor-sg* + 3 + 51 + (new 'static 'vector :y 4096.0 :w 4096.0) + 5 + ) + (set! (-> obj bounce-away) #f) + (set! (-> obj tasks) (get-task-control (game-task jungle-lurkerm))) + (set! (-> obj sound-flava) (the-as uint 8)) + (set! (-> obj draw light-index) (the-as uint 2)) + (dummy-42 obj) + (none) + ) diff --git a/test/decompiler/reference/levels/beach/sculptor_REF.gc b/test/decompiler/reference/levels/beach/sculptor_REF.gc new file mode 100644 index 000000000..cbff33029 --- /dev/null +++ b/test/decompiler/reference/levels/beach/sculptor_REF.gc @@ -0,0 +1,1201 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sculptor +(deftype sculptor (process-taskable) + ((muse handle :offset-assert 384) + ) + :heap-base #x120 + :method-count-assert 53 + :size-assert #x188 + :flag-assert #x3501200188 + ) + +;; definition for method 3 of type sculptor +(defmethod inspect sculptor ((obj sculptor)) + (let ((t9-0 (method-of-type process-taskable inspect))) + (t9-0 obj) + ) + (format #t "~T~Tmuse: ~D~%" (-> obj muse)) + obj + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "sculptor-muse" + :bounds (new 'static 'vector :w 10240.0) + :version #x6 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 2) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 4095996000.0) + (set! *sculptor-muse-sg* v1-1) + ) + +;; failed to figure out what this is: +(let + ((v1-2 + (new 'static 'skeleton-group + :art-group-name "sculptor" + :bounds (new 'static 'vector :w 10240.0) + :version #x6 + :shadow 2 + ) + ) + ) + (set! (-> v1-2 jgeo) 0) + (set! (-> v1-2 janim) 4) + (set! (-> v1-2 mgeo 0) (the-as uint 1)) + (set! (-> v1-2 lod-dist 0) 4095996000.0) + (set! *sculptor-sg* v1-2) + ) + +;; definition for method 52 of type sculptor +;; INFO: Return type mismatch int vs none. +(defmethod dummy-52 sculptor ((obj sculptor)) + (let ((v1-1 (-> obj draw shadow-ctrl))) + (when v1-1 + (let ((f0-0 (-> obj root trans y))) + (let ((a0-2 v1-1)) + (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) + ) + 0 + (set! (-> v1-1 settings top-plane w) (- (+ 2048.0 f0-0))) + ) + 0 + ) + ) + (none) + ) + +;; definition for method 48 of type sculptor +(defmethod draw-shadow sculptor ((obj sculptor)) + (-> obj draw shadow-ctrl) + (cond + ((and + (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (nonzero? (logand (-> obj draw status) 8)) + ) + (let ((v1-9 (-> obj draw shadow-ctrl))) + (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + ) + 0 + ((method-of-object (-> obj draw shadow-ctrl) dummy-14)) + ) + (else + (let ((v1-14 (-> obj draw shadow-ctrl))) + (logior! (-> v1-14 settings flags) 32) + ) + 0 + ) + ) + (none) + ) + +;; definition for function muse-to-idle +(defbehavior muse-to-idle sculptor ((arg0 muse)) + (when (not (handle->process (-> arg0 incomming-attack-id))) + (let* ((s5-0 (get-process *default-dead-pool* manipy #x4000)) + (v1-5 (when s5-0 + (let ((t9-1 (method-of-type manipy activate))) + (t9-1 + (the-as manipy s5-0) + arg0 + 'manipy + (the-as pointer #x70004000) + ) + ) + ((the-as + (function process function object object object object object) + run-function-in-process + ) + s5-0 + manipy-init + (-> arg0 collide-info trans) + (-> arg0 entity) + *sculptor-muse-sg* + #f + ) + (-> s5-0 ppointer) + ) + ) + ) + (set! + (-> arg0 incomming-attack-id) + (new 'static 'handle :process v1-5 :pid (-> v1-5 0 pid)) + ) + ) + ) + (let ((v1-11 (handle->process (-> arg0 incomming-attack-id)))) + (if v1-11 + (set! (-> (the-as muse v1-11) draw light-index) (the-as uint 3)) + ) + ) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) self) + (set! (-> a1-5 num-params) 1) + (set! (-> a1-5 message) 'anim-mode) + (set! (-> a1-5 param 0) (the-as uint 'loop)) + (send-event-function (handle->process (-> arg0 incomming-attack-id)) a1-5) + ) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) self) + (set! (-> a1-6 num-params) 2) + (set! (-> a1-6 message) 'art-joint-anim) + (set! (-> a1-6 param 0) (the-as uint "idle")) + (set! (-> a1-6 param 1) (the-as uint 0)) + (send-event-function (handle->process (-> arg0 incomming-attack-id)) a1-6) + ) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) self) + (set! (-> a1-7 num-params) 1) + (set! (-> a1-7 message) 'draw) + (set! (-> a1-7 param 0) (the-as uint #t)) + (send-event-function (handle->process (-> arg0 incomming-attack-id)) a1-7) + ) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) self) + (set! (-> a1-8 num-params) 1) + (set! (-> a1-8 message) 'origin-joint-index) + (set! (-> a1-8 param 0) (the-as uint 26)) + (send-event-function (handle->process (-> arg0 incomming-attack-id)) a1-8) + ) + ) + +;; failed to figure out what this is: +(defstate give-cell (sculptor) + :virtual #t + :enter + (behavior () + (muse-to-idle (the-as muse self)) + (none) + ) + ) + +;; definition for method 32 of type sculptor +(defmethod play-anim! sculptor ((obj sculptor) (arg0 symbol)) + (with-pp + (case (current-status (-> obj tasks)) + ((2 3) + (if arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "sculptor-introduction" + :index 16 + :parts 14 + :command-list + '( + (0 + display-level + beach + special + ) + (0 + kill + "med-res-level-2" + ) + (0 + kill + "med-res-level-4" + ) + (0 + kill + "med-res-level-6" + ) + (0 + kill + "med-res-level-7" + ) + (0 + kill + "med-res-level-8" + ) + (0 + kill + "med-res-level-11" + ) + (0 + kill + "med-res-level-14" + ) + (0 + kill + "med-res-level-22" + ) + (0 + kill + "med-res-level-23" + ) + ((the binteger 285) + joint + "cameraB" + ) + ((the binteger 331) + joint + "camera" + ) + ((the binteger 614) + joint + "cameraB" + ) + ((the binteger 760) + joint + "camera" + ) + ((the binteger 1183) + joint + "cameraB" + ) + ((the binteger 1278) + joint + "camera" + ) + ((the binteger 1433) joint "cameraB") + ) + ) + ) + ((5) + (set! (-> obj skippable) #t) + (new 'static 'spool-anim + :name "sculptor-reminder-1" + :index 17 + :parts 2 + :command-list '() + ) + ) + ((6) + (when arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + (let* ((s5-1 (get-process *default-dead-pool* manipy #x4000)) + (v1-12 (when s5-1 + (let ((t9-5 (method-of-type manipy activate))) + (t9-5 + (the-as manipy s5-1) + obj + 'manipy + (the-as pointer #x70004000) + ) + ) + ((the-as + (function process function object object object object object) + run-function-in-process + ) + s5-1 + manipy-init + (-> obj root trans) + (-> obj entity) + *sculptor-muse-sg* + #f + ) + (-> s5-1 ppointer) + ) + ) + ) + (set! + (-> obj muse) + (new 'static 'handle :process v1-12 :pid (-> v1-12 0 pid)) + ) + ) + (let ((v1-18 (handle->process (-> obj muse)))) + (if v1-18 + (set! (-> (the-as muse v1-18) draw light-index) (the-as uint 3)) + ) + ) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) pp) + (set! (-> a1-8 num-params) 1) + (set! (-> a1-8 message) 'center-joint) + (set! (-> a1-8 param 0) (the-as uint 4)) + (send-event-function (handle->process (-> obj muse)) a1-8) + ) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) pp) + (set! (-> a1-9 num-params) 1) + (set! (-> a1-9 message) 'anim-mode) + (set! (-> a1-9 param 0) (the-as uint 'clone-anim)) + (send-event-function (handle->process (-> obj muse)) a1-9) + ) + ) + (new 'static 'spool-anim + :name "sculptor-resolution" + :index 18 + :parts 4 + :command-list + '( + ((the binteger 51) joint "cameraB") ((the binteger 87) joint "camera") + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (-> obj draw art-group data 4) + ) + ) + ) + ) + +;; definition for method 31 of type sculptor +(defmethod get-art-elem sculptor ((obj sculptor)) + (let ((v1-1 (current-status (-> obj tasks)))) + (if (or (zero? v1-1) (= v1-1 7)) + (-> obj draw art-group data 11) + (-> obj draw art-group data 3) + ) + ) + ) + +;; definition for method 43 of type sculptor +(defmethod TODO-RENAME-43 sculptor ((obj sculptor)) + (when + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 9000 + 122880.0 + obj + ) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f0-2 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.85714287 f0-2) + (dummy-11 (-> obj ambient) "SCU-LO01" #f (-> obj root trans)) + ) + ((< 0.71428573 f0-2) + (dummy-11 (-> obj ambient) "SCU-AM05" #f (-> obj root trans)) + ) + ((< 0.5714286 f0-2) + (dummy-11 (-> obj ambient) "SCU-AM06" #f (-> obj root trans)) + ) + ((< 0.42857143 f0-2) + (dummy-11 (-> obj ambient) "SCU-AM03" #f (-> obj root trans)) + ) + ((< 0.2857143 f0-2) + (dummy-11 (-> obj ambient) "SCU-AM04" #f (-> obj root trans)) + ) + ((< 0.14285715 f0-2) + (dummy-11 (-> obj ambient) "SCU-AM01" #f (-> obj root trans)) + ) + (else + (dummy-11 (-> obj ambient) "SCU-AM02" #f (-> obj root trans)) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (sculptor) + :virtual #t + :code + (behavior () + (when (!= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (get-art-elem self) + ) + (ja-channel-push! 1 60) + (let ((gp-0 (-> self skel root-channel 0))) + (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) + ) + ) + (let ((a0-8 (-> self skel root-channel 0))) + (set! + (-> a0-8 param 0) + (the float (+ (-> a0-8 frame-group data 0 length) -1)) + ) + (set! (-> a0-8 param 1) 1.0) + (joint-control-channel-group! + a0-8 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (let ((v1-16 (current-status (-> self tasks)))) + (when (or (zero? v1-16) (= v1-16 7)) + (let ((a0-12 (-> self skel root-channel 0))) + (set! + (-> a0-12 frame-group) + (the-as art-joint-anim (-> self draw art-group data 12)) + ) + (set! + (-> a0-12 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 12)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-12 param 1) 1.0) + (set! (-> a0-12 frame-num) 0.0) + (joint-control-channel-group! + a0-12 + (the-as art-joint-anim (-> self draw art-group data 12)) + num-func-seek! + ) + ) + (until (ja-done? 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! + ) + ) + ) + (muse-to-idle (the-as muse self)) + ) + ) + (while #t + (let ((v1-43 (current-status (-> self tasks)))) + (cond + ((or (zero? v1-43) (= v1-43 7)) + (let ((a0-18 (-> self skel root-channel 0))) + (set! + (-> a0-18 frame-group) + (the-as art-joint-anim (-> self draw art-group data 8)) + ) + (set! + (-> a0-18 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 8)) + 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 8)) + 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! + ) + ) + ) + (let* ((f30-0 4.0) + (v1-68 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-69 (the-as number (logior #x3f800000 v1-68))) + ) + (countdown + (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-69)))) 4)) + (let ((a0-23 (-> self skel root-channel 0))) + (set! + (-> a0-23 frame-group) + (the-as art-joint-anim (-> self draw art-group data 9)) + ) + (set! + (-> a0-23 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 9)) + 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 9)) + 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! + ) + ) + ) + ) + ) + (let* ((v1-97 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-98 (the-as number (logior #x3f800000 v1-97))) + (f30-1 (+ -1.0 (the-as float v1-98))) + ) + (let ((a0-28 (-> self skel root-channel 0))) + (set! + (-> a0-28 frame-group) + (the-as art-joint-anim (-> self draw art-group data 10)) + ) + (set! + (-> a0-28 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 10)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-28 param 1) 1.0) + (set! (-> a0-28 frame-num) 0.0) + (joint-control-channel-group! + a0-28 + (the-as art-joint-anim (-> self draw art-group data 10)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-29 (-> self skel root-channel 0))) + (set! + (-> a0-29 param 0) + (the float (+ (-> a0-29 frame-group data 0 length) -1)) + ) + (set! (-> a0-29 param 1) 1.0) + (joint-control-channel-group-eval! + a0-29 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((a0-31 (-> self skel root-channel 0))) + (set! + (-> a0-31 frame-group) + (the-as art-joint-anim (-> self draw art-group data 11)) + ) + (set! + (-> a0-31 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 11)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-31 param 1) 1.0) + (set! (-> a0-31 frame-num) 0.0) + (joint-control-channel-group! + a0-31 + (the-as art-joint-anim (-> self draw art-group data 11)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-32 (-> self skel root-channel 0))) + (set! + (-> a0-32 param 0) + (the float (+ (-> a0-32 frame-group data 0 length) -1)) + ) + (set! (-> a0-32 param 1) 1.0) + (joint-control-channel-group-eval! + a0-32 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((a0-34 (-> self skel root-channel 0))) + (set! + (-> a0-34 frame-group) + (the-as art-joint-anim (-> self draw art-group data 12)) + ) + (set! + (-> a0-34 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 12)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-34 param 1) 1.0) + (set! (-> a0-34 frame-num) 0.0) + (joint-control-channel-group! + a0-34 + (the-as art-joint-anim (-> self draw art-group data 12)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-35 (-> self skel root-channel 0))) + (set! + (-> a0-35 param 0) + (the float (+ (-> a0-35 frame-group data 0 length) -1)) + ) + (set! (-> a0-35 param 1) 1.0) + (joint-control-channel-group-eval! + a0-35 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (when (< f30-1 0.5) + (let ((a0-37 (-> self skel root-channel 0))) + (set! + (-> a0-37 frame-group) + (the-as art-joint-anim (-> self draw art-group data 13)) + ) + (set! + (-> a0-37 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 13)) + 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 13)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-38 (-> self skel root-channel 0))) + (set! + (-> a0-38 param 0) + (the float (+ (-> a0-38 frame-group data 0 length) -1)) + ) + (set! (-> a0-38 param 1) 1.0) + (joint-control-channel-group-eval! + a0-38 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let* ((f30-2 2.0) + (v1-190 + (/ (the-as int (rand-uint31-gen *random-generator*)) 256) + ) + (v1-191 (the-as number (logior #x3f800000 v1-190))) + ) + (countdown + (gp-2 (+ (the int (* f30-2 (+ -1.0 (the-as float v1-191)))) 2)) + (let ((a0-42 (-> self skel root-channel 0))) + (set! + (-> a0-42 frame-group) + (the-as art-joint-anim (-> self draw art-group data 14)) + ) + (set! + (-> a0-42 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 14)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-42 param 1) 1.0) + (set! (-> a0-42 frame-num) 0.0) + (joint-control-channel-group! + a0-42 + (the-as art-joint-anim (-> self draw art-group data 14)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-43 (-> self skel root-channel 0))) + (set! + (-> a0-43 param 0) + (the float (+ (-> a0-43 frame-group data 0 length) -1)) + ) + (set! (-> a0-43 param 1) 1.0) + (joint-control-channel-group-eval! + a0-43 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + ) + (let ((a0-45 (-> self skel root-channel 0))) + (set! + (-> a0-45 frame-group) + (the-as art-joint-anim (-> self draw art-group data 15)) + ) + (set! + (-> a0-45 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 15)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-45 param 1) 1.0) + (set! (-> a0-45 frame-num) 0.0) + (joint-control-channel-group! + a0-45 + (the-as art-joint-anim (-> self draw art-group data 15)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-46 (-> self skel root-channel 0))) + (set! + (-> a0-46 param 0) + (the float (+ (-> a0-46 frame-group data 0 length) -1)) + ) + (set! (-> a0-46 param 1) 1.0) + (joint-control-channel-group-eval! + a0-46 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((a0-48 (-> self skel root-channel 0))) + (set! + (-> a0-48 frame-group) + (the-as art-joint-anim (-> self draw art-group data 11)) + ) + (set! + (-> a0-48 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 11)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-48 param 1) 1.0) + (set! (-> a0-48 frame-num) 0.0) + (joint-control-channel-group! + a0-48 + (the-as art-joint-anim (-> self draw art-group data 11)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-49 (-> self skel root-channel 0))) + (set! + (-> a0-49 param 0) + (the float (+ (-> a0-49 frame-group data 0 length) -1)) + ) + (set! (-> a0-49 param 1) 1.0) + (joint-control-channel-group-eval! + a0-49 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((a0-51 (-> self skel root-channel 0))) + (set! + (-> a0-51 frame-group) + (the-as art-joint-anim (-> self draw art-group data 12)) + ) + (set! + (-> a0-51 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 12)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-51 param 1) 1.0) + (set! (-> a0-51 frame-num) 0.0) + (joint-control-channel-group! + a0-51 + (the-as art-joint-anim (-> self draw art-group data 12)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-52 (-> self skel root-channel 0))) + (set! + (-> a0-52 param 0) + (the float (+ (-> a0-52 frame-group data 0 length) -1)) + ) + (set! (-> a0-52 param 1) 1.0) + (joint-control-channel-group-eval! + a0-52 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + ) + ) + ((begin + (TODO-RENAME-43 self) + (let* ((f30-3 4.0) + (v1-287 + (/ (the-as int (rand-uint31-gen *random-generator*)) 256) + ) + (v1-288 (the-as number (logior #x3f800000 v1-287))) + ) + (countdown + (gp-3 (+ (the int (* f30-3 (+ -1.0 (the-as float v1-288)))) 4)) + (let ((a0-57 (-> self skel root-channel 0))) + (set! + (-> a0-57 frame-group) + (the-as art-joint-anim (-> self draw art-group data 3)) + ) + (set! + (-> a0-57 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 3)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-57 param 1) 1.0) + (set! (-> a0-57 frame-num) 0.0) + (joint-control-channel-group! + a0-57 + (the-as art-joint-anim (-> self draw art-group data 3)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-58 (-> self skel root-channel 0))) + (set! + (-> a0-58 param 0) + (the float (+ (-> a0-58 frame-group data 0 length) -1)) + ) + (set! (-> a0-58 param 1) 1.0) + (joint-control-channel-group-eval! + a0-58 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + ) + (let* + ((v1-316 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-317 (the-as number (logior #x3f800000 v1-316))) + ) + (< (+ -1.0 (the-as float v1-317)) 0.5) + ) + ) + (let ((a0-62 (-> self skel root-channel 0))) + (set! + (-> a0-62 frame-group) + (the-as art-joint-anim (-> self draw art-group data 4)) + ) + (set! + (-> a0-62 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 4)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-62 param 1) 1.0) + (set! (-> a0-62 frame-num) 0.0) + (joint-control-channel-group! + a0-62 + (the-as art-joint-anim (-> self draw art-group data 4)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-63 (-> self skel root-channel 0))) + (set! + (-> a0-63 param 0) + (the float (+ (-> a0-63 frame-group data 0 length) -1)) + ) + (set! (-> a0-63 param 1) 1.0) + (joint-control-channel-group-eval! + a0-63 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + (else + (let ((a0-65 (-> self skel root-channel 0))) + (set! + (-> a0-65 frame-group) + (the-as art-joint-anim (-> self draw art-group data 5)) + ) + (set! + (-> a0-65 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 5)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-65 param 1) 1.0) + (set! (-> a0-65 frame-num) 0.0) + (joint-control-channel-group! + a0-65 + (the-as art-joint-anim (-> self draw art-group data 5)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-66 (-> self skel root-channel 0))) + (set! + (-> a0-66 param 0) + (the float (+ (-> a0-66 frame-group data 0 length) -1)) + ) + (set! (-> a0-66 param 1) 1.0) + (joint-control-channel-group-eval! + a0-66 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((a0-68 (-> self skel root-channel 0))) + (set! + (-> a0-68 frame-group) + (the-as art-joint-anim (-> self draw art-group data 6)) + ) + (set! + (-> a0-68 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 6)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-68 param 1) 1.0) + (set! (-> a0-68 frame-num) 0.0) + (joint-control-channel-group! + a0-68 + (the-as art-joint-anim (-> self draw art-group data 6)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-69 (-> self skel root-channel 0))) + (set! + (-> a0-69 param 0) + (the float (+ (-> a0-69 frame-group data 0 length) -1)) + ) + (set! (-> a0-69 param 1) 1.0) + (joint-control-channel-group-eval! + a0-69 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((a0-71 (-> self skel root-channel 0))) + (set! + (-> a0-71 frame-group) + (the-as art-joint-anim (-> self draw art-group data 7)) + ) + (set! + (-> a0-71 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 7)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-71 param 1) 1.0) + (set! (-> a0-71 frame-num) 0.0) + (joint-control-channel-group! + a0-71 + (the-as art-joint-anim (-> self draw art-group data 7)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-72 (-> self skel root-channel 0))) + (set! + (-> a0-72 param 0) + (the float (+ (-> a0-72 frame-group data 0 length) -1)) + ) + (set! (-> a0-72 param 1) 1.0) + (joint-control-channel-group-eval! + a0-72 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 11 of type sculptor +(defmethod copy-defaults! sculptor ((obj sculptor) (arg0 res-lump)) + (dummy-40 obj arg0 *sculptor-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> obj tasks) (get-task-control (game-task misty-muse))) + (set! (-> obj muse) (the-as handle #f)) + (set! (-> obj sound-flava) (the-as uint 9)) + (set! (-> obj draw light-index) (the-as uint 3)) + (dummy-42 obj) + (none) + ) diff --git a/test/decompiler/reference/levels/common/nav-enemy-h_REF.gc b/test/decompiler/reference/levels/common/nav-enemy-h_REF.gc index 3fbf0ef3c..252b2705a 100644 --- a/test/decompiler/reference/levels/common/nav-enemy-h_REF.gc +++ b/test/decompiler/reference/levels/common/nav-enemy-h_REF.gc @@ -162,7 +162,7 @@ (free-time uint64 :offset-assert 360) (touch-time uint64 :offset-assert 368) (nav-enemy-flags uint32 :offset-assert 376) - (incomming-attack-id uint64 :offset-assert 384) + (incomming-attack-id handle :offset-assert 384) (jump-return-state (state process) :offset-assert 392) (rand-gen random-generator :offset-assert 396) ) diff --git a/test/decompiler/reference/levels/common/nav-enemy_REF.gc b/test/decompiler/reference/levels/common/nav-enemy_REF.gc index b69685d77..4baf38cfb 100644 --- a/test/decompiler/reference/levels/common/nav-enemy_REF.gc +++ b/test/decompiler/reference/levels/common/nav-enemy_REF.gc @@ -3164,7 +3164,7 @@ nav-enemy-default-event-handler ) (logior! (-> obj nav flags) - (nav-control-flags bit0 display-marks bit3 bit5 bit6 bit7) + (nav-control-flags display-marks bit0 bit3 bit5 bit6 bit7) ) (set! (-> obj nav gap-event) 'jump) (dummy-26 (-> obj nav)) diff --git a/test/decompiler/reference/levels/village1/explorer_REF.gc b/test/decompiler/reference/levels/village1/explorer_REF.gc new file mode 100644 index 000000000..93dcab36f --- /dev/null +++ b/test/decompiler/reference/levels/village1/explorer_REF.gc @@ -0,0 +1,1041 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type explorer +(deftype explorer (process-taskable) + () + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + ) + +;; definition for method 3 of type explorer +(defmethod inspect explorer ((obj explorer)) + (let ((t9-0 (method-of-type process-taskable inspect))) + (t9-0 obj) + ) + obj + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "explorer" + :bounds (new 'static 'vector :w 10240.0) + :version #x6 + :shadow 2 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 3) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 4095996000.0) + (set! *explorer-sg* v1-1) + ) + +;; definition for method 52 of type explorer +;; INFO: Return type mismatch int vs none. +(defmethod dummy-52 explorer ((obj explorer)) + (let ((v1-1 (-> obj draw shadow-ctrl))) + (when v1-1 + (let ((f0-0 (-> obj root trans y))) + (let ((a0-2 v1-1)) + (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) + ) + 0 + (let ((a0-4 v1-1)) + (set! (-> a0-4 settings top-plane w) (- (+ 4096.0 f0-0))) + ) + ) + 0 + (set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags))) + ) + ) + (none) + ) + +;; definition for method 48 of type explorer +(defmethod draw-shadow explorer ((obj explorer)) + (-> obj draw shadow-ctrl) + (cond + ((and + (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (nonzero? (logand (-> obj draw status) 8)) + ) + (let ((v1-9 (-> obj draw shadow-ctrl))) + (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + ) + 0 + ((method-of-object (-> obj draw shadow-ctrl) dummy-14)) + ) + (else + (let ((v1-14 (-> obj draw shadow-ctrl))) + (logior! (-> v1-14 settings flags) 32) + ) + 0 + ) + ) + (none) + ) + +;; definition for method 32 of type explorer +(defmethod play-anim! explorer ((obj explorer) (arg0 symbol)) + (with-pp + (set! (-> obj talk-message) (the-as uint 260)) + (case (current-status (-> obj tasks)) + ((2 3) + (if arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "explorer-introduction" + :index 9 + :parts 11 + :command-list + '( + ((the binteger 418) + joint + "cameraB" + ) + ((the binteger 695) + shadow + self + #f + ) + ((the binteger 695) + joint + "camera" + ) + ((the binteger 838) + shadow + self + #t + ) + ((the binteger 838) joint "cameraB") + ) + ) + ) + ((5) + (set! (-> obj skippable) #t) + (cond + ((zero? (get-reminder (-> obj tasks) 0)) + (if arg0 + (save-reminder (-> obj tasks) 1 0) + ) + (new 'static 'spool-anim + :name "explorer-reminder-1" + :index 10 + :parts 5 + :command-list + '( + (0 + send-event + target + draw + #f + ) + ((the binteger 148) + send-event + target + draw + #t + ) + ((the binteger 148) + joint + "cameraB" + ) + ((the binteger 390) + send-event + target + draw + #f + ) + ((the binteger 390) + joint + "camera" + ) + ((the binteger 505) send-event target draw #t) + ) + ) + ) + (else + (if arg0 + (save-reminder (-> obj tasks) 0 0) + ) + (new 'static 'spool-anim + :name "explorer-reminder-2" + :index 11 + :parts 3 + :command-list '() + ) + ) + ) + ) + ((6) + (cond + (arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) pp) + (set! (-> a1-7 num-params) 2) + (set! (-> a1-7 message) 'get-pickup) + (set! (-> a1-7 param 0) (the-as uint 5)) + (set! + (-> a1-7 param 1) + (the-as uint (- (-> *GAME-bank* money-task-inc))) + ) + (send-event-function *target* a1-7) + ) + ) + (else + (set! (-> obj will-talk) #t) + (set! (-> obj talk-message) (the-as uint 282)) + ) + ) + (new 'static 'spool-anim + :name "explorer-resolution" + :index 12 + :parts 5 + :command-list + '( + ((the binteger 167) joint "cameraB") ((the binteger 310) joint "camera") + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (-> obj draw art-group data 3) + ) + ) + ) + ) + +;; definition for method 31 of type explorer +(defmethod get-art-elem explorer ((obj explorer)) + (-> obj draw art-group data 3) + ) + +;; definition for method 43 of type explorer +(defmethod TODO-RENAME-43 explorer ((obj explorer)) + (when + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 9000 + 122880.0 + obj + ) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f0-2 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.85714287 f0-2) + (dummy-11 (-> obj ambient) "EXP-AM05" #f (-> obj root trans)) + ) + ((< 0.71428573 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task village1-uncle-money) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "EXP-LO02" #f (-> obj root trans)) + ) + ) + ((< 0.5714286 f0-2) + (dummy-11 (-> obj ambient) "EXP-AM04" #f (-> obj root trans)) + ) + ((< 0.42857143 f0-2) + (dummy-11 (-> obj ambient) "EXP-AM03" #f (-> obj root trans)) + ) + ((< 0.2857143 f0-2) + (dummy-11 (-> obj ambient) "EXP-AM02" #f (-> obj root trans)) + ) + ((< 0.14285715 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task village1-uncle-money) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "EXP-AM01" #f (-> obj root trans)) + ) + ) + (else + (dummy-11 (-> obj ambient) "EXP-LO1A" #f (-> obj root trans)) + ) + ) + ) + ) + (none) + ) + +;; definition for method 47 of type explorer +;; INFO: Return type mismatch basic vs symbol. +(defmethod target-above-threshold? explorer ((obj explorer)) + (the-as + symbol + (and + *target* + (< (-> (target-pos 0) x) -202752.0) + (< 98304.0 (-> (target-pos 0) z)) + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (explorer) + :virtual #t + :code + (behavior () + (if (!= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 3) + ) + (ja-channel-push! 1 60) + ) + (while #t + (TODO-RENAME-43 self) + (let ((v1-9 (-> self skel root-channel 0))) + (set! + (-> v1-9 frame-group) + (the-as art-joint-anim (-> self draw art-group data 3)) + ) + ) + (let* ((f30-0 2.0) + (v1-11 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-12 (the-as number (logior #x3f800000 v1-11))) + ) + (countdown (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-12)))) 1)) + (let ((a0-12 (-> self skel root-channel 0))) + (set! + (-> a0-12 frame-group) + (the-as art-joint-anim (-> self draw art-group data 3)) + ) + (set! + (-> a0-12 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 3)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-12 param 1) 1.0) + (set! (-> a0-12 frame-num) 0.0) + (joint-control-channel-group! + a0-12 + (the-as art-joint-anim (-> self draw art-group data 3)) + num-func-seek! + ) + ) + (until (ja-done? 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! + ) + ) + ) + ) + ) + (let* ((v1-40 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-41 (the-as number (logior #x3f800000 v1-40))) + ) + (cond + ((< (+ -1.0 (the-as float v1-41)) 0.5) + (let ((a0-17 (-> self skel root-channel 0))) + (set! + (-> a0-17 frame-group) + (the-as art-joint-anim (-> self draw art-group data 4)) + ) + (set! + (-> a0-17 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 4)) + 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 4)) + 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! + ) + ) + ) + (let ((gp-1 (-> *display* base-frame-counter))) + (while (let* ((s5-0 (-> *display* base-frame-counter)) + (f30-1 300.0) + (f28-0 0.5) + (f26-0 0.5) + (v1-68 + (/ (the-as int (rand-uint31-gen *random-generator*)) 256) + ) + (v1-69 (the-as number (logior #x3f800000 v1-68))) + ) + (< + (the-as + int + (- + s5-0 + (the-as + uint + (the + int + (* f30-1 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-69))))) + ) + ) + ) + ) + (the-as int gp-1) + ) + ) + (suspend) + ) + ) + (let* ((v1-75 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-76 (the-as number (logior #x3f800000 v1-75))) + ) + (when (< (+ -1.0 (the-as float v1-76)) 0.75) + (let ((a0-24 (-> self skel root-channel 0))) + (set! + (-> a0-24 frame-group) + (the-as art-joint-anim (-> self draw art-group data 5)) + ) + (set! + (-> a0-24 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 5)) + 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 5)) + 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! + ) + ) + ) + (let ((gp-2 (-> *display* base-frame-counter))) + (while (let* ((s5-1 (-> *display* base-frame-counter)) + (f30-2 300.0) + (f28-1 0.5) + (f26-1 0.5) + (v1-104 + (/ + (the-as int (rand-uint31-gen *random-generator*)) + 256 + ) + ) + (v1-105 (the-as number (logior #x3f800000 v1-104))) + ) + (< + (the-as + int + (- + s5-1 + (the-as + uint + (the + int + (* + f30-2 + (+ f28-1 (* f26-1 (+ -1.0 (the-as float v1-105)))) + ) + ) + ) + ) + ) + (the-as int gp-2) + ) + ) + (suspend) + ) + ) + (let ((a0-29 (-> self skel root-channel 0))) + (set! (-> a0-29 frame-group) (if (> (-> self skel active-channels) 0) + (-> + self + skel + root-channel + 0 + frame-group + ) + ) + ) + (set! (-> a0-29 param 0) 0.0) + (set! (-> a0-29 param 1) 1.0) + (set! + (-> a0-29 frame-num) + (the float (+ (-> (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -1 + ) + ) + ) + (joint-control-channel-group! + a0-29 + (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-30 (-> self skel root-channel 0))) + (set! (-> a0-30 param 0) 0.0) + (set! (-> a0-30 param 1) 1.0) + (joint-control-channel-group-eval! + a0-30 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let* + ((v1-135 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-136 (the-as number (logior #x3f800000 v1-135))) + ) + (when (< (+ -1.0 (the-as float v1-136)) 0.5) + (let ((a0-34 (-> self skel root-channel 0))) + (set! + (-> a0-34 frame-group) + (the-as art-joint-anim (-> self draw art-group data 5)) + ) + (set! + (-> a0-34 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 5)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-34 param 1) 1.0) + (set! (-> a0-34 frame-num) 0.0) + (joint-control-channel-group! + a0-34 + (the-as art-joint-anim (-> self draw art-group data 5)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-35 (-> self skel root-channel 0))) + (set! + (-> a0-35 param 0) + (the float (+ (-> a0-35 frame-group data 0 length) -1)) + ) + (set! (-> a0-35 param 1) 1.0) + (joint-control-channel-group-eval! + a0-35 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((gp-3 (-> *display* base-frame-counter))) + (while (let* ((s5-2 (-> *display* base-frame-counter)) + (f30-3 300.0) + (f28-2 0.5) + (f26-2 0.5) + (v1-164 + (/ + (the-as int (rand-uint31-gen *random-generator*)) + 256 + ) + ) + (v1-165 (the-as number (logior #x3f800000 v1-164))) + ) + (< + (the-as + int + (- + s5-2 + (the-as + uint + (the + int + (* + f30-3 + (+ f28-2 (* f26-2 (+ -1.0 (the-as float v1-165)))) + ) + ) + ) + ) + ) + (the-as int gp-3) + ) + ) + (suspend) + ) + ) + (let ((a0-39 (-> self skel root-channel 0))) + (set! + (-> a0-39 frame-group) + (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-39 param 0) 0.0) + (set! (-> a0-39 param 1) 1.0) + (set! + (-> a0-39 frame-num) + (the float (+ (-> (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -1 + ) + ) + ) + (joint-control-channel-group! + a0-39 + (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-40 (-> self skel root-channel 0))) + (set! (-> a0-40 param 0) 0.0) + (set! (-> a0-40 param 1) 1.0) + (joint-control-channel-group-eval! + a0-40 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + ) + ) + ) + (let ((a0-42 (-> self skel root-channel 0))) + (set! + (-> a0-42 frame-group) + (the-as art-joint-anim (-> self draw art-group data 4)) + ) + (set! (-> a0-42 param 0) 0.0) + (set! (-> a0-42 param 1) 1.0) + (set! + (-> a0-42 frame-num) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 4)) + data + 0 + length + ) + -1 + ) + ) + ) + (joint-control-channel-group! + a0-42 + (the-as art-joint-anim (-> self draw art-group data 4)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-43 (-> self skel root-channel 0))) + (set! (-> a0-43 param 0) 0.0) + (set! (-> a0-43 param 1) 1.0) + (joint-control-channel-group-eval! + a0-43 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + (else + (let ((a0-45 (-> self skel root-channel 0))) + (set! + (-> a0-45 frame-group) + (the-as art-joint-anim (-> self draw art-group data 6)) + ) + (set! + (-> a0-45 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 6)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-45 param 1) 1.0) + (set! (-> a0-45 frame-num) 0.0) + (joint-control-channel-group! + a0-45 + (the-as art-joint-anim (-> self draw art-group data 6)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-46 (-> self skel root-channel 0))) + (set! + (-> a0-46 param 0) + (the float (+ (-> a0-46 frame-group data 0 length) -1)) + ) + (set! (-> a0-46 param 1) 1.0) + (joint-control-channel-group-eval! + a0-46 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((gp-4 (-> *display* base-frame-counter))) + (while (let* ((s5-3 (-> *display* base-frame-counter)) + (f30-4 300.0) + (f28-3 0.5) + (f26-3 0.5) + (v1-237 + (/ (the-as int (rand-uint31-gen *random-generator*)) 256) + ) + (v1-238 (the-as number (logior #x3f800000 v1-237))) + ) + (< + (the-as + int + (- + s5-3 + (the-as + uint + (the + int + (* + f30-4 + (+ f28-3 (* f26-3 (+ -1.0 (the-as float v1-238)))) + ) + ) + ) + ) + ) + (the-as int gp-4) + ) + ) + (suspend) + ) + ) + (let ((a0-50 (-> self skel root-channel 0))) + (set! + (-> a0-50 frame-group) + (the-as art-joint-anim (-> self draw art-group data 7)) + ) + (set! + (-> a0-50 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 7)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-50 param 1) 1.0) + (set! (-> a0-50 frame-num) 0.0) + (joint-control-channel-group! + a0-50 + (the-as art-joint-anim (-> self draw art-group data 7)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-51 (-> self skel root-channel 0))) + (set! + (-> a0-51 param 0) + (the float (+ (-> a0-51 frame-group data 0 length) -1)) + ) + (set! (-> a0-51 param 1) 1.0) + (joint-control-channel-group-eval! + a0-51 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((gp-5 (-> *display* base-frame-counter))) + (while (let* ((s5-4 (-> *display* base-frame-counter)) + (f30-5 300.0) + (f28-4 0.5) + (f26-4 0.5) + (v1-268 + (/ (the-as int (rand-uint31-gen *random-generator*)) 256) + ) + (v1-269 (the-as number (logior #x3f800000 v1-268))) + ) + (< + (the-as + int + (- + s5-4 + (the-as + uint + (the + int + (* + f30-5 + (+ f28-4 (* f26-4 (+ -1.0 (the-as float v1-269)))) + ) + ) + ) + ) + ) + (the-as int gp-5) + ) + ) + (suspend) + ) + ) + (let ((a0-55 (-> self skel root-channel 0))) + (set! (-> a0-55 frame-group) (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-55 param 0) 0.0) + (set! (-> a0-55 param 1) 1.0) + (set! + (-> a0-55 frame-num) + (the float (+ (-> (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -1 + ) + ) + ) + (joint-control-channel-group! + a0-55 + (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-56 (-> self skel root-channel 0))) + (set! (-> a0-56 param 0) 0.0) + (set! (-> a0-56 param 1) 1.0) + (joint-control-channel-group-eval! + a0-56 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((gp-6 (-> *display* base-frame-counter))) + (while (let* ((s5-5 (-> *display* base-frame-counter)) + (f30-6 300.0) + (f28-5 0.5) + (f26-5 0.5) + (v1-301 + (/ (the-as int (rand-uint31-gen *random-generator*)) 256) + ) + (v1-302 (the-as number (logior #x3f800000 v1-301))) + ) + (< + (the-as + int + (- + s5-5 + (the-as + uint + (the + int + (* + f30-6 + (+ f28-5 (* f26-5 (+ -1.0 (the-as float v1-302)))) + ) + ) + ) + ) + ) + (the-as int gp-6) + ) + ) + (suspend) + ) + ) + (let ((a0-60 (-> self skel root-channel 0))) + (set! + (-> a0-60 frame-group) + (the-as art-joint-anim (-> self draw art-group data 8)) + ) + (set! + (-> a0-60 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 8)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-60 param 1) 1.0) + (set! (-> a0-60 frame-num) 0.0) + (joint-control-channel-group! + a0-60 + (the-as art-joint-anim (-> self draw art-group data 8)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-61 (-> self skel root-channel 0))) + (set! + (-> a0-61 param 0) + (the float (+ (-> a0-61 frame-group data 0 length) -1)) + ) + (set! (-> a0-61 param 1) 1.0) + (joint-control-channel-group-eval! + a0-61 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 11 of type explorer +(defmethod copy-defaults! explorer ((obj explorer) (arg0 res-lump)) + (dummy-40 obj arg0 *explorer-sg* 3 42 (new 'static 'vector :w 4096.0) 5) + (set! (-> obj tasks) (get-task-control (game-task village1-uncle-money))) + (set! (-> obj sound-flava) (the-as uint 10)) + (set! (-> obj draw light-index) (the-as uint 5)) + (dummy-42 obj) + (none) + ) diff --git a/test/decompiler/reference/levels/village1/farmer_REF.gc b/test/decompiler/reference/levels/village1/farmer_REF.gc new file mode 100644 index 000000000..58df956a3 --- /dev/null +++ b/test/decompiler/reference/levels/village1/farmer_REF.gc @@ -0,0 +1,204 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type farmer +(deftype farmer (process-taskable) + () + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + ) + +;; definition for method 3 of type farmer +(defmethod inspect farmer ((obj farmer)) + (let ((t9-0 (method-of-type process-taskable inspect))) + (t9-0 obj) + ) + obj + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "farmer" + :bounds (new 'static 'vector :w 16384.0) + :max-lod 1 + :version #x6 + :shadow 3 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 4) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 81920.0) + (set! (-> v1-1 mgeo 1) (the-as uint 2)) + (set! (-> v1-1 lod-dist 1) 4095996000.0) + (set! *farmer-sg* v1-1) + ) + +;; definition for method 32 of type farmer +(defmethod play-anim! farmer ((obj farmer) (arg0 symbol)) + (case (current-status (-> obj tasks)) + ((2 3) + (if arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "farmer-introduction" + :index 6 + :parts 5 + :command-list '() + ) + ) + ((5) + (set! (-> obj skippable) #t) + (cond + ((zero? (get-reminder (-> obj tasks) 0)) + (if arg0 + (save-reminder (-> obj tasks) 1 0) + ) + (new 'static 'spool-anim + :name "farmer-reminder-1" + :index 7 + :parts 2 + :command-list '() + ) + ) + (else + (if arg0 + (save-reminder (-> obj tasks) 0 0) + ) + (new 'static 'spool-anim + :name "farmer-reminder-2" + :index 8 + :parts 2 + :command-list '() + ) + ) + ) + ) + ((6) + (when arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + ) + (new 'static 'spool-anim + :name "farmer-resolution" + :index 9 + :parts 4 + :command-list '() + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (the-as task-status (current-status (-> obj tasks)))) + ) + ) + (-> obj draw art-group data 4) + ) + ) + ) + +;; definition for method 31 of type farmer +(defmethod get-art-elem farmer ((obj farmer)) + (let ((v1-1 (current-status (-> obj tasks)))) + (if (or (= v1-1 2) (= v1-1 3) (= v1-1 7) (zero? v1-1)) + (-> obj draw art-group data 4) + (-> obj draw art-group data 5) + ) + ) + ) + +;; definition for method 43 of type farmer +(defmethod TODO-RENAME-43 farmer ((obj farmer)) + (when + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 9000 + 122880.0 + obj + ) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f0-2 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.8333333 f0-2) + (dummy-11 (-> obj ambient) "FAR-LO1A" #f (-> obj root trans)) + ) + ((< 0.6666667 f0-2) + (dummy-11 (-> obj ambient) "FAR-AM01" #f (-> obj root trans)) + ) + ((< 0.5 f0-2) + ) + ((< 0.33333334 f0-2) + (dummy-11 (-> obj ambient) "FAR-AM2A" #f (-> obj root trans)) + ) + ((< 0.16666667 f0-2) + (dummy-11 (-> obj ambient) "FAR-AM02" #f (-> obj root trans)) + ) + (else + ) + ) + ) + ) + (none) + ) + +;; definition for method 41 of type farmer +;; INFO: Return type mismatch int vs none. +(defmethod initialize-collision farmer ((obj farmer) (arg0 int)) + (let + ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s4-0 prim-core collide-as) (the-as uint 256)) + (set! (-> s4-0 collide-with) (the-as uint 16)) + (set! (-> s4-0 prim-core action) (the-as uint 1)) + (set! (-> s4-0 prim-core offense) 4) + (set-vector! (-> s4-0 local-sphere) 4096.0 8192.0 -4096.0 12288.0) + ((method-of-object s5-0 dummy-46)) + (let ((s3-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> s3-0 prim-core collide-as) (the-as uint 256)) + (set! (-> s3-0 collide-with) (the-as uint 16)) + (set! (-> s3-0 prim-core action) (the-as uint 1)) + (set! (-> s3-0 prim-core offense) 4) + (set-vector! (-> s3-0 local-sphere) 4096.0 6144.0 -4096.0 8192.0) + ) + ((method-of-object s4-0 dummy-28)) + (let ((s3-1 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> s3-1 prim-core collide-as) (the-as uint 256)) + (set! (-> s3-1 collide-with) (the-as uint 16)) + (set! (-> s3-1 prim-core action) (the-as uint 1)) + (set! (-> s3-1 prim-core offense) 4) + (set-vector! (-> s3-1 local-sphere) 4096.0 10240.0 -4096.0 8192.0) + ) + ((method-of-object s4-0 dummy-28)) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + ((method-of-object s5-0 dummy-50)) + (set! (-> obj root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type farmer +(defmethod copy-defaults! farmer ((obj farmer) (arg0 res-lump)) + (dummy-40 obj arg0 *farmer-sg* 3 25 (new 'static 'vector :w 4096.0) 5) + (set! (-> obj root nav-radius) 40960.0) + (nav-mesh-connect obj (-> obj root) (the-as nav-control #f)) + (set! (-> obj tasks) (get-task-control (game-task village1-yakow))) + (dummy-42 obj) + (none) + ) diff --git a/test/decompiler/reference/levels/village1/sage_REF.gc b/test/decompiler/reference/levels/village1/sage_REF.gc new file mode 100644 index 000000000..8b2f0f13a --- /dev/null +++ b/test/decompiler/reference/levels/village1/sage_REF.gc @@ -0,0 +1,1397 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sage +(deftype sage (process-taskable) + ((reminder-played basic :offset-assert 380) + (assistant handle :offset-assert 384) + ) + :heap-base #x120 + :method-count-assert 53 + :size-assert #x188 + :flag-assert #x3501200188 + ) + +;; definition for method 3 of type sage +(defmethod inspect sage ((obj sage)) + (let ((t9-0 (method-of-type process-taskable inspect))) + (t9-0 obj) + ) + (format #t "~T~Treminder-played: ~A~%" (-> obj reminder-played)) + (format #t "~T~Tassistant: ~D~%" (-> obj assistant)) + obj + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "sage" + :bounds (new 'static 'vector :w 10240.0) + :version #x6 + :shadow 2 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 4) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 4095996000.0) + (set! *sage-sg* v1-1) + ) + +;; definition for method 32 of type sage +(defmethod play-anim! sage ((obj sage) (arg0 symbol)) + (with-pp + (when (!= *kernel-boot-message* 'play) + (close-specific-task! (game-task intro) (task-status need-resolution)) + (return + (new 'static 'spool-anim + :name "sage-introduction-misty-cannon" + :index 8 + :parts 12 + :command-list + '( + ((the binteger 1) + blackout + 0 + ) + ((the binteger 100) + want-levels + village1 + misty + ) + ((the binteger 261) + joint + "cameraB" + ) + ((the binteger 521) + joint + "camera" + ) + ((the binteger 776) + joint + "cameraB" + ) + ((the binteger 810) + joint + "camera" + ) + ((the binteger 1171) + joint + "cameraB" + ) + ((the binteger 1235) + joint + "camera" + ) + ((the binteger 1235) + save + ) + ((the binteger 1418) blackout (the binteger 30)) + ) + ) + ) + ) + (case (current-status (-> obj tasks)) + ((2 3) + (case (current-task (-> obj tasks)) + ((109) + (when arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + (set-setting! *setting-control* pp 'music-volume-movie 'abs 0.0 0) + (copy-settings-from-target! *setting-control*) + ) + (new 'static 'spool-anim + :name "sage-intro-sequence-d1" + :index 16 + :parts 17 + :command-list + '( + (0 + display-level + misty + #f + ) + (0 + display-level + village1 + display + ) + (0 + want-vis + vi1 + ) + (0 + save + ) + (0 + want-force-inside + village1 + #t + ) + (0 + want-force-vis + village1 + #t + ) + (0 + kill + "assistant-11" + ) + (0 + kill + "reflector-middle-2" + ) + (0 + kill + "eco-11" + ) + (0 + kill + "eco-10" + ) + (0 + kill + "sharkey-12" + ) + (0 + kill + "reflector-end-1" + ) + (0 + kill + "water-vol-10" + ) + (0 + kill + "water-vol-8" + ) + (0 + kill + "water-vol-7" + ) + (0 + kill + "fishermans-boat-2" + ) + (0 + kill + "revcycleprop-2" + ) + (0 + kill + "revcycle-8" + ) + (0 + kill + "ropebridge-5" + ) + (0 + kill + "ropebridge-4" + ) + (0 + kill + "villagea-water-2" + ) + (0 + time-of-day + (the binteger 7) + ) + ((the binteger 1) + time-of-day + (the binteger -1) + ) + ((the binteger 3) + blackout + 0 + ) + ((the binteger 25) + blackout + 0 + ) + ((the binteger 25) + want-force-vis + village1 + #f + ) + ((the binteger 56) + joint + "cameraB" + ) + ((the binteger 100) + want-force-inside + village1 + #f + ) + ((the binteger 107) + joint + "camera" + ) + ((the binteger 137) + joint + "cameraB" + ) + ((the binteger 202) + joint + "camera" + ) + ((the binteger 286) + joint + "cameraB" + ) + ((the binteger 554) + joint + "camera" + ) + ((the binteger 633) + joint + "cameraB" + ) + ((the binteger 711) + joint + "camera" + ) + ((the binteger 796) + joint + "cameraB" + ) + ((the binteger 921) + joint + "camera" + ) + ((the binteger 1021) + shadow + self + #f + ) + ((the binteger 1021) + joint + "cameraB" + ) + ((the binteger 1081) + joint + "camera" + ) + ((the binteger 1183) + joint + "cameraB" + ) + ((the binteger 1221) + joint + "camera" + ) + ((the binteger 1496) + shadow + self + #t + ) + ((the binteger 1496) + joint + "cameraB" + ) + ((the binteger 1496) + time-of-day + (the binteger 18) + ) + ((the binteger 1721) + joint + "camera" + ) + ((the binteger 1721) + time-of-day + (the binteger 7) + ) + ((the binteger 1722) time-of-day (the binteger -1)) + ) + ) + ) + ((15) + (when arg0 + (let* ((s5-1 (-> obj tasks)) + (s4-0 (method-of-object s5-1 save-reminder)) + (a1-6 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-6 from) pp) + (set! (-> a1-6 num-params) 2) + (set! (-> a1-6 message) 'query) + (set! (-> a1-6 param 0) (the-as uint 'pickup)) + (set! (-> a1-6 param 1) (the-as uint 6)) + (s4-0 + s5-1 + (the int (the-as float (send-event-function *target* a1-6))) + 1 + ) + ) + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "sage-intro-sequence-e" + :index 14 + :parts 13 + :command-list + '( + (0 + want-levels + village1 + beach + ) + (0 + blackout + 0 + ) + ((the binteger 197) + joint + "cameraB" + ) + ((the binteger 361) + joint + "camera" + ) + ((the binteger 660) + joint + "cameraB" + ) + ((the binteger 937) + display-level + beach + movie + ) + ((the binteger 937) + want-force-vis + beach + #t + ) + ((the binteger 938) + alive + "ecoventrock-3" + ) + ((the binteger 938) + alive + "ecoventrock-4" + ) + ((the binteger 938) + alive + "ecoventrock-5" + ) + ((the binteger 938) + alive + "ecoventrock-6" + ) + ((the binteger 938) + alive + "ecoventrock-7" + ) + ((the binteger 938) + alive + "harvester-87" + ) + ((the binteger 938) + alive + "harvester-88" + ) + ((the binteger 938) + alive + "harvester-89" + ) + ((the binteger 938) + alive + "harvester-90" + ) + ((the binteger 938) + alive + "harvester-91" + ) + ((the binteger 940) + joint + "camera" + ) + ((the binteger 1160) + joint + "cameraB" + ) + ((the binteger 1162) + dead + "ecoventrock-3" + ) + ((the binteger 1162) + dead + "ecoventrock-4" + ) + ((the binteger 1162) + dead + "ecoventrock-5" + ) + ((the binteger 1162) + dead + "ecoventrock-6" + ) + ((the binteger 1162) + dead + "ecoventrock-7" + ) + ((the binteger 1162) + dead + "harvester-87" + ) + ((the binteger 1162) + dead + "harvester-88" + ) + ((the binteger 1162) + dead + "harvester-89" + ) + ((the binteger 1162) + dead + "harvester-90" + ) + ((the binteger 1162) + dead + "harvester-91" + ) + ((the binteger 1310) + joint + "camera" + ) + ((the binteger 1313) + want-force-vis + beach + #f + ) + ((the binteger 1313) + display-level + beach + #f + ) + ((the binteger 1313) send-event "warp-gate-switch-3" 'hide) + ) + ) + ) + (else + (if arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "sage-introduction-misty-cannon" + :index 8 + :parts 12 + :command-list + '( + (0 + want-levels + village1 + beach + ) + ((the binteger 261) + joint + "cameraB" + ) + ((the binteger 521) + joint + "camera" + ) + ((the binteger 776) + joint + "cameraB" + ) + ((the binteger 810) + joint + "camera" + ) + ((the binteger 1171) + joint + "cameraB" + ) + ((the binteger 1235) joint "camera") + ) + ) + ) + ) + ) + ((5) + (set! (-> obj skippable) #t) + (if arg0 + (set! (-> obj reminder-played) #t) + ) + (case (get-reminder (-> obj tasks) 0) + ((3) + (new 'static 'spool-anim + :name "sage-reminder-2-generic" + :index 13 + :parts 4 + :command-list '() + ) + ) + ((2) + (new 'static 'spool-anim + :name "sage-reminder-1-generic" + :index 12 + :parts 3 + :command-list '() + ) + ) + ((1) + (new 'static 'spool-anim + :name "sage-reminder-1-misty-cannon" + :index 9 + :parts 5 + :command-list + '( + ((the binteger 86) joint "cameraB") ((the binteger 320) joint "camera") + ) + ) + ) + (else + (new 'static 'spool-anim + :name "sage-reminder-1-ecorocks" + :index 11 + :parts 4 + :command-list + '( + (0 + want-levels + village1 + beach + ) + ((the binteger 245) + display-level + beach + movie + ) + ((the binteger 245) + want-force-vis + beach + #t + ) + ((the binteger 246) + alive + "ecoventrock-3" + ) + ((the binteger 246) + alive + "ecoventrock-4" + ) + ((the binteger 246) + alive + "ecoventrock-5" + ) + ((the binteger 246) + alive + "ecoventrock-6" + ) + ((the binteger 246) + alive + "ecoventrock-7" + ) + ((the binteger 246) + alive + "harvester-87" + ) + ((the binteger 246) + alive + "harvester-88" + ) + ((the binteger 246) + alive + "harvester-89" + ) + ((the binteger 246) + alive + "harvester-90" + ) + ((the binteger 246) + alive + "harvester-91" + ) + ((the binteger 246) + joint + "cameraB" + ) + ((the binteger 365) + want-force-vis + beach + #f + ) + ((the binteger 365) + display-level + beach + #f + ) + ((the binteger 366) joint "camera") + ) + ) + ) + ) + ) + ((6) + (when arg0 + (set-setting! *setting-control* pp 'music-volume-movie 'abs 0.0 0) + (copy-settings-from-target! *setting-control*) + (close-status! (-> obj tasks) (task-status need-reward-speech)) + (let* ((s5-2 (get-process *default-dead-pool* manipy #x4000)) + (v1-41 (when s5-2 + (let ((t9-15 (method-of-type manipy activate))) + (t9-15 + (the-as manipy s5-2) + obj + 'manipy + (the-as pointer #x70004000) + ) + ) + ((the-as + (function process function object object object object object) + run-function-in-process + ) + s5-2 + manipy-init + (-> obj root trans) + (-> obj entity) + *assistant-sg* + #f + ) + (-> s5-2 ppointer) + ) + ) + ) + (set! + (-> obj assistant) + (new 'static 'handle :process v1-41 :pid (-> v1-41 0 pid)) + ) + ) + (let ((a1-16 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-16 from) pp) + (set! (-> a1-16 num-params) 1) + (set! (-> a1-16 message) 'anim-mode) + (set! (-> a1-16 param 0) (the-as uint 'clone-anim)) + (send-event-function (handle->process (-> obj assistant)) a1-16) + ) + (let ((a1-17 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-17 from) pp) + (set! (-> a1-17 num-params) 1) + (set! (-> a1-17 message) 'blend-shape) + (set! (-> a1-17 param 0) (the-as uint #t)) + (send-event-function (handle->process (-> obj assistant)) a1-17) + ) + (let ((a1-18 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-18 from) pp) + (set! (-> a1-18 num-params) 1) + (set! (-> a1-18 message) 'center-joint) + (set! (-> a1-18 param 0) (the-as uint 3)) + (send-event-function (handle->process (-> obj assistant)) a1-18) + ) + (let ((v1-68 (handle->process (-> obj assistant)))) + (if v1-68 + (set! (-> (the-as assistant v1-68) draw light-index) (the-as uint 1)) + ) + ) + (set! (-> obj draw bounds w) 40960.0) + ) + (new 'static 'spool-anim + :name "sage-intro-sequence-d2" + :index 15 + :parts 20 + :command-list + '( + (0 + want-levels + village1 + beach + ) + (0 + kill + "assistant-11" + ) + (0 + kill + "reflector-middle-2" + ) + (0 + kill + "eco-11" + ) + (0 + kill + "eco-10" + ) + (0 + kill + "sharkey-12" + ) + (0 + kill + "reflector-end-1" + ) + (0 + kill + "water-vol-10" + ) + (0 + kill + "water-vol-8" + ) + (0 + kill + "water-vol-7" + ) + (0 + kill + "fishermans-boat-2" + ) + (0 + kill + "revcycleprop-2" + ) + (0 + kill + "revcycle-8" + ) + ((the binteger 113) + joint + "cameraB" + ) + ((the binteger 232) + joint + "camera" + ) + ((the binteger 289) + joint + "cameraB" + ) + ((the binteger 338) + joint + "camera" + ) + ((the binteger 405) + joint + "cameraB" + ) + ((the binteger 560) + joint + "camera" + ) + ((the binteger 660) + joint + "cameraB" + ) + ((the binteger 699) + joint + "camera" + ) + ((the binteger 837) + joint + "cameraB" + ) + ((the binteger 837) + shadow + self + #f + ) + ((the binteger 910) + joint + "camera" + ) + ((the binteger 945) + alive + "farmer-3" + ) + ((the binteger 945) + alive + "hutlamp-2" + ) + ((the binteger 950) + joint + "cameraB" + ) + ((the binteger 974) + display-level + beach + movie + ) + ((the binteger 974) + want-force-vis + beach + #t + ) + ((the binteger 1011) + alive + "bird-lady-4" + ) + ((the binteger 1015) + joint + "camera" + ) + ((the binteger 1018) + dead + "farmer-3" + ) + ((the binteger 1018) + dead + "hutlamp-2" + ) + ((the binteger 1075) + alive + "explorer-4" + ) + ((the binteger 1080) + joint + "cameraB" + ) + ((the binteger 1080) + want-force-vis + beach + #f + ) + ((the binteger 1080) + display-level + beach + #f + ) + ((the binteger 1082) + dead + "bird-lady-4" + ) + ((the binteger 1133) + joint + "camera" + ) + ((the binteger 1135) + dead + "explorer-4" + ) + ((the binteger 1244) + display-level + beach + movie + ) + ((the binteger 1244) + want-force-vis + beach + #t + ) + ((the binteger 1245) + alive + "fuel-cell-42" + ) + ((the binteger 1246) + joint + "cameraB" + ) + ((the binteger 1369) + joint + "camera" + ) + ((the binteger 1438) + alive + "fuel-cell-42" + ) + ((the binteger 1438) + want-force-vis + beach + #f + ) + ((the binteger 1438) + dead + "fuel-cell-42" + ) + ((the binteger 1438) + kill + "villagea-water-2" + ) + ((the binteger 1438) + kill + "crate-3147" + ) + ((the binteger 1438) + kill + "crate-3146" + ) + ((the binteger 1438) + kill + "crate-3143" + ) + ((the binteger 1438) + kill + "sagesail-6" + ) + ((the binteger 1438) + kill + "windmill-sail-4" + ) + ((the binteger 1438) + kill + "ropebridge-4" + ) + ((the binteger 1438) + kill + "ropebridge-5" + ) + ((the binteger 1438) + kill + "windspinner-8" + ) + ((the binteger 1438) + kill + "windspinner-9" + ) + ((the binteger 1438) + joint + "cameraB" + ) + ((the binteger 1439) + want-levels + village1 + training + ) + ((the binteger 1439) + save + ) + ((the binteger 1529) + joint + "camera" + ) + ((the binteger 1691) + joint + "cameraB" + ) + ((the binteger 1753) + joint + "camera" + ) + ((the binteger 1874) + joint + "cameraB" + ) + ((the binteger 2057) + joint + "camera" + ) + ((the binteger 2176) + joint + "cameraB" + ) + ((the binteger 2226) + joint + "camera" + ) + ((the binteger 2226) shadow self #t) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (get-art-elem obj) + ) + ) + ) + ) + +;; definition for method 45 of type sage +;; INFO: Return type mismatch symbol vs none. +(defmethod dummy-45 sage ((obj sage)) + (cond + ((and + (closed? + (-> obj tasks) + (game-task beach-ecorocks) + (task-status need-reminder) + ) + (= (get-reminder (-> obj tasks) 0) 0) + ) + #t + ) + ((and + (closed? + (-> obj tasks) + (game-task misty-cannon) + (task-status need-reminder) + ) + (= (get-reminder (-> obj tasks) 0) 1) + ) + #t + ) + ((and + (-> obj reminder-played) + (< 81920.0 (vector-vector-distance (-> obj root trans) (camera-pos))) + ) + #t + ) + (else + ) + ) + (none) + ) + +;; definition for method 31 of type sage +(defmethod get-art-elem sage ((obj sage)) + (cond + ((and + (= (current-task (-> obj tasks)) 15) + (or + (= (current-status (-> obj tasks)) 2) + (= (current-status (-> obj tasks)) 3) + ) + ) + (save-reminder (-> obj tasks) 0 0) + ) + ((and + (= (current-task (-> obj tasks)) 26) + (or + (= (current-status (-> obj tasks)) 2) + (= (current-status (-> obj tasks)) 3) + ) + ) + (save-reminder (-> obj tasks) 1 0) + ) + ((dummy-45 obj) + (set! (-> obj reminder-played) #f) + (cond + ((zero? (current-task (-> obj tasks))) + (case (get-reminder (-> obj tasks) 0) + ((2) + (save-reminder (-> obj tasks) 3 0) + ) + (else + (save-reminder (-> obj tasks) 2 0) + ) + ) + ) + ((closed? + (-> obj tasks) + (game-task beach-ecorocks) + (task-status need-reminder) + ) + (save-reminder (-> obj tasks) 1 0) + ) + ((or + (closed? + (-> obj tasks) + (game-task misty-cannon) + (task-status need-reminder) + ) + (not + (closed? + (-> obj tasks) + (game-task misty-cannon) + (task-status need-introduction) + ) + ) + ) + (save-reminder (-> obj tasks) 0 0) + ) + ((zero? (get-reminder (-> obj tasks) 0)) + (save-reminder (-> obj tasks) 1 0) + ) + (else + (save-reminder (-> obj tasks) 0 0) + ) + ) + ) + ) + (case (get-reminder (-> obj tasks) 0) + ((3) + (-> obj draw art-group data 7) + ) + ((2) + (-> obj draw art-group data 6) + ) + ((1) + (-> obj draw art-group data 3) + ) + (else + (-> obj draw art-group data 4) + ) + ) + ) + +;; definition for method 43 of type sage +(defmethod TODO-RENAME-43 sage ((obj sage)) + (let + ((s5-0 + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 9000 + 122880.0 + obj + ) + ) + ) + (when s5-0 + (let* ((v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-3 (the-as number (logior #x3f800000 v1-2))) + (f0-2 (+ -1.0 (the-as float v1-3))) + ) + (cond + ((< (-> s5-0 y) -12288.0) + ) + ((< 0.8 f0-2) + (dummy-11 (-> obj ambient) "SAGELP03" #f (-> obj root trans)) + ) + ((< 0.6 f0-2) + (dummy-11 (-> obj ambient) "SAGELP04" #f (-> obj root trans)) + ) + ((< 0.4 f0-2) + (dummy-11 (-> obj ambient) "SAGELP05" #f (-> obj root trans)) + ) + ((< 0.2 f0-2) + (dummy-11 (-> obj ambient) "SAGELP06" #f (-> obj root trans)) + ) + (else + (dummy-11 (-> obj ambient) "SAGELP11" #f (-> obj root trans)) + ) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (sage) + :virtual #t + :trans + (behavior () + (case (get-task-status (game-task intro)) + (((task-status need-reward-speech)) + (when (process-grab? *target*) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) self) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'play-anim) + (send-event-function self a1-0) + ) + ) + ) + ) + ((-> (method-of-type process-taskable idle) trans)) + (none) + ) + :code + (behavior () + (if (!= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (get-art-elem self) + ) + (ja-channel-push! 1 60) + ) + (while #t + (let ((gp-0 (-> self skel root-channel 0))) + (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) + ) + (let* ((f30-0 3.0) + (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-10 (the-as number (logior #x3f800000 v1-9))) + ) + (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-10)))) 5)) + (TODO-RENAME-43 self) + (let ((a0-11 (-> self skel root-channel 0))) + (set! (-> a0-11 frame-group) (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + (set! + (-> a0-11 param 0) + (the float (+ (-> (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-11 param 1) 1.0) + (set! (-> a0-11 frame-num) 0.0) + (joint-control-channel-group! + a0-11 + (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + num-func-seek! + ) + ) + (until (ja-done? 0) + (if + (and + (-> self reminder-played) + (< 81920.0 (vector-vector-distance (-> self root trans) (camera-pos))) + ) + (go-virtual idle) + ) + (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! + ) + ) + ) + ) + ) + (when (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 4) + ) + (let ((a0-20 (-> self skel root-channel 0))) + (set! + (-> a0-20 frame-group) + (the-as art-joint-anim (-> self draw art-group data 5)) + ) + (set! + (-> a0-20 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 5)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-20 param 1) 1.0) + (set! (-> a0-20 frame-num) 0.0) + (joint-control-channel-group! + a0-20 + (the-as art-joint-anim (-> self draw art-group data 5)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-21 (-> self skel root-channel 0))) + (set! + (-> a0-21 param 0) + (the float (+ (-> a0-21 frame-group data 0 length) -1)) + ) + (set! (-> a0-21 param 1) 1.0) + (joint-control-channel-group-eval! + a0-21 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate play-anim (sage) + :virtual #t + :exit + (behavior () + (set! (-> self draw bounds w) 10240.0) + (let ((a0-1 (handle->process (-> self assistant)))) + (if a0-1 + (deactivate a0-1) + ) + ) + ((-> (method-of-type process-taskable play-anim) exit)) + (case (get-task-status (game-task intro)) + (((task-status need-resolution)) + (clear-pending-settings-from-process + *setting-control* + self + 'music-volume-movie + ) + (close-specific-task! (game-task intro) (task-status need-resolution)) + (start 'play (get-continue-by-name *game-info* "game-start")) + ) + ) + (none) + ) + :trans + (behavior () + (case (get-task-status (game-task intro)) + (((task-status need-reward-speech)) + (spool-push *art-control* "sage-intro-sequence-d2" 0 self -1.0) + ) + ) + ((-> (method-of-type process-taskable play-anim) trans)) + (none) + ) + ) + +;; definition for method 39 of type sage +(defmethod should-display? sage ((obj sage)) + (not (sages-kidnapped?)) + ) + +;; definition for method 41 of type sage +;; INFO: Return type mismatch int vs none. +(defmethod initialize-collision sage ((obj sage) (arg0 int)) + (let + ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s4-0 prim-core collide-as) (the-as uint 256)) + (set! (-> s4-0 collide-with) (the-as uint 16)) + (set! (-> s4-0 prim-core action) (the-as uint 1)) + (set! (-> s4-0 prim-core offense) 4) + (set! (-> s4-0 transform-index) arg0) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 10240.0) + ((method-of-object s5-0 dummy-46)) + (let ((s2-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> s2-0 prim-core collide-as) (the-as uint 256)) + (set! (-> s2-0 collide-with) (the-as uint 16)) + (set! (-> s2-0 prim-core action) (the-as uint 1)) + (set! (-> s2-0 prim-core offense) 4) + (set! (-> s2-0 transform-index) arg0) + (set-vector! (-> s2-0 local-sphere) 0.0 -2048.0 0.0 5324.8) + ) + ((method-of-object s4-0 dummy-28)) + (let ((s2-1 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> s2-1 prim-core collide-as) (the-as uint 256)) + (set! (-> s2-1 collide-with) (the-as uint 16)) + (set! (-> s2-1 prim-core action) (the-as uint 1)) + (set! (-> s2-1 prim-core offense) 4) + (set! (-> s2-1 transform-index) arg0) + (set-vector! (-> s2-1 local-sphere) 0.0 2048.0 0.0 5324.8) + ) + ((method-of-object s4-0 dummy-28)) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + ((method-of-object s5-0 dummy-50)) + (set! (-> obj root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type sage +(defmethod copy-defaults! sage ((obj sage) (arg0 res-lump)) + (dummy-40 obj arg0 *sage-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> obj tasks) (get-task-control (game-task misty-cannon))) + (set! (-> obj reminder-played) #f) + (set! (-> obj sound-flava) (the-as uint 5)) + (set! (-> obj assistant) (the-as handle #f)) + (set! (-> obj draw light-index) (the-as uint 1)) + (dummy-42 obj) + (none) + ) diff --git a/test/decompiler/reference/levels/village2/gambler_REF.gc b/test/decompiler/reference/levels/village2/gambler_REF.gc new file mode 100644 index 000000000..090f5f5b4 --- /dev/null +++ b/test/decompiler/reference/levels/village2/gambler_REF.gc @@ -0,0 +1,459 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type gambler +(deftype gambler (process-taskable) + () + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + ) + +;; definition for method 3 of type gambler +(defmethod inspect gambler ((obj gambler)) + (let ((t9-0 (method-of-type process-taskable inspect))) + (t9-0 obj) + ) + obj + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "gambler" + :bounds (new 'static 'vector :w 16384.0) + :max-lod 2 + :version #x6 + :shadow 4 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 5) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 81920.0) + (set! (-> v1-1 mgeo 1) (the-as uint 2)) + (set! (-> v1-1 lod-dist 1) 163840.0) + (set! (-> v1-1 mgeo 2) (the-as uint 3)) + (set! (-> v1-1 lod-dist 2) 4095996000.0) + (set! *gambler-sg* v1-1) + ) + +;; definition for method 32 of type gambler +(defmethod play-anim! gambler ((obj gambler) (arg0 symbol)) + (with-pp + (set! (-> obj talk-message) (the-as uint 260)) + (case (current-status (-> obj tasks)) + ((2 3) + (when arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + (close-specific-task! + (game-task village2-gambler-money) + (task-status need-introduction) + ) + ) + (new 'static 'spool-anim + :name "gambler-introduction-1" + :index 11 + :parts 9 + :command-list + '( + (0 + want-levels + village2 + rolling + ) + (0 + display-level + rolling + #f + ) + ((the binteger 29) + joint + "cameraB" + ) + ((the binteger 103) + joint + "camera" + ) + ((the binteger 231) + joint + "cameraB" + ) + ((the binteger 730) + display-level + rolling + display + ) + ((the binteger 730) + want-force-vis + rolling + #t + ) + ((the binteger 732) + alive + "gorge-pusher-5" + ) + ((the binteger 732) + alive + "gorge-pusher-6" + ) + ((the binteger 732) + alive + "gorge-start-1" + ) + ((the binteger 732) + joint + "camera" + ) + ((the binteger 945) + joint + "cameraB" + ) + ((the binteger 950) + dead + "gorge-pusher-5" + ) + ((the binteger 950) + dead + "gorge-pusher-6" + ) + ((the binteger 950) + dead + "gorge-start-1" + ) + ((the binteger 950) + display-level + rolling + #f + ) + ((the binteger 950) want-force-vis rolling #f) + ) + ) + ) + ((5) + (set! (-> obj skippable) #t) + (cond + ((closed? + (-> obj tasks) + (game-task rolling-race) + (task-status need-reward-speech) + ) + (new 'static 'spool-anim + :name "gambler-reminder-money" + :index 13 + :parts 2 + :command-list '() + ) + ) + ((closed? + (-> obj tasks) + (game-task village2-gambler-money) + (task-status need-reward-speech) + ) + (new 'static 'spool-anim + :name "gambler-reminder-race" + :index 12 + :parts 2 + :command-list '() + ) + ) + ((zero? (get-reminder (-> obj tasks) 5)) + (if arg0 + (save-reminder (-> obj tasks) 1 5) + ) + (new 'static 'spool-anim + :name "gambler-reminder-race" + :index 12 + :parts 2 + :command-list '() + ) + ) + (else + (if arg0 + (save-reminder (-> obj tasks) 0 5) + ) + (new 'static 'spool-anim + :name "gambler-reminder-money" + :index 13 + :parts 2 + :command-list '() + ) + ) + ) + ) + ((6) + (if (not arg0) + (set! (-> obj will-talk) #t) + ) + (case (current-task (-> obj tasks)) + ((52) + (when arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + ) + (new 'static 'spool-anim + :name "gambler-resolution-race" + :index 14 + :parts 3 + :command-list '() + ) + ) + (else + (cond + (arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + (let ((a1-10 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-10 from) pp) + (set! (-> a1-10 num-params) 2) + (set! (-> a1-10 message) 'get-pickup) + (set! (-> a1-10 param 0) (the-as uint 5)) + (set! + (-> a1-10 param 1) + (the-as uint (- (-> *GAME-bank* money-task-inc))) + ) + (send-event-function *target* a1-10) + ) + ) + (else + (set! (-> obj talk-message) (the-as uint 282)) + ) + ) + (new 'static 'spool-anim + :name "gambler-resolution-money" + :index 15 + :parts 2 + :command-list '() + ) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (-> obj draw art-group data 7) + ) + ) + ) + ) + +;; definition for method 31 of type gambler +(defmethod get-art-elem gambler ((obj gambler)) + (-> obj draw art-group data 7) + ) + +;; definition for method 43 of type gambler +(defmethod TODO-RENAME-43 gambler ((obj gambler)) + (when + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 9000 + 61440.0 + obj + ) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f0-2 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.9230769 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM01" #f (-> obj root trans)) + ) + ((< 0.84615386 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM02" #f (-> obj root trans)) + ) + ((< 0.7692308 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM03" #f (-> obj root trans)) + ) + ((< 0.6923077 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM04" #f (-> obj root trans)) + ) + ((< 0.61538464 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM05" #f (-> obj root trans)) + ) + ((< 0.53846157 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM06" #f (-> obj root trans)) + ) + ((< 0.46153846 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM07" #f (-> obj root trans)) + ) + ((< 0.3846154 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM08" #f (-> obj root trans)) + ) + ((< 0.30769232 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM09" #f (-> obj root trans)) + ) + ((< 0.23076923 f0-2) + (if (not (task-closed? (game-task ogre-boss) (task-status need-reminder))) + (dummy-11 (-> obj ambient) "GAM-AM10" #f (-> obj root trans)) + ) + ) + ((< 0.15384616 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM11" #f (-> obj root trans)) + ) + ((< 0.07692308 f0-2) + (dummy-11 (-> obj ambient) "GAM-AM12" #f (-> obj root trans)) + ) + (else + (dummy-11 (-> obj ambient) "GAM-AM13" #f (-> obj root trans)) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (gambler) + :virtual #t + :code + (behavior () + (when (!= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 7) + ) + (ja-channel-push! 1 60) + (let ((v1-6 (-> self skel root-channel 0))) + (set! + (-> v1-6 frame-group) + (the-as art-joint-anim (-> self draw art-group data 7)) + ) + ) + ) + (while #t + (let ((a0-9 (-> self skel root-channel 0))) + (set! (-> a0-9 frame-group) (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + (set! + (-> a0-9 param 0) + (the float (+ (-> (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-9 param 1) 1.0) + (set! (-> a0-9 frame-num) 0.0) + (joint-control-channel-group! a0-9 (if (> (-> self skel active-channels) 0) + (-> + self + skel + root-channel + 0 + frame-group + ) + ) + num-func-seek! + ) + ) + (until (ja-done? 0) + (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! + ) + ) + ) + (TODO-RENAME-43 self) + (let* ((v1-38 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-39 (the-as number (logior #x3f800000 v1-38))) + (f0-9 (+ -1.0 (the-as float v1-39))) + ) + (cond + ((< f0-9 0.16666667) + (let ((a0-15 (-> self skel root-channel 0))) + (set! + (-> a0-15 frame-group) + (the-as art-joint-anim (-> self draw art-group data 5)) + ) + ) + ) + ((< f0-9 0.33333334) + (let ((a0-16 (-> self skel root-channel 0))) + (set! + (-> a0-16 frame-group) + (the-as art-joint-anim (-> self draw art-group data 6)) + ) + ) + ) + ((< f0-9 0.5) + (let ((a0-17 (-> self skel root-channel 0))) + (set! + (-> a0-17 frame-group) + (the-as art-joint-anim (-> self draw art-group data 7)) + ) + ) + ) + ((< f0-9 0.6666667) + (let ((a0-18 (-> self skel root-channel 0))) + (set! + (-> a0-18 frame-group) + (the-as art-joint-anim (-> self draw art-group data 8)) + ) + ) + ) + ((< f0-9 0.8333333) + (let ((a0-19 (-> self skel root-channel 0))) + (set! + (-> a0-19 frame-group) + (the-as art-joint-anim (-> self draw art-group data 9)) + ) + ) + ) + (else + (let ((a0-20 (-> self skel root-channel 0))) + (set! + (-> a0-20 frame-group) + (the-as art-joint-anim (-> self draw art-group data 10)) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 11 of type gambler +(defmethod copy-defaults! gambler ((obj gambler) (arg0 res-lump)) + (dummy-40 obj arg0 *gambler-sg* 3 32 (new 'static 'vector :w 4096.0) 5) + (set! (-> obj tasks) (get-task-control (game-task rolling-race))) + (set! (-> obj sound-flava) (the-as uint 17)) + (set! (-> obj draw light-index) (the-as uint 4)) + (dummy-42 obj) + (none) + ) diff --git a/test/decompiler/reference/levels/village2/geologist_REF.gc b/test/decompiler/reference/levels/village2/geologist_REF.gc new file mode 100644 index 000000000..2b860f4e4 --- /dev/null +++ b/test/decompiler/reference/levels/village2/geologist_REF.gc @@ -0,0 +1,314 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type geologist +(deftype geologist (process-taskable) + () + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + ) + +;; definition for method 3 of type geologist +(defmethod inspect geologist ((obj geologist)) + (let ((t9-0 (method-of-type process-taskable inspect))) + (t9-0 obj) + ) + obj + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "geologist" + :bounds (new 'static 'vector :w 16384.0) + :max-lod 2 + :version #x6 + :shadow 4 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 5) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 81920.0) + (set! (-> v1-1 mgeo 1) (the-as uint 2)) + (set! (-> v1-1 lod-dist 1) 163840.0) + (set! (-> v1-1 mgeo 2) (the-as uint 3)) + (set! (-> v1-1 lod-dist 2) 4095996000.0) + (set! *geologist-sg* v1-1) + ) + +;; definition for method 32 of type geologist +(defmethod play-anim! geologist ((obj geologist) (arg0 symbol)) + (with-pp + (set! (-> obj talk-message) (the-as uint 260)) + (case (current-status (-> obj tasks)) + ((2 3) + (when arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + (close-specific-task! + (game-task village2-geologist-money) + (task-status need-introduction) + ) + ) + (new 'static 'spool-anim + :name "geologist-introduction" + :index 6 + :parts 13 + :command-list + '( + (0 + want-levels + village2 + rolling + ) + ((the binteger 199) + joint + "cameraB" + ) + ((the binteger 325) + joint + "camera" + ) + ((the binteger 520) + alive + "racer-2" + ) + ((the binteger 544) + joint + "cameraB" + ) + ((the binteger 546) + dead + "racer-2" + ) + ((the binteger 809) + joint + "camera" + ) + ((the binteger 1031) + joint + "cameraB" + ) + ((the binteger 1229) joint "camera") + ) + ) + ) + ((5) + (set! (-> obj skippable) #t) + (cond + ((closed? + (-> obj tasks) + (game-task rolling-moles) + (task-status need-reward-speech) + ) + (new 'static 'spool-anim + :name "geologist-reminder-money" + :index 8 + :parts 2 + :command-list '() + ) + ) + ((closed? + (-> obj tasks) + (game-task village2-geologist-money) + (task-status need-reward-speech) + ) + (new 'static 'spool-anim + :name "geologist-reminder-moles" + :index 7 + :parts 3 + :command-list '() + ) + ) + ((zero? (get-reminder (-> obj tasks) 0)) + (if arg0 + (save-reminder (-> obj tasks) 1 0) + ) + (new 'static 'spool-anim + :name "geologist-reminder-moles" + :index 7 + :parts 3 + :command-list '() + ) + ) + (else + (if arg0 + (save-reminder (-> obj tasks) 0 0) + ) + (new 'static 'spool-anim + :name "geologist-reminder-money" + :index 8 + :parts 2 + :command-list '() + ) + ) + ) + ) + ((6) + (if (not arg0) + (set! (-> obj will-talk) #t) + ) + (case (current-task (-> obj tasks)) + ((54) + (when arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + ) + (new 'static 'spool-anim + :name "geologist-resolution-moles" + :index 9 + :parts 3 + :command-list '() + ) + ) + (else + (cond + (arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + (let ((a1-10 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-10 from) pp) + (set! (-> a1-10 num-params) 2) + (set! (-> a1-10 message) 'get-pickup) + (set! (-> a1-10 param 0) (the-as uint 5)) + (set! + (-> a1-10 param 1) + (the-as uint (- (-> *GAME-bank* money-task-inc))) + ) + (send-event-function *target* a1-10) + ) + ) + (else + (set! (-> obj talk-message) (the-as uint 282)) + ) + ) + (new 'static 'spool-anim + :name "geologist-resolution-money" + :index 10 + :parts 2 + :command-list '() + ) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (-> obj draw art-group data 5) + ) + ) + ) + ) + +;; definition for method 31 of type geologist +(defmethod get-art-elem geologist ((obj geologist)) + (-> obj draw art-group data 5) + ) + +;; definition for method 43 of type geologist +(defmethod TODO-RENAME-43 geologist ((obj geologist)) + (when + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 9000 + 122880.0 + obj + ) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f0-2 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.8888889 f0-2) + (dummy-11 (-> obj ambient) "GEO-AM01" #f (-> obj root trans)) + ) + ((< 0.7777778 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task rolling-moles) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "GEO-AM02" #f (-> obj root trans)) + ) + ) + ((< 0.6666667 f0-2) + (dummy-11 (-> obj ambient) "GEO-AM03" #f (-> obj root trans)) + ) + ((< 0.5555556 f0-2) + (if + (closed? + (-> obj tasks) + (game-task village2-geologist-money) + (task-status need-introduction) + ) + (dummy-11 (-> obj ambient) "GEO-AM04" #f (-> obj root trans)) + ) + ) + ((< 0.44444445 f0-2) + (dummy-11 (-> obj ambient) "GEO-AM05" #f (-> obj root trans)) + ) + ((< 0.33333334 f0-2) + (dummy-11 (-> obj ambient) "GEO-AM06" #f (-> obj root trans)) + ) + ((< 0.22222222 f0-2) + (if + (not + (closed? + (-> obj tasks) + (game-task rolling-moles) + (task-status need-reminder) + ) + ) + (dummy-11 (-> obj ambient) "GEO-AM07" #f (-> obj root trans)) + ) + ) + ((< 0.11111111 f0-2) + (dummy-11 (-> obj ambient) "GEO-LO02" #f (-> obj root trans)) + ) + ((closed? + (-> obj tasks) + (game-task village2-geologist-money) + (task-status need-resolution) + ) + (dummy-11 (-> obj ambient) "GEO-AM08" #f (-> obj root trans)) + ) + (else + (dummy-11 (-> obj ambient) "GEO-LO01" #f (-> obj root trans)) + ) + ) + ) + ) + (none) + ) + +;; definition for method 11 of type geologist +(defmethod copy-defaults! geologist ((obj geologist) (arg0 res-lump)) + (dummy-40 obj arg0 *geologist-sg* 3 45 (new 'static 'vector :w 4096.0) 5) + (set! (-> obj tasks) (get-task-control (game-task rolling-moles))) + (set! (-> obj sound-flava) (the-as uint 16)) + (set! (-> obj draw light-index) (the-as uint 2)) + (dummy-42 obj) + (none) + ) diff --git a/test/decompiler/reference/levels/village2/warrior_REF.gc b/test/decompiler/reference/levels/village2/warrior_REF.gc new file mode 100644 index 000000000..e9c892ca6 --- /dev/null +++ b/test/decompiler/reference/levels/village2/warrior_REF.gc @@ -0,0 +1,362 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type warrior +(deftype warrior (process-taskable) + () + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + ) + +;; definition for method 3 of type warrior +(defmethod inspect warrior ((obj warrior)) + (let ((t9-0 (method-of-type process-taskable inspect))) + (t9-0 obj) + ) + obj + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "warrior" + :bounds (new 'static 'vector :w 16384.0) + :max-lod 2 + :version #x6 + :shadow 4 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 5) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 81920.0) + (set! (-> v1-1 mgeo 1) (the-as uint 2)) + (set! (-> v1-1 lod-dist 1) 163840.0) + (set! (-> v1-1 mgeo 2) (the-as uint 3)) + (set! (-> v1-1 lod-dist 2) 4095996000.0) + (set! *warrior-sg* v1-1) + ) + +;; definition for method 52 of type warrior +;; INFO: Return type mismatch int vs none. +(defmethod dummy-52 warrior ((obj warrior)) + (let ((v1-1 (-> obj draw shadow-ctrl))) + (when v1-1 + (let ((f0-0 (-> obj root trans y))) + (let ((a0-2 v1-1)) + (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) + ) + 0 + (set! (-> v1-1 settings top-plane w) (- (+ 3072.0 f0-0))) + ) + 0 + ) + ) + (none) + ) + +;; definition for method 48 of type warrior +(defmethod draw-shadow warrior ((obj warrior)) + (-> obj draw shadow-ctrl) + (cond + ((and + (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (nonzero? (logand (-> obj draw status) 8)) + ) + (let ((v1-9 (-> obj draw shadow-ctrl))) + (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + ) + 0 + ((method-of-object (-> obj draw shadow-ctrl) dummy-14)) + ) + (else + (let ((v1-14 (-> obj draw shadow-ctrl))) + (logior! (-> v1-14 settings flags) 32) + ) + 0 + ) + ) + (none) + ) + +;; definition for method 32 of type warrior +(defmethod play-anim! warrior ((obj warrior) (arg0 symbol)) + (with-pp + (set! (-> obj talk-message) (the-as uint 260)) + (case (current-status (-> obj tasks)) + ((2 3) + (if arg0 + (close-status! (-> obj tasks) (task-status need-introduction)) + ) + (new 'static 'spool-anim + :name "warrior-introduction" + :index 6 + :parts 29 + :command-list + '( + ((the binteger 125) + joint + "cameraB" + ) + ((the binteger 260) + joint + "camera" + ) + ((the binteger 574) + joint + "cameraB" + ) + ((the binteger 918) + joint + "camera" + ) + ((the binteger 1174) + joint + "cameraB" + ) + ((the binteger 1174) + shadow + self + #f + ) + ((the binteger 1301) + joint + "camera" + ) + ((the binteger 1301) + shadow + self + #t + ) + ((the binteger 2025) + joint + "cameraB" + ) + ((the binteger 2322) + joint + "camera" + ) + ((the binteger 2560) joint "cameraB") + ) + ) + ) + ((5) + (set! (-> obj skippable) #t) + (new 'static 'spool-anim + :name "warrior-reminder-1" + :index 7 + :parts 3 + :command-list '() + ) + ) + ((6) + (cond + (arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) pp) + (set! (-> a1-4 num-params) 2) + (set! (-> a1-4 message) 'get-pickup) + (set! (-> a1-4 param 0) (the-as uint 5)) + (set! + (-> a1-4 param 1) + (the-as uint (- (-> *GAME-bank* money-task-inc))) + ) + (send-event-function *target* a1-4) + ) + (let ((s5-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> s5-1 from) pp) + (set! (-> s5-1 num-params) 1) + (set! (-> s5-1 message) 'clone) + (let* ((a0-10 obj) + (v1-19 (if a0-10 + (-> a0-10 ppointer) + ) + ) + ) + (set! + (-> s5-1 param 0) + (the-as + uint + (logior + (shl (-> v1-19 0 pid) 32) + (new 'static 'handle :process v1-19) + ) + ) + ) + ) + (send-event-function + (-> (entity-by-type allpontoons) extra process) + s5-1 + ) + ) + (dotimes (s5-2 (entity-actor-count (-> obj entity) 'alt-actor)) + (entity-birth-no-kill + (entity-actor-lookup (-> obj entity) 'alt-actor s5-2) + ) + (let ((s4-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-2 from) pp) + (set! (-> s4-2 num-params) 0) + (set! (-> s4-2 message) 'die) + (let ((s3-0 send-event-function) + (v1-25 (entity-actor-lookup (-> obj entity) 'alt-actor s5-2)) + ) + (s3-0 (if v1-25 + (-> v1-25 extra process) + ) + s4-2 + ) + ) + ) + ) + ) + (else + (set! (-> obj will-talk) #t) + (set! (-> obj talk-message) (the-as uint 282)) + ) + ) + (new 'static 'spool-anim + :name "warrior-resolution" + :index 8 + :parts 6 + :command-list + '( + ((the binteger 508) + blackout + (the binteger 10) + ) + ((the binteger 511) blackout 0) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (-> obj draw art-group data 5) + ) + ) + ) + ) + +;; definition for method 31 of type warrior +(defmethod get-art-elem warrior ((obj warrior)) + (-> obj draw art-group data 5) + ) + +;; failed to figure out what this is: +(defstate play-anim (warrior) + :virtual #t + :exit + (behavior () + (let ((gp-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-0 from) self) + (set! (-> gp-0 num-params) 0) + (set! (-> gp-0 message) 'end-mode) + (send-event-function (-> (entity-by-type allpontoons) extra process) gp-0) + ) + ((-> (method-of-type process-taskable play-anim) exit)) + (none) + ) + ) + +;; definition for method 43 of type warrior +(defmethod TODO-RENAME-43 warrior ((obj warrior)) + (when + (TODO-RENAME-10 + (-> obj ambient) + (new 'stack-no-clear 'vector) + 600 + 61440.0 + obj + ) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f0-2 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.66 f0-2) + (dummy-11 (-> obj ambient) "WAR-LO1A" #f (-> obj root trans)) + ) + ((< 0.33 f0-2) + (dummy-11 (-> obj ambient) "WAR-LO1B" #f (-> obj root trans)) + ) + (else + (dummy-11 (-> obj ambient) "WAR-LO1C" #f (-> obj root trans)) + ) + ) + ) + ) + (none) + ) + +;; definition for method 41 of type warrior +;; INFO: Return type mismatch int vs none. +(defmethod initialize-collision warrior ((obj warrior) (arg0 int)) + (let + ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s4-0 prim-core collide-as) (the-as uint 256)) + (set! (-> s4-0 collide-with) (the-as uint 16)) + (set! (-> s4-0 prim-core action) (the-as uint 1)) + (set! (-> s4-0 prim-core offense) 4) + (set-vector! (-> s4-0 local-sphere) -3072.0 8192.0 0.0 11264.0) + ((method-of-object s5-0 dummy-46)) + (let ((s3-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> s3-0 prim-core collide-as) (the-as uint 256)) + (set! (-> s3-0 collide-with) (the-as uint 16)) + (set! (-> s3-0 prim-core action) (the-as uint 1)) + (set! (-> s3-0 prim-core offense) 4) + (set-vector! (-> s3-0 local-sphere) -2048.0 9216.0 0.0 8192.0) + ) + ((method-of-object s4-0 dummy-28)) + (let ((s3-1 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> s3-1 prim-core collide-as) (the-as uint 256)) + (set! (-> s3-1 collide-with) (the-as uint 16)) + (set! (-> s3-1 prim-core action) (the-as uint 1)) + (set! (-> s3-1 prim-core offense) 4) + (set-vector! (-> s3-1 local-sphere) 0.0 2048.0 0.0 4096.0) + ) + ((method-of-object s4-0 dummy-28)) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + ((method-of-object s5-0 dummy-50)) + (set! (-> obj root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type warrior +(defmethod copy-defaults! warrior ((obj warrior) (arg0 res-lump)) + (dummy-40 + obj + arg0 + *warrior-sg* + 3 + 33 + (new 'static 'vector :y -4096.0 :w 10240.0) + 5 + ) + (set! (-> obj tasks) (get-task-control (game-task village2-warrior-money))) + (set! (-> obj sound-flava) (the-as uint 15)) + (set! (-> obj draw light-index) (the-as uint 3)) + (dummy-42 obj) + (none) + ) diff --git a/test/decompiler/reference/levels/village_common/oracle_REF.gc b/test/decompiler/reference/levels/village_common/oracle_REF.gc new file mode 100644 index 000000000..38255acb0 --- /dev/null +++ b/test/decompiler/reference/levels/village_common/oracle_REF.gc @@ -0,0 +1,819 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type oracle +(deftype oracle (process-taskable) + ((first-task uint8 :offset-assert 380) + (second-task uint8 :offset-assert 381) + (left-eye-cell handle :offset-assert 384) + (right-eye-cell handle :offset-assert 392) + ) + :heap-base #x120 + :method-count-assert 53 + :size-assert #x190 + :flag-assert #x3501200190 + ) + +;; definition for method 3 of type oracle +(defmethod inspect oracle ((obj oracle)) + (let ((t9-0 (method-of-type process-taskable inspect))) + (t9-0 obj) + ) + (format #t "~T~Tfirst-task: ~D~%" (-> obj first-task)) + (format #t "~T~Tsecond-task: ~D~%" (-> obj second-task)) + (format #t "~T~Tleft-eye-cell: ~D~%" (-> obj left-eye-cell)) + (format #t "~T~Tright-eye-cell: ~D~%" (-> obj right-eye-cell)) + obj + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "oracle" + :bounds (new 'static 'vector :w 16384.0) + :version #x6 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 2) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 4095996000.0) + (set! *oracle-sg* v1-1) + ) + +;; definition for method 32 of type oracle +(defmethod play-anim! oracle ((obj oracle) (arg0 symbol)) + (with-pp + (set! (-> obj talk-message) (the-as uint 260)) + (case (current-status (-> obj tasks)) + ((2 3) + (when arg0 + (close-specific-task! + (the-as game-task (-> obj first-task)) + (task-status need-introduction) + ) + (close-specific-task! + (the-as game-task (-> obj second-task)) + (task-status need-introduction) + ) + ) + (case (-> (level-get-target-inside *level*) name) + (('village1) + (new 'static 'spool-anim + :name "oracle-intro-1" + :index 9 + :parts 5 + :command-list '() + ) + ) + (('village2) + (new 'static 'spool-anim + :name "oracle-intro-2" + :index 11 + :parts 4 + :command-list + '( + (0 + kill + "pontoonten-20" + ) + (0 + kill + "pontoonten-19" + ) + (0 + kill + "pontoonten-18" + ) + (0 + kill + "pontoonten-15" + ) + (0 + kill + "pontoonten-14" + ) + (0 + kill + "pontoonfive-14" + ) + (0 + kill + "pontoonfive-15" + ) + (0 + kill + "pontoonfive-19" + ) + (0 + kill + "pontoonfive-20" + ) + (0 + kill + "med-res-level-12" + ) + (0 + kill + "med-res-level-13" + ) + (0 + kill + "med-res-level-15" + ) + (0 + kill + "money-2844" + ) + (0 + kill + "money-2845" + ) + (0 + kill + "money-2846" + ) + (0 + kill + "money-2847" + ) + (0 + kill + "money-2848" + ) + (0 + kill + "money-2849" + ) + (0 + kill + "money-2850" + ) + (0 + kill + "money-2854" + ) + (0 + kill + "money-2855" + ) + (0 + kill + "money-2856" + ) + (0 + kill + "money-2860" + ) + (0 + kill + "money-2861" + ) + (0 + kill + "money-2862" + ) + (0 + kill + "eco-27" + ) + (0 + kill + "eco-26" + ) + (0 + kill + "sharkey-25" + ) + (0 + kill + "barrel-13" + ) + (0 + kill + "barrel-14" + ) + (0 + kill + "barrel-15" + ) + (0 + kill + "barrel-16" + ) + (0 + kill + "barrel-17" + ) + (0 + kill + "barrel-18" + ) + (0 + kill + "barrel-19" + ) + (0 + kill + "barrel-20" + ) + (0 + kill + "barrel-21" + ) + (0 + kill + "barrel-22" + ) + (0 + kill + "barrel-23" + ) + (0 + kill + "villageb-part-18" + ) + (0 + kill + "villageb-part-19" + ) + (0 + kill + "villageb-part-20" + ) + (0 + kill + "villageb-part-21" + ) + (0 + kill + "villageb-part-28" + ) + (0 + kill + "villageb-part-29" + ) + (0 + kill + "villageb-part-30" + ) + (0 + kill + "villageb-part-31" + ) + (0 + kill + "villageb-part-32" + ) + (0 + kill + "villageb-part-33" + ) + (0 + kill + "villageb-part-35" + ) + (0 + kill + "villageb-part-37" + ) + (0 + kill + "villageb-part-38" + ) + (0 + kill + "villageb-part-47" + ) + (0 + kill + "villageb-part-48" + ) + (0 + kill + "villageb-part-49" + ) + (0 + kill + "villageb-part-50" + ) + (0 + kill + "villageb-part-56" + ) + (0 + kill + "villageb-part-62" + ) + (0 + kill + "villageb-part-63" + ) + (0 + kill + "villageb-ogreboss-1" + ) + (0 + kill + "crate-3127" + ) + (0 + kill + "crate-3128" + ) + (0 + kill + "crate-3129" + ) + (0 + kill + "crate-3133" + ) + (0 + kill + "geologist-1" + ) + (0 + kill + "fireboulder-2" + ) + (0 + kill + "fireboulder-3" + ) + (0 + kill + "fireboulder-4" + ) + (0 + kill + "water-vol-100" + ) + (0 + kill + "water-vol-101" + ) + (0 + kill + "water-vol-102" + ) + (0 + kill + "water-vol-103" + ) + (0 + kill + "water-vol-284" + ) + (0 + kill + "water-vol-285" + ) + (0 + kill + "water-vol-286" + ) + (0 + kill + "ceilingflag-6" + ) + (0 + kill + "ceilingflag-7" + ) + (0 + kill + "ceilingflag-8" + ) + (0 + kill + "ceilingflag-9" + ) + (0 + kill + "orb-cache-top-14" + ) + (0 + setting-reset + ocean-off + near + ) + ((the binteger 399) setting-unset ocean-off) + ) + ) + ) + (('village3) + (new 'static 'spool-anim + :name "oracle-intro-3" + :index 13 + :parts 4 + :command-list '() + ) + ) + ) + ) + ((5) + (set! (-> obj skippable) #t) + (case (-> (level-get-target-inside *level*) name) + (('village1) + (new 'static 'spool-anim + :name "oracle-reminder-1" + :index 10 + :parts 4 + :command-list '() + ) + ) + (('village2) + (new 'static 'spool-anim + :name "oracle-reminder-2" + :index 12 + :parts 2 + :command-list '() + ) + ) + (('village3) + (new 'static 'spool-anim + :name "oracle-reminder-3" + :index 14 + :parts 2 + :command-list '() + ) + ) + ) + ) + ((6) + (cond + (arg0 + (set! + (-> obj cell-for-task) + (the-as game-task (current-task (-> obj tasks))) + ) + (close-current! (-> obj tasks)) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) pp) + (set! (-> a1-5 num-params) 2) + (set! (-> a1-5 message) 'get-pickup) + (set! (-> a1-5 param 0) (the-as uint 5)) + (set! + (-> a1-5 param 1) + (the-as uint (- (-> *GAME-bank* money-oracle-inc))) + ) + (send-event-function *target* a1-5) + ) + (cond + ((= (current-task (-> obj tasks)) (-> obj first-task)) + (let ((a0-25 (handle->process (-> obj right-eye-cell)))) + (if a0-25 + (deactivate a0-25) + ) + ) + ) + (else + (let ((a0-29 (handle->process (-> obj left-eye-cell)))) + (if a0-29 + (deactivate a0-29) + ) + ) + ) + ) + ) + (else + (set! (-> obj will-talk) #t) + (set! (-> obj talk-message) (the-as uint 283)) + ) + ) + (cond + ((= (current-task (-> obj tasks)) (-> obj first-task)) + (case (-> (level-get-target-inside *level*) name) + (('village1) + (new 'static 'spool-anim + :name "oracle-right-eye-1" + :index 3 + :parts 2 + :command-list '() + ) + ) + (('village2) + (new 'static 'spool-anim + :name "oracle-right-eye-2" + :index 5 + :parts 2 + :command-list '() + ) + ) + (('village3) + (new 'static 'spool-anim + :name "oracle-right-eye-3" + :index 7 + :parts 2 + :command-list '() + ) + ) + ) + ) + (else + (case (-> (level-get-target-inside *level*) name) + (('village1) + (new 'static 'spool-anim + :name "oracle-left-eye-1" + :index 4 + :parts 2 + :command-list '() + ) + ) + (('village2) + (new 'static 'spool-anim + :name "oracle-left-eye-2" + :index 6 + :parts 2 + :command-list '() + ) + ) + (('village3) + (new 'static 'spool-anim + :name "oracle-left-eye-3" + :index 8 + :parts 2 + :command-list '() + ) + ) + ) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string + (the-as task-status (current-status (-> obj tasks))) + ) + ) + ) + (-> obj draw art-group data 2) + ) + ) + ) + ) + +;; definition for method 31 of type oracle +(defmethod get-art-elem oracle ((obj oracle)) + (-> obj draw art-group data 2) + ) + +;; failed to figure out what this is: +(defstate idle (oracle) + :virtual #t + :exit + (behavior () + (stop! (-> self sound)) + ((-> (method-of-type process-taskable idle) exit)) + (none) + ) + :trans + (behavior () + (update! (-> self sound)) + ((-> (method-of-type process-taskable idle) trans)) + (none) + ) + ) + +;; definition for method 11 of type oracle +(defmethod copy-defaults! oracle ((obj oracle) (arg0 res-lump)) + (with-pp + (dummy-40 + obj + arg0 + *oracle-sg* + 3 + 4 + (new 'static 'vector :y -4096.0 :w 4096.0) + -1 + ) + (set! + (-> obj sound) + (new + 'process + 'ambient-sound + (new 'static 'sound-spec + :mask #x80 + :num 1.0 + :group #x1 + :sound-name-char + (new 'static 'array uint8 16 + #x6f + #x72 + #x61 + #x63 + #x6c + #x65 + #x2d + #x73 + #x6c + #x65 + #x65 + #x70 + #x0 + #x0 + #x0 + #x0 + ) + :volume #x400 + :fo-max 50 + ) + (-> obj root trans) + ) + ) + (set! (-> obj first-task) (the-as uint (-> arg0 extra perm task))) + (set! + (-> obj second-task) + (the-as + uint + (get-property-value + arg0 + 'alt-task + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (set! + (-> obj tasks) + (get-task-control (the-as game-task (-> obj first-task))) + ) + (set! (-> obj right-eye-cell) (the-as handle #f)) + (set! (-> obj left-eye-cell) (the-as handle #f)) + (logior! (-> obj draw status) 32) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-1 (lambda :behavior oracle () (let* ((gp-0 (-> self root)) + (v1-1 + (if + (and + (nonzero? gp-0) + (type-type? + (-> gp-0 type) + collide-shape + ) + ) + gp-0 + ) + ) + ) + (if v1-1 + (-> + (the-as collide-shape v1-1) + root-prim + prim-core + ) + (-> self root trans) + ) + ) + ((method-of-object (-> self part) dummy-11)) + 0 + (none) + ) + ) + ) + (ja-post) + (when + (not + (task-closed? + (the-as game-task (-> obj first-task)) + (task-status need-resolution) + ) + ) + (vector<-cspace! s4-0 (-> obj node-list data 5)) + (let* ((s3-0 (get-process *default-dead-pool* manipy #x4000)) + (v1-13 (when s3-0 + (let ((t9-8 (method-of-type manipy activate))) + (t9-8 + (the-as manipy s3-0) + obj + 'manipy + (the-as pointer #x70004000) + ) + ) + ((the-as + (function process function object object object object object) + run-function-in-process + ) + s3-0 + manipy-init + s4-0 + (-> obj entity) + *fuel-cell-sg* + (new 'static 'vector :w 4915.2) + ) + (-> s3-0 ppointer) + ) + ) + ) + (set! + (-> obj right-eye-cell) + (new 'static 'handle :process v1-13 :pid (-> v1-13 0 pid)) + ) + ) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) pp) + (set! (-> a1-9 num-params) 1) + (set! (-> a1-9 message) 'eval) + (set! + (-> a1-9 param 0) + (the-as + uint + (lambda :behavior oracle + () + (let ((v0-0 (dummy-9 (-> *part-group-id-table* 63) self))) + (set! (-> self part) (the-as sparticle-launch-control v0-0)) + v0-0 + ) + ) + ) + ) + (send-event-function (handle->process (-> obj right-eye-cell)) a1-9) + ) + (let ((a1-10 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-10 from) pp) + (set! (-> a1-10 num-params) 1) + (set! (-> a1-10 message) 'trans-hook) + (set! (-> a1-10 param 0) (the-as uint s5-1)) + (send-event-function (handle->process (-> obj right-eye-cell)) a1-10) + ) + ) + (when + (not + (task-closed? + (the-as game-task (-> obj second-task)) + (task-status need-resolution) + ) + ) + (vector<-cspace! s4-0 (-> obj node-list data 6)) + (let* ((s3-1 (get-process *default-dead-pool* manipy #x4000)) + (v1-33 (when s3-1 + (let ((t9-15 (method-of-type manipy activate))) + (t9-15 + (the-as manipy s3-1) + obj + 'manipy + (the-as pointer #x70004000) + ) + ) + ((the-as + (function process function object object object object object) + run-function-in-process + ) + s3-1 + manipy-init + s4-0 + (-> obj entity) + *fuel-cell-sg* + (new 'static 'vector :w 4915.2) + ) + (-> s3-1 ppointer) + ) + ) + ) + (set! + (-> obj left-eye-cell) + (new 'static 'handle :process v1-33 :pid (-> v1-33 0 pid)) + ) + ) + (let ((a1-16 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-16 from) pp) + (set! (-> a1-16 num-params) 1) + (set! (-> a1-16 message) 'eval) + (set! + (-> a1-16 param 0) + (the-as + uint + (lambda :behavior oracle + () + (let ((v0-0 (dummy-9 (-> *part-group-id-table* 63) self))) + (set! (-> self part) (the-as sparticle-launch-control v0-0)) + v0-0 + ) + ) + ) + ) + (send-event-function (handle->process (-> obj left-eye-cell)) a1-16) + ) + (let ((a1-17 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-17 from) pp) + (set! (-> a1-17 num-params) 1) + (set! (-> a1-17 message) 'trans-hook) + (set! (-> a1-17 param 0) (the-as uint s5-1)) + (send-event-function (handle->process (-> obj left-eye-cell)) a1-17) + ) + ) + ) + (dummy-42 obj) + (none) + ) + )