diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index 4ffbca9f01..4ac375fdd2 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -9032,6 +9032,8 @@ (carc 16) (guard-bike 18) (hellcat 19) + (traffic-type-20 20) + (traffic-type-21 21) ) ;; ---traffic-h:traffic-type @@ -45071,11 +45073,10 @@ ;; protect ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype seal-of-mar (process-drawable) - ((attach-object uint64 :offset-assert 196) - (scale float :offset-assert 204) - (trans-y float :offset-assert 208) + ((attach-object uint64 :offset-assert 200) + (scale float :offset-assert 208) + (trans-y float :offset-assert 212) ) :method-count-assert 24 :size-assert #xd8 @@ -45083,13 +45084,11 @@ (:methods (idle () _type_ :state 20) (die () _type_ :state 21) - (seal-of-mar-method-22 () none 22) - (seal-of-mar-method-23 () none 23) + (seal-of-mar-method-22 (_type_) none 22) + (seal-of-mar-method-23 (_type_) none 23) ) ) -|# -#| (deftype city-slums-transport-info (structure) ((id uint32 :offset-assert 0) (spawned basic :offset-assert 4) @@ -45103,11 +45102,10 @@ :size-assert #x54 :flag-assert #x900000054 ) -|# -;; (define-extern seal-of-mar-init-by-other function) -;; (define-extern seal-of-mar-spawn function) -;; (define-extern *city-slums-transport-info* array) +(define-extern seal-of-mar-init-by-other (function vector vector vector none :behavior seal-of-mar)) +(define-extern seal-of-mar-spawn (function task-manager vector vector vector (pointer seal-of-mar))) +(define-extern *city-slums-transport-info* (array city-slums-transport-info)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; forexita-part ;; @@ -50682,9 +50680,8 @@ ) |# -#| (deftype stadium-racer (vehicle-rider) - ((rider-type uint8 :offset-assert 217) + ((rider-type uint8 :offset-assert 221) ) :method-count-assert 36 :size-assert #xde @@ -50692,9 +50689,7 @@ (:methods ) ) -|# -#| (deftype errol-rider (stadium-racer) () :method-count-assert 36 @@ -50703,7 +50698,6 @@ (:methods ) ) -|# #| (deftype turbo-pickup (process-drawable) @@ -50773,14 +50767,14 @@ (waiting-for-start () _type_ :state 145) (racing () _type_ :state 146) (race-finished () _type_ :state 147) - (vehicle-racer-method-148 () none 148) - (vehicle-racer-method-149 () none 149) - (vehicle-racer-method-150 () none 150) - (vehicle-racer-method-151 () none 151) - (vehicle-racer-method-152 () none 152) - (vehicle-racer-method-153 () none 153) - (vehicle-racer-method-154 () none 154) - (vehicle-racer-method-155 () none 155) + (vehicle-racer-method-148 (_type_) none 148) + (vehicle-racer-method-149 (_type_) none 149) + (vehicle-racer-method-150 (_type_) none 150) + (vehicle-racer-method-151 (_type_) none 151) + (vehicle-racer-method-152 (_type_) none 152) + (vehicle-racer-method-153 (_type_) none 153) + (vehicle-racer-method-154 (_type_) none 154) + (vehicle-racer-method-155 (_type_) none 155) ) ) @@ -51676,9 +51670,8 @@ ;; errol-chal ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype errol-racer (vehicle-rider) - ((minimap connection-minimap :offset-assert 220) + ((minimap connection-minimap :offset-assert 224) ) :method-count-assert 36 :size-assert #xe4 @@ -51686,7 +51679,6 @@ (:methods ) ) -|# (deftype vehicle-city-racer (vehicle-racer) () @@ -51725,17 +51717,17 @@ ) ) -#| (deftype turbo-ring (process-drawable) - ((touch-time time-frame :offset-assert 196) - (minimap connection-minimap :offset-assert 204) - (player-got basic :offset-assert 208) - (persistent basic :offset-assert 212) - (id int8 :offset-assert 216) - (boost float :offset-assert 220) - (plane vector :inline :offset-assert 236) - (part-track uint64 :offset-assert 252) - (mat matrix :inline :offset-assert 268) + ((root-override collide-shape :offset 128 :score 100) + (touch-time time-frame :offset-assert 200) + (minimap connection-minimap :offset-assert 208) + (player-got symbol :offset-assert 212) + (persistent symbol :offset-assert 216) + (id int8 :offset-assert 220) + (boost float :offset-assert 224) + (plane vector :inline :offset-assert 240) + (part-track handle :offset-assert 256) + (mat matrix :inline :offset-assert 272) ) :method-count-assert 25 :size-assert #x150 @@ -51743,19 +51735,18 @@ (:methods (idle () _type_ :state 20) (die () _type_ :state 21) - (turbo-ring-method-22 () none 22) - (turbo-ring-method-23 () none 23) - (turbo-ring-method-24 () none 24) + (turbo-ring-method-22 (_type_) none 22) + (turbo-ring-method-23 (_type_) none 23) + (turbo-ring-method-24 (_type_) none 24) ) ) -|# -;; (define-extern *race-bike-a-constants* object) -;; (define-extern *race-bike-b-constants* object) -;; (define-extern turbo-ring-init-by-other function) -;; (define-extern turbo-ring-spawn function) -;; (define-extern *city-errol-challenge-rings* array) -;; (define-extern *city-bush-port-rings* array) +(define-extern *race-bike-a-constants* rigid-body-vehicle-constants) +(define-extern *race-bike-b-constants* rigid-body-vehicle-constants) +(define-extern turbo-ring-init-by-other (function city-race-ring-info int symbol none :behavior turbo-ring)) +(define-extern turbo-ring-spawn (function task-manager city-race-ring-info int symbol turbo-ring)) +(define-extern *city-errol-challenge-rings* (array city-race-ring-info)) +(define-extern *city-bush-port-rings* (array city-race-ring-info)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/decompiler/config/jak2/anonymous_function_types.jsonc b/decompiler/config/jak2/anonymous_function_types.jsonc index 242435f8a1..399f126bcd 100644 --- a/decompiler/config/jak2/anonymous_function_types.jsonc +++ b/decompiler/config/jak2/anonymous_function_types.jsonc @@ -1188,5 +1188,38 @@ 13, "(function crimson-guard-hover cspace float float vector vector int none)" ] + ], + "protect": [ + [0, "(function none :behavior task-manager)"], + [1, "(function none :behavior task-manager)"], + [2, "(function none :behavior task-manager)"], + [3, "(function none :behavior task-manager)"], + [4, "(function none :behavior task-manager)"], + [5, "(function none :behavior task-manager)"], + [6, "(function none :behavior task-manager)"], + [7, "(function none :behavior task-manager)"], + [8, "(function none :behavior task-manager)"] + ], + "errol-chal": [ + [0, "(function none :behavior task-manager)"], + [1, "(function none :behavior task-manager)"], + [2, "(function none :behavior task-manager)"], + [3, "(function none :behavior task-manager)"], + [ + 4, + "(function process int symbol event-message-block object :behavior task-manager)" + ], + [5, "(function none :behavior task-manager)"], + [6, "(function none :behavior task-manager)"], + [7, "(function none :behavior task-manager)"], + [8, "(function none :behavior task-manager)"], + [9, "(function none :behavior task-manager)"], + [10, "(function none :behavior task-manager)"], + [ + 11, + "(function process int symbol event-message-block object :behavior task-manager)" + ], + [12, "(function none :behavior task-manager)"], + [13, "(function none :behavior task-manager)"] ] } diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index 71679c02b1..f4a92be848 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -101,7 +101,6 @@ "(anon-function 10 meet-brutter)", "(method 154 vehicle-racer)", "(method 228 hal-sewer)", - "(method 154 vehicle-city-racer)", "test-to-from-spr", "test-from-spr", "test-to-spr", @@ -525,7 +524,8 @@ "(method 18 vehicle-controller)": [0, 1, 74, 75], "(method 15 vehicle-controller)": [0, 3, 5, 6, 7, 10], "(anon-function 41 guard)": [9], - "(anon-function 10 metalhead-predator)": [24, 25] + "(anon-function 10 metalhead-predator)": [24, 25], + "(anon-function 10 errol-chal)": [6] }, // Sometimes the game might use format strings that are fetched dynamically, diff --git a/decompiler/config/jak2/inputs.jsonc b/decompiler/config/jak2/inputs.jsonc index 2e6f87d0fa..9caa09438b 100644 --- a/decompiler/config/jak2/inputs.jsonc +++ b/decompiler/config/jak2/inputs.jsonc @@ -206,6 +206,7 @@ "CTA.DGO", "CTB.DGO", "CTC.DGO", + "CTYASHA.DGO", "CTYKORA.DGO", "CWI.DGO", "D3A.DGO", @@ -226,6 +227,7 @@ "FORDUMPD.DGO", "FRA.DGO", "FRB.DGO", + "GARAGE.DGO", "GGA.DGO", "HIDEOUT.DGO", "HIPHOG.DGO", @@ -238,6 +240,8 @@ "LCGUARD.DGO", "LCITYLOW.DGO", "LDJAKBRN.DGO", + "LERLCHAL.DGO", + "LERLTESS.DGO", "LERROL.DGO", "LGUARD.DGO", "LHELLDOG.DGO", @@ -246,6 +250,7 @@ "LJAKDAX.DGO", "LJKDXASH.DGO", "LKEIRIFT.DGO", + "LMEETBRT.DGO", "LOUTCSTB.DGO", "LPACKAGE.DGO", "LPORTRUN.DGO", @@ -276,6 +281,7 @@ "LWIDEC.DGO", "LYSAMSAM.DGO", "LYSKDCD.DGO", + "MCN.DGO", "MTN.DGO", "MTX.DGO", "NEB.DGO", @@ -287,6 +293,7 @@ "PAC.DGO", "PAE.DGO", "PALBOSS.DGO", + "PALOUT.DGO", "PAR.DGO", "PAS.DGO", "PORTWALL.DGO", @@ -301,7 +308,9 @@ "STB.DGO", "STC.DGO", "STR.DGO", + "SWB.DGO", "TBO.DGO", + "THR.DGO", "TITLE.DGO", "TOA.DGO", "TOB.DGO", diff --git a/decompiler/config/jak2/label_types.jsonc b/decompiler/config/jak2/label_types.jsonc index 9c5a9f3a8f..033303152e 100644 --- a/decompiler/config/jak2/label_types.jsonc +++ b/decompiler/config/jak2/label_types.jsonc @@ -1604,5 +1604,10 @@ ["L138", "turret-path", true], ["L119", "turret-path", true] ], - "drill-baron": [["L183", "turret-path-event", true]] + "drill-baron": [["L183", "turret-path-event", true]], + "protect": [["L127", "vector"]], + "errol-chal": [ + ["L142", "vector"], + ["L119", "vector"] + ] } diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index 3c2dabba2c..e405135e41 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -2082,5 +2082,15 @@ "(event attack drill-barons-ship-turret)": [[16, "vector"]], "(post attack drill-barons-ship-turret)": [ [16, "projectile-init-by-other-params"] - ] + ], + "(anon-function 6 protect)": [ + [112, "vector"], + [48, "vector"], + [128, "vector"], + [144, "vector"], + [160, "transport-params"], + [224, "vector"] + ], + "(anon-function 10 errol-chal)": [[16, ["inline-array", "vector", 1]]], + "(event idle turbo-ring)": [[16, "vehicle-control-point"]] } diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index 79e1f6cbcd..6ff8ed774e 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -9821,5 +9821,11 @@ "(method 37 drill-ship-shot)": [ [2, "v1", "drill-barons-ship"], [7, "v1", "drill-barons-ship"] - ] + ], + "(code taunt errol-racer)": [ + [19, "v1", "art-joint-anim"], + [72, "v1", "art-joint-anim"] + ], + "(event idle turbo-ring)": [[4, "s5", "vehicle"]], + "(anon-function 2 errol-chal)": [[17, "v1", "process-drawable"]] } diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.cpp b/game/graphics/opengl_renderer/OpenGLRenderer.cpp index f9559034b7..47a2c76670 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.cpp +++ b/game/graphics/opengl_renderer/OpenGLRenderer.cpp @@ -155,6 +155,7 @@ void OpenGLRenderer::init_bucket_renderers_jak2() { init_bucket_renderer("tex-l3-shrub", BucketCategory::TEX, BucketId::TEX_L3_SHRUB); init_bucket_renderer("shrub-l3-shrub", BucketCategory::SHRUB, BucketId::SHRUB_L3_SHRUB); + init_bucket_renderer("merc-l3-shrub", BucketCategory::MERC, BucketId::MERC_L3_SHRUB); init_bucket_renderer("tex-l4-shrub", BucketCategory::TEX, BucketId::TEX_L4_SHRUB); // 110 @@ -280,6 +281,8 @@ void OpenGLRenderer::init_bucket_renderers_jak2() { BucketId::TEX_L4_WATER); init_bucket_renderer("merc-l4-water", BucketCategory::MERC, BucketId::MERC_L4_WATER); // 290 + init_bucket_renderer("tex-l5-water", BucketCategory::TEX, + BucketId::TEX_L5_WATER); // 300 init_bucket_renderer("tex-lcom-water", BucketCategory::TEX, BucketId::TEX_LCOM_WATER); diff --git a/game/graphics/opengl_renderer/buckets.h b/game/graphics/opengl_renderer/buckets.h index 5a99f7a038..aee24dfa06 100644 --- a/game/graphics/opengl_renderer/buckets.h +++ b/game/graphics/opengl_renderer/buckets.h @@ -118,6 +118,7 @@ enum class BucketId { MERC_L2_SHRUB = 97, TEX_L3_SHRUB = 100, SHRUB_L3_SHRUB = 101, + MERC_L3_SHRUB = 106, TEX_L4_SHRUB = 109, SHRUB_L4_SHRUB = 110, TEX_L5_SHRUB = 118, @@ -179,6 +180,7 @@ enum class BucketId { MERC_L3_WATER = 280, TEX_L4_WATER = 288, MERC_L4_WATER = 289, + TEX_L5_WATER = 297, TEX_LCOM_WATER = 306, MERC_LCOM_WATER = 307, TEX_LCOM_SKY_POST = 309, diff --git a/goal_src/jak2/engine/ai/traffic-h.gc b/goal_src/jak2/engine/ai/traffic-h.gc index 3252ca78df..bef3ea6311 100644 --- a/goal_src/jak2/engine/ai/traffic-h.gc +++ b/goal_src/jak2/engine/ai/traffic-h.gc @@ -48,6 +48,8 @@ (carc 16) (guard-bike 18) (hellcat 19) + (traffic-type-20 20) + (traffic-type-21 21) ) ;; ---traffic-h:traffic-type diff --git a/goal_src/jak2/levels/common/airlock.gc b/goal_src/jak2/levels/common/airlock.gc index 7f1b69d6a5..d52a0e589e 100644 --- a/goal_src/jak2/levels/common/airlock.gc +++ b/goal_src/jak2/levels/common/airlock.gc @@ -1193,6 +1193,7 @@ This commonly includes things such as: - collision information - loading the skeleton group / bones - sounds" + (stack-size-set! (-> obj main-thread) 1024) (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) diff --git a/goal_src/jak2/levels/forest/lifeseed/protect.gc b/goal_src/jak2/levels/forest/lifeseed/protect.gc index 1385d16f46..678c973030 100644 --- a/goal_src/jak2/levels/forest/lifeseed/protect.gc +++ b/goal_src/jak2/levels/forest/lifeseed/protect.gc @@ -7,3 +7,616 @@ ;; DECOMP BEGINS +(defskelgroup skel-seal-of-mar-game seal-of-mar-top seal-of-mar-top-lod0-jg seal-of-mar-top-idle-ja + ((seal-of-mar-top-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +(deftype seal-of-mar (process-drawable) + ((attach-object uint64 :offset-assert 200) + (scale float :offset-assert 208) + (trans-y float :offset-assert 212) + ) + :heap-base #x60 + :method-count-assert 24 + :size-assert #xd8 + :flag-assert #x18006000d8 + (:methods + (idle () _type_ :state 20) + (die () _type_ :state 21) + (seal-of-mar-method-22 (_type_) none 22) + (seal-of-mar-method-23 (_type_) none 23) + ) + ) + + +(defmethod seal-of-mar-method-22 seal-of-mar ((obj seal-of-mar)) + (set! (-> obj root) (new 'process 'trsqv)) + 0 + (none) + ) + +(defmethod seal-of-mar-method-23 seal-of-mar ((obj seal-of-mar)) + (with-pp + (set! (-> pp level) (level-get *level* 'lprotect)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-seal-of-mar-game" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj draw force-lod) 0) + (set! (-> obj scale) 1.0) + (set! (-> obj draw lod-set lod 0 dist) 409600.0) + 0 + (none) + ) + ) + +(defstate idle (seal-of-mar) + :virtual #t + :code (the-as (function none :behavior seal-of-mar) sleep-code) + :post (behavior () + (spawn (-> self part) (-> self node-list data 3 bone transform trans)) + (ja-post) + (none) + ) + ) + +(defstate die (seal-of-mar) + :virtual #t + :code (behavior () + (cleanup-for-death self) + (none) + ) + ) + +;; WARN: Return type mismatch entity-perm-status vs none. +(defmethod init-from-entity! seal-of-mar ((obj seal-of-mar) (arg0 entity-actor)) + "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. +This commonly includes things such as: +- stack size +- collision information +- loading the skeleton group / bones +- sounds" + (process-entity-status! obj (entity-perm-status dead) #t) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior seal-of-mar-init-by-other seal-of-mar ((arg0 vector) (arg1 vector) (arg2 vector)) + (stack-size-set! (-> self main-thread) 16) + (set! (-> self mask) (logior (process-mask crate) (-> self mask))) + (logclear! (-> self mask) (process-mask actor-pause movie)) + (seal-of-mar-method-22 self) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) (the-as quaternion arg1)) + (set! (-> self root scale quad) (-> arg2 quad)) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 182) self)) + (set! (-> self trans-y) (-> arg0 y)) + (seal-of-mar-method-23 self) + (go-virtual idle) + (none) + ) + +;; WARN: Return type mismatch (pointer process) vs (pointer seal-of-mar). +(defun seal-of-mar-spawn ((arg0 task-manager) (arg1 vector) (arg2 vector) (arg3 vector)) + (process-spawn seal-of-mar arg1 arg2 arg3 :to arg0) + ) + +(deftype city-slums-transport-info (structure) + ((id uint32 :offset-assert 0) + (spawned basic :offset-assert 4) + (plane-pos vector :inline :offset-assert 16) + (plane-quat quaternion :inline :offset-assert 32) + (t-pos vector :inline :offset-assert 48) + (t-quat quaternion :inline :offset-assert 64) + (num-guard uint32 :offset-assert 80) + ) + :method-count-assert 9 + :size-assert #x54 + :flag-assert #x900000054 + ) + + +(define *city-slums-transport-info* (new 'static 'boxed-array :type city-slums-transport-info + (new 'static 'city-slums-transport-info + :plane-pos (new 'static 'vector :x 3095165.2 :y 37526.324 :z -2934498.0 :w 1.0) + :plane-quat (new 'static 'quaternion :y 0.0178 :w 0.9998) + :t-pos (new 'static 'vector :x 2939573.8 :y 61440.0 :z -2691468.5 :w 1.0) + :t-quat (new 'static 'quaternion :y 0.3598 :w -0.933) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x1 + :plane-pos (new 'static 'vector :x 2892557.0 :y 29433.447 :z -2661706.2 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.0007 :y -0.4948 :z 0.0013 :w 0.869) + :t-pos (new 'static 'vector :x 2679873.2 :y 77824.0 :z -2581594.0 :w 1.0) + :t-quat (new 'static 'quaternion :x 0.001 :y -0.5269 :z 0.0011 :w 0.8498) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x2 + :plane-pos (new 'static 'vector :x 2990101.2 :y 38305.793 :z -2735072.0 :w 1.0) + :plane-quat (new 'static 'quaternion :y 0.4134 :z -0.0015 :w -0.9105) + :t-pos (new 'static 'vector :x 3044893.0 :y 65536.0 :z -2410427.2 :w 1.0) + :t-quat (new 'static 'quaternion :x 0.0014 :y -0.3754 :z 0.0005 :w 0.9268) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x3 + :plane-pos (new 'static 'vector :x 3058367.2 :y 27387.084 :z -2246145.2 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.0011 :y -0.0362 :z 0.0009 :w 0.9993) + :t-pos (new 'static 'vector :x 2994847.0 :y 57344.0 :z -2093633.5 :w 1.0) + :t-quat (new 'static 'quaternion :y 0.7931 :w -0.609) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x4 + :plane-pos (new 'static 'vector :x 3053228.5 :y 26790.297 :z -2491042.2 :w 1.0) + :plane-quat (new 'static 'quaternion :x -0.0006 :y -0.2174 :z -0.0012 :w -0.976) + :t-pos (new 'static 'vector :x 2986468.5 :y 65536.0 :z -2262228.2 :w 1.0) + :t-quat (new 'static 'quaternion :x 0.001 :y -0.0806 :z 0.0008 :w 0.9967) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x5 + :plane-pos (new 'static 'vector :x 3006777.0 :y 17257.678 :z -2312612.8 :w 1.0) + :plane-quat (new 'static 'quaternion :y -0.3316 :z -0.0013 :w 0.9434) + :t-pos (new 'static 'vector :x 2676877.8 :y 69632.0 :z -2161058.2 :w 1.0) + :t-quat (new 'static 'quaternion :x 0.0001 :y 0.4182 :z -0.0013 :w -0.9083) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x6 + :plane-pos (new 'static 'vector :x 2715756.5 :y 30702.387 :z -2200581.8 :w 1.0) + :plane-quat (new 'static 'quaternion :y -0.4639 :z 0.0013 :w 0.8858) + :t-pos (new 'static 'vector :x 2460337.0 :y 77824.0 :z -2301717.8 :w 1.0) + :t-quat (new 'static 'quaternion :x -0.0002 :y 0.6653 :z -0.0013 :w -0.7465) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x7 + :plane-pos (new 'static 'vector :x 2520547.8 :y 37126.965 :z -2310556.0 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.0014 :y 0.6249 :z -0.0006 :w -0.7806) + :t-pos (new 'static 'vector :x 2274454.2 :y 73728.0 :z -2308863.2 :w 1.0) + :t-quat (new 'static 'quaternion :x -0.0008 :y -0.9106 :z -0.0011 :w 0.413) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x8 + :plane-pos (new 'static 'vector :x 2477350.0 :y 30634.395 :z -2239698.5 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.0012 :y 0.1168 :z -0.0008 :w 0.9931) + :t-pos (new 'static 'vector :x 2533168.2 :y 77824.0 :z -2036614.4 :w 1.0) + :t-quat (new 'static 'quaternion :x -0.0008 :y -0.1427 :z 0.0011 :w -0.9897) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x9 + :plane-pos (new 'static 'vector :x 2285256.0 :y 33538.457 :z -2189906.8 :w 1.0) + :plane-quat (new 'static 'quaternion :y -0.6014 :w 0.7989) + :t-pos (new 'static 'vector :x 2091575.2 :y 73728.0 :z -2066113.8 :w 1.0) + :t-quat (new 'static 'quaternion :y -0.7502 :w 0.6611) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #xa + :plane-pos (new 'static 'vector :x 2153970.0 :y 34320.383 :z -2080023.4 :w 1.0) + :plane-quat (new 'static 'quaternion :y -0.1532 :w 0.9881) + :t-pos (new 'static 'vector :x 2116023.5 :y 90112.0 :z -1830102.6 :w 1.0) + :t-quat (new 'static 'quaternion :x 0.0013 :y 0.0828 :z 0.0003 :w -0.9965) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #xb + :plane-pos (new 'static 'vector :x 2169575.5 :y 47590.605 :z -1779327.0 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.0015 :y 0.1973 :z 0.0003 :w -0.9803) + :t-pos (new 'static 'vector :x 2094825.9 :y 77824.0 :z -1617763.5 :w 1.0) + :t-quat (new 'static 'quaternion :x -0.0012 :y 0.172 :z -0.0008 :w 0.985) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #xc + :plane-pos (new 'static 'vector :x 1921790.8 :y 30183.014 :z -1487026.6 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.0015 :y 0.1582 :z 0.0004 :w -0.9874) + :t-pos (new 'static 'vector :x 1823168.1 :y 69632.0 :z -1394735.1 :w 1.0) + :t-quat (new 'static 'quaternion :x -0.001 :y -0.9566 :z 0.0011 :w 0.2913) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #xd + :plane-pos (new 'static 'vector :x 1703265.9 :y 20098.252 :z -1322308.9 :w 1.0) + :plane-quat (new 'static 'quaternion :x -0.0014 :y -0.1073 :z -0.0005 :w 0.9942) + :t-pos (new 'static 'vector :x 1664688.5 :y 90112.0 :z -1180704.4 :w 1.0) + :t-quat (new 'static 'quaternion :x -0.0014 :y -0.0343 :z -0.0006 :w 0.9994) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #xe + :plane-pos (new 'static 'vector :x 1749161.1 :y 22818.816 :z -1555168.9 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.0014 :y 0.0245 :z 0.0006 :w -0.9996) + :t-pos (new 'static 'vector :x 1678245.1 :y 77824.0 :z -1422948.4 :w 1.0) + :t-quat (new 'static 'quaternion :x -0.0013 :y -0.7978 :z 0.0007 :w 0.6028) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #xf + :plane-pos (new 'static 'vector :x 1852649.5 :y 17886.822 :z -1740609.1 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.001 :y 0.3503 :z -0.0009 :w -0.9366) + :t-pos (new 'static 'vector :x 1762047.1 :y 69632.0 :z -1603024.1 :w 1.0) + :t-quat (new 'static 'quaternion :x 0.0007 :y 0.1395 :z 0.0011 :w -0.9902) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x10 + :plane-pos (new 'static 'vector :x 2073022.5 :y 30489.395 :z -1919885.8 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.0013 :y -0.7611 :z 0.0008 :w 0.6486) + :t-pos (new 'static 'vector :x 1964806.5 :y 61440.0 :z -1930829.9 :w 1.0) + :t-quat (new 'static 'quaternion :y -0.6727 :w 0.7398) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x11 + :plane-pos (new 'static 'vector :x 1850323.0 :y 29569.844 :z -1880109.0 :w 1.0) + :plane-quat (new 'static 'quaternion :y 0.1031 :z 0.0015 :w 0.9946) + :t-pos (new 'static 'vector :x 1879482.4 :y 61440.0 :z -1762779.1 :w 1.0) + :t-quat (new 'static 'quaternion :x 0.0001 :y 0.0476 :z 0.0015 :w 0.9988) + :num-guard #x14 + ) + ) + ) + +(set-subtask-hook! + *game-info* + 142 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set-setting! 'exclusive-task #f 0 (-> self node-info task)) + (set-setting! 'airlock #f 0 0) + (let ((v1-5 (entity-by-name "parking-spot-1"))) + (if v1-5 + (logior! (-> v1-5 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-7 (entity-by-name "parking-spot-2"))) + (if v1-7 + (logior! (-> v1-7 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-9 (entity-by-name "parking-spot-12"))) + (if v1-9 + (logior! (-> v1-9 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-11 (entity-by-name "parking-spot-59"))) + (if v1-11 + (logior! (-> v1-11 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-13 (entity-by-name "parking-spot-60"))) + (if v1-13 + (logior! (-> v1-13 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-15 (entity-by-name "parking-spot-61"))) + (if v1-15 + (logior! (-> v1-15 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-17 (entity-by-name "parking-spot-62"))) + (if v1-17 + (logior! (-> v1-17 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'set-alert-level 2) + (send-event gp-0 'set-alert-duration #xa4cb80) + (send-event gp-0 'deactivate-by-type 6) + (send-event gp-0 'deactivate-by-type 18) + (send-event gp-0 'deactivate-by-type 19) + (send-event gp-0 'deactivate-by-type 20) + (send-event gp-0 'deactivate-by-type 11) + (send-event gp-0 'deactivate-by-type 12) + (send-event gp-0 'deactivate-by-type 13) + (send-event gp-0 'deactivate-by-type 14) + (send-event gp-0 'deactivate-by-type 15) + (send-event gp-0 'deactivate-by-type 16) + (send-event gp-0 'set-object-target-count 6 0) + (send-event gp-0 'set-object-target-count 18 0) + (send-event gp-0 'set-object-target-count 19 0) + (send-event gp-0 'set-object-target-count 11 0) + (send-event gp-0 'set-object-target-count 12 0) + (send-event gp-0 'set-object-target-count 13 0) + (send-event gp-0 'set-object-target-count 14 0) + (send-event gp-0 'set-object-target-count 15 0) + (send-event gp-0 'set-object-target-count 16 0) + (send-event gp-0 'set-object-auto-activate 6 #f) + (send-event gp-0 'set-guard-target-count-range 0 4 4) + (send-event gp-0 'set-guard-target-count-range 1 5 5) + (send-event gp-0 'set-guard-target-count-range 4 0 0) + (send-event gp-0 'set-guard-target-count-range 5 0 0) + ) + (speech-control-method-10 *speech-control* 6 (new 'static 'speech-type-info + :channel #x1 + :priority -2 + :min-delay #x258 + :max-delay #x4b0 + :list (new 'static 'boxed-array :type string + "kg320a" + "kg321a" + "kg322a" + "kg323a" + "kg324a" + "kg325a" + "kg326a" + "kg327a" + "kg328a" + "kg329a" + "kg330a" + "kg331a" + "kg332a" + "kg333a" + "kg334a" + "kg335a" + "kg336a" + "kg337a" + "kg338a" + "kg339a" + "kg340a" + "kg341a" + "kg342a" + "kg343a" + "kg344a" + "kg345a" + "kg347a" + ) + ) + ) + (dotimes (gp-1 (length *city-slums-transport-info*)) + (set! (-> *city-slums-transport-info* gp-1 spawned) #f) + ) + (let ((gp-2 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-2 pos quad) (-> (new 'static 'vector :x 1666621.9 :y 32766.771 :z -1103984.6 :w 1.0) quad)) + (quaternion-identity! (-> gp-2 quat)) + (set! (-> gp-2 flags) (task-arrow-flags)) + (set! (-> gp-2 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn gp-2 (the-as task-arrow self)))) + ) + (set! (-> self data-int32 0) 0) + 0 + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 142 + 1 + (the-as (function object) (lambda :behavior task-manager + () + (let ((a0-0 *traffic-manager*)) + (send-event a0-0 'restore-default-settings) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 142 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (local-vars (s5-4 object)) + (let ((s4-0 (new 'static 'vector :x 1666621.9 :y 32766.771 :z -1103984.6 :w 1.0)) + (gp-0 (vector-z-quaternion! + (new 'stack-no-clear 'vector) + (new 'static 'quaternion :x -0.0015 :y -0.199 :z 0.0002 :w -0.9799) + ) + ) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-! s5-0 (target-pos 0) s4-0) + (let ((v1-1 s5-0)) + (if (and (< (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))) 122880.0) + (< 0.0 (vector-dot s5-0 gp-0)) + ) + (set! (-> self data-int32 0) 1) + ) + ) + ) + (cond + ((zero? (-> self data-int32 0)) + (dotimes (gp-1 (length *city-slums-transport-info*)) + (let ((s5-1 (-> *city-slums-transport-info* gp-1))) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + 0.0 + (let ((f0-7 (vector-vector-xz-distance (target-pos 0) (-> s5-1 t-pos)))) + (cond + ((and (< f0-7 327680.0) (< 204800.0 f0-7)) + (when (and (not (handle->process (-> self slave gp-1))) + (< (the int (-> self data-float gp-1)) (-> self clock frame-counter)) + ) + (let ((s4-2 (new 'stack-no-clear 'transport-params))) + (let ((s3-2 (new 'stack-no-clear 'vector))) + (set! (-> s3-2 quad) (-> s5-1 t-pos quad)) + (set! (-> s4-2 spawn-pos quad) (-> s5-1 t-pos quad)) + (quaternion-copy! (-> s4-2 quat) (-> s5-1 t-quat)) + (set! (-> s4-2 max-guard) (-> s5-1 num-guard)) + (set! (-> s4-2 max-guard) (the-as uint 8)) + (set! (-> s4-2 turret?) #t) + (set! (-> s4-2 speeches?) #t) + (set! (-> s3-2 y) 0.0) + ) + (let* ((s5-2 (entity-nav-mesh-by-aid (the-as actor-id 9070))) + (a0-16 (if (type? s5-2 entity-nav-mesh) + s5-2 + ) + ) + ) + (when a0-16 + (set! (-> s4-2 nav-mesh) (-> a0-16 nav-mesh)) + (set! (-> self slave gp-1) (ppointer->handle (process-spawn transport s4-2 :to self))) + ) + ) + ) + ) + ) + ((< 368640.0 f0-7) + (if (handle->process (-> self slave gp-1)) + (send-event (handle->process (-> self slave gp-1)) 'leave) + ) + ) + ) + ) + ) + (if (and (handle->process (-> self slave gp-1)) + (begin + (let ((s5-5 #t) + (a1-11 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-11 from) (process->ppointer self)) + (set! (-> a1-11 num-params) 0) + (set! (-> a1-11 message) 'guards-left) + (let ((v1-75 (the-as object (send-event-function (handle->process (-> self slave gp-1)) a1-11)))) + (cmove-#f-nonzero s5-4 v1-75 s5-5) + ) + ) + s5-4 + ) + ) + (set! (-> self data-float gp-1) (the float (+ (-> self clock frame-counter) (seconds 20)))) + ) + ) + ) + (else + (let ((gp-2 0)) + (dotimes (s5-6 (length *city-slums-transport-info*)) + (when (handle->process (-> self slave s5-6)) + (send-event (handle->process (-> self slave s5-6)) 'leave) + (+! gp-2 1) + ) + ) + (if (zero? gp-2) + (go-virtual complete) + ) + ) + ) + ) + (none) + ) + ) + ) + +(set-subtask-hook! *game-info* 142 3 (the-as (function object) (lambda :behavior task-manager + () + (until #f + (suspend) + ) + #f + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 142 + 4 + (the-as + (function object) + (lambda :behavior task-manager + () + (send-event (handle->process (-> self arrow)) 'leave) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (talker-spawn-func (-> *talker-speech* 185) *entity-pool* (target-pos 0) (the-as region #f)) + (none) + ) + ) + ) + +(set-subtask-hook! *game-info* 142 5 (the-as (function object) (lambda :behavior task-manager () (none)))) + +(set-subtask-hook! + *game-info* + 142 + 1 + (the-as + (function object) + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + ) + +(set-subtask-hook! + *game-info* + 141 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self slave 0) + (ppointer->handle (seal-of-mar-spawn + self + (new 'static 'vector :x 3150154.5 :y 41696.617 :z -2989634.8 :w 1.0) + (new 'static 'vector :x -0.0086 :y -0.0227 :z -0.691 :w 0.7223) + (new 'static 'vector :x 0.06 :y 0.06 :z 0.06 :w 1.0) + ) + ) + ) + (set! (-> self slave 1) (the-as handle #f)) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 141 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (when (handle->process (-> self slave 0)) + (let ((f0-0 + (vector-vector-xz-distance (new 'static 'vector :x 3132661.8 :y 33669.12 :z -2965708.8 :w 1.0) (target-pos 0)) + ) + ) + (cond + ((< f0-0 20480.0) + (when (!= (-> self slave 0) #f) + (deactivate (handle->process (-> self slave 0))) + (set! (-> self slave 0) (the-as handle #f)) + ) + (if (= (-> self slave 1) #f) + (set! (-> self slave 1) + (ppointer->handle (process-spawn scene-player :init scene-player-init "city-protect-slums-intro" #t #f)) + ) + ) + ) + ((< f0-0 163840.0) + (eval! + (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) + '(want-anim "city-protect-slums-intro") + ) + ) + ) + ) + ) + (none) + ) + ) + ) diff --git a/goal_src/jak2/levels/palace/pal-obs.gc b/goal_src/jak2/levels/palace/pal-obs.gc index beb6802e29..4eecb3a5ca 100644 --- a/goal_src/jak2/levels/palace/pal-obs.gc +++ b/goal_src/jak2/levels/palace/pal-obs.gc @@ -5,6 +5,8 @@ ;; name in dgo: pal-obs ;; dgos: PAE, PAC +;; og:update-with-merge:substr + ;; DECOMP BEGINS (deftype pal-falling-plat (process-drawable) @@ -190,6 +192,7 @@ This commonly includes things such as: - collision information - loading the skeleton group / bones - sounds" + (stack-size-set! (-> obj main-thread) 1024) (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) diff --git a/goal_src/jak2/levels/power_station/vinroom-obs.gc b/goal_src/jak2/levels/power_station/vinroom-obs.gc index 1c42273d8c..7e98cc7d8c 100644 --- a/goal_src/jak2/levels/power_station/vinroom-obs.gc +++ b/goal_src/jak2/levels/power_station/vinroom-obs.gc @@ -260,6 +260,7 @@ This commonly includes things such as: - collision information - loading the skeleton group / bones - sounds" + (stack-size-set! (-> obj main-thread) 1024) (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) diff --git a/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc b/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc new file mode 100644 index 0000000000..844fb091ed --- /dev/null +++ b/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc @@ -0,0 +1,1660 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *race-bike-a-constants*, type rigid-body-vehicle-constants +(define *race-bike-a-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 0.995 + :angular-damping 0.995 + :friction-factor 0.516 + :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 1.5) (meters 2) (meters 5)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*race-bike-a-constants* + :flags #x311 + :object-type #xd + :guard-type #x7 + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 32.0 + :engine-intake-factor 1.0 + :brake-factor 2.0 + :turbo-boost-factor 0.5 + :max-xz-speed (meters 100) + :ground-probe-distance (meters 5) + :ground-probe-offset (meters 0.5) + :cos-ground-effect-angle -0.00000004371139 + :spring-lift-factor 0.35 + :air-drag-factor 1.2 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 6.0 + :steering-thruster-max-gain 2.0 + :steering-thruster-half-gain-speed (meters 80) + :tire-steering-angle 1274.3112 + :tire-static-friction 0.5 + :tire-static-friction-speed (meters 1) + :tire-dynamic-friction 0.25 + :tire-dynamic-friction-speed (meters 3) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 8.0 + :drag-force-factor 1.0 + :speed-limiting-drag 0.75 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :roll-angle 7281.778 + :jump-thrust-factor 0.625 + :buoyancy-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 0.125) + :target-speed-offset (meters 4) + :turning-accel (meters 20) + :toughness-factor 2.0 + :damage-factor 4.0 + :camera-string-min-height (meters 2.5) + :camera-string-max-height (meters 2.5) + :camera-string-min-length (meters 5) + :camera-string-max-length (meters 5.5) + :camera-min-fov 16384.0 + :camera-max-fov 18204.445 + :camera-head-offset 4096.0 + :camera-foot-offset -4096.0 + :camera-air-max-angle-offset 5461.3335 + :camera-max-lookaround-speed 40960.0 + :seat-count 1 + :section-count 2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info :position (new 'static 'vector :w (the-as float #x10000))) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2457.6 :y 409.6 :z 4710.4 :w 1.0) + (new 'static 'vector :x -2457.6 :y 409.6 :z 4710.4 :w 1.0) + ) + :section-bike-front (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x10 #x8 #x2) + :damage-seg-count 3 + ) + :section-bike-rear (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x4 #x0) + :damage-seg-count 2 + ) + :explosion #f + :engine-pitch-scale 0.25 + :engine-pitch-offset -0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound-select 2 + :engine-sound (static-sound-name "vehicle-engine") + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "bike-scrape-stn") + :glance-sound (static-sound-name "bike-glance-stn") + :impact-sound (static-sound-name "bike-impact-stn") + :extra-sound (static-sound-name "car-by-1") + :explosion-part #xa1 + :headlight-count 1 + :taillight-count 1 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :z -3276.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 204.8 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :y 204.8 :z -3276.8 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y -2048.0 :z 7372.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y -2048.0 :z 7372.8 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :y -819.2 :z 10240.0 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :y 1433.6 :z -10240.0 :w 1.0) (new 'static 'vector)) + :lift-thruster-count 2 + :roll-thruster-count 2 + :steering-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-control-point 2 + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :z 7372.8003 :w 1.0) + :normal (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :z -2457.6 :w 1.0) + :normal (new 'static 'vector :y -1.0 :w 1.0) + ) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-control-point 2 + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0) + :normal (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0) + :normal (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :steering-thruster-array (new 'static 'inline-array vehicle-control-point 2 + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :z 10240.0 :w 1.0) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :z -5324.8 :w 1.0) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-control-point 6 + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :z 10649.6 :w 1.0) + :normal (new 'static 'vector :x 1.0 :w 0.25) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :z 2457.6 :w 1.0) + :normal (new 'static 'vector :x 1.0 :w 0.75) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :normal (new 'static 'vector :y 1.0 :w 0.25) + ) + (new 'static 'vehicle-control-point) + (new 'static 'vehicle-control-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :color-option-count 1 + :color-option-array (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) + ) + ) + +;; definition for symbol *race-bike-b-constants*, type rigid-body-vehicle-constants +(define *race-bike-b-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 0.995 + :angular-damping 0.995 + :friction-factor 0.516 + :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 1.5) (meters 2) (meters 5)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*race-bike-b-constants* + :flags #x311 + :object-type #xd + :guard-type #x7 + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 32.0 + :engine-intake-factor 1.0 + :brake-factor 2.0 + :turbo-boost-factor 0.5 + :max-xz-speed (meters 100) + :ground-probe-distance (meters 5) + :ground-probe-offset (meters 0.5) + :cos-ground-effect-angle -0.00000004371139 + :spring-lift-factor 0.35 + :air-drag-factor 1.2 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 6.0 + :steering-thruster-max-gain 2.0 + :steering-thruster-half-gain-speed (meters 80) + :tire-steering-angle 1274.3112 + :tire-static-friction 0.5 + :tire-static-friction-speed (meters 1) + :tire-dynamic-friction 0.25 + :tire-dynamic-friction-speed (meters 3) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 8.0 + :drag-force-factor 1.0 + :speed-limiting-drag 0.75 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :roll-angle 7281.778 + :jump-thrust-factor 0.625 + :buoyancy-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 0.125) + :target-speed-offset (meters 4) + :turning-accel (meters 20) + :toughness-factor 2.0 + :damage-factor 4.0 + :camera-string-min-height (meters 2.5) + :camera-string-max-height (meters 2.5) + :camera-string-min-length (meters 5) + :camera-string-max-length (meters 5.5) + :camera-min-fov 16384.0 + :camera-max-fov 18204.445 + :camera-head-offset 4096.0 + :camera-foot-offset -4096.0 + :camera-air-max-angle-offset 5461.3335 + :camera-max-lookaround-speed 40960.0 + :seat-count 2 + :section-count 2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 757.76 :z 1175.552 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 2048.0 :z -4096.0 :w (the-as float #x40000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2457.6 :y 409.6 :z 4710.4 :w 1.0) + (new 'static 'vector :x -2457.6 :y 409.6 :z 4710.4 :w 1.0) + ) + :section-bike-front (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x20 #x8 #x2) + :damage-seg-count 3 + ) + :section-bike-rear (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x40 #x10 #x4) + :damage-seg-count 3 + ) + :explosion #f + :engine-pitch-scale 0.25 + :engine-pitch-offset -0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound-select 2 + :engine-sound (static-sound-name "vehicle-engine") + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "bike-scrape-stn") + :glance-sound (static-sound-name "bike-glance-stn") + :impact-sound (static-sound-name "bike-impact-stn") + :extra-sound (static-sound-name "car-by-1") + :explosion-part #xa1 + :headlight-count 1 + :taillight-count 1 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :z -3276.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 204.8 :z -3276.8 :w 1.0) + (new 'static 'vector :x -1024.0 :y 204.8 :z -3276.8 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y -2048.0 :z 7372.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y -2048.0 :z 7372.8 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :z 11059.2 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :y 1433.6 :z -8192.0 :w 1.0) (new 'static 'vector)) + :lift-thruster-count 2 + :roll-thruster-count 2 + :steering-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-control-point 2 + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :z 7372.8003 :w 1.0) + :normal (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :z -2457.6 :w 1.0) + :normal (new 'static 'vector :y -1.0 :w 1.0) + ) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-control-point 2 + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0) + :normal (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0) + :normal (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :steering-thruster-array (new 'static 'inline-array vehicle-control-point 2 + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :z 10240.0 :w 1.0) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :z -5324.8 :w 1.0) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-control-point 6 + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :z 10649.6 :w 1.0) + :normal (new 'static 'vector :x 1.0 :w 0.25) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :z 2457.6 :w 1.0) + :normal (new 'static 'vector :x 1.0 :w 0.75) + ) + (new 'static 'vehicle-control-point + :local-pos (new 'static 'vector :z -5734.4 :w 1.0) + :normal (new 'static 'vector :y 1.0 :w 0.25) + ) + (new 'static 'vehicle-control-point) + (new 'static 'vehicle-control-point) + ) + :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0) + :color-option-count 1 + :color-option-array (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) + ) + ) + +;; failed to figure out what this is: +(set! (-> *race-bike-a-constants* explosion) *bike-explosion-info*) + +;; failed to figure out what this is: +(set! (-> *race-bike-b-constants* explosion) *bike-explosion-info*) + +;; definition of type errol-racer +(deftype errol-racer (vehicle-rider) + ((minimap connection-minimap :offset-assert 224) + ) + :heap-base #x70 + :method-count-assert 36 + :size-assert #xe4 + :flag-assert #x24007000e4 + ) + +;; definition for method 3 of type errol-racer +(defmethod inspect errol-racer ((obj errol-racer)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type vehicle-rider inspect))) + (t9-0 obj) + ) + (format #t "~2Tminimap: #~%" (-> obj minimap)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-errol-racer errol-racer errol-racer-lod0-jg errol-racer-idle-ja + ((errol-racer-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 3) + ) + +;; definition for method 31 of type errol-racer +;; WARN: Return type mismatch int vs none. +(defmethod initialize-collision errol-racer ((obj errol-racer)) + (set! (-> obj level) (level-get *level* 'lerlchal)) + (stack-size-set! (-> obj main-thread) 256) + (when (not (-> obj level)) + (format 0 "errol-racer::initialize-collision: ERROR, no lerlchal level~%") + (go process-drawable-art-error "no lerlchal level") + ) + (set! (-> obj root-override) (the-as collide-shape (new 'process 'trsqv))) + 0 + (none) + ) + +;; definition for method 32 of type errol-racer +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-rider-method-32 errol-racer ((obj errol-racer)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-errol-racer" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (logior! (-> obj flags) 1) + (set! (-> obj draw lod-set lod 0 dist) 286720.0) + (vehicle-rider-method-33 obj) + (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 38) (the-as int #f) (the-as vector #t) 0)) + (set! (-> obj riding-anim) 4) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate got-passed (errol-rider) + :virtual #t + :enter (behavior () + (format #t "errol-rider::got-passed~%") + (speech-control-method-12 + *speech-control* + self + (speech-type speech-type-1 speech-type-2 speech-type-4 speech-type-5) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate taunt (errol-racer) + :virtual #t + :event (the-as + (function process int symbol event-message-block object :behavior errol-racer) + vehicle-rider-event-handler + ) + :enter (behavior () + (format #t "errol-rider::taunt race-errol-pass~%") + (speech-control-method-12 + *speech-control* + self + (speech-type speech-type-0 speech-type-2 speech-type-4 speech-type-5) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.05)) + (cond + ((zero? (rand-vu-int-count 2)) + (ja-no-eval :group! (-> self draw art-group data 5) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 6) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (go-virtual active) + (none) + ) + :post (behavior () + (let* ((v1-0 (-> self parent-override)) + (gp-0 (if v1-0 + (-> v1-0 0 self-override) + ) + ) + ) + (when gp-0 + (compute-seat-position gp-0 (-> self root-override trans) 0) + (quaternion-copy! (-> self root-override quat) (-> gp-0 root-override-2 quat)) + ) + ) + (ja-post) + (none) + ) + ) + +;; definition of type vehicle-city-racer +(deftype vehicle-city-racer (vehicle-racer) + () + :heap-base #x380 + :method-count-assert 156 + :size-assert #x3f8 + :flag-assert #x9c038003f8 + ) + +;; definition for method 3 of type vehicle-city-racer +(defmethod inspect vehicle-city-racer ((obj vehicle-city-racer)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type vehicle-racer inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 117 of type vehicle-city-racer +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-117 vehicle-city-racer ((obj vehicle-city-racer) (arg0 vector) (arg1 int) (arg2 int)) + ((method-of-type vehicle vehicle-method-117) obj arg0 arg1 arg2) + 0 + (none) + ) + +;; definition for method 137 of type vehicle-city-racer +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-137 vehicle-city-racer ((obj vehicle-city-racer) (arg0 traffic-object-spawn-params)) + (let ((t9-0 vehicle-rider-spawn) + (v1-0 (-> arg0 user-data)) + ) + (t9-0 + obj + (if (= v1-0 2) + errol-racer + citizen-norm-rider + ) + arg0 + ) + ) + 0 + (none) + ) + +;; definition for method 154 of type vehicle-city-racer +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-racer-method-154 vehicle-city-racer ((obj vehicle-city-racer)) + (cond + ((logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) + (let ((f0-0 368640.0)) + (if (or (< (* f0-0 f0-0) (-> obj player-dist2)) + (let ((f0-3 102400.0)) + (and (< (* f0-3 f0-3) (-> obj player-dist2)) + (zero? (logand (-> obj draw status) (draw-control-status on-screen))) + ) + ) + ) + (rigid-body-object-method-39 obj) + ) + ) + ) + (else + (let ((f0-6 (-> obj player-dist2)) + (f1-2 348160.0) + ) + (if (and (< f0-6 (* f1-2 f1-2)) + (let ((f0-7 (-> obj player-dist2)) + (f1-5 81920.0) + ) + (or (< f0-7 (* f1-5 f1-5)) (logtest? (-> obj draw status) (draw-control-status on-screen))) + ) + ) + (rigid-body-object-method-38 obj) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type race-bike-a +(deftype race-bike-a (vehicle-city-racer) + () + :heap-base #x380 + :method-count-assert 156 + :size-assert #x3f8 + :flag-assert #x9c038003f8 + ) + +;; definition for method 3 of type race-bike-a +(defmethod inspect race-bike-a ((obj race-bike-a)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type vehicle-city-racer inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 7 of type race-bike-a +;; WARN: Return type mismatch vehicle-city-racer vs race-bike-a. +(defmethod relocate race-bike-a ((obj race-bike-a) (arg0 int)) + (the-as race-bike-a ((method-of-type vehicle-city-racer relocate) obj arg0)) + ) + +;; definition for method 32 of type race-bike-a +;; WARN: Return type mismatch int vs none. +(defmethod allocate-and-init-cshape race-bike-a ((obj race-bike-a)) + (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) + (set! (-> s5-0 total-prims) (the-as uint 6)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 11264.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 0.0 -819.2 4505.6 3686.4) + (set! (-> v1-11 nav-radius) 6144.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-13 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 -3686.4 4096.0) + (set! (-> v1-13 nav-radius) 6144.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 96)))) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 204.8 3276.8 1228.8 3276.8) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 -819.2 9011.2 1638.4) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 0.0 1228.8 -8601.6 2048.0) + ) + (set! (-> s5-0 nav-radius) 16384.0) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> obj root-override-2) s5-0) + ) + 0 + (none) + ) + +;; definition for method 33 of type race-bike-a +;; WARN: Return type mismatch int vs none. +(defmethod init-skel-and-rigid-body race-bike-a ((obj race-bike-a)) + (lwide-entity-hack) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-bikea" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj rider-hand-joint) 0) + (alloc-and-init-rigid-body-control obj *race-bike-a-constants*) + 0 + (none) + ) + +;; definition of type race-bike-b +(deftype race-bike-b (vehicle-city-racer) + () + :heap-base #x380 + :method-count-assert 156 + :size-assert #x3f8 + :flag-assert #x9c038003f8 + ) + +;; definition for method 3 of type race-bike-b +(defmethod inspect race-bike-b ((obj race-bike-b)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type vehicle-city-racer inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 7 of type race-bike-b +;; WARN: Return type mismatch vehicle-racer vs race-bike-b. +(defmethod relocate race-bike-b ((obj race-bike-b) (arg0 int)) + (the-as race-bike-b ((method-of-type vehicle-racer relocate) obj arg0)) + ) + +;; definition for method 32 of type race-bike-b +;; WARN: Return type mismatch int vs none. +(defmethod allocate-and-init-cshape race-bike-b ((obj race-bike-b)) + (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) + (set! (-> s5-0 total-prims) (the-as uint 6)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 11264.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 0.0 -409.6 4505.6 4300.8) + (set! (-> v1-11 nav-radius) 6144.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-13 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 -3686.4 4096.0) + (set! (-> v1-13 nav-radius) 6144.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 96)))) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 204.8 3276.8 1228.8 3276.8) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 -819.2 9011.2 1638.4) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 0.0 1228.8 -8601.6 2048.0) + ) + (set! (-> s5-0 nav-radius) 16384.0) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> obj root-override-2) s5-0) + ) + 0 + (none) + ) + +;; definition for method 33 of type race-bike-b +;; WARN: Return type mismatch int vs none. +(defmethod init-skel-and-rigid-body race-bike-b ((obj race-bike-b)) + (lwide-entity-hack) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-bikeb" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj rider-hand-joint) 0) + (alloc-and-init-rigid-body-control obj *race-bike-b-constants*) + 0 + (none) + ) + +;; definition of type turbo-ring +(deftype turbo-ring (process-drawable) + ((root-override collide-shape :offset 128) + (touch-time time-frame :offset-assert 200) + (minimap connection-minimap :offset-assert 208) + (player-got symbol :offset-assert 212) + (persistent symbol :offset-assert 216) + (id int8 :offset-assert 220) + (boost float :offset-assert 224) + (plane vector :inline :offset-assert 240) + (part-track handle :offset-assert 256) + (mat matrix :inline :offset-assert 272) + ) + :heap-base #xd0 + :method-count-assert 25 + :size-assert #x150 + :flag-assert #x1900d00150 + (:methods + (idle () _type_ :state 20) + (die () _type_ :state 21) + (turbo-ring-method-22 (_type_) none 22) + (turbo-ring-method-23 (_type_) none 23) + (turbo-ring-method-24 (_type_) none 24) + ) + ) + +;; definition for method 3 of type turbo-ring +(defmethod inspect turbo-ring ((obj turbo-ring)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Ttouch-time: ~D~%" (-> obj touch-time)) + (format #t "~2Tminimap: #~%" (-> obj minimap)) + (format #t "~2Tplayer-got: ~A~%" (-> obj player-got)) + (format #t "~2Tpersistent: ~A~%" (-> obj persistent)) + (format #t "~2Tid: ~D~%" (-> obj id)) + (format #t "~2Tboost: ~f~%" (-> obj boost)) + (format #t "~2Tplane: #~%" (-> obj plane)) + (format #t "~2Tpart-track: ~D~%" (-> obj part-track)) + (format #t "~2Tmat: #~%" (-> obj mat)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defstate idle (turbo-ring) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as + object + (case event-type + (('touched) + (let* ((s4-0 (-> (the-as vehicle proc) root-override-2)) + (gp-0 (if (type? s4-0 collide-shape-moving) + s4-0 + ) + ) + ) + (when gp-0 + (let ((s4-1 (new 'stack-no-clear 'vehicle-control-point))) + (set! (-> s4-1 local-pos quad) (-> gp-0 trans quad)) + (set! (-> s4-1 normal quad) (-> gp-0 trans-old-old quad)) + (set! (-> s4-1 local-pos w) 1.0) + (set! (-> s4-1 normal w) 1.0) + (let ((f30-0 (vector4-dot (-> self plane) (-> s4-1 local-pos))) + (f28-0 (vector4-dot (-> self plane) (-> s4-1 normal))) + (f0-5 (fmax + (vector-vector-distance-squared (-> self root-override trans) (-> s4-1 local-pos)) + (vector-vector-distance-squared (-> self root-override trans) (-> s4-1 normal)) + ) + ) + (f1-0 40960.0) + ) + (when (< f0-5 (* f1-0 f1-0)) + (when (or (and (< f30-0 0.0) (>= f28-0 0.0)) (and (< f28-0 0.0) (>= f30-0 0.0))) + (send-event proc 'turbo-ring (-> self boost)) + (set! (-> self touch-time) (-> self clock frame-counter)) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1059) + 0 + #f + #f + #f + (-> self mat) + :to *entity-pool* + ) + (when (logtest? (-> gp-0 root-prim prim-core collide-as) (collide-spec jak)) + (set! (-> self player-got) #t) + (send-event (ppointer->process (-> self parent)) 'turbo-ring-pickup (-> self id)) + (if (not (-> self persistent)) + (the-as symbol (kill-callback (-> *minimap* engine) (-> self minimap))) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :code (the-as (function none :behavior turbo-ring) sleep-code) + :post (behavior () + (if (and (-> self player-got) + (>= (- (-> self clock frame-counter) (-> self touch-time)) (seconds 3)) + (or (not *target*) + (or (< 204800.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + (logtest? (focus-status teleporting) (-> *target* focus-status)) + ) + ) + (not (-> self persistent)) + ) + (go-virtual die) + ) + (spawn-with-matrix (-> self part) (-> self mat)) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die (turbo-ring) + :virtual #t + :code (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-3 (-> self root-override root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (none) + ) + ) + +;; definition for method 22 of type turbo-ring +;; WARN: Return type mismatch int vs none. +(defmethod turbo-ring-method-22 turbo-ring ((obj turbo-ring)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrate-using) (the-as penetrate -1)) + (set! (-> s5-0 penetrated-by) (the-as penetrate -1)) + (let ((v1-4 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-as) (collide-spec obstacle)) + (set-vector! (-> v1-4 local-sphere) 0.0 0.0 0.0 22528.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-4) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-7 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-7 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-7 prim-core collide-with)) + ) + (set! (-> s5-0 event-self) 'touched) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; definition for method 23 of type turbo-ring +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod turbo-ring-method-23 turbo-ring ((obj turbo-ring)) + (with-pp + (let ((s5-0 (-> obj mat))) + (let ((s4-0 (new 'stack-no-clear 'quaternion))) + (quaternion-rotate-local-y! s4-0 (-> obj root-override quat) 16384.0) + (quaternion->matrix s5-0 s4-0) + ) + (set! (-> s5-0 trans quad) (-> obj root-override trans quad)) + (set! (-> obj plane quad) (-> s5-0 vector 0 quad)) + ) + (set! (-> obj plane w) (- (vector-dot (-> obj plane) (-> obj root-override trans)))) + (update-transforms (-> obj root-override)) + (set! (-> obj player-got) #f) + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1058) obj)) + (if (not (-> obj persistent)) + (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 15) (the-as int #f) (the-as vector #t) 0)) + ) + (set! (-> obj touch-time) (-> pp clock frame-counter)) + 0 + (none) + ) + ) + +;; definition for function turbo-ring-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior turbo-ring-init-by-other turbo-ring ((arg0 city-race-ring-info) (arg1 int) (arg2 symbol)) + (turbo-ring-method-22 self) + (set! (-> self root-override trans quad) (-> arg0 pos quad)) + (set! (-> self root-override trans y) (+ 10240.0 (-> self root-override trans y))) + (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (-> arg0 pos w)) + (set! (-> self boost) (-> arg0 boost)) + (set! (-> self id) arg1) + (set! (-> self persistent) arg2) + (turbo-ring-method-23 self) + (go-virtual idle) + (none) + ) + +;; definition for function turbo-ring-spawn +;; WARN: Return type mismatch process vs turbo-ring. +(defun turbo-ring-spawn ((arg0 task-manager) (arg1 city-race-ring-info) (arg2 int) (arg3 symbol)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn turbo-ring arg1 arg2 arg3 :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as turbo-ring gp-0) + ) + ) + +;; definition for symbol *city-errol-challenge-rings*, type (array city-race-ring-info) +(define *city-errol-challenge-rings* + (new 'static 'boxed-array :type city-race-ring-info + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -501267.66 :y 45521.715 :z 5746707.5 :w -10478.551) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -1228800.0 :y 42188.8 :z 5879808.0 :w -23301.69) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -1477360.9 :y 29575.986 :z 5499939.0 :w -31020.3) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -1564742.9 :y 39918.387 :z 4562023.5 :w -30155.426) + :boost 1.0 + :dist 1228800.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -1316062.0 :y 43584.72 :z 3987215.2 :w 17430.592) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -977305.6 :y 43778.457 :z 4550656.0 :w 9357.085) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -286720.0 :y 43008.0 :z 4481024.0 :w 28599.184) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -627501.44 :y 43474.125 :z 3367819.8 :w -22064.916) + :boost 1.0 + :dist 1433600.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -1121484.8 :y 42598.4 :z 3148595.2 :w -25395.2) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -1216512.0 :y 42598.4 :z 2364620.8 :w 24903.68) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -502169.6 :y 42598.4 :z 2482176.0 :w 7281.778) + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 43008.0 :y 75776.0 :z 2939699.2 :w 3895.751) + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 121241.6 :y 75776.0 :z 3137536.0 :w 11141.12) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 668467.2 :y 42926.08 :z 3215769.5 :w 5734.4) + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 593276.5 :y 42948.61 :z 3583451.2 :w -11135.367) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 394001.62 :y 42757.734 :z 4304348.0 :w 2242.6238) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 1143199.4 :y 43119.0 :z 4350973.0 :w 29214.02) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 1132719.2 :y 43012.098 :z 3730843.8 :w -23207.373) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 889651.2 :y 43130.47 :z 3519283.2 :w -28053.05) + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 1098956.8 :y 79407.92 :z 3152171.8 :w 15883.359) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 1462272.0 :y 75776.0 :z 3139584.0 :w 26396.445) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 1469836.5 :y 75548.266 :z 2407241.8 :w 32354.158) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 1473249.2 :y 75912.4 :z 1783800.2 :w -23723.45) + :boost 1.0 + :dist 1433600.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 924123.56 :y 76269.57 :z 1767255.2 :w -24209.729) + :boost 0.5 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 923115.5 :y 60855.5 :z 1340197.2 :w 25778.986) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 1125048.4 :y 11059.2 :z 890880.0 :w -30947.555) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 1073152.0 :y 11059.2 :z 443596.8 :w -27306.666) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 400853.8 :y 44764.363 :z 358071.1 :w -16960.117) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 13721.6 :y 43203.79 :z 118620.16 :w -20024.889) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -490209.28 :y 43203.79 :z 103424.0 :w -16384.0) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -953139.2 :y 43366.81 :z 48291.84 :w -26099.95) + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -752844.8 :y 43361.074 :z -201523.2 :w 23619.176) + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -762741.1 :y 43008.0 :z -404684.8 :w -19180.986) + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -1064960.0 :y 43008.0 :z -496435.2 :w -27045.65) + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -882273.06 :y 55597.465 :z -725249.6 :w 20593.486) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -169574.4 :y 10721.689 :z -826982.4 :w 25912.205) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -253296.64 :y 10721.689 :z -1131315.2 :w -29655.04) + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -306380.8 :y 10564.403 :z -1419673.6 :w 21044.338) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 154887.38 :y 10681.14 :z -1433848.2 :w 9148.079) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 341606.4 :y 10649.6 :z -1017446.4 :w 16384.0) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 840908.8 :y 10240.0 :z -1014169.6 :w 16384.0) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 1126400.0 :y 10240.0 :z -1013760.0 :w 16384.0) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 1460224.0 :y 44236.8 :z -1370521.6 :w -30419.627) + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 1461862.4 :y 43499.52 :z -1816985.6 :w -25991.395) + :boost 1.0 + :dist 819200.0 + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 189 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0 32) + (set-setting! 'exclusive-task #f 0 (-> self node-info task)) + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'set-target-level #x3e800000) + (send-event gp-0 'set-guard-target-count-range 0 0 0) + (send-event gp-0 'set-guard-target-count-range 1 0 0) + (send-event gp-0 'set-guard-target-count-range 2 0 0) + (send-event gp-0 'set-guard-target-count-range 3 0 0) + (send-event gp-0 'set-guard-target-count-range 4 0 1) + (send-event gp-0 'set-guard-target-count-range 5 0 0) + ) + (until (= (level-status *level* 'ctyport) 'active) + (suspend) + ) + (let ((v1-43 (entity-by-name "parking-spot-20"))) + (if v1-43 + (logior! (-> v1-43 extra perm status) (entity-perm-status bit-9)) + ) + ) + (set! (-> self start-time) 0) + (set! (-> self sub-state) (the-as uint 0)) + (set! (-> self count) 0) + (set! (-> self max-count) -1) + (race-start (-> self info index) (the-as symbol self) #f) + (set! (-> self begin-pos quad) + (-> (new 'static 'vector :x -326041.6 :y 36454.4 :z 5391565.0 :w 266240.0) quad) + ) + (set-setting! 'attack #f 0 0) + (set-setting! 'board #f 0 0) + (set-setting! 'gun #f 0 0) + (set-setting! 'vehicle-hijacking #f 0 0) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 189 + 1 + (the-as + (function object) + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 189 + 6 + (the-as + (function object) + (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('turbo-ring-pickup) + (let ((gp-0 (-> arg3 param 0))) + (format #t "player collected ring ~d~%" gp-0) + (cond + ((= gp-0 (-> self sub-state)) + (let ((v0-0 (the-as object (+ (-> self sub-state) 1)))) + (set! (-> self sub-state) (the-as uint v0-0)) + v0-0 + ) + ) + ((< (the-as int gp-0) (the-as int (-> self sub-state))) + (format #t "player re-collecting an earlier ring (~d)~%" gp-0) + ) + (else + (format #t "missed a ring (ring-id ~d, sub-state ~d)~%" gp-0 (-> self sub-state)) + (go-virtual fail) + ) + ) + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 189 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 1)) + (s5-0 *city-errol-challenge-rings*) + ) + (if (= (-> self max-count) -1) + (set! (-> self max-count) (-> s5-0 length)) + ) + (set! (-> gp-0 0 quad) (-> (target-pos 0) quad)) + (let* ((s4-1 (new 'static 'vector :x 1305804.8 :y 102400.0 :z 3180544.0 :w 163840.0)) + (f0-0 (vector-vector-distance-squared s4-1 (-> gp-0 0))) + (f1-0 (-> s4-1 w)) + ) + (when (< f0-0 (* f1-0 f1-0)) + (if (< (-> self count) 18) + (go-virtual fail) + ) + ) + ) + (while (< (-> self count) (-> self max-count)) + (let ((s4-2 (-> s5-0 (-> self count)))) + (let ((f0-1 (-> s4-2 dist))) + (b! (< (* f0-1 f0-1) (vector-vector-distance-squared (-> gp-0 0) (-> s4-2 pos))) cfg-11) + ) + (if (turbo-ring-spawn self s4-2 (-> self count) #f) + (+! (-> self count) 1) + ) + ) + ) + ) + (label cfg-11) + 0 + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 189 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (not (logtest? (-> *race-state* flags) 1)) + (let ((f0-0 (-> self begin-pos w))) + (if (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0))) + (go-virtual fail) + ) + ) + (suspend) + ) + (set-setting! 'exclusive-load 'lerlchal 0 0) + (set-setting! 'airlock #f 0 0) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! *game-info* 189 5 (the-as (function object) (lambda :behavior task-manager () (none)))) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 189 + 4 + (the-as + (function object) + (lambda :behavior task-manager () (send-event *traffic-manager* 'decrease-alert-level 0) (none)) + ) + ) + +;; failed to figure out what this is: +(copy-hooks! (-> *game-info* sub-task-list 307) (-> *game-info* sub-task-list 189)) + +;; definition for symbol *city-bush-port-rings*, type (array city-race-ring-info) +(define *city-bush-port-rings* (new 'static 'boxed-array :type city-race-ring-info + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 2232320.0 :y 44646.4 :z 6668697.5 :w -12524.658) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 1606451.2 :y 44646.4 :z 6968525.0 :w -13871.786) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 1113702.4 :y 45875.2 :z 7122944.0 :w -13926.4) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 764313.6 :y 80691.2 :z 7154073.5 :w -16511.43) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 292454.4 :y 41779.2 :z 7047987.0 :w -20807.68) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -140083.2 :y 45056.0 :z 6921421.0 :w -22646.33) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -908492.8 :y 44646.4 :z 6564659.0 :w -27270.258) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -838041.6 :y 40550.4 :z 6183731.0 :w 26578.488) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -681984.0 :y 65126.4 :z 5944934.5 :w 26396.445) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x -327270.4 :y 45465.6 :z 5598003.0 :w 22974.008) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 185139.2 :y 44236.8 :z 5402214.5 :w 11487.004) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 785203.2 :y 43417.6 :z 5620531.0 :w 16019.911) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 1370112.0 :y 42188.8 :z 5401805.0 :w 19478.756) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 1925939.2 :y 46694.4 :z 5620941.0 :w 10012.444) + :boost 1.0 + :dist 819200.0 + ) + (new 'static 'city-race-ring-info + :pos (new 'static 'vector :x 2256896.0 :y 65126.4 :z 5926502.5 :w 7645.8667) + :boost 1.0 + :dist 819200.0 + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 309 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0 32) + (set-setting! 'exclusive-task #f 0 (-> self node-info task)) + (set-setting! 'exclusive-load 'lprtrace 0 0) + (set-setting! 'airlock #f 0 0) + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'set-target-level #x3e800000) + (send-event gp-0 'set-guard-target-count-range 0 0 0) + (send-event gp-0 'set-guard-target-count-range 1 0 0) + (send-event gp-0 'set-guard-target-count-range 2 0 0) + (send-event gp-0 'set-guard-target-count-range 3 0 0) + (send-event gp-0 'set-guard-target-count-range 4 0 1) + (send-event gp-0 'set-guard-target-count-range 5 0 0) + ) + (until (= (level-status *level* 'ctyport) 'active) + (suspend) + ) + (let ((v1-47 (entity-by-name "parking-spot-22"))) + (if v1-47 + (logior! (-> v1-47 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-49 (entity-by-name "parking-spot-23"))) + (if v1-49 + (logior! (-> v1-49 extra perm status) (entity-perm-status bit-9)) + ) + ) + (set! (-> self start-time) 0) + (set! (-> self sub-state) (the-as uint 0)) + (set! (-> self count) 0) + (let ((gp-2 *city-bush-port-rings*)) + (set! (-> self max-count) (-> gp-2 length)) + (dotimes (s5-0 (-> self max-count)) + (let ((a1-12 (-> gp-2 s5-0))) + (if (turbo-ring-spawn self a1-12 s5-0 #t) + (+! (-> self count) 1) + ) + ) + ) + ) + (race-start (-> self info index) (the-as symbol self) #f) + (set! (-> self begin-pos quad) + (-> (new 'static 'vector :x 2519040.0 :y 40960.0 :z 6545408.0 :w 184320.0) quad) + ) + (set-setting! 'attack #f 0 0) + (set-setting! 'board #f 0 0) + (set-setting! 'gun #f 0 0) + (set-setting! 'vehicle-hijacking #f 0 0) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 309 + 1 + (the-as + (function object) + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 309 + 6 + (the-as (function object) (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (the-as object (case arg2 + (('race-win 'race-lose) + (let ((v0-0 1)) + (set! (-> self sub-state) (the-as uint v0-0)) + v0-0 + ) + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 309 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (not (logtest? (-> *race-state* flags) 1)) + (let ((f0-0 (-> self begin-pos w))) + (if (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0))) + (go-virtual fail) + ) + ) + (suspend) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 309 + 2 + (the-as (function object) (lambda :behavior task-manager + () + (when (zero? (-> self sub-state)) + (let ((v1-2 (-> *target* pilot))) + (when (nonzero? v1-2) + (let ((v1-4 (handle->process (-> v1-2 vehicle)))) + (when v1-4 + (if (< (-> (the-as process-drawable v1-4) root trans y) 16384.0) + (go-virtual fail) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! *game-info* 309 5 (the-as (function object) (lambda :behavior task-manager () (none)))) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 309 + 4 + (the-as + (function object) + (lambda :behavior task-manager () (send-event *traffic-manager* 'decrease-alert-level 0) (none)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/forest/lifeseed/protect_REF.gc b/test/decompiler/reference/jak2/levels/forest/lifeseed/protect_REF.gc new file mode 100644 index 0000000000..fc3e08b2c8 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/forest/lifeseed/protect_REF.gc @@ -0,0 +1,675 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-seal-of-mar-game seal-of-mar-top seal-of-mar-top-lod0-jg seal-of-mar-top-idle-ja + ((seal-of-mar-top-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +;; definition of type seal-of-mar +(deftype seal-of-mar (process-drawable) + ((attach-object uint64 :offset-assert 200) + (scale float :offset-assert 208) + (trans-y float :offset-assert 212) + ) + :heap-base #x60 + :method-count-assert 24 + :size-assert #xd8 + :flag-assert #x18006000d8 + (:methods + (idle () _type_ :state 20) + (die () _type_ :state 21) + (seal-of-mar-method-22 (_type_) none 22) + (seal-of-mar-method-23 (_type_) none 23) + ) + ) + +;; definition for method 3 of type seal-of-mar +(defmethod inspect seal-of-mar ((obj seal-of-mar)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tattach-object: ~D~%" (-> obj attach-object)) + (format #t "~2Tscale: ~f~%" (-> obj scale)) + (format #t "~2Ttrans-y: ~f~%" (-> obj trans-y)) + (label cfg-4) + obj + ) + +;; definition for method 22 of type seal-of-mar +;; WARN: Return type mismatch int vs none. +(defmethod seal-of-mar-method-22 seal-of-mar ((obj seal-of-mar)) + (set! (-> obj root) (new 'process 'trsqv)) + 0 + (none) + ) + +;; definition for method 23 of type seal-of-mar +;; WARN: Return type mismatch int vs none. +(defmethod seal-of-mar-method-23 seal-of-mar ((obj seal-of-mar)) + (with-pp + (set! (-> pp level) (level-get *level* 'lprotect)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-seal-of-mar-game" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj draw force-lod) 0) + (set! (-> obj scale) 1.0) + (set! (-> obj draw lod-set lod 0 dist) 409600.0) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate idle (seal-of-mar) + :virtual #t + :code (the-as (function none :behavior seal-of-mar) sleep-code) + :post (behavior () + (spawn (-> self part) (-> self node-list data 3 bone transform trans)) + (ja-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die (seal-of-mar) + :virtual #t + :code (behavior () + (cleanup-for-death self) + (none) + ) + ) + +;; definition for method 11 of type seal-of-mar +;; WARN: Return type mismatch entity-perm-status vs none. +(defmethod init-from-entity! seal-of-mar ((obj seal-of-mar) (arg0 entity-actor)) + "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. +This commonly includes things such as: +- stack size +- collision information +- loading the skeleton group / bones +- sounds" + (process-entity-status! obj (entity-perm-status dead) #t) + (none) + ) + +;; definition for function seal-of-mar-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior seal-of-mar-init-by-other seal-of-mar ((arg0 vector) (arg1 vector) (arg2 vector)) + (stack-size-set! (-> self main-thread) 16) + (set! (-> self mask) (logior (process-mask crate) (-> self mask))) + (logclear! (-> self mask) (process-mask actor-pause movie)) + (seal-of-mar-method-22 self) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) (the-as quaternion arg1)) + (set! (-> self root scale quad) (-> arg2 quad)) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 182) self)) + (set! (-> self trans-y) (-> arg0 y)) + (seal-of-mar-method-23 self) + (go-virtual idle) + (none) + ) + +;; definition for function seal-of-mar-spawn +;; WARN: Return type mismatch (pointer process) vs (pointer seal-of-mar). +(defun seal-of-mar-spawn ((arg0 task-manager) (arg1 vector) (arg2 vector) (arg3 vector)) + (process-spawn seal-of-mar arg1 arg2 arg3 :to arg0) + ) + +;; definition of type city-slums-transport-info +(deftype city-slums-transport-info (structure) + ((id uint32 :offset-assert 0) + (spawned basic :offset-assert 4) + (plane-pos vector :inline :offset-assert 16) + (plane-quat quaternion :inline :offset-assert 32) + (t-pos vector :inline :offset-assert 48) + (t-quat quaternion :inline :offset-assert 64) + (num-guard uint32 :offset-assert 80) + ) + :method-count-assert 9 + :size-assert #x54 + :flag-assert #x900000054 + ) + +;; definition for method 3 of type city-slums-transport-info +(defmethod inspect city-slums-transport-info ((obj city-slums-transport-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'city-slums-transport-info) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tspawned: ~A~%" (-> obj spawned)) + (format #t "~1Tplane-pos: #~%" (-> obj plane-pos)) + (format #t "~1Tplane-quat: #~%" (-> obj plane-quat)) + (format #t "~1Tt-pos: #~%" (-> obj t-pos)) + (format #t "~1Tt-quat: #~%" (-> obj t-quat)) + (format #t "~1Tnum-guard: ~D~%" (-> obj num-guard)) + (label cfg-4) + obj + ) + +;; definition for symbol *city-slums-transport-info*, type (array city-slums-transport-info) +(define *city-slums-transport-info* (new 'static 'boxed-array :type city-slums-transport-info + (new 'static 'city-slums-transport-info + :plane-pos (new 'static 'vector :x 3095165.2 :y 37526.324 :z -2934498.0 :w 1.0) + :plane-quat (new 'static 'quaternion :y 0.0178 :w 0.9998) + :t-pos (new 'static 'vector :x 2939573.8 :y 61440.0 :z -2691468.5 :w 1.0) + :t-quat (new 'static 'quaternion :y 0.3598 :w -0.933) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x1 + :plane-pos (new 'static 'vector :x 2892557.0 :y 29433.447 :z -2661706.2 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.0007 :y -0.4948 :z 0.0013 :w 0.869) + :t-pos (new 'static 'vector :x 2679873.2 :y 77824.0 :z -2581594.0 :w 1.0) + :t-quat (new 'static 'quaternion :x 0.001 :y -0.5269 :z 0.0011 :w 0.8498) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x2 + :plane-pos (new 'static 'vector :x 2990101.2 :y 38305.793 :z -2735072.0 :w 1.0) + :plane-quat (new 'static 'quaternion :y 0.4134 :z -0.0015 :w -0.9105) + :t-pos (new 'static 'vector :x 3044893.0 :y 65536.0 :z -2410427.2 :w 1.0) + :t-quat (new 'static 'quaternion :x 0.0014 :y -0.3754 :z 0.0005 :w 0.9268) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x3 + :plane-pos (new 'static 'vector :x 3058367.2 :y 27387.084 :z -2246145.2 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.0011 :y -0.0362 :z 0.0009 :w 0.9993) + :t-pos (new 'static 'vector :x 2994847.0 :y 57344.0 :z -2093633.5 :w 1.0) + :t-quat (new 'static 'quaternion :y 0.7931 :w -0.609) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x4 + :plane-pos (new 'static 'vector :x 3053228.5 :y 26790.297 :z -2491042.2 :w 1.0) + :plane-quat (new 'static 'quaternion :x -0.0006 :y -0.2174 :z -0.0012 :w -0.976) + :t-pos (new 'static 'vector :x 2986468.5 :y 65536.0 :z -2262228.2 :w 1.0) + :t-quat (new 'static 'quaternion :x 0.001 :y -0.0806 :z 0.0008 :w 0.9967) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x5 + :plane-pos (new 'static 'vector :x 3006777.0 :y 17257.678 :z -2312612.8 :w 1.0) + :plane-quat (new 'static 'quaternion :y -0.3316 :z -0.0013 :w 0.9434) + :t-pos (new 'static 'vector :x 2676877.8 :y 69632.0 :z -2161058.2 :w 1.0) + :t-quat (new 'static 'quaternion :x 0.0001 :y 0.4182 :z -0.0013 :w -0.9083) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x6 + :plane-pos (new 'static 'vector :x 2715756.5 :y 30702.387 :z -2200581.8 :w 1.0) + :plane-quat (new 'static 'quaternion :y -0.4639 :z 0.0013 :w 0.8858) + :t-pos (new 'static 'vector :x 2460337.0 :y 77824.0 :z -2301717.8 :w 1.0) + :t-quat (new 'static 'quaternion :x -0.0002 :y 0.6653 :z -0.0013 :w -0.7465) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x7 + :plane-pos (new 'static 'vector :x 2520547.8 :y 37126.965 :z -2310556.0 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.0014 :y 0.6249 :z -0.0006 :w -0.7806) + :t-pos (new 'static 'vector :x 2274454.2 :y 73728.0 :z -2308863.2 :w 1.0) + :t-quat (new 'static 'quaternion :x -0.0008 :y -0.9106 :z -0.0011 :w 0.413) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x8 + :plane-pos (new 'static 'vector :x 2477350.0 :y 30634.395 :z -2239698.5 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.0012 :y 0.1168 :z -0.0008 :w 0.9931) + :t-pos (new 'static 'vector :x 2533168.2 :y 77824.0 :z -2036614.4 :w 1.0) + :t-quat (new 'static 'quaternion :x -0.0008 :y -0.1427 :z 0.0011 :w -0.9897) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x9 + :plane-pos (new 'static 'vector :x 2285256.0 :y 33538.457 :z -2189906.8 :w 1.0) + :plane-quat (new 'static 'quaternion :y -0.6014 :w 0.7989) + :t-pos (new 'static 'vector :x 2091575.2 :y 73728.0 :z -2066113.8 :w 1.0) + :t-quat (new 'static 'quaternion :y -0.7502 :w 0.6611) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #xa + :plane-pos (new 'static 'vector :x 2153970.0 :y 34320.383 :z -2080023.4 :w 1.0) + :plane-quat (new 'static 'quaternion :y -0.1532 :w 0.9881) + :t-pos (new 'static 'vector :x 2116023.5 :y 90112.0 :z -1830102.6 :w 1.0) + :t-quat (new 'static 'quaternion :x 0.0013 :y 0.0828 :z 0.0003 :w -0.9965) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #xb + :plane-pos (new 'static 'vector :x 2169575.5 :y 47590.605 :z -1779327.0 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.0015 :y 0.1973 :z 0.0003 :w -0.9803) + :t-pos (new 'static 'vector :x 2094825.9 :y 77824.0 :z -1617763.5 :w 1.0) + :t-quat (new 'static 'quaternion :x -0.0012 :y 0.172 :z -0.0008 :w 0.985) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #xc + :plane-pos (new 'static 'vector :x 1921790.8 :y 30183.014 :z -1487026.6 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.0015 :y 0.1582 :z 0.0004 :w -0.9874) + :t-pos (new 'static 'vector :x 1823168.1 :y 69632.0 :z -1394735.1 :w 1.0) + :t-quat (new 'static 'quaternion :x -0.001 :y -0.9566 :z 0.0011 :w 0.2913) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #xd + :plane-pos (new 'static 'vector :x 1703265.9 :y 20098.252 :z -1322308.9 :w 1.0) + :plane-quat (new 'static 'quaternion :x -0.0014 :y -0.1073 :z -0.0005 :w 0.9942) + :t-pos (new 'static 'vector :x 1664688.5 :y 90112.0 :z -1180704.4 :w 1.0) + :t-quat (new 'static 'quaternion :x -0.0014 :y -0.0343 :z -0.0006 :w 0.9994) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #xe + :plane-pos (new 'static 'vector :x 1749161.1 :y 22818.816 :z -1555168.9 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.0014 :y 0.0245 :z 0.0006 :w -0.9996) + :t-pos (new 'static 'vector :x 1678245.1 :y 77824.0 :z -1422948.4 :w 1.0) + :t-quat (new 'static 'quaternion :x -0.0013 :y -0.7978 :z 0.0007 :w 0.6028) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #xf + :plane-pos (new 'static 'vector :x 1852649.5 :y 17886.822 :z -1740609.1 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.001 :y 0.3503 :z -0.0009 :w -0.9366) + :t-pos (new 'static 'vector :x 1762047.1 :y 69632.0 :z -1603024.1 :w 1.0) + :t-quat (new 'static 'quaternion :x 0.0007 :y 0.1395 :z 0.0011 :w -0.9902) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x10 + :plane-pos (new 'static 'vector :x 2073022.5 :y 30489.395 :z -1919885.8 :w 1.0) + :plane-quat (new 'static 'quaternion :x 0.0013 :y -0.7611 :z 0.0008 :w 0.6486) + :t-pos (new 'static 'vector :x 1964806.5 :y 61440.0 :z -1930829.9 :w 1.0) + :t-quat (new 'static 'quaternion :y -0.6727 :w 0.7398) + :num-guard #x14 + ) + (new 'static 'city-slums-transport-info + :id #x11 + :plane-pos (new 'static 'vector :x 1850323.0 :y 29569.844 :z -1880109.0 :w 1.0) + :plane-quat (new 'static 'quaternion :y 0.1031 :z 0.0015 :w 0.9946) + :t-pos (new 'static 'vector :x 1879482.4 :y 61440.0 :z -1762779.1 :w 1.0) + :t-quat (new 'static 'quaternion :x 0.0001 :y 0.0476 :z 0.0015 :w 0.9988) + :num-guard #x14 + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 142 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set-setting! 'exclusive-task #f 0 (-> self node-info task)) + (set-setting! 'airlock #f 0 0) + (let ((v1-5 (entity-by-name "parking-spot-1"))) + (if v1-5 + (logior! (-> v1-5 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-7 (entity-by-name "parking-spot-2"))) + (if v1-7 + (logior! (-> v1-7 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-9 (entity-by-name "parking-spot-12"))) + (if v1-9 + (logior! (-> v1-9 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-11 (entity-by-name "parking-spot-59"))) + (if v1-11 + (logior! (-> v1-11 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-13 (entity-by-name "parking-spot-60"))) + (if v1-13 + (logior! (-> v1-13 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-15 (entity-by-name "parking-spot-61"))) + (if v1-15 + (logior! (-> v1-15 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((v1-17 (entity-by-name "parking-spot-62"))) + (if v1-17 + (logior! (-> v1-17 extra perm status) (entity-perm-status bit-9)) + ) + ) + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'set-alert-level 2) + (send-event gp-0 'set-alert-duration #xa4cb80) + (send-event gp-0 'deactivate-by-type 6) + (send-event gp-0 'deactivate-by-type 18) + (send-event gp-0 'deactivate-by-type 19) + (send-event gp-0 'deactivate-by-type 20) + (send-event gp-0 'deactivate-by-type 11) + (send-event gp-0 'deactivate-by-type 12) + (send-event gp-0 'deactivate-by-type 13) + (send-event gp-0 'deactivate-by-type 14) + (send-event gp-0 'deactivate-by-type 15) + (send-event gp-0 'deactivate-by-type 16) + (send-event gp-0 'set-object-target-count 6 0) + (send-event gp-0 'set-object-target-count 18 0) + (send-event gp-0 'set-object-target-count 19 0) + (send-event gp-0 'set-object-target-count 11 0) + (send-event gp-0 'set-object-target-count 12 0) + (send-event gp-0 'set-object-target-count 13 0) + (send-event gp-0 'set-object-target-count 14 0) + (send-event gp-0 'set-object-target-count 15 0) + (send-event gp-0 'set-object-target-count 16 0) + (send-event gp-0 'set-object-auto-activate 6 #f) + (send-event gp-0 'set-guard-target-count-range 0 4 4) + (send-event gp-0 'set-guard-target-count-range 1 5 5) + (send-event gp-0 'set-guard-target-count-range 4 0 0) + (send-event gp-0 'set-guard-target-count-range 5 0 0) + ) + (speech-control-method-10 *speech-control* 6 (new 'static 'speech-type-info + :channel #x1 + :priority -2 + :min-delay #x258 + :max-delay #x4b0 + :list (new 'static 'boxed-array :type string + "kg320a" + "kg321a" + "kg322a" + "kg323a" + "kg324a" + "kg325a" + "kg326a" + "kg327a" + "kg328a" + "kg329a" + "kg330a" + "kg331a" + "kg332a" + "kg333a" + "kg334a" + "kg335a" + "kg336a" + "kg337a" + "kg338a" + "kg339a" + "kg340a" + "kg341a" + "kg342a" + "kg343a" + "kg344a" + "kg345a" + "kg347a" + ) + ) + ) + (dotimes (gp-1 (length *city-slums-transport-info*)) + (set! (-> *city-slums-transport-info* gp-1 spawned) #f) + ) + (let ((gp-2 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-2 pos quad) (-> (new 'static 'vector :x 1666621.9 :y 32766.771 :z -1103984.6 :w 1.0) quad)) + (quaternion-identity! (-> gp-2 quat)) + (set! (-> gp-2 flags) (task-arrow-flags)) + (set! (-> gp-2 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn gp-2 (the-as task-arrow self)))) + ) + (set! (-> self data-int32 0) 0) + 0 + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 142 + 1 + (the-as (function object) (lambda :behavior task-manager + () + (let ((a0-0 *traffic-manager*)) + (send-event a0-0 'restore-default-settings) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 142 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (local-vars (s5-4 object)) + (let ((s4-0 (new 'static 'vector :x 1666621.9 :y 32766.771 :z -1103984.6 :w 1.0)) + (gp-0 (vector-z-quaternion! + (new 'stack-no-clear 'vector) + (new 'static 'quaternion :x -0.0015 :y -0.199 :z 0.0002 :w -0.9799) + ) + ) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-! s5-0 (target-pos 0) s4-0) + (let ((v1-1 s5-0)) + (if (and (< (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))) 122880.0) + (< 0.0 (vector-dot s5-0 gp-0)) + ) + (set! (-> self data-int32 0) 1) + ) + ) + ) + (cond + ((zero? (-> self data-int32 0)) + (dotimes (gp-1 (length *city-slums-transport-info*)) + (let ((s5-1 (-> *city-slums-transport-info* gp-1))) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + 0.0 + (let ((f0-7 (vector-vector-xz-distance (target-pos 0) (-> s5-1 t-pos)))) + (cond + ((and (< f0-7 327680.0) (< 204800.0 f0-7)) + (when (and (not (handle->process (-> self slave gp-1))) + (< (the int (-> self data-float gp-1)) (-> self clock frame-counter)) + ) + (let ((s4-2 (new 'stack-no-clear 'transport-params))) + (let ((s3-2 (new 'stack-no-clear 'vector))) + (set! (-> s3-2 quad) (-> s5-1 t-pos quad)) + (set! (-> s4-2 spawn-pos quad) (-> s5-1 t-pos quad)) + (quaternion-copy! (-> s4-2 quat) (-> s5-1 t-quat)) + (set! (-> s4-2 max-guard) (-> s5-1 num-guard)) + (set! (-> s4-2 max-guard) (the-as uint 8)) + (set! (-> s4-2 turret?) #t) + (set! (-> s4-2 speeches?) #t) + (set! (-> s3-2 y) 0.0) + ) + (let* ((s5-2 (entity-nav-mesh-by-aid (the-as actor-id 9070))) + (a0-16 (if (type? s5-2 entity-nav-mesh) + s5-2 + ) + ) + ) + (when a0-16 + (set! (-> s4-2 nav-mesh) (-> a0-16 nav-mesh)) + (set! (-> self slave gp-1) (ppointer->handle (process-spawn transport s4-2 :to self))) + ) + ) + ) + ) + ) + ((< 368640.0 f0-7) + (if (handle->process (-> self slave gp-1)) + (send-event (handle->process (-> self slave gp-1)) 'leave) + ) + ) + ) + ) + ) + (if (and (handle->process (-> self slave gp-1)) + (begin + (let ((s5-5 #t) + (a1-11 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-11 from) (process->ppointer self)) + (set! (-> a1-11 num-params) 0) + (set! (-> a1-11 message) 'guards-left) + (let ((v1-75 (the-as object (send-event-function (handle->process (-> self slave gp-1)) a1-11)))) + (cmove-#f-nonzero s5-4 v1-75 s5-5) + ) + ) + s5-4 + ) + ) + (set! (-> self data-float gp-1) (the float (+ (-> self clock frame-counter) (seconds 20)))) + ) + ) + ) + (else + (let ((gp-2 0)) + (dotimes (s5-6 (length *city-slums-transport-info*)) + (when (handle->process (-> self slave s5-6)) + (send-event (handle->process (-> self slave s5-6)) 'leave) + (+! gp-2 1) + ) + ) + (if (zero? gp-2) + (go-virtual complete) + ) + ) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! *game-info* 142 3 (the-as (function object) (lambda :behavior task-manager + () + (until #f + (suspend) + ) + #f + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 142 + 4 + (the-as + (function object) + (lambda :behavior task-manager + () + (send-event (handle->process (-> self arrow)) 'leave) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (talker-spawn-func (-> *talker-speech* 185) *entity-pool* (target-pos 0) (the-as region #f)) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! *game-info* 142 5 (the-as (function object) (lambda :behavior task-manager () (none)))) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 142 + 1 + (the-as + (function object) + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 141 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self slave 0) + (ppointer->handle (seal-of-mar-spawn + self + (new 'static 'vector :x 3150154.5 :y 41696.617 :z -2989634.8 :w 1.0) + (new 'static 'vector :x -0.0086 :y -0.0227 :z -0.691 :w 0.7223) + (new 'static 'vector :x 0.06 :y 0.06 :z 0.06 :w 1.0) + ) + ) + ) + (set! (-> self slave 1) (the-as handle #f)) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 141 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (when (handle->process (-> self slave 0)) + (let ((f0-0 + (vector-vector-xz-distance (new 'static 'vector :x 3132661.8 :y 33669.12 :z -2965708.8 :w 1.0) (target-pos 0)) + ) + ) + (cond + ((< f0-0 20480.0) + (when (!= (-> self slave 0) #f) + (deactivate (handle->process (-> self slave 0))) + (set! (-> self slave 0) (the-as handle #f)) + ) + (if (= (-> self slave 1) #f) + (set! (-> self slave 1) + (ppointer->handle (process-spawn scene-player :init scene-player-init "city-protect-slums-intro" #t #f)) + ) + ) + ) + ((< f0-0 163840.0) + (eval! + (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) + '(want-anim "city-protect-slums-intro") + ) + ) + ) + ) + ) + (none) + ) + ) + ) + + + + diff --git a/test/offline/config/jak2/config.jsonc b/test/offline/config/jak2/config.jsonc index 8cb5702f55..c02725d601 100644 --- a/test/offline/config/jak2/config.jsonc +++ b/test/offline/config/jak2/config.jsonc @@ -19,6 +19,7 @@ "DGO/COB.DGO", "DGO/CPA.DGO", "DGO/CTA.DGO", + "DGO/LPROTECT.DGO", "DGO/CPO.DGO", "DGO/CTB.DGO", "DGO/CTC.DGO",