From 18507bc78eb105f4f3c533ffbd832b448f24ad72 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Sat, 28 Jan 2023 19:36:57 -0500 Subject: [PATCH] d/jak2: get `portrun` working and decompile a bunch of miscellaneous files (#2169) --- decompiler/analysis/label_types.cpp | 2 +- decompiler/config/jak2/all-types.gc | 525 ++-- .../jak2/anonymous_function_types.jsonc | 73 + decompiler/config/jak2/hacks.jsonc | 13 +- decompiler/config/jak2/inputs.jsonc | 25 +- decompiler/config/jak2/label_types.jsonc | 69 +- decompiler/config/jak2/stack_structures.jsonc | 27 +- decompiler/config/jak2/type_casts.jsonc | 82 +- decompiler/util/data_decompile.cpp | 4 + .../opengl_renderer/OpenGLRenderer.cpp | 1 + game/graphics/opengl_renderer/buckets.h | 1 + .../engine/common_objs/rigid-body-plat.gc | 24 +- goal_src/jak2/engine/entity/entity-table.gc | 12 +- .../jak2/engine/game/task/task-control-h.gc | 2 +- .../jak2/engine/game/task/task-control.gc | 2 +- goal_src/jak2/engine/physics/rigid-body.gc | 32 +- goal_src/jak2/engine/ui/text-id-h.gc | 8 + goal_src/jak2/game.gp | 126 +- .../jak2/levels/castle/pad/castle-tasks.gc | 32 + .../jak2/levels/city/common/ctyport-obs.gc | 963 +++++++ .../jak2/levels/city/common/ctywide-obs-h.gc | 8 +- .../jak2/levels/city/common/ctywide-tasks.gc | 1 - .../jak2/levels/city/common/searchlight.gc | 103 + .../levels/city/common/vehicle-effects.gc | 6 +- goal_src/jak2/levels/city/common/vehicle-h.gc | 234 +- .../levels/city/common/vehicle-physics.gc | 811 ------ .../jak2/levels/city/common/vehicle-states.gc | 4 +- .../jak2/levels/city/common/vehicle-util.gc | 22 +- goal_src/jak2/levels/city/common/vehicle.gc | 16 +- .../levels/city/industrial/ctyinda-obs.gc | 1 - .../levels/city/industrial/ctyindb-obs.gc | 1 - .../city/market/east/ashelin/ctyasha-obs.gc | 2174 +++++++++++++++ .../jak2/levels/city/palace/ctypal-obs.gc | 267 ++ .../jak2/levels/city/port/mines/portrun.gc | 1969 ++++++++++++++ .../levels/common/entities/com-elevator.gc | 331 +++ .../jak2/levels/common/races/race-manager.gc | 2 +- goal_src/jak2/levels/dig/dig-obs.gc | 18 +- goal_src/jak2/levels/dig/dig1-obs.gc | 45 +- goal_src/jak2/levels/dig/dig3-obs.gc | 48 +- goal_src/jak2/levels/outro/outro-scenes.gc | 1808 +++++++++++++ .../power_station/power_switches/ctypower.gc | 280 ++ .../jak2/levels/power_station/vinroom-obs.gc | 298 +++ goal_src/jak2/levels/ruins/ruins-obs.gc | 20 +- .../jak2/levels/stadium/stadium-scenes.gc | 2 +- .../engine/common_objs/rigid-body-plat_REF.gc | 44 +- .../jak2/engine/entity/entity-table_REF.gc | 12 +- .../engine/game/task/task-control-h_REF.gc | 2 +- .../jak2/engine/game/task/task-control_REF.gc | 2 +- .../jak2/engine/physics/rigid-body-h_REF.gc | 20 +- .../jak2/engine/physics/rigid-body_REF.gc | 32 +- .../reference/jak2/engine/ui/credits_REF.gc | 1070 ++++++++ .../levels/castle/pad/castle-tasks_REF.gc | 40 + .../levels/city/common/ctyport-obs_REF.gc | 1056 ++++++++ .../levels/city/common/ctywide-obs-h_REF.gc | 12 +- .../levels/city/common/ctywide-tasks_REF.gc | 913 +++++++ .../levels/city/common/searchlight_REF.gc | 127 + .../levels/city/common/vehicle-effects_REF.gc | 6 +- .../jak2/levels/city/common/vehicle-h_REF.gc | 254 +- .../levels/city/common/vehicle-physics_REF.gc | 887 ------- .../levels/city/common/vehicle-states_REF.gc | 4 +- .../levels/city/common/vehicle-util_REF.gc | 22 +- .../jak2/levels/city/common/vehicle_REF.gc | 16 +- .../levels/city/industrial/ctyinda-obs_REF.gc | 9 + .../levels/city/industrial/ctyindb-obs_REF.gc | 9 + .../market/east/ashelin/ctyasha-obs_REF.gc | 2336 +++++++++++++++++ .../jak2/levels/city/palace/ctypal-obs_REF.gc | 340 +++ .../levels/city/port/mines/portrun_REF.gc | 2114 +++++++++++++++ .../common/entities/com-elevator_REF.gc | 383 +++ .../reference/jak2/levels/dig/dig-obs_REF.gc | 18 +- .../reference/jak2/levels/dig/dig1-obs_REF.gc | 45 +- .../reference/jak2/levels/dig/dig3-obs_REF.gc | 42 +- .../jak2/levels/outro/outro-scenes_REF.gc | 1809 +++++++++++++ .../power_switches/ctypower_REF.gc | 301 +++ .../levels/power_station/vinroom-obs_REF.gc | 345 +++ .../jak2/levels/ruins/ruins-obs_REF.gc | 20 +- .../jak2/levels/stadium/stadium-scenes_REF.gc | 2 +- .../jak2/levels/underport/under-obs_REF.gc | 63 +- test/offline/config/jak2/config.jsonc | 4 + 78 files changed, 20254 insertions(+), 2597 deletions(-) create mode 100644 test/decompiler/reference/jak2/engine/ui/credits_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/castle/pad/castle-tasks_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/city/common/ctyport-obs_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/city/common/ctywide-tasks_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/city/common/searchlight_REF.gc delete mode 100644 test/decompiler/reference/jak2/levels/city/common/vehicle-physics_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/city/industrial/ctyinda-obs_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/city/industrial/ctyindb-obs_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/city/market/east/ashelin/ctyasha-obs_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/city/port/mines/portrun_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/outro/outro-scenes_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/power_station/power_switches/ctypower_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/power_station/vinroom-obs_REF.gc diff --git a/decompiler/analysis/label_types.cpp b/decompiler/analysis/label_types.cpp index 343d5fa20..9167a066e 100644 --- a/decompiler/analysis/label_types.cpp +++ b/decompiler/analysis/label_types.cpp @@ -55,7 +55,7 @@ void find_functions(LabelDB* db, LinkedObjectFile* file) { int offset_of_function = func.start_word * 4 + 4; auto idx_of_label = db->try_get_index_by_offset(seg, offset_of_function); if (!idx_of_label) { - func.warnings.error("Could not find any references to this function: {}", func.name()); + func.warnings.warning("Could not find any references to this function: {}", func.name()); } else { auto old = db->set_and_get_previous(*idx_of_label, func.type, false, {}); if (old.known) { diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index cdc910950..883fc278c 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -7000,8 +7000,16 @@ (text-x24e #x024e) (text-x24f #x024f) (text-x277 #x0277) + (text-x278 #x0278) + (text-x27a #x027a) + (text-x27b #x027b) + (text-x27c #x027c) + (text-x27d #x027d) + (text-x27e #x027e) + (text-x27f #x027f) (scene-subtitles-enabled #x30d) (scene-subtitles-disabled #x30e) + (text-x30f #x30f) (progress-unknown-continue #x310) ) ;; ---text-id-h:game-text-id @@ -7375,7 +7383,6 @@ :method-count-assert 9 :size-assert #x24 :flag-assert #x900000024 - ;; Failed to read fields. ) @@ -7393,7 +7400,6 @@ :method-count-assert 9 :size-assert #x50 :flag-assert #x900000050 - ;; Failed to read fields. ) (deftype engine-minimap (engine-pers) @@ -9848,7 +9854,7 @@ (data-float float 32) (data-vector vector 32 :inline :offset-assert 800 :score 100) (actor-group (pointer entity-actor) 4 :offset-assert 1312) - (minimap uint32 8 :offset-assert 1328) + (minimap connection-minimap 8 :offset-assert 1328) (hud handle 4 :offset-assert 1360) (hud-timer handle :offset 1360) (hud-counter handle :offset 1368) @@ -33100,7 +33106,7 @@ ) (deftype rigid-body-object-constants (structure) - ((info rigid-body-info :inline :offset-assert 0 :score -1) + ((info rigid-body-info :inline :offset-assert 0) (mass float :offset 0) (inv-mass float :offset 4) (cm-joint vector :inline :offset 32) @@ -41718,7 +41724,7 @@ ;; ctypower ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *city-power-switch-on-position* array) +(define-extern *city-power-switch-on-position* (array vector)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctyindb-part ;; @@ -43439,7 +43445,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define-extern death-precursor death-info) -(define-extern start-precursor-effect (function object none)) +(define-extern start-precursor-effect (function manipy none)) (define-extern birth-func-pecker-feather-color (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -44991,9 +44997,8 @@ ;; searchlight ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype searchlight (process-drawable) - ((sync sync-eased :inline :offset-assert 196) + ((sync sync-eased :inline :offset-assert 200) ) :method-count-assert 21 :size-assert #xf4 @@ -45002,7 +45007,6 @@ (idle () _type_ :state 20) ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -46604,31 +46608,29 @@ ;; com-elevator ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype com-elevator (elevator) - ((camera-startup UNKNOWN 2 :offset-assert 364) - (use-camera-startup? UNKNOWN 2 :offset-assert 396) - (sound-id uint32 :offset-assert 404) + ((camera-startup vector 2 :inline :offset-assert 368) + (use-camera-startup? symbol 2 :offset-assert 400) + (sound-id sound-id :offset-assert 408) ) :method-count-assert 50 :size-assert #x19c :flag-assert #x320120019c (:methods - (com-elevator-method-49 () none 49) + (com-elevator-method-49 (_type_ symbol) none 49) ) ) -|# -#| (deftype tomb-trans-elevator (com-elevator) - () + ( + (unknown-gijh1bn2i3hb1 int32 :offset-assert 412) + ) :method-count-assert 50 :size-assert #x1a0 :flag-assert #x32012001a0 (:methods ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -46776,9 +46778,8 @@ ;; portrun ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype city-port-run-mine-info (structure) - ((handle uint64 :offset-assert 0) + ((handle handle :offset-assert 0) (pos1-x float :offset-assert 8) (pos1-y float :offset-assert 12) (pos1-z float :offset-assert 16) @@ -46788,30 +46789,29 @@ (pos2-z float :offset-assert 32) (speed float :offset-assert 36) (offset float :offset-assert 40) - (center-x float :offset-assert 8) - (center-y float :offset-assert 12) - (center-z float :offset-assert 16) - (radius float :offset-assert 24) + (center-x float :offset 8) + (center-y float :offset 12) + (center-z float :offset 16) + (radius float :offset 24) ) :method-count-assert 9 :size-assert #x2c :flag-assert #x90000002c ) -|# -#| (deftype ctyport-mine (process-drawable) - ((info city-port-run-mine-info :offset-assert 196) - (base-height float :offset-assert 200) - (center vector :inline :offset-assert 204) - (time-skew uint64 :offset-assert 220) - (period float :offset-assert 228) - (trans-y float :offset-assert 232) - (speed-y float :offset-assert 236) - (acc-y float :offset-assert 240) - (beep basic :offset-assert 244) - (beep-time time-frame :offset-assert 252) - (beep-color vector :inline :offset-assert 268) + ((root-override collide-shape-moving :offset 128 :score 100) + (info city-port-run-mine-info :offset-assert 200) + (base-height float :offset-assert 204) + (center vector :inline :offset-assert 208) + (time-skew uint64 :offset-assert 224) + (period float :offset-assert 232) + (trans-y float :offset-assert 236) + (speed-y float :offset-assert 240) + (acc-y float :offset-assert 244) + (beep basic :offset-assert 248) + (beep-time time-frame :offset-assert 256) + (beep-color vector :inline :offset-assert 272) ) :method-count-assert 24 :size-assert #x120 @@ -46820,14 +46820,12 @@ (idle () _type_ :state 20) (die () _type_ :state 21) (fall () _type_ :state 22) - (ctyport-mine-method-23 () none 23) + (ctyport-mine-method-23 (_type_) none 23) ) ) -|# -#| (deftype ctyport-spy (process-drawable) - ((trans-y float :offset-assert 196) + ((trans-y float :offset-assert 200) ) :method-count-assert 21 :size-assert #xcc @@ -46836,13 +46834,11 @@ (idle () _type_ :state 20) ) ) -|# -#| (deftype ctyport-cargo (process-focusable) - ((minimap connection-minimap :offset-assert 200) - (trans-y float :offset-assert 204) - (speed-y float :offset-assert 208) + ((minimap connection-minimap :offset-assert 204) + (trans-y float :offset-assert 208) + (speed-y float :offset-assert 212) ) :method-count-assert 31 :size-assert #xd8 @@ -46851,12 +46847,10 @@ (idle () _type_ :state 27) (focus-camera () _type_ :state 28) (die () _type_ :state 29) - (ctyport-cargo-method-30 () none 30) + (ctyport-cargo-method-30 (_type_) none 30) ) ) -|# -#| (deftype city-port-run-cargo-info (structure) ((pos vector :inline :offset-assert 0) ) @@ -46864,19 +46858,18 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -;; (define-extern check-cargo-piece-ground function) -;; (define-extern *city-port-run-mine-info* array) -;; (define-extern ctyport-mine-init-by-other function) -;; (define-extern ctyport-mine-spawn function) -;; (define-extern ctyport-spy-init-by-other function) -;; (define-extern ctyport-spy-spawn function) -;; (define-extern *city-port-position* object) -;; (define-extern *ctyport-cargo-exploder-params* joint-exploder-static-params) -;; (define-extern ctyport-cargo-init-by-other function) -;; (define-extern ctyport-cargo-spawn function) -;; (define-extern *city-port-run-cargo-info* array) +(define-extern check-cargo-piece-ground (function sparticle-system sparticle-cpuinfo matrix none)) +(define-extern *city-port-run-mine-info* (array city-port-run-mine-info)) +(define-extern ctyport-mine-init-by-other (function city-port-run-mine-info none :behavior ctyport-mine)) +(define-extern ctyport-mine-spawn (function task-manager city-port-run-mine-info process)) +(define-extern ctyport-spy-init-by-other (function vector none :behavior ctyport-spy)) +(define-extern ctyport-spy-spawn (function process vector vector float process)) +(define-extern *city-port-position* vector) +(define-extern *ctyport-cargo-exploder-params* joint-exploder-static-params) +(define-extern ctyport-cargo-init-by-other (function vector nav-mesh none :behavior ctyport-cargo)) +(define-extern ctyport-cargo-spawn (function task-manager vector nav-mesh process)) +(define-extern *city-port-run-cargo-info* (array city-port-run-cargo-info)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctygenb-part ;; @@ -47338,12 +47331,11 @@ ;; vinroom-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype vin-turbine (process-drawable) - ((dont-draw-outside? basic :offset-assert 196) - (lightning-timer uint64 :offset-assert 204) - (outside-plane plane :inline :offset-assert 220) - (lightning-plane plane :inline :offset-assert 236) + ((dont-draw-outside? symbol :offset-assert 200) + (lightning-timer uint64 :offset-assert 208) + (outside-plane plane :inline :offset-assert 224) + (lightning-plane plane :inline :offset-assert 240) ) :method-count-assert 22 :size-assert #x100 @@ -47353,9 +47345,7 @@ (dormant () _type_ :state 21) ) ) -|# -#| (deftype vin-door (com-airlock) () :method-count-assert 28 @@ -47364,7 +47354,6 @@ (:methods ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -47421,7 +47410,6 @@ ;; ctypal-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype water-anim-ctypal (water-anim) () :method-count-assert 29 @@ -47430,9 +47418,7 @@ (:methods ) ) -|# -#| (deftype palace-door (com-airlock) () :method-count-assert 28 @@ -47441,11 +47427,9 @@ (:methods ) ) -|# -#| (deftype ctypal-broke-wall (process-drawable) - ((ent basic :offset-assert 196) + ((ent basic :offset-assert 200) ) :method-count-assert 22 :size-assert #xcc @@ -47455,9 +47439,7 @@ (done () _type_ :state 21) ) ) -|# -#| (deftype ctypal-baron-statue-broken (process-drawable) () :method-count-assert 21 @@ -47467,10 +47449,9 @@ (idle () _type_ :state 20) ) ) -|# -;; (define-extern ripple-for-water-anim-ctypal ripple-wave-set) -;; (define-extern ripple-ctypal-smlground-pool ripple-wave-set) +(define-extern ripple-for-water-anim-ctypal ripple-wave-set) +(define-extern ripple-ctypal-smlground-pool ripple-wave-set) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; under-shoot-block ;; @@ -49207,7 +49188,7 @@ (section-count int8 :offset-assert 421) (rider-stance uint8 :offset-assert 422) (grab-rail-count int8 :offset-assert 423) - (grab-rail-array uint32 :offset-assert 424) + (grab-rail-array (inline-array vehicle-grab-rail-info) :offset-assert 424) (seat-array vehicle-seat-info 4 :inline :offset-assert 432) (rider-hand-offset vector 2 :inline :offset-assert 496) (section-array vehicle-section-info 4 :inline :offset-assert 528 :score -999) @@ -49222,12 +49203,12 @@ (engine-pitch-offset float :offset-assert 664) (engine-pitch-mod-amp float :offset-assert 668) (engine-sound-select int8 :offset-assert 672) - (engine-sound uint128 :offset-assert 688) - (thrust-sound uint128 :offset-assert 704) - (scrape-sound uint128 :offset-assert 720) - (glance-sound uint128 :offset-assert 736) - (impact-sound uint128 :offset-assert 752) - (extra-sound uint128 :offset-assert 768) + (engine-sound sound-name :offset-assert 688) + (thrust-sound sound-name :offset-assert 704) + (scrape-sound sound-name :offset-assert 720) + (glance-sound sound-name :offset-assert 736) + (impact-sound sound-name :offset-assert 752) + (extra-sound sound-name :offset-assert 768) (explosion-part int32 :offset-assert 784) (headlight-count int8 :offset-assert 788) (taillight-count int8 :offset-assert 789) @@ -49261,7 +49242,7 @@ (part-vel vector :offset-assert 1496) (color-option-count int8 :offset-assert 1500) (color-option-select int8 :offset-assert 1501) - (color-option-array (array rgba) :offset-assert 1504) + (color-option-array (inline-array vector) :offset-assert 1504) ;; making this a vector is a bit of a guess, but it's a bunch of floats (sample-dir vector :inline :offset-assert 1520) (sample-time time-frame :offset-assert 1536) (sample-index int32 :offset-assert 1544) @@ -49519,7 +49500,7 @@ (vehicle-method-132 (_type_) none 132) (check-player-get-on (_type_) none 133) (vehicle-method-134 "Stubbed" (_type_ process) none 134) - (vehicle-method-135 () none 135) + (vehicle-method-135 (_type_ traffic-object-spawn-params) none 135) (vehicle-method-136 (_type_ traffic-object-spawn-params) none 136) (vehicle-method-137 (_type_ traffic-object-spawn-params) none 137) (vehicle-method-138 (_type_) none 138) @@ -49672,7 +49653,7 @@ :size-assert #x18 :flag-assert #xa00000018 (:methods - (city-race-ring-info-method-9 () none 9) + (city-race-ring-info-method-9 (_type_ symbol) none 9) ) ) @@ -49687,13 +49668,13 @@ (deftype city-ambush-info (structure) ((count int16 :offset-assert 0) - (array uint32 :offset-assert 4) + (array (inline-array city-ambush-spot) :offset-assert 4) ) :method-count-assert 10 :size-assert #x8 :flag-assert #xa00000008 (:methods - (city-ambush-info-method-9 () none 9) + (city-ambush-info-method-9 (_type_ traffic-object-spawn-params) none 9) ) ) @@ -50654,7 +50635,7 @@ ;; (define-extern race-manager-event-handler function) (define-extern *race-manager* race-manager) ;; (define-extern race-manager-init-by-other function) -(define-extern race-start (function int symbol symbol object)) +(define-extern race-start (function int symbol symbol process)) ;; (define-extern race-kill function) (define-extern type-from-race-vehicle-type (function int type)) ;; (define-extern race-vehicle-entity-hack function) @@ -51686,6 +51667,7 @@ (deftype security-wall (process-drawable) ( + (root-override collide-shape :offset 128 :score 100) (pass int32 :offset-assert 200) (incoming-attack-id uint32 :offset-assert 204) (next-message-time int64 :offset-assert 208) @@ -51701,11 +51683,11 @@ :size-assert #x11c :flag-assert #x1900a0011c (:methods - (security-wall-method-20 () none 20) - (security-wall-method-21 () none 21) - (security-wall-method-22 () none 22) - (security-wall-method-23 () none 23) - (security-wall-method-24 () none 24) + (idle-open () _type_ :state 20) + (idle-close () _type_ :state 21) + (security-wall-method-22 (_type_ path-control float) vector 22) + (security-wall-method-23 (_type_) none 23) + (security-wall-method-24 (_type_) none 24) ) ) @@ -51723,137 +51705,192 @@ :size-assert #x130 :flag-assert #x1e00b00130 (:methods - (fruit-stand-method-27 () none 27) - (fruit-stand-method-28 () none 28) - (fruit-stand-method-29 () none 29) + (idle () _type_ :state 27) + (fruit-stand-method-28 (_type_) none 28) + (fruit-stand-method-29 (_type_) none 29) ) ) -#| -(deftype cty-fruit-stand (UNKNOWN) +(deftype cty-fruit-stand (fruit-stand) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 30 + :size-assert #x130 ;; 304 + :flag-assert #x1e00b00130 ) -|# -#| -(deftype cty-guard-turret (UNKNOWN) +(deftype cty-guard-turret (process-focusable) + ( + (incoming-attack-id uint32 :offset-assert 204) + (jm-turret joint-mod :offset-assert 208) + (jm-gunsL joint-mod :offset-assert 212) + (jm-gunsR joint-mod :offset-assert 216) + (angle-turret degrees :offset-assert 220) + (angle-guns degrees :offset-assert 224) + (last-no-zero int64 :offset-assert 232) + (next-time-shot time-frame :offset-assert 240) + (num-shots uint32 :offset-assert 248) + (focus focus :inline :offset-assert 256) + (id int32 :offset-assert 268) + (destroyed symbol :offset-assert 272) + (button-down? symbol :offset-assert 276) + (hit-points int32 :offset-assert 280) + ) + :method-count-assert 36 + :size-assert #x11c ;; 284 + :flag-assert #x2400a0011c + (:methods + (idle () _type_ :state 27) + (hostile () _type_ :state 28) + (explode () _type_ :state 29) + (wait-for-pushing () _type_ :state 30) + (pushed () _type_ :state 31) + (cty-guard-turret-method-32 (_type_) none 32) + (cty-guard-turret-method-33 (_type_) none 33) + (cty-guard-turret-method-34 (_type_) none 34) + (cty-guard-turret-method-35 (_type_) quaternion 35)) + ) + +(deftype parking-spot (process-drawable) + ( + (vehicle handle :offset-assert 200) + (spawned symbol :offset-assert 208) + (minimap connection-minimap :offset-assert 212) + (test-sphere sphere :inline :offset-assert 224) + ) + :method-count-assert 25 + :size-assert #xf0 ;; 240 + :flag-assert #x19007000f0 + (:methods + (idle () _type_ :state 20) + (parking-spot-method-21 (_type_) none 21) + (parking-spot-method-22 (_type_) none 22) + (parking-spot-method-23 (_type_ uint) none 23) + (parking-spot-method-24 (_type_) none 24)) + ) + +(deftype propa (process-focusable) + ( + (sound-id uint32 :offset-assert 204) + (sound-index uint32 :offset-assert 208) + (handle handle :offset-assert 216) + (y-rot float :offset-assert 224) + (hit-points int32 :offset-assert 228) + (incoming-attack-id uint32 :offset-assert 232) + ) + :method-count-assert 32 + :size-assert #xec ;; 236 + :flag-assert #x20007000ec + (:methods + (idle () _type_ :state 27) + (broken () _type_ :state 28) + (propa-method-29 (_type_) none 29) + (propa-method-30 (_type_) none 30) + (propa-method-31 (_type_ vector) none 31)) + ) + +(deftype baron-statue (process-drawable) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 21 + :size-assert #xc8 ;; 200 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20)) ) -|# -#| -(deftype parking-spot (UNKNOWN) +(deftype burning-bush (process-focusable) + ( + (task game-task-control :offset-assert 204) + (part-off sparticle-launch-control :offset-assert 208) + (part-alert sparticle-launch-control :offset-assert 212) + (angle degrees :offset-assert 216) + (time float :offset-assert 220) + ) + :method-count-assert 33 + :size-assert #xe0 ;; 224 + :flag-assert #x21006000e0 + (:methods + (idle () _type_ :state 27) + (talking () _type_ :state 28) + (menu () _type_ :state 29) + (burning-bush-method-30 (_type_) none 30) + (burning-bush-method-31 (_type_) none 31) + (burning-bush-method-32 (_type_) object 32)) + ) + +(deftype barons-ship-lores (process-drawable) + ( + (paths path-control 3 :offset-assert 200) ;; elt size: 5.333333333333333 + (sync sync-eased :inline :offset-assert 216) + (current-path int32 :offset-assert 260) + (forward-backward symbol :offset-assert 264) + ) + :method-count-assert 21 + :size-assert #x10c ;; 268 + :flag-assert #x150090010c + (:methods + (idle () _type_ :state 20)) + ) + +(deftype lurker-pipe-lid (process-focusable) + ( + (angle degrees :offset-assert 204) + (rot float :offset-assert 208) + ) + :method-count-assert 31 + :size-assert #xd4 ;; 212 + :flag-assert #x1f006000d4 + (:methods + (idle () _type_ :state 27) + (lurker-pipe-lid-method-28 (_type_) none 28) + (lurker-pipe-lid-method-29 (_type_) none 29) + (lurker-pipe-lid-method-30 (_type_) none 30)) + ) + +(deftype ctyn-lamp (process-focusable) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 31 + :size-assert #xcc ;; 204 + :flag-assert #x1f005000cc + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (ctyn-lamp-method-29 (_type_) none 29) + (ctyn-lamp-method-30 (_type_) none 30)) ) -|# -#| -(deftype propa (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. - ) -|# - -#| -(deftype baron-statue (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. - ) -|# - -#| -(deftype burning-bush (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. - ) -|# - -#| -(deftype barons-ship-lores (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. - ) -|# - -#| -(deftype lurker-pipe-lid (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. - ) -|# - -#| -(deftype ctyn-lamp (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. - ) -|# - -;; (define-extern *fruit-check-ground-counter* object) -;; (define-extern fruit-check-ground-bounce function) -;; (define-extern fruit-sparticle-next-on-mode-1 function) -;; (define-extern fruit-stand-event-handler function) -;; (define-extern *cty-guard-turret-exploder-params* joint-exploder-static-params) -;; (define-extern cty-guard-turret-event-handler function) -;; (define-extern *propa-sounds* array) -;; (define-extern *propa-sounds-class-3* array) -;; (define-extern *propa-sounds-class-2* array) -;; (define-extern *propa-sounds-class-1* array) -;; (define-extern *propa-sounds-metalheads* array) -;; (define-extern *propa-sounds-baron-construction* array) -;; (define-extern propa-pu->knocked-type function) -;; (define-extern *ctyn-lamp-exploder-params* joint-exploder-static-params) +(define-extern *fruit-check-ground-counter* int) +(define-extern fruit-check-ground-bounce (function sparticle-system sparticle-cpuinfo sparticle-launchinfo matrix float)) +(define-extern fruit-sparticle-next-on-mode-1 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo float)) +(define-extern fruit-stand-event-handler (function process int symbol event-message-block object :behavior fruit-stand)) +(define-extern *cty-guard-turret-exploder-params* joint-exploder-static-params) +(define-extern cty-guard-turret-event-handler (function process int symbol event-message-block object :behavior cty-guard-turret)) +(define-extern *propa-sounds* (array string)) +(define-extern *propa-sounds-class-3* (array string)) +(define-extern *propa-sounds-class-2* (array string)) +(define-extern *propa-sounds-class-1* (array string)) +(define-extern *propa-sounds-metalheads* (array string)) +(define-extern *propa-sounds-baron-construction* (array string)) +(define-extern propa-pu->knocked-type (function penetrate knocked-type)) +(define-extern *ctyn-lamp-exploder-params* joint-exploder-static-params) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctywide-tasks ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype city-bb-racepoint-info (structure) ((bike-pos vector :inline :offset-assert 0) (end-pos vector :inline :offset-assert 16) (bike-angle float :offset-assert 32) - (map basic :offset-assert 36) + (map symbol :offset-assert 36) (time float :offset-assert 40) ) :method-count-assert 9 :size-assert #x2c :flag-assert #x90000002c ) -|# -;; (define-extern wait-for-speech-end function) -;; (define-extern *city-bb-racepoint-info* array) +(define-extern wait-for-speech-end (function sound-id none)) +(define-extern *city-bb-racepoint-info* (array city-bb-racepoint-info)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctywide-scenes ;; @@ -51870,50 +51907,40 @@ ;; ctyport-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype boat-manager (process) - ((mesh basic :offset-assert 124) - (paths UNKNOWN 4 :offset-assert 128) + ((mesh basic :offset-assert 128) + (paths path-control 4 :offset-assert 132) ) :method-count-assert 16 :size-assert #x94 :flag-assert #x1000200094 (:methods - (boat-manager-method-9 () none 9) - (boat-manager-method-10 () none 10) - (boat-manager-method-11 () none 11) - (boat-manager-method-12 () none 12) - (boat-manager-method-13 () none 13) (idle () _type_ :state 14) - (boat-manager-method-15 () none 15) + (boat-manager-method-15 (_type_) none 15) ) ) -|# -#| (deftype boat-base (vehicle) - ((angle float :offset-assert 876) - (y-rot float :offset-assert 880) - (path-num uint32 :offset-assert 884) - (path-index float :offset-assert 888) + ((angle float :offset-assert 880) + (y-rot float :offset-assert 884) + (path-num uint32 :offset-assert 888) + (path-index float :offset-assert 892) ) :method-count-assert 149 :size-assert #x380 :flag-assert #x9503000380 (:methods - (boat-base-method-144 () none 144) - (boat-base-method-145 () none 145) - (boat-base-method-146 () none 146) - (boat-base-method-147 () none 147) - (boat-base-method-148 () none 148) + (boat-base-method-144 (_type_ nav-control) none 144) + (boat-base-method-145 (_type_ nav-control) none 145) + (boat-base-method-146 (_type_ nav-control) none 146) + (boat-base-method-147 (_type_ nav-control) none 147) + (boat-base-method-148 (_type_ nav-control) none 148) ) ) -|# -#| (deftype barge (boat-base) - ((engine uint32 :offset-assert 892) - (bow-wash uint32 :offset-assert 896) + ((engine uint32 :offset-assert 896) + (bow-wash uint32 :offset-assert 900) ) :method-count-assert 149 :size-assert #x388 @@ -51921,10 +51948,9 @@ (:methods ) ) -|# -;; (define-extern *barge-constants* object) -;; (define-extern *boat-nav-callback-info* object) +(define-extern *barge-constants* rigid-body-vehicle-constants) +(define-extern *boat-nav-callback-info* nav-callback-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-pilot ;; @@ -52439,21 +52465,16 @@ ;; ctyasha-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype tanker-grunt (grunt) - ((expensive-gnd-collide? basic :offset-assert 688) + ((expensive-gnd-collide? symbol :offset 692) ) :method-count-assert 186 :size-assert #x2b8 :flag-assert #xba024002b8 - (:methods - ) ) -|# -#| (deftype tanker-juicer (juicer) - ((expensive-gnd-collide? basic :offset-assert 844) + ((expensive-gnd-collide? symbol :offset-assert 848) ) :method-count-assert 185 :size-assert #x354 @@ -52461,25 +52482,21 @@ (:methods ) ) -|# -#| (deftype tanker-container (process-drawable) - () + ((root-override collide-shape :offset 128 :score 100)) :method-count-assert 23 :size-assert #xc8 :flag-assert #x17005000c8 (:methods (dormant () _type_ :state 20) (idle () _type_ :state 21) - (tanker-container-method-22 () none 22) + (tanker-container-method-22 (_type_) none 22) ) ) -|# -#| (deftype tanker-crash (process-drawable) - () + ((root-override collide-shape :offset 128 :score 100)) :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 @@ -52488,14 +52505,13 @@ (idle () _type_ :state 21) ) ) -|# -#| (deftype tanker-deadly (process-drawable) - ((track-joint int32 :offset-assert 196) - (attack-id uint32 :offset-assert 200) - (die-time time-frame :offset-assert 204) - (prev-pos vector :inline :offset-assert 220) + ((root-override collide-shape :offset 128 :score 100) + (track-joint int32 :offset-assert 200) + (attack-id uint32 :offset-assert 204) + (die-time time-frame :offset-assert 208) + (prev-pos vector :inline :offset-assert 224) ) :method-count-assert 22 :size-assert #xf0 @@ -52505,14 +52521,13 @@ (die-fast () _type_ :state 21) ) ) -|# -;; (define-extern tanker-container-event-handler function) -;; (define-extern tanker-deadly-init-by-other function) -;; (define-extern tanker-spawn-deadly-barrels function) -;; (define-extern tanker-spawn-deadly-cab function) -;; (define-extern tanker-spawn-deadly-trailers function) -;; (define-extern tanker-spawn-deadly-container function) +(define-extern tanker-container-event-handler (function process int symbol event-message-block object :behavior tanker-container)) +(define-extern tanker-deadly-init-by-other (function vector int int none :behavior tanker-deadly)) +(define-extern tanker-spawn-deadly-barrels (function process-tree (pointer process))) +(define-extern tanker-spawn-deadly-cab (function process-tree (pointer process))) +(define-extern tanker-spawn-deadly-trailers (function process-tree (pointer process))) +(define-extern tanker-spawn-deadly-container (function process-tree (pointer process))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ash4-course ;; diff --git a/decompiler/config/jak2/anonymous_function_types.jsonc b/decompiler/config/jak2/anonymous_function_types.jsonc index 89c6e96bc..9c5e97288 100644 --- a/decompiler/config/jak2/anonymous_function_types.jsonc +++ b/decompiler/config/jak2/anonymous_function_types.jsonc @@ -1022,5 +1022,78 @@ [55, "(function object sig-under symbol)"], [56, "(function sig-under none)"], [57, "(function object sig-under symbol)"] + ], + "ctywide-obs": [ + [33, "(function entity-perm-status :behavior task-manager)"], + [38, "(function none)"], + [101, "(function symbol)"] + ], + "ctywide-tasks": [ + [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)"], + [9, "(function none :behavior task-manager)"], + [10, "(function none :behavior task-manager)"], + [11, "(function none :behavior task-manager)"], + [12, "(function none :behavior task-manager)"], + [13, "(function none :behavior task-manager)"], + [14, "(function none :behavior task-manager)"], + [15, "(function none :behavior task-manager)"], + [16, "(function none :behavior task-manager)"], + [17, "(function none :behavior task-manager)"], + [18, "(function none :behavior task-manager)"], + [19, "(function none :behavior task-manager)"], + [20, "(function none :behavior task-manager)"], + [21, "(function none :behavior task-manager)"], + [ + 23, + "(function process int symbol event-message-block object :behavior task-manager)" + ], + [24, "(function none :behavior task-manager)"], + [25, "(function none :behavior task-manager)"], + [26, "(function none :behavior task-manager)"], + [27, "(function none :behavior task-manager)"], + [28, "(function none :behavior task-manager)"], + [29, "(function none :behavior task-manager)"], + [30, "(function none :behavior task-manager)"], + [31, "(function none :behavior task-manager)"], + [32, "(function none :behavior task-manager)"] + ], + "ctyport-obs": [ + [6, "(function collide-shape-prim none)"], + [26, "(function object nav-control none)"], + [27, "(function object nav-control none)"], + [28, "(function object nav-control none)"], + [29, "(function object nav-control none)"], + [30, "(function object nav-control none)"] + ], + "castle-tasks": [[0, "(function none :behavior task-manager)"]], + "portrun": [ + [0, "(function none :behavior task-manager)"], + [1, "(function none :behavior task-manager)"], + [2, "(function none :behavior task-manager)"], + [3, "(function object object symbol none :behavior task-manager)"], + [4, "(function none :behavior task-manager)"], + [5, "(function none :behavior task-manager)"], + [6, "(function none :behavior task-manager)"], + [33, "(function none :behavior task-manager)"] + ], + "ctypower": [ + [ + 0, + "(function process-drawable int symbol event-message-block object :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)"] ] } diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index b53435270..0dc2b365f 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -582,7 +582,18 @@ [431, 0], [477, 0], [508, 0] - ] + ], + "(trans menu burning-bush)": [ + [294, 0], + [378, 0], + [406, 0], + [434, 0], + [462, 0], + [490, 0], + [518, 0], + [350, 0] + ], + "(trans idle burning-bush)": [[171, 0]] }, "mips2c_functions_by_name": [ diff --git a/decompiler/config/jak2/inputs.jsonc b/decompiler/config/jak2/inputs.jsonc index 3d7baa291..facc6f8b4 100644 --- a/decompiler/config/jak2/inputs.jsonc +++ b/decompiler/config/jak2/inputs.jsonc @@ -43,7 +43,7 @@ "DGO/ATE.DGO", // "DGO/LERROL.DGO", "DGO/LTRNYSAM.DGO", - // "DGO/LOUTCSTB.DGO", + "DGO/LOUTCSTB.DGO", // "DGO/LASHTHRN.DGO", "DGO/TOC.DGO", "DGO/CFB.DGO", @@ -54,7 +54,7 @@ "DGO/SEB.DGO", // "DGO/LPRSNCST.DGO", "DGO/SWB.DGO", - // "DGO/LPOWER.DGO", + "DGO/LPOWER.DGO", "DGO/FOB.DGO", "DGO/CIB.DGO", // "DGO/LSHUTTLE.DGO", @@ -74,7 +74,7 @@ // "DGO/DEMO.DGO", // "DGO/LRACEDF.DGO", "DGO/LERLCHAL.DGO", - // "DGO/LHIPOUT.DGO", + "DGO/LHIPOUT.DGO", "DGO/OUTROCST.DGO", "DGO/NES.DGO", "DGO/PAR.DGO", @@ -86,7 +86,7 @@ // "DGO/LJKDXASH.DGO", "DGO/CAS.DGO", "DGO/COA.DGO", - // "DGO/LTESS.DGO", + "DGO/LTESS.DGO", "DGO/CFA.DGO", "DGO/TOMBEXT.DGO", "DGO/LCGUARD.DGO", @@ -124,14 +124,14 @@ "DGO/LBBUSH.DGO", "DGO/LPACKAGE.DGO", "DGO/LINTCSTB.DGO", - // "DGO/LPORTRUN.DGO", + "DGO/LPORTRUN.DGO", // "DGO/LASHGRD.DGO", "DGO/CGB.DGO", "DGO/D3B.DGO", // "DGO/STB.DGO", // "DGO/GARAGE.DGO", - // "DGO/PORTWALL.DGO", - // "DGO/LHELLDOG.DGO", + "DGO/PORTWALL.DGO", + "DGO/LHELLDOG.DGO", "DGO/SWE.DGO", // "DGO/LRACECB.DGO", "DGO/GGA.DGO", @@ -152,7 +152,7 @@ "DGO/CTYKORA.DGO", "DGO/RUI.DGO", "DGO/LSACK.DGO", - // "DGO/CTYASHA.DGO", + "DGO/CTYASHA.DGO", // "DGO/LPRTRACE.DGO", "DGO/LWIDEA.DGO", "DGO/HIPHOG.DGO", @@ -233,9 +233,15 @@ "LCITYLOW.DGO", "LDJAKBRN.DGO", "LGUARD.DGO", + "LHELLDOG.DGO", + "LHIPOUT.DGO", "LINTCSTB.DGO", + "LOUTCSTB.DGO", + "LPORTRUN.DGO", + "LPOWER.DGO", "LPROTECT.DGO", "LSACK.DGO", + "LTESS.DGO", "LTRNYSAM.DGO", "LWHACK.DGO", "LWIDEA.DGO", @@ -247,10 +253,13 @@ "NES.DGO", "ONINTENT.DGO", "ORACLE.DGO", + "OUTROCST.DGO", "PAC.DGO", + "PAE.DGO", "PALBOSS.DGO", "PAR.DGO", "PAS.DGO", + "PORTWALL.DGO", "PRI.DGO", "RUI.DGO", "SAG.DGO", diff --git a/decompiler/config/jak2/label_types.jsonc b/decompiler/config/jak2/label_types.jsonc index 44bd260a0..44050800d 100644 --- a/decompiler/config/jak2/label_types.jsonc +++ b/decompiler/config/jak2/label_types.jsonc @@ -1230,5 +1230,72 @@ "squid-states": [ ["L451", "vector"], ["L450", "vector"] - ] + ], + "ctywide-obs": [ + ["L867", "uint64", true], + ["L861", "uint64", true], + ["L868", "uint64", true], + ["L862", "uint64", true], + ["L866", "uint64", true], + ["L860", "uint64", true], + ["L864", "uint64", true], + ["L865", "uint64", true], + ["L863", "uint64", true], + ["L869", "uint64", true], + ["L774", "uint64", true], + ["L771", "uint64", true], + ["L777", "uint64", true], + ["L773", "uint64", true], + ["L776", "uint64", true], + ["L775", "uint64", true], + ["L772", "uint64", true], + ["L751", "vector"], + ["L750", "vector"], + ["L756", "attack-info"], + ["L749", "vector"] + ], + "ctywide-tasks": [ + ["L197", "vector"], + ["L196", "vector"], + ["L198", "vector"] + ], + "ctyport-obs": [["L96", "vector"]], + "ctyasha-obs": [ + ["L146", "vector"], + ["L153", "vector"], + ["L160", "vector"], + ["L167", "vector"], + ["L661", "vector"], + ["L714", "vector"], + ["L728", "vector"], + ["L742", "vector"], + ["L756", "vector"], + ["L763", "vector"], + ["L777", "vector"], + ["L879", "vector"], + ["L878", "vector"], + ["L877", "vector"], + ["L876", "vector"], + ["L875", "vector"], + ["L874", "vector"], + ["L873", "vector"], + ["L872", "vector"], + ["L871", "vector"], + ["L870", "vector"], + ["L869", "vector"], + ["L868", "vector"], + ["L867", "vector"], + ["L866", "vector"], + ["L865", "vector"], + ["L855", "attack-info"], + ["L852", "vector"], + ["L851", "vector"], + ["L850", "vector"], + ["L849", "vector"] + ], + "portrun": [ + ["L274", "attack-info"], + ["L220", "vector"] + ], + "ctypower": [["L71", "vector"]] } diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index a337e2c3f..ea1f3e1fb 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -1816,5 +1816,30 @@ [16, "collide-query"], [560, "bounding-box"] ], - "squid-grenade-move": [[48, "matrix"]] + "squid-grenade-move": [[48, "matrix"]], + "(method 12 city-level-info)": [[16, ["inline-array", "vector", 7]]], + "(method 24 security-wall)": [[16, ["inline-array", "vector", 1]]], + "(method 35 cty-guard-turret)": [ + [144, "vector"], + [80, "vector"] + ], + "(method 24 parking-spot)": [[16, "collide-query-with-2vec"]], + "(method 23 parking-spot)": [ + [16, ["inline-array", "collide-query", 1]], + [560, ["inline-array", "vector", 1]] + ], + "(event idle propa)": [[16, "vector"]], + "(post idle propa)": [[16, "vector"]], + "(trans talking burning-bush)": [ + [32, "vector"], + [64, "vector"] + ], + "(trans menu burning-bush)": [[128, "vector"]], + "fruit-check-ground-bounce": [[16, "vector"]], + "(method 120 boat-base)": [[80, "vector"]], + "(method 29 boat-base)": [[16, "matrix"]], + "(method 23 ctyport-mine)": [ + [32, "vector"], + [48, "vector"] + ] } diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index a860236eb..8382e8815 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -8610,5 +8610,85 @@ "(event idle squid-baron)": [[13, "v1", "rgbaf"]], "(event idle squid-driver)": [[[11, 15], "v0", "matrix"]], "(trans idle squid-baron)": [[4, "a0", "squid"]], - "(method 23 squid-tentacle)": [["_stack_", 1584, "vector"]] + "(method 23 squid-tentacle)": [["_stack_", 1584, "vector"]], + "(event idle-close security-wall)": [ + [[25, 28], "v1", "attack-info"], + [35, "s5", "process-drawable"], + [136, "v1", "process-drawable"], + [152, "v1", "process-drawable"], + [159, "v1", "process-drawable"], + [162, "a0", "process-drawable"], + [176, "v1", "process-drawable"], + [183, "v1", "process-drawable"], + [186, "a0", "process-drawable"], + [202, "a0", "process-drawable"], + [199, "v1", "process-drawable"], + [282, "gp", "process-focusable"], + [210, "a2", "float"] + ], + "cty-guard-turret-event-handler": [ + [[18, 21], "v1", "attack-info"], + [[30, 35], "v1", "attack-info"] + ], + "(post idle cty-guard-turret)": [ + [88, "gp", "process-focusable"], + [129, "gp", "process-focusable"] + ], + "(method 35 cty-guard-turret)": [ + [15, "s5", "process-focusable"], + [47, "s5", "process-focusable"], + [168, "s5", "process-focusable"] + ], + "(code hostile cty-guard-turret)": [ + [88, "gp", "process-focusable"], + [119, "gp", "process-focusable"] + ], + "(method 7 cty-guard-turret)": [ + [24, "t9", "(function process-focusable int process-focusable)"] + ], + "(method 21 parking-spot)": [[[13, 38], "s5", "vehicle"]], + "(event idle propa)": [ + [[12, 15], "v1", "attack-info"], + [[59, 62], "a0", "collide-shape-prim-group"] + ], + "(post idle propa)": [ + [190, "s3", "process-focusable"], + [92, "v0", "sound-rpc-set-param"] + ], + "(method 31 propa)": [ + [26, "a0", "collide-shape"], + [32, "s0", "process-focusable"], + [10, "s3", "uint32"] + ], + "(method 7 barons-ship-lores)": [ + [24, "t9", "(function process-drawable int process-drawable)"] + ], + "(event idle ctyn-lamp)": [[4, "a0", "process-drawable"]], + "fruit-check-ground-bounce": [[[5, 40], "v1", "fruit-stand"]], + "fruit-stand-event-handler": [[[5, 8], "v1", "attack-info"]], + "(code idle-close security-wall)": [[[60, 999], "v0", "symbol"]], + "(anon-function 15 ctywide-tasks)": [[65, "v1", "vehicle"]], + "(anon-function 16 ctywide-tasks)": [[26, "v1", "vehicle"]], + "(anon-function 19 ctywide-tasks)": [[136, "v1", "vehicle"]], + "(method 120 boat-base)": [[282, "v1", "boat-manager"]], + "(post active tanker-deadly)": [[15, "v1", "process-drawable"]], + "tanker-deadly-init-by-other": [[70, "v1", "process-drawable"]], + "(post idle vin-turbine)": [[205, "a0", "lightning-tracker"]], + "(method 49 com-elevator)": [[2, "v1", "collide-shape-prim-group"]], + "(enter dormant com-elevator)": [ + [4, "v0", "state"], + [6, "t9", "(function none)"] + ], + "(method 10 com-elevator)": [[10, "t9", "(function elevator none)"]], + "(method 10 tomb-trans-elevator)": [ + [10, "t9", "(function com-elevator none)"] + ], + "(method 33 tomb-trans-elevator)": [ + [7, "t9", "(function com-elevator none)"] + ], + "(anon-function 4 ctypower)": [[137, "gp", "process-drawable"]], + "(anon-function 0 ctypower)": [ + [19, "a0", "vector"], + [81, "v1", "basebutton"] + ] } diff --git a/decompiler/util/data_decompile.cpp b/decompiler/util/data_decompile.cpp index 084e11e0b..01c336213 100644 --- a/decompiler/util/data_decompile.cpp +++ b/decompiler/util/data_decompile.cpp @@ -736,6 +736,10 @@ const std::unordered_map< {"nav-network-info", {{"adjacency", ArrayFieldDecompMeta(TypeSpec("nav-network-adjacency"), 16)}}}, {"sig-path", {{"samples", ArrayFieldDecompMeta(TypeSpec("sig-path-sample"), 64)}}}, + {"rigid-body-vehicle-constants", + {{"color-option-array", ArrayFieldDecompMeta(TypeSpec("vector"), 16)}, + {"grab-rail-array", ArrayFieldDecompMeta(TypeSpec("vehicle-grab-rail-info"), 48)}}}, + {"city-ambush-info", {{"array", ArrayFieldDecompMeta(TypeSpec("city-ambush-spot"), 32)}}}, {"fort-robotank-segment", {{"event-tbl", ArrayFieldDecompMeta(TypeSpec("fort-robotank-segment-event"), 32)}}}, {"race-info", diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.cpp b/game/graphics/opengl_renderer/OpenGLRenderer.cpp index 5a12a6bb1..08ae1dc8f 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.cpp +++ b/game/graphics/opengl_renderer/OpenGLRenderer.cpp @@ -149,6 +149,7 @@ void OpenGLRenderer::init_bucket_renderers_jak2() { // 90 init_bucket_renderer("tex-l2-shrub", BucketCategory::TEX, BucketId::TEX_L2_SHRUB); + init_bucket_renderer("merc-l2-shrub", BucketCategory::MERC, BucketId::MERC_L2_SHRUB); init_bucket_renderer("shrub-l2-shrub", BucketCategory::SHRUB, BucketId::SHRUB_L2_SHRUB); // 100 init_bucket_renderer("tex-l3-shrub", BucketCategory::TEX, diff --git a/game/graphics/opengl_renderer/buckets.h b/game/graphics/opengl_renderer/buckets.h index d357c2b6c..c43d1f127 100644 --- a/game/graphics/opengl_renderer/buckets.h +++ b/game/graphics/opengl_renderer/buckets.h @@ -115,6 +115,7 @@ enum class BucketId { SHRUB_L1_SHRUB = 83, TEX_L2_SHRUB = 91, SHRUB_L2_SHRUB = 92, + MERC_L2_SHRUB = 97, TEX_L3_SHRUB = 100, SHRUB_L3_SHRUB = 101, TEX_L4_SHRUB = 109, diff --git a/goal_src/jak2/engine/common_objs/rigid-body-plat.gc b/goal_src/jak2/engine/common_objs/rigid-body-plat.gc index 1afd45f6a..6a2cedfec 100644 --- a/goal_src/jak2/engine/common_objs/rigid-body-plat.gc +++ b/goal_src/jak2/engine/common_objs/rigid-body-plat.gc @@ -355,12 +355,12 @@ ) (update-transforms (-> obj root-override-2)) (let ((v1-5 (-> obj rbody)) - (a1-3 (&-> (-> obj info-override) mass)) + (a1-3 (-> obj info-override info)) (a2-2 (-> obj root-override-2 trans)) (a3-0 (-> obj root-override-2 quat)) (t0-0 (method-of-object obj rigid-body-object-method-29)) ) - (rigid-body-method-25 (-> v1-5 state) (the-as rigid-body-info a1-3) a2-2 a3-0 t0-0) + (rigid-body-method-25 (-> v1-5 state) a1-3 a2-2 a3-0 t0-0) ) (set! (-> obj player-bonk-timeout) (the-as uint (-> pp clock frame-counter))) (set! (-> obj player-force quad) (-> *null-vector* quad)) @@ -403,16 +403,16 @@ ) (define *rigid-body-platform-constants* (new 'static 'rigid-body-platform-constants - :mass 2.0 - :inv-mass 0.5 - :cm-joint (new 'static 'vector :w 1.0) - :linear-damping 1.0 - :angular-damping 1.0 - :bounce-factor 0.5 - :friction-factor 0.1 - :inertial-tensor-x (meters 4) - :inertial-tensor-y (meters 4) - :inertial-tensor-z (meters 4) + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.5 + :friction-factor 0.1 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 4) (meters 4) (meters 4)) + ) :max-time-step 0.033333335 :gravity (meters 80) :idle-distance (meters 50) diff --git a/goal_src/jak2/engine/entity/entity-table.gc b/goal_src/jak2/engine/entity/entity-table.gc index 57a1a64e6..2733c17b1 100644 --- a/goal_src/jak2/engine/entity/entity-table.gc +++ b/goal_src/jak2/engine/entity/entity-table.gc @@ -100,7 +100,7 @@ :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref burning-bush :method-count 35) + :ptype (type-ref burning-bush :method-count 33) :package "game" :art-group '() :pool '*16k-dead-pool* @@ -114,14 +114,14 @@ :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref barge :method-count 151) + :ptype (type-ref barge :method-count 149) :package "game" :art-group '() :pool '*16k-dead-pool* :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref propa :method-count 35) + :ptype (type-ref propa :method-count 32) :package "game" :art-group '() :pool '*16k-dead-pool* @@ -142,7 +142,7 @@ :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref parking-spot :method-count 27) + :ptype (type-ref parking-spot :method-count 25) :package "game" :art-group '() :pool '*16k-dead-pool* @@ -156,14 +156,14 @@ :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref cty-guard-turret :method-count 39) + :ptype (type-ref cty-guard-turret :method-count 36) :package "game" :art-group '() :pool '*16k-dead-pool* :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref cty-fruit-stand :method-count 31) + :ptype (type-ref cty-fruit-stand :method-count 30) :package "game" :art-group '() :pool '*16k-dead-pool* diff --git a/goal_src/jak2/engine/game/task/task-control-h.gc b/goal_src/jak2/engine/game/task/task-control-h.gc index 07e464727..ffb3c4191 100644 --- a/goal_src/jak2/engine/game/task/task-control-h.gc +++ b/goal_src/jak2/engine/game/task/task-control-h.gc @@ -1473,7 +1473,7 @@ (data-float float 32 :offset-assert 672) (data-vector vector 32 :inline :offset-assert 800) (actor-group (pointer entity-actor) 4 :offset-assert 1312) - (minimap uint32 8 :offset-assert 1328) + (minimap connection-minimap 8 :offset-assert 1328) (hud handle 4 :offset-assert 1360) (hud-timer handle :offset 1360) (hud-counter handle :offset 1368) diff --git a/goal_src/jak2/engine/game/task/task-control.gc b/goal_src/jak2/engine/game/task/task-control.gc index c099ab0e9..0fb96351b 100644 --- a/goal_src/jak2/engine/game/task/task-control.gc +++ b/goal_src/jak2/engine/game/task/task-control.gc @@ -1894,7 +1894,7 @@ ) (set! (-> obj arrow) (the-as handle #f)) (countdown (v1-8 4) - (set! (-> obj minimap v1-8) (the-as uint #f)) + (set! (-> obj minimap v1-8) #f) ) (countdown (v1-11 4) (set! (-> obj actor-group v1-11) (the-as (pointer entity-actor) #f)) diff --git a/goal_src/jak2/engine/physics/rigid-body.gc b/goal_src/jak2/engine/physics/rigid-body.gc index 4b73f808c..c11b57df2 100644 --- a/goal_src/jak2/engine/physics/rigid-body.gc +++ b/goal_src/jak2/engine/physics/rigid-body.gc @@ -857,17 +857,17 @@ ) (defmethod get-inv-mass rigid-body-object ((obj rigid-body-object)) - (-> obj info inv-mass) + (-> obj info info inv-mass) ) (defmethod rigid-body-object-method-35 rigid-body-object ((obj rigid-body-object)) (let ((a0-1 (-> obj info name))) (when (nonzero? a0-1) (set! (-> obj info) (the-as rigid-body-object-constants (-> a0-1 value))) - (set! (-> obj rbody state info) (the-as rigid-body-info (&-> (-> obj info) mass))) + (set! (-> obj rbody state info) (-> obj info info)) ) ) - ((method-of-type rigid-body-info rigid-body-info-method-9) (the-as rigid-body-info (&-> (-> obj info) mass))) + (rigid-body-info-method-9 (-> obj info info)) (set! (-> obj rbody state force-callback) (method-of-object obj rigid-body-object-method-29)) 0 (none) @@ -933,7 +933,7 @@ (update-transforms (-> obj root-override-2)) (rigid-body-method-25 (-> obj rbody state) - (the-as rigid-body-info (&-> (-> obj info) mass)) + (-> obj info info) (-> obj root-override-2 trans) (-> obj root-override-2 quat) (method-of-object obj rigid-body-object-method-29) @@ -978,16 +978,16 @@ ) (define *rigid-body-object-constants* (new 'static 'rigid-body-object-constants - :mass 2.0 - :inv-mass 0.5 - :cm-joint (new 'static 'vector :w 1.0) - :linear-damping 1.0 - :angular-damping 1.0 - :bounce-factor 0.5 - :friction-factor 0.1 - :inertial-tensor-x (meters 4) - :inertial-tensor-y (meters 4) - :inertial-tensor-z (meters 4) + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.5 + :friction-factor 0.1 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 4) (meters 4) (meters 4)) + ) :max-time-step 0.033333335 :gravity (meters 80) :idle-distance (meters 50) @@ -1060,7 +1060,7 @@ This commonly includes things such as: (when (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) (logior! (-> obj rbody state flags) (rigid-body-flag enable-physics)) (rigid-body-method-26 (-> obj rbody state) (-> obj root-override-2 trans) (-> obj root-override-2 quat)) - (vector-float*! (-> obj rbody state lin-momentum) (-> obj root-override-2 transv) (-> obj info mass)) + (vector-float*! (-> obj rbody state lin-momentum) (-> obj root-override-2 transv) (-> obj info info mass)) (vector-reset! (-> obj rbody state ang-momentum)) ) 0 @@ -1242,7 +1242,7 @@ This commonly includes things such as: ) (let ((f0-1 (vector-dot (-> s5-0 velocity) (-> s5-0 normal)))) (when (< f0-1 0.0) - (set! (-> s5-0 impulse) (/ f0-1 (+ f30-0 (-> obj info inv-mass)))) + (set! (-> s5-0 impulse) (/ f0-1 (+ f30-0 (-> obj info info inv-mass)))) (vector+float*! s4-0 s4-0 (-> s5-0 normal) (* -3.1 f30-0 (-> s5-0 impulse))) (set! (-> s4-0 y) (fmax (* 49152.0 f30-0) (-> s4-0 y))) (rigid-body-object-method-42 obj) diff --git a/goal_src/jak2/engine/ui/text-id-h.gc b/goal_src/jak2/engine/ui/text-id-h.gc index de69d080a..88e5841ad 100644 --- a/goal_src/jak2/engine/ui/text-id-h.gc +++ b/goal_src/jak2/engine/ui/text-id-h.gc @@ -373,8 +373,16 @@ (text-x24e #x024e) (text-x24f #x024f) (text-x277 #x0277) + (text-x278 #x0278) + (text-x27a #x027a) + (text-x27b #x027b) + (text-x27c #x027c) + (text-x27d #x027d) + (text-x27e #x027e) + (text-x27f #x027f) (scene-subtitles-enabled #x30d) (scene-subtitles-disabled #x30e) + (text-x30f #x30f) (progress-unknown-continue #x310) ) ;; ---game-text-id diff --git a/goal_src/jak2/game.gp b/goal_src/jak2/game.gp index 01aa9453d..2a6d6204a 100644 --- a/goal_src/jak2/game.gp +++ b/goal_src/jak2/game.gp @@ -2702,22 +2702,17 @@ ;; ;; LHIPOUT ;; ;;;;;;;;;;;;;;;;;;;;; -;; (cgo "LHIPOUT.DGO" "lhipout.gd") +(cgo "LHIPOUT.DGO" "lhipout.gd") -;; (copy-textures 3440 3199 3200 3486 3242 3544) +(copy-textures 3440 3199 3200 3486 3242 3544) -;; (copy-gos -;; "pecker-highres-ag" -;; "crocadog-highres-ag" -;; "sig-highres-ag" -;; "metalkor-chopped-ag" -;; "gold-key-ag" -;; "kid-medallion-ag" -;; "hip-bottle-c-ag" -;; "hip-mug-ag" -;; "particleman-ag" -;; "lhipout" -;; ) +(copy-gos + "kid-medallion-ag" + "hip-mug-ag" + "lhipout" + ) + +(copy-strs "OUPORT") ;;;;;;;;;;;;;;;;;;;;; ;; LINTCSTB @@ -2831,22 +2826,17 @@ ;; ;; LOUTCSTB ;; ;;;;;;;;;;;;;;;;;;;;; -;; (cgo "LOUTCSTB.DGO" "loutcstb.gd") +(cgo "LOUTCSTB.DGO" "loutcstb.gd") -;; (copy-textures 3186 3185 3187 3245) +(copy-textures 3186 3185 3187 3245) -;; (copy-gos -;; "youngsamos-highres-ag" -;; "brutter-highres-ag" -;; "kid-highres-ag" -;; "rift-ring-ag" -;; "brutter-balloon-norift-ag" -;; "metalkor-chopped-ag" -;; "rift-rider-ag" -;; "precursor-stone-ag" -;; "particleman-ag" -;; "loutcstb" -;; ) +(copy-gos + "brutter-balloon-norift-ag" + "metalkor-chopped-ag" + "loutcstb" + ) + +(copy-strs "OUNEST") ;;;;;;;;;;;;;;;;;;;;; ;; LPACKAGE @@ -2871,42 +2861,40 @@ ;; ;; LPORTRUN ;; ;;;;;;;;;;;;;;;;;;;;; -;; (cgo "LPORTRUN.DGO" "lportrun.gd") +(cgo "LPORTRUN.DGO" "lportrun.gd") -;; (goal-src-sequence -;; "" -;; :deps ("$OUT/obj/los-control.o") -;; "levels/city/port/mines/portrun.gc" -;; ) +(goal-src-sequence + "" + :deps ("$OUT/obj/los-control.o") + "levels/city/port/mines/portrun.gc" + ) -;; (copy-textures 2817 2373) +(copy-textures 2817 2373) -;; (copy-gos -;; "ctyport-cargo-ag" -;; "ctyport-spy-ag" -;; "mine-b-ag" -;; "ctyport-mine-ag" -;; "lportrun" -;; ) +(copy-gos + "ctyport-cargo-ag" + "ctyport-spy-ag" + "ctyport-mine-ag" + "lportrun" + ) ;; ;;;;;;;;;;;;;;;;;;;;; ;; ;; LPOWER ;; ;;;;;;;;;;;;;;;;;;;;; -;; (cgo "LPOWER.DGO" "lpower.gd") +(cgo "LPOWER.DGO" "lpower.gd") -;; (goal-src-sequence -;; "" -;; :deps ("$OUT/obj/los-control.o") -;; "levels/power_station/power_switches/ctypower.gc" -;; ) +(goal-src-sequence + "" + :deps ("$OUT/obj/los-control.o") + "levels/power_station/power_switches/ctypower.gc" + ) -;; (copy-textures 3348) +(copy-textures 3348) -;; (copy-gos -;; "cty-guard-turret-button-ag" -;; "lpower" -;; ) +(copy-gos + "lpower" + ) ;; ;;;;;;;;;;;;;;;;;;;;; ;; ;; LPROTECT @@ -3157,19 +3145,16 @@ ;; ;; LTESS ;; ;;;;;;;;;;;;;;;;;;;;; -;; (cgo "LTESS.DGO" "ltess.gd") +(cgo "LTESS.DGO" "ltess.gd") -;; (copy-textures 1862 1756 2881 3241) +(copy-textures 1862 1756 2881 3241) -;; (copy-gos -;; "tess-lhiphog+0-ag" -;; "krew-highres-ag" -;; "sig-highres-ag" -;; "tess-highres-ag" -;; "hip-bottle-c-ag" -;; "hip-bottle-b-ag" -;; "ltess" -;; ) +(copy-gos + "tess-lhiphog+0-ag" + "hip-bottle-c-ag" + "hip-bottle-b-ag" + "ltess" + ) ;; ;;;;;;;;;;;;;;;;;;;;; ;; ;; LTHRNOUT @@ -3651,8 +3636,6 @@ "7credits-tx" "keira-highres-ag" "samos-highres-ag" - ;; "tess-highres-ag" - ;; "onin-highres-ag" "rift-break-ring-ag" "precursor-ag" "outrocst" @@ -3817,14 +3800,13 @@ ;; ;; PORTWALL ;; ;;;;;;;;;;;;;;;;;;;;; -;; (cgo "PORTWALL.DGO" "portwall.gd") +(cgo "PORTWALL.DGO" "portwall.gd") -;; (copy-textures 3181 3323) +(copy-textures 3181 3323) -;; (copy-gos -;; "mecha-daxter-ag" -;; "portwall" -;; ) +(copy-gos + "portwall" + ) ;; ;;;;;;;;;;;;;;;;;;;;; ;; ;; RUI diff --git a/goal_src/jak2/levels/castle/pad/castle-tasks.gc b/goal_src/jak2/levels/castle/pad/castle-tasks.gc index 5f757666c..0477af98f 100644 --- a/goal_src/jak2/levels/castle/pad/castle-tasks.gc +++ b/goal_src/jak2/levels/castle/pad/castle-tasks.gc @@ -7,3 +7,35 @@ ;; DECOMP BEGINS +(set-subtask-hook! + *game-info* + 219 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> self info end-sphere quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 (the-as task-arrow self)))) + ) + (until #f + (when (< (vector-vector-distance (target-pos 0) (-> self info end-sphere)) (-> self info end-sphere r)) + (send-event (handle->process (-> self arrow)) 'leave) + (let ((gp-2 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-2) (seconds 0.007)) + (suspend) + ) + ) + (go-virtual complete) + ) + (suspend) + ) + #f + (none) + ) + ) + ) diff --git a/goal_src/jak2/levels/city/common/ctyport-obs.gc b/goal_src/jak2/levels/city/common/ctyport-obs.gc index 9057cfb1c..d07a9c1f1 100644 --- a/goal_src/jak2/levels/city/common/ctyport-obs.gc +++ b/goal_src/jak2/levels/city/common/ctyport-obs.gc @@ -7,3 +7,966 @@ ;; DECOMP BEGINS +(deftype boat-manager (process) + ((mesh basic :offset-assert 128) + (paths path-control 4 :offset-assert 132) + ) + :heap-base #x20 + :method-count-assert 16 + :size-assert #x94 + :flag-assert #x1000200094 + (:methods + (idle () _type_ :state 14) + (boat-manager-method-15 (_type_) none 15) + ) + ) + + +(define *barge-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 100.0 + :inv-mass 0.01 + :linear-damping 0.9 + :angular-damping 0.9 + :bounce-factor 0.1 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z 8192.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 16) (meters 6) (meters 20)) + ) + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + :name '*barge-constants* + :flags #x8 + :object-type #x11 + :guard-type #x7 + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 1.0 + :turbo-boost-factor 1.0 + :max-xz-speed (meters 30) + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261824 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 1274.3112 + :tire-friction-factor 1.0 + :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 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.7 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 0.5 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :turning-accel (meters 20) + :toughness-factor 1.0 + :damage-factor 0.5 + :camera-string-min-height (meters 4.5) + :camera-string-max-height (meters 4.5) + :camera-string-min-length (meters 5) + :camera-string-max-length (meters 12.5) + :camera-min-fov 15109.688 + :camera-max-fov 17476.268 + :camera-head-offset 8192.0 + :camera-foot-offset 4096.0 + :camera-normal-max-angle-offset 182.04445 + :camera-air-max-angle-offset 5461.3335 + :camera-max-lookaround-speed 40960.0 + :rider-stance #x1 + :grab-rail-array #f + :rider-hand-offset (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :explosion #f + :engine-pitch-scale 0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound (static-sound-name "vehicle-engine") + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "car-scrape-stn") + :glance-sound (static-sound-name "car-glance-stn") + :impact-sound (static-sound-name "car-impact-stn") + :extra-sound (static-sound-name "car-by-1") + :explosion-part #xa1 + :thruster-flame-width (meters 0.25) + :thruster-flame-length (meters 4) + :thruster-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :exhaust-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :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 :w 1.0) (new 'static 'vector :w 1.0)) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :z 22118.4 :w 1.0) + :brake-local-pos (new 'static 'vector :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)) + ) + ) + +(deftype boat-base (vehicle) + ((angle float :offset-assert 880) + (y-rot float :offset-assert 884) + (path-num uint32 :offset-assert 888) + (path-index float :offset-assert 892) + ) + :heap-base #x300 + :method-count-assert 149 + :size-assert #x380 + :flag-assert #x9503000380 + (:methods + (boat-base-method-144 (_type_ nav-control) none 144) + (boat-base-method-145 (_type_ nav-control) none 145) + (boat-base-method-146 (_type_ nav-control) none 146) + (boat-base-method-147 (_type_ nav-control) none 147) + (boat-base-method-148 (_type_ nav-control) none 148) + ) + ) + + +(defmethod boat-base-method-144 boat-base ((obj boat-base) (arg0 nav-control)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> arg0 state))) + (set! (-> gp-0 rotation-rate) (-> gp-0 nav max-rotation-rate)) + (if (< 0.0 (-> gp-0 speed)) + (set! (-> gp-0 rotation-rate) + (fmin + (-> gp-0 rotation-rate) + (* (/ (-> gp-0 nav turning-acceleration) (-> gp-0 speed)) (-> gp-0 mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> gp-0 nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> gp-0 heading) (-> gp-0 nav shape quat)) + (set! (-> gp-0 heading y) 0.0) + (let ((v1-12 (-> gp-0 heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((a1-2 (new 'stack-no-clear 'vector))) + (set! (-> a1-2 quad) (-> gp-0 nav shape trans quad)) + (if (or (not (-> gp-0 current-poly)) + (!= (-> gp-0 current-pos x) (-> a1-2 x)) + (!= (-> gp-0 current-pos z) (-> a1-2 z)) + ) + (do-navigation-to-destination gp-0 a1-2) + ) + ) + (logclear! + (-> gp-0 flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap) + ) + ) + 0 + 0 + (none) + ) + ) + +(defmethod boat-base-method-145 boat-base ((obj boat-base) (arg0 nav-control)) + (navigate-using-route-portals (-> arg0 state)) + 0 + 0 + (none) + ) + +(defmethod boat-base-method-146 boat-base ((obj boat-base) (arg0 nav-control)) + (navigate-using-best-dir-recompute-avoid-spheres-2 (-> arg0 state)) + 0 + (none) + ) + +(defmethod boat-base-method-147 boat-base ((obj boat-base) (arg0 nav-control)) + (update-travel-dir-from-spheres (-> arg0 state)) + 0 + (none) + ) + +(defmethod boat-base-method-148 boat-base ((obj boat-base) (arg0 nav-control)) + (compute-speed-simple (-> arg0 state)) + 0 + (none) + ) + +(define *boat-nav-callback-info* + (new 'static 'nav-callback-info + :callback-count 5 + :callback-array (new 'static 'array (function object nav-control none) 10 + (lambda ((arg0 object) (arg1 nav-control)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> arg1 state))) + (set! (-> gp-0 rotation-rate) (-> gp-0 nav max-rotation-rate)) + (if (< 0.0 (-> gp-0 speed)) + (set! (-> gp-0 rotation-rate) + (fmin + (-> gp-0 rotation-rate) + (* (/ (-> gp-0 nav turning-acceleration) (-> gp-0 speed)) (-> gp-0 mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> gp-0 nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> gp-0 heading) (-> gp-0 nav shape quat)) + (set! (-> gp-0 heading y) 0.0) + (let ((v1-14 (-> gp-0 heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-14 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-14 quad) vf1) + ) + ) + (let ((a1-2 (new 'stack-no-clear 'vector))) + (set! (-> a1-2 quad) (-> gp-0 nav shape trans quad)) + (if (or (not (-> gp-0 current-poly)) + (!= (-> gp-0 current-pos x) (-> a1-2 x)) + (!= (-> gp-0 current-pos z) (-> a1-2 z)) + ) + (do-navigation-to-destination gp-0 a1-2) + ) + ) + (logclear! + (-> gp-0 flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap) + ) + ) + 0 + 0 + 0 + (none) + ) + ) + (lambda ((arg0 object) (arg1 nav-control)) (navigate-using-route-portals (-> arg1 state)) 0 0 0 (none)) + (lambda ((arg0 object) (arg1 nav-control)) + (let* ((v1-0 arg1) + (a2-2 (-> v1-0 state mesh sphere-hash sphere-array)) + (a3-0 (-> v1-0 sphere-id-array)) + (t0-1 (-> v1-0 state mesh bounds)) + (t1-0 (-> v1-0 root-nav-sphere)) + (t2-0 (-> v1-0 sphere-count)) + ) + (dotimes (t3-0 t2-0) + (let ((t5-0 (-> a2-2 (-> a3-0 t3-0))) + (t4-4 (-> v1-0 sphere-array t3-0)) + ) + (vector-! (the-as vector t4-4) (the-as vector t5-0) t0-1) + (set! (-> t4-4 r) (+ (-> t5-0 r) (-> t1-0 w))) + ) + ) + ) + 0 + (navigate-using-best-dir-recompute-avoid-spheres-2 (-> arg1 state)) + 0 + 0 + (none) + ) + (lambda ((arg0 object) (arg1 nav-control)) + (let* ((v1-0 arg1) + (a2-2 (-> v1-0 state mesh sphere-hash sphere-array)) + (a3-0 (-> v1-0 sphere-id-array)) + (t0-1 (-> v1-0 state mesh bounds)) + (t1-0 (-> v1-0 root-nav-sphere)) + (t2-0 (-> v1-0 sphere-count)) + ) + (dotimes (t3-0 t2-0) + (let ((t5-0 (-> a2-2 (-> a3-0 t3-0))) + (t4-4 (-> v1-0 sphere-array t3-0)) + ) + (vector-! (the-as vector t4-4) (the-as vector t5-0) t0-1) + (set! (-> t4-4 r) (+ (-> t5-0 r) (-> t1-0 w))) + ) + ) + ) + 0 + (update-travel-dir-from-spheres (-> arg1 state)) + 0 + 0 + (none) + ) + (lambda ((arg0 object) (arg1 nav-control)) (compute-speed-simple (-> arg1 state)) 0 0 (none)) + ) + ) + ) + +(defmethod apply-damage boat-base ((obj boat-base) (arg0 float) (arg1 rigid-body-impact)) + 0 + (none) + ) + +(defmethod rigid-body-object-method-47 boat-base ((obj boat-base) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) + ((method-of-type vehicle rigid-body-object-method-47) obj arg0 arg1 arg2 arg3) + #f + ) + +(defmethod vehicle-method-120 boat-base ((obj boat-base)) + (with-pp + (let ((t9-0 (method-of-type vehicle vehicle-method-120))) + (t9-0 obj) + ) + (when (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) + (let ((a1-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override-2 quat))) + (s5-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-from-two-vectors-max-angle! s5-0 a1-1 *up-vector* (* 728.1778 (-> pp clock seconds-per-frame))) + (quaternion*! (-> obj root-override-2 quat) s5-0 (-> obj root-override-2 quat)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override-2 quat))) + ) + (new 'stack-no-clear 'vector) + (let ((a1-4 (-> obj nav state))) + (set! (-> s4-0 quad) (-> a1-4 velocity quad)) + ) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (let ((s0-0 (-> obj nav state current-poly))) + (vector-xz-normalize-copy! s1-0 s4-0 163840.0) + (set! (-> s2-0 quad) (-> s1-0 quad)) + (clamp-vector-to-mesh-no-gaps (-> obj nav) (-> obj root-override-2 trans) s0-0 s2-0 s3-0) + ) + (when (-> s3-0 found-boundary) + (let ((f30-0 (vector-length s4-0))) + (vector-flatten! s4-0 s4-0 (-> s3-0 boundary-normal)) + (vector-rotate90-around-y! s4-0 (-> s3-0 boundary-normal)) + (vector-normalize! s4-0 f30-0) + ) + (when (= obj *debug-actor*) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> obj root-override-2 trans) s4-0 (meters 10) *color-blue*) + (format *stdcon* "avoid border~%") + ) + ) + ) + (set! (-> obj y-rot) (- (-> obj y-rot) (* 2.0 (-> pp clock seconds-per-frame) (-> obj y-rot)))) + (+! (-> obj y-rot) + (* 10.0 + (-> pp clock seconds-per-frame) + (deg- (deg- (vector-y-angle s4-0) (quaternion-y-angle (-> obj root-override-2 quat))) (-> obj y-rot)) + ) + ) + (set! (-> obj y-rot) (fmax -10922.667 (fmin 10922.667 (-> obj y-rot)))) + (set! (-> obj y-rot) (deg- (vector-y-angle s4-0) (quaternion-y-angle (-> obj root-override-2 quat)))) + (quaternion-rotate-local-y! + (-> obj root-override-2 quat) + (-> obj root-override-2 quat) + (* (-> obj y-rot) (-> pp clock seconds-per-frame)) + ) + (vector-v*float+! (-> obj root-override-2 trans) (-> obj root-override-2 trans) s5-1 8954.266) + ) + (seek! (-> obj root-override-2 trans y) 4096.0 (* 4096.0 (-> pp clock seconds-per-frame))) + (when (= obj *debug-actor*) + (format *stdcon* "no physics~%") + (format *stdcon* "~M~%" (-> obj root-override-2 trans y)) + ) + ) + (if (= obj *debug-actor*) + (format *stdcon* "speed ~M~%" (vector-length (-> obj root-override-2 transv))) + ) + (let ((s4-2 (ppointer->process (-> obj parent))) + (s5-2 (new 'stack-no-clear 'vector)) + ) + (when s4-2 + (let ((a1-24 (-> obj nav state))) + (set! (-> s5-2 quad) (-> a1-24 target-post quad)) + ) + (when (< (vector-vector-xz-distance (-> obj root-override-2 trans) s5-2) 163840.0) + (set! (-> obj path-index) (+ 0.01 (-> obj path-index))) + (let ((f0-22 (-> obj path-index))) + (set! (-> obj path-index) (- f0-22 (* (the float (the int (/ f0-22 1.0))) 1.0))) + ) + ) + (get-point-at-percent-along-path! + (-> (the-as boat-manager (+ (* (-> obj path-num) 4) (the-as uint s4-2))) paths 0) + s5-2 + (-> obj path-index) + 'interp + ) + (let ((v1-76 (-> obj nav state))) + (logclear! (-> v1-76 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-76 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-76 target-post quad) (-> s5-2 quad)) + ) + 0 + ) + ) + (vehicle-method-85 obj) + (none) + ) + ) + +(defmethod rigid-body-object-method-29 boat-base ((obj boat-base) (arg0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s3-0 (-> obj rbody)) + (s2-0 (-> obj info-override)) + (s4-0 (new 'stack-no-clear 'matrix)) + ) + (let ((a1-1 (-> obj nav state))) + (set! (-> s4-0 vector 1 quad) (-> a1-1 velocity quad)) + ) + (vector-! (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1) (-> s3-0 state lin-velocity)) + (vector-float*! (the-as vector (-> s4-0 vector)) (the-as vector (-> s4-0 vector)) (* 4.0 (-> s2-0 info mass))) + (let ((s1-0 (-> s4-0 vector 2))) + (let ((s0-0 (-> obj root-override-2 trans))) + (let ((v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override-2 quat)))) + (let ((a0-6 40960.0)) + (.mov vf7 a0-6) + ) + (.lvf vf5 (&-> v1-7 quad)) + ) + (.lvf vf4 (&-> s0-0 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s1-0 quad) vf6) + ) + (let ((s0-1 (-> s4-0 vector 2))) + (let ((s1-1 (-> s4-0 vector 2))) + (let ((v1-9 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override-2 quat)))) + (let ((a0-9 -32768.0)) + (.mov vf7 a0-9) + ) + (.lvf vf5 (&-> v1-9 quad)) + ) + (.lvf vf4 (&-> s1-1 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s0-1 quad) vf6) + ) + (let ((v1-10 s3-0) + (a1-9 (-> s4-0 vector 2)) + (a2-0 (-> s4-0 vector)) + ) + (rigid-body-method-18 (-> v1-10 state) a1-9 (the-as vector a2-0)) + ) + (.svf (&-> (-> s4-0 vector) 0 quad) vf0) + (set! (-> s4-0 vector 0 y) (* -4.0 (-> s2-0 gravity) (-> s2-0 info mass))) + (let ((a1-10 (-> s4-0 vector))) + (rigid-body-method-20 (-> s3-0 state) (the-as vector a1-10)) + ) + ) + (rigid-body-object-method-50 obj arg0) + (vehicle-method-99 obj arg0) + (none) + ) + ) + +(defmethod vehicle-method-96 boat-base ((obj boat-base)) + 0 + (none) + ) + +(defmethod rigid-body-object-method-36 boat-base ((obj boat-base)) + 0 + (none) + ) + +(defmethod vehicle-method-135 boat-base ((obj boat-base) (arg0 traffic-object-spawn-params)) + (get-nav-control obj (-> arg0 nav-mesh)) + (set! (-> obj nav callback-info) *boat-nav-callback-info*) + (logior! (-> obj nav flags) (nav-control-flag display-marks limit-rotation-rate update-heading-from-facing)) + (let ((v1-4 (-> obj nav))) + (set! (-> v1-4 target-speed) 40960.0) + ) + 0 + (let ((v1-6 (-> obj nav))) + (set! (-> v1-6 acceleration) 8192.0) + ) + 0 + (let ((v1-8 (-> obj nav))) + (set! (-> v1-8 turning-acceleration) 8192.0) + ) + 0 + (let ((v1-10 (-> obj nav))) + (set! (-> v1-10 max-rotation-rate) 9102.223) + ) + 0 + (let ((v1-12 (-> obj nav))) + (set! (-> v1-12 nav-cull-radius) 122880.0) + ) + 0 + (let ((v1-14 (-> obj nav))) + (set! (-> v1-14 sphere-mask) (the-as uint 64)) + ) + 0 + (set! (-> obj path-num) (-> arg0 user-data)) + (set! (-> obj path-index) (+ 0.05 (-> arg0 position w))) + (set! (-> obj root-override-2 root-prim prim-core collide-as) + (logior (collide-spec pusher) (-> obj root-override-2 root-prim prim-core collide-as)) + ) + (let ((v1-21 (-> obj root-override-2 root-prim))) + (set! (-> obj root-override-2 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> obj root-override-2 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + 0 + (none) + ) + +(defmethod rigid-body-object-method-31 boat-base ((obj boat-base) (arg0 rigid-body-vehicle-constants)) + ((method-of-type vehicle rigid-body-object-method-31) obj arg0) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod vehicle-method-113 boat-base ((obj boat-base)) + (go (method-of-object obj idle)) + (none) + ) + +(defstate waiting (boat-base) + :virtual #t + :enter (behavior () + (go-virtual idle) + (none) + ) + :exit (behavior () + '() + (none) + ) + ) + +(defstate inactive (boat-base) + :virtual #t + :enter (behavior () + (go-virtual idle) + (none) + ) + :exit (behavior () + '() + (none) + ) + ) + +(defstate idle (boat-base) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior boat-base) vehicle-event-handler) + :enter (behavior () + (logior! (-> self flags) (rigid-body-object-flag riding)) + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :exit (behavior () + '() + (none) + ) + :trans (behavior () + '() + (none) + ) + :post (behavior () + (rigid-body-object-method-37 self) + (update-transforms (-> self root-override-2)) + (none) + ) + ) + +(defskelgroup skel-barge barge barge-lod0-jg barge-idle-ja + ((barge-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) + +(deftype barge (boat-base) + ((engine uint32 :offset-assert 896) + (bow-wash uint32 :offset-assert 900) + ) + :heap-base #x310 + :method-count-assert 149 + :size-assert #x388 + :flag-assert #x9503100388 + ) + + +(defmethod vehicle-method-120 barge ((obj barge)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((t9-0 (method-of-type boat-base vehicle-method-120))) + (t9-0 obj) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (-> obj root-override-2 trans))) + (let ((v1-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override-2 quat)))) + (let ((a0-4 -61440.0)) + (.mov vf7 a0-4) + ) + (.lvf vf5 (&-> v1-3 quad)) + ) + (.lvf vf4 (&-> s4-0 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s5-0 quad) vf6) + (cond + ((< (vector-vector-distance s5-0 (camera-pos)) 614400.0) + (let ((a0-6 (static-sound-spec "barge-engine"))) + (sound-play-by-spec a0-6 (the-as sound-id (-> obj engine)) s5-0) + ) + ) + (else + (sound-stop (the-as sound-id (-> obj engine))) + ) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (let ((s4-2 (-> obj root-override-2 trans))) + (let ((v1-9 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override-2 quat)))) + (let ((a0-10 61440.0)) + (.mov vf7 a0-10) + ) + (.lvf vf5 (&-> v1-9 quad)) + ) + (.lvf vf4 (&-> s4-2 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s5-1 quad) vf6) + (cond + ((< (vector-vector-distance s5-1 (camera-pos)) 614400.0) + (let ((a0-12 (static-sound-spec "bow-wash"))) + (sound-play-by-spec a0-12 (the-as sound-id (-> obj bow-wash)) s5-1) + ) + ) + (else + (sound-stop (the-as sound-id (-> obj bow-wash))) + ) + ) + ) + (none) + ) + ) + +(defmethod rigid-body-object-method-32 barge ((obj barge)) + (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 19) 0))) + (set! (-> s5-0 total-prims) (the-as uint 20)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 81920.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-11 prim-core action) (collide-action solid rideable)) + (set! (-> v1-11 transform-index) 3) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 81920.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-13 prim-core action) (collide-action solid rideable)) + (set! (-> v1-13 transform-index) 3) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 81920.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 -32768.0 16384.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 -8192.0 16384.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 16384.0 16384.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 0) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 40960.0 16384.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core action) (collide-action solid)) + (set! (-> v1-23 transform-index) 0) + (set-vector! (-> v1-23 local-sphere) 24576.0 0.0 -32768.0 16384.0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-25 prim-core action) (collide-action solid)) + (set! (-> v1-25 transform-index) 0) + (set-vector! (-> v1-25 local-sphere) 24576.0 0.0 -8192.0 16384.0) + ) + (let ((v1-27 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-27 prim-core action) (collide-action solid)) + (set! (-> v1-27 transform-index) 0) + (set-vector! (-> v1-27 local-sphere) 24576.0 0.0 16384.0 16384.0) + ) + (let ((v1-29 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-29 prim-core action) (collide-action solid)) + (set! (-> v1-29 transform-index) 0) + (set-vector! (-> v1-29 local-sphere) 24576.0 0.0 40960.0 16384.0) + ) + (let ((v1-31 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-31 prim-core action) (collide-action solid)) + (set! (-> v1-31 transform-index) 0) + (set-vector! (-> v1-31 local-sphere) -24576.0 0.0 -32768.0 16384.0) + ) + (let ((v1-33 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-33 prim-core action) (collide-action solid)) + (set! (-> v1-33 transform-index) 0) + (set-vector! (-> v1-33 local-sphere) -24576.0 0.0 -8192.0 16384.0) + ) + (let ((v1-35 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-35 prim-core action) (collide-action solid)) + (set! (-> v1-35 transform-index) 0) + (set-vector! (-> v1-35 local-sphere) -24576.0 0.0 16384.0 16384.0) + ) + (let ((v1-37 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-37 prim-core action) (collide-action solid)) + (set! (-> v1-37 transform-index) 0) + (set-vector! (-> v1-37 local-sphere) -24576.0 0.0 40960.0 16384.0) + ) + (let ((v1-39 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-39 prim-core action) (collide-action solid)) + (set! (-> v1-39 transform-index) 0) + (set-vector! (-> v1-39 local-sphere) 16384.0 0.0 -57344.0 16384.0) + ) + (let ((v1-41 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-41 prim-core action) (collide-action solid)) + (set! (-> v1-41 transform-index) 0) + (set-vector! (-> v1-41 local-sphere) -16384.0 0.0 -57344.0 16384.0) + ) + (let ((v1-43 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-43 prim-core action) (collide-action solid)) + (set! (-> v1-43 transform-index) 0) + (set-vector! (-> v1-43 local-sphere) 0.0 8192.0 -61440.0 16384.0) + ) + (let ((v1-45 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-45 prim-core action) (collide-action solid)) + (set! (-> v1-45 transform-index) 0) + (set-vector! (-> v1-45 local-sphere) -40960.0 0.0 -53248.0 16384.0) + ) + (let ((v1-47 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-47 prim-core action) (collide-action solid)) + (set! (-> v1-47 transform-index) 0) + (set-vector! (-> v1-47 local-sphere) 40960.0 0.0 -53248.0 16384.0) + ) + (set! (-> s5-0 nav-radius) 81920.0) + (let ((v1-49 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-49 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-49 prim-core collide-with)) + ) + (set! (-> obj root-override-2) s5-0) + ) + 0 + (none) + ) + +(defmethod rigid-body-object-method-33 barge ((obj barge)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-barge" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (rigid-body-object-method-31 obj *barge-constants*) + (set! (-> obj draw lod-set lod 0 dist) 1228800.0) + (set! (-> obj engine) (the-as uint (new-sound-id))) + (set! (-> obj bow-wash) (the-as uint (new-sound-id))) + (iterate-prims + (-> obj root-override-2) + (lambda ((arg0 collide-shape-prim)) + (case (-> arg0 prim-core prim-type) + (((prim-type sphere)) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-sphere)) + ) + (((prim-type mesh)) + (set! (-> arg0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> arg0 prim-core collide-as) (collide-spec camera-blocker vehicle-mesh vehicle-mesh-probeable)) + ) + (((prim-type group)) + (set! (-> arg0 prim-core collide-with) + (collide-spec + backgnd + jak + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + ) + ) + (set! (-> arg0 prim-core collide-as) + (collide-spec vehicle-sphere camera-blocker vehicle-mesh vehicle-mesh-probeable) + ) + ) + ) + (none) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch process vs boat-manager. +(defmethod relocate boat-manager ((obj boat-manager) (arg0 int)) + (dotimes (v1-0 4) + (if (-> obj paths v1-0) + (&+! (-> obj paths v1-0) arg0) + ) + ) + (the-as boat-manager ((method-of-type process relocate) obj arg0)) + ) + +(defstate idle (boat-manager) + :virtual #t + :enter (behavior () + '() + (none) + ) + :exit (behavior () + '() + (none) + ) + :trans (behavior () + (dotimes (gp-0 4) + (let ((a0-0 (-> self paths gp-0))) + (if a0-0 + (debug-draw a0-0) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior boat-manager) sleep-code) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! boat-manager ((obj boat-manager) (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" + (set! (-> obj mesh) (nav-mesh-from-res-tag arg0 'nav-mesh-actor 0)) + (set! (-> obj entity) arg0) + (when (-> obj mesh) + (dotimes (s5-1 4) + (set! (-> obj paths s5-1) (new 'process 'curve-control obj 'path (the float s5-1))) + (when (-> obj paths s5-1) + (logior! (-> obj paths s5-1 flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((s4-0 (-> obj paths s5-1)) + (s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (f30-0 0.0) + ) + 1 + (the int (* 0.0000016276042 (total-distance s4-0))) + (while (< f30-0 0.8) + (displacement-between-points-at-percent-normalized! s4-0 s2-0 f30-0) + (get-point-at-percent-along-path! s4-0 s3-0 f30-0 'interp) + (vector-normalize! s2-0 1.0) + (let ((s1-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s1-0 behavior) (the-as uint 1)) + (set! (-> s1-0 id) (the-as uint 0)) + (set! (-> s1-0 nav-mesh) (the-as nav-mesh (-> obj mesh))) + (set! (-> s1-0 position quad) (-> s3-0 quad)) + (quaternion-look-at! (-> s1-0 rotation) s2-0 *up-vector*) + (set! (-> s1-0 user-data) (the-as uint s5-1)) + (set! (-> s1-0 position w) f30-0) + (logior! (-> s1-0 flags) 1) + (process->handle (vehicle-spawn obj barge s1-0)) + ) + (+! f30-0 (/ (* 4096.0 (+ 150.0 (* 150.0 (rand-vu)))) (total-distance s4-0))) + ) + ) + ) + ) + ) + (go (method-of-object obj idle)) + (none) + ) diff --git a/goal_src/jak2/levels/city/common/ctywide-obs-h.gc b/goal_src/jak2/levels/city/common/ctywide-obs-h.gc index 44a306577..02f3a869c 100644 --- a/goal_src/jak2/levels/city/common/ctywide-obs-h.gc +++ b/goal_src/jak2/levels/city/common/ctywide-obs-h.gc @@ -17,7 +17,7 @@ :size-assert #x18 :flag-assert #xa00000018 (:methods - (city-race-ring-info-method-9 () none 9) + (city-race-ring-info-method-9 (_type_ symbol) none 9) ) ) @@ -33,13 +33,13 @@ (deftype city-ambush-info (structure) - ((count int16 :offset-assert 0) - (array uint32 :offset-assert 4) + ((count int16 :offset-assert 0) + (array (inline-array city-ambush-spot) :offset-assert 4) ) :method-count-assert 10 :size-assert #x8 :flag-assert #xa00000008 (:methods - (city-ambush-info-method-9 () none 9) + (city-ambush-info-method-9 (_type_ traffic-object-spawn-params) none 9) ) ) diff --git a/goal_src/jak2/levels/city/common/ctywide-tasks.gc b/goal_src/jak2/levels/city/common/ctywide-tasks.gc index 6052e11c7..5a7848aec 100644 --- a/goal_src/jak2/levels/city/common/ctywide-tasks.gc +++ b/goal_src/jak2/levels/city/common/ctywide-tasks.gc @@ -6,4 +6,3 @@ ;; dgos: CWI ;; DECOMP BEGINS - diff --git a/goal_src/jak2/levels/city/common/searchlight.gc b/goal_src/jak2/levels/city/common/searchlight.gc index 63d970a2c..7cc943027 100644 --- a/goal_src/jak2/levels/city/common/searchlight.gc +++ b/goal_src/jak2/levels/city/common/searchlight.gc @@ -7,3 +7,106 @@ ;; DECOMP BEGINS +(deftype searchlight (process-drawable) + ((sync sync-eased :inline :offset-assert 200) + ) + :heap-base #x80 + :method-count-assert 21 + :size-assert #xf4 + :flag-assert #x15008000f4 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-searchlight searchlight searchlight-lod0-jg searchlight-idle-ja + ((searchlight-lod0-mg (meters 999999))) + :bounds (static-spherem 0 60 0 120) + :origin-joint-index 3 + ) + +(defstate idle (searchlight) + :virtual #t + :code (behavior () + (until #f + (let ((gp-1 (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + (new 'static 'vector :z 1.0 :w 1.0) + (+ -4004.9778 (* 8192.0 (get-norm! (-> self sync) 0))) + ) + ) + (s5-2 (quaternion-axis-angle! + (new 'stack-no-clear 'quaternion) + 0.0 + 1.0 + 0.0 + (vector-y-angle (-> (math-camera-matrix) vector 2)) + ) + ) + ) + (let ((f0-3 (calc-fade-from-fog (-> self root trans)))) + (set-vector! (-> self draw color-emissive) f0-3 f0-3 f0-3 1.0) + ) + (quaternion-normalize! (quaternion*! (-> self root quat) s5-2 gp-1)) + ) + (when (rand-vu-percent? 0.05) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer self)) + (set! (-> a1-4 num-params) 0) + (set! (-> a1-4 message) 'hour) + (let ((v1-13 (send-event-function (ppointer->process *time-of-day*) a1-4))) + (if (and v1-13 (>= (the-as int v1-13) 7) (>= 18 (the-as int v1-13))) + (logior! (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + ) + ) + ) + (suspend) + ) + #f + (none) + ) + :post (the-as (function none :behavior searchlight) ja-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! searchlight ((obj searchlight) (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" + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (logclear! (-> obj mask) (process-mask actor-pause)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-searchlight" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (logior! (-> obj draw status) (draw-control-status disable-fog)) + (set! (-> obj root scale y) (rand-vu-float-range 1.8 2.0)) + (set-vector! (-> obj draw color-mult) 0.0 0.0 0.0 0.0) + (let ((s4-1 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-12 0)) + (if #t + (set! v1-12 (logior v1-12 1)) + ) + (set! (-> s4-1 sync-type) 'sync-eased) + (set! (-> s4-1 sync-flags) (the-as sync-flags v1-12)) + ) + (set! (-> s4-1 period) (the-as uint (rand-vu-int-range 3000 6000))) + (set! (-> s4-1 entity) arg0) + (set! (-> s4-1 percent) 0.0) + (set! (-> s4-1 ease-in) 0.15) + (set! (-> s4-1 ease-out) 0.15) + (set! (-> s4-1 pause-in) 0.0) + (set! (-> s4-1 pause-out) 0.0) + (initialize! (-> obj sync) s4-1) + ) + (go (method-of-object obj idle)) + (none) + ) diff --git a/goal_src/jak2/levels/city/common/vehicle-effects.gc b/goal_src/jak2/levels/city/common/vehicle-effects.gc index ab682d7be..bb95523fe 100644 --- a/goal_src/jak2/levels/city/common/vehicle-effects.gc +++ b/goal_src/jak2/levels/city/common/vehicle-effects.gc @@ -26,7 +26,7 @@ (set! (-> obj scrape-sound-id) (new-sound-id)) ) (sound-play-by-name - (the-as sound-name (-> obj info-override scrape-sound)) + (-> obj info-override scrape-sound) (-> obj scrape-sound-id) (the int (* 1024.0 (-> obj scrape-sound-envelope))) 0 @@ -62,7 +62,7 @@ ) (a0-9 (static-sound-spec "vehicle-engine" :volume 0.0 :mask (pitch reg0))) ) - (set! (-> a0-9 sound-name) (the-as sound-name (-> obj info-override engine-sound))) + (set! (-> a0-9 sound-name) (-> obj info-override engine-sound)) (set! (-> obj engine-sound-factor) f30-0) (cond (#f @@ -144,7 +144,7 @@ (f0-38 0.0) ) (sound-play-by-name - (the-as sound-name (-> obj info-override thrust-sound)) + (-> obj info-override thrust-sound) (-> obj thrust-sound-id) (the int (* 1024.0 f1-25)) (the int (* 1524.0 f0-38)) diff --git a/goal_src/jak2/levels/city/common/vehicle-h.gc b/goal_src/jak2/levels/city/common/vehicle-h.gc index 6c73be28f..bbb11f7f3 100644 --- a/goal_src/jak2/levels/city/common/vehicle-h.gc +++ b/goal_src/jak2/levels/city/common/vehicle-h.gc @@ -125,122 +125,122 @@ (deftype rigid-body-vehicle-constants (rigid-body-object-constants) - ((flags uint32 :offset-assert 208) - (object-type uint8 :offset-assert 212) - (guard-type uint8 :offset-assert 213) - (max-engine-thrust meters :offset-assert 216) - (inv-max-engine-thrust float :offset-assert 220) - (engine-response-rate float :offset-assert 224) - (engine-intake-factor float :offset-assert 228) - (brake-factor float :offset-assert 232) - (turbo-boost-factor float :offset-assert 236) - (max-xz-speed meters :offset-assert 240) - (ground-probe-distance meters :offset-assert 244) - (ground-probe-offset meters :offset-assert 248) - (cos-ground-effect-angle float :offset-assert 252) - (spring-lift-factor float :offset-assert 256) - (air-steering-factor float :offset-assert 260) - (air-drag-factor float :offset-assert 264) - (steering-fin-angle float :offset-assert 268) - (steering-thruster-factor float :offset-assert 272) - (steering-thruster-max-gain float :offset-assert 276) - (steering-thruster-half-gain-speed meters :offset-assert 280) - (tire-steering-angle float :offset-assert 284) - (tire-friction-factor float :offset-assert 288) - (tire-static-friction float :offset-assert 292) - (tire-static-friction-speed meters :offset-assert 296) - (tire-dynamic-friction float :offset-assert 300) - (tire-dynamic-friction-speed meters :offset-assert 304) - (tire-inv-max-friction-speed float :offset-assert 308) - (airfoil-factor float :offset-assert 312) - (drag-force-factor float :offset-assert 316) - (speed-scrubbing-drag float :offset-assert 320) - (speed-limiting-drag float :offset-assert 324) - (pitch-control-factor float :offset-assert 328) - (roll-control-factor float :offset-assert 332) - (roll-angle float :offset-assert 336) - (jump-thrust-factor float :offset-assert 340) - (buoyancy-factor float :offset-assert 344) - (player-weight float :offset-assert 348) - (player-shift-x meters :offset-assert 352) - (player-shift-z meters :offset-assert 356) - (target-speed-offset meters :offset-assert 360) - (turning-accel meters :offset-assert 364) - (toughness-factor float :offset-assert 368) - (damage-factor float :offset-assert 372) - (camera-string-min-height meters :offset-assert 376) - (camera-string-max-height meters :offset-assert 380) - (camera-string-min-length meters :offset-assert 384) - (camera-string-max-length meters :offset-assert 388) - (camera-min-fov float :offset-assert 392) - (camera-max-fov float :offset-assert 396) - (camera-head-offset float :offset-assert 400) - (camera-foot-offset float :offset-assert 404) - (camera-normal-max-angle-offset float :offset-assert 408) - (camera-air-max-angle-offset float :offset-assert 412) - (camera-max-lookaround-speed float :offset-assert 416) - (seat-count int8 :offset-assert 420) - (section-count int8 :offset-assert 421) - (rider-stance uint8 :offset-assert 422) - (grab-rail-count int8 :offset-assert 423) - (grab-rail-array uint32 :offset-assert 424) - (seat-array vehicle-seat-info 4 :inline :offset-assert 432) - (rider-hand-offset vector 2 :inline :offset-assert 496) - (section-array vehicle-section-info 4 :inline :offset-assert 528) - (section-bike-front vehicle-section-info :inline :offset 528) - (section-bike-rear vehicle-section-info :inline :offset 560) - (section-car-front-left vehicle-section-info :inline :offset 528) - (section-car-rear-left vehicle-section-info :inline :offset 560) - (section-car-front-right vehicle-section-info :inline :offset 592) - (section-car-rear-right vehicle-section-info :inline :offset 624) - (explosion vehicle-explosion-info :offset-assert 656) - (engine-pitch-scale float :offset-assert 660) - (engine-pitch-offset float :offset-assert 664) - (engine-pitch-mod-amp float :offset-assert 668) - (engine-sound-select int8 :offset-assert 672) - (engine-sound uint128 :offset-assert 688) - (thrust-sound uint128 :offset-assert 704) - (scrape-sound uint128 :offset-assert 720) - (glance-sound uint128 :offset-assert 736) - (impact-sound uint128 :offset-assert 752) - (extra-sound uint128 :offset-assert 768) - (explosion-part int32 :offset-assert 784) - (headlight-count int8 :offset-assert 788) - (taillight-count int8 :offset-assert 789) - (thruster-flame-width meters :offset-assert 792) - (thruster-flame-length meters :offset-assert 796) - (thruster-local-pos vector 2 :inline :offset-assert 800) - (exhaust-local-pos vector 2 :inline :offset-assert 832) - (exhaust-local-dir vector 2 :inline :offset-assert 864) - (smoke-local-pos vector 2 :inline :offset-assert 896) - (smoke-local-vel vector 2 :inline :offset-assert 928) - (headlight-local-pos vector 3 :inline :offset-assert 960) - (taillight-local-pos vector 2 :inline :offset-assert 1008) - (lift-thruster-count int8 :offset-assert 1040) - (roll-thruster-count int8 :offset-assert 1041) - (steering-thruster-count int8 :offset-assert 1042) - (stabilizer-count int8 :offset-assert 1043) - (inv-lift-thruster-count float :offset-assert 1044) - (pad int8 8 :offset-assert 1048) - (lift-thruster-array vehicle-control-point 2 :inline :offset-assert 1056) - (roll-thruster-array vehicle-control-point 2 :inline :offset-assert 1120) - (steering-thruster-array vehicle-control-point 2 :inline :offset-assert 1184) - (stabilizer-array vehicle-control-point 6 :inline :offset-assert 1248) - (engine-thrust-local-pos vector :inline :offset-assert 1440) - (brake-local-pos vector :inline :offset-assert 1456) - (particle-system-2d basic :offset-assert 1472) - (particle-system-3d basic :offset-assert 1476) - (part-thruster basic :offset-assert 1480) - (part-thruster-scale-x sp-field-init-spec :offset-assert 1484) - (part-thruster-scale-y sp-field-init-spec :offset-assert 1488) - (part-quat quaternion :offset-assert 1492) - (part-vel vector :offset-assert 1496) - (color-option-count int8 :offset-assert 1500) - (color-option-select int8 :offset-assert 1501) - (color-option-array (array rgba) :offset-assert 1504) - (sample-dir vector :inline :offset-assert 1520) - (sample-time time-frame :offset-assert 1536) - (sample-index int32 :offset-assert 1544) + ((flags uint32 :offset-assert 208) + (object-type uint8 :offset-assert 212) + (guard-type uint8 :offset-assert 213) + (max-engine-thrust meters :offset-assert 216) + (inv-max-engine-thrust float :offset-assert 220) + (engine-response-rate float :offset-assert 224) + (engine-intake-factor float :offset-assert 228) + (brake-factor float :offset-assert 232) + (turbo-boost-factor float :offset-assert 236) + (max-xz-speed meters :offset-assert 240) + (ground-probe-distance meters :offset-assert 244) + (ground-probe-offset meters :offset-assert 248) + (cos-ground-effect-angle float :offset-assert 252) + (spring-lift-factor float :offset-assert 256) + (air-steering-factor float :offset-assert 260) + (air-drag-factor float :offset-assert 264) + (steering-fin-angle float :offset-assert 268) + (steering-thruster-factor float :offset-assert 272) + (steering-thruster-max-gain float :offset-assert 276) + (steering-thruster-half-gain-speed meters :offset-assert 280) + (tire-steering-angle float :offset-assert 284) + (tire-friction-factor float :offset-assert 288) + (tire-static-friction float :offset-assert 292) + (tire-static-friction-speed meters :offset-assert 296) + (tire-dynamic-friction float :offset-assert 300) + (tire-dynamic-friction-speed meters :offset-assert 304) + (tire-inv-max-friction-speed float :offset-assert 308) + (airfoil-factor float :offset-assert 312) + (drag-force-factor float :offset-assert 316) + (speed-scrubbing-drag float :offset-assert 320) + (speed-limiting-drag float :offset-assert 324) + (pitch-control-factor float :offset-assert 328) + (roll-control-factor float :offset-assert 332) + (roll-angle float :offset-assert 336) + (jump-thrust-factor float :offset-assert 340) + (buoyancy-factor float :offset-assert 344) + (player-weight float :offset-assert 348) + (player-shift-x meters :offset-assert 352) + (player-shift-z meters :offset-assert 356) + (target-speed-offset meters :offset-assert 360) + (turning-accel meters :offset-assert 364) + (toughness-factor float :offset-assert 368) + (damage-factor float :offset-assert 372) + (camera-string-min-height meters :offset-assert 376) + (camera-string-max-height meters :offset-assert 380) + (camera-string-min-length meters :offset-assert 384) + (camera-string-max-length meters :offset-assert 388) + (camera-min-fov float :offset-assert 392) + (camera-max-fov float :offset-assert 396) + (camera-head-offset float :offset-assert 400) + (camera-foot-offset float :offset-assert 404) + (camera-normal-max-angle-offset float :offset-assert 408) + (camera-air-max-angle-offset float :offset-assert 412) + (camera-max-lookaround-speed float :offset-assert 416) + (seat-count int8 :offset-assert 420) + (section-count int8 :offset-assert 421) + (rider-stance uint8 :offset-assert 422) + (grab-rail-count int8 :offset-assert 423) + (grab-rail-array (inline-array vehicle-grab-rail-info) :offset-assert 424) + (seat-array vehicle-seat-info 4 :inline :offset-assert 432) + (rider-hand-offset vector 2 :inline :offset-assert 496) + (section-array vehicle-section-info 4 :inline :offset-assert 528) + (section-bike-front vehicle-section-info :inline :offset 528) + (section-bike-rear vehicle-section-info :inline :offset 560) + (section-car-front-left vehicle-section-info :inline :offset 528) + (section-car-rear-left vehicle-section-info :inline :offset 560) + (section-car-front-right vehicle-section-info :inline :offset 592) + (section-car-rear-right vehicle-section-info :inline :offset 624) + (explosion vehicle-explosion-info :offset-assert 656) + (engine-pitch-scale float :offset-assert 660) + (engine-pitch-offset float :offset-assert 664) + (engine-pitch-mod-amp float :offset-assert 668) + (engine-sound-select int8 :offset-assert 672) + (engine-sound sound-name :offset-assert 688) + (thrust-sound sound-name :offset-assert 704) + (scrape-sound sound-name :offset-assert 720) + (glance-sound sound-name :offset-assert 736) + (impact-sound sound-name :offset-assert 752) + (extra-sound sound-name :offset-assert 768) + (explosion-part int32 :offset-assert 784) + (headlight-count int8 :offset-assert 788) + (taillight-count int8 :offset-assert 789) + (thruster-flame-width meters :offset-assert 792) + (thruster-flame-length meters :offset-assert 796) + (thruster-local-pos vector 2 :inline :offset-assert 800) + (exhaust-local-pos vector 2 :inline :offset-assert 832) + (exhaust-local-dir vector 2 :inline :offset-assert 864) + (smoke-local-pos vector 2 :inline :offset-assert 896) + (smoke-local-vel vector 2 :inline :offset-assert 928) + (headlight-local-pos vector 3 :inline :offset-assert 960) + (taillight-local-pos vector 2 :inline :offset-assert 1008) + (lift-thruster-count int8 :offset-assert 1040) + (roll-thruster-count int8 :offset-assert 1041) + (steering-thruster-count int8 :offset-assert 1042) + (stabilizer-count int8 :offset-assert 1043) + (inv-lift-thruster-count float :offset-assert 1044) + (pad int8 8 :offset-assert 1048) + (lift-thruster-array vehicle-control-point 2 :inline :offset-assert 1056) + (roll-thruster-array vehicle-control-point 2 :inline :offset-assert 1120) + (steering-thruster-array vehicle-control-point 2 :inline :offset-assert 1184) + (stabilizer-array vehicle-control-point 6 :inline :offset-assert 1248) + (engine-thrust-local-pos vector :inline :offset-assert 1440) + (brake-local-pos vector :inline :offset-assert 1456) + (particle-system-2d basic :offset-assert 1472) + (particle-system-3d basic :offset-assert 1476) + (part-thruster basic :offset-assert 1480) + (part-thruster-scale-x sp-field-init-spec :offset-assert 1484) + (part-thruster-scale-y sp-field-init-spec :offset-assert 1488) + (part-quat quaternion :offset-assert 1492) + (part-vel vector :offset-assert 1496) + (color-option-count int8 :offset-assert 1500) + (color-option-select int8 :offset-assert 1501) + (color-option-array (inline-array vector) :offset-assert 1504) + (sample-dir vector :inline :offset-assert 1520) + (sample-time time-frame :offset-assert 1536) + (sample-index int32 :offset-assert 1544) ) :method-count-assert 11 :size-assert #x60c @@ -460,7 +460,7 @@ (vehicle-method-132 (_type_) none 132) (check-player-get-on (_type_) none 133) (vehicle-method-134 (_type_ process) none 134) - (vehicle-method-135 () none 135) + (vehicle-method-135 (_type_ traffic-object-spawn-params) none 135) (vehicle-method-136 (_type_ traffic-object-spawn-params) none 136) (vehicle-method-137 (_type_ traffic-object-spawn-params) none 137) (vehicle-method-138 (_type_) none 138) diff --git a/goal_src/jak2/levels/city/common/vehicle-physics.gc b/goal_src/jak2/levels/city/common/vehicle-physics.gc index 9ca64e222..14d00a643 100644 --- a/goal_src/jak2/levels/city/common/vehicle-physics.gc +++ b/goal_src/jak2/levels/city/common/vehicle-physics.gc @@ -6,814 +6,3 @@ ;; dgos: CWI ;; DECOMP BEGINS - -(defmethod vehicle-method-99 vehicle ((obj vehicle) (arg0 float)) - (let ((s4-0 (new 'stack-no-clear 'vehicle-grab-rail-info)) - (s3-0 (-> obj root-override-2 root-prim)) - (s2-0 1) - ) - (when (< (-> obj rbody state position y) (+ (-> obj water-height) (-> s3-0 local-sphere w))) - (when (= (-> s3-0 prim-core prim-type) (prim-type group)) - (let ((v1-5 (the-as collide-shape-prim-group s3-0))) - (set! s3-0 (-> v1-5 child 0)) - (set! s2-0 (the-as int (-> v1-5 num-children))) - ) - ) - (countdown (s1-0 s2-0) - (when (= (-> s3-0 prim-core prim-type) (prim-type sphere)) - (let* ((s0-0 (-> s3-0 prim-core)) - (f0-2 (- (-> s0-0 world-sphere y) (-> s0-0 world-sphere w))) - ) - (when (< f0-2 (-> obj water-height)) - (set! (-> s4-0 local-pos 0 quad) (-> s0-0 world-sphere quad)) - (let ((f1-5 (fmin (-> obj water-height) (+ (-> s0-0 world-sphere y) (-> s0-0 world-sphere w))))) - 0.0 - (let* ((f2-5 (fmax -1.0 (fmin 1.0 (/ (- (-> obj water-height) (-> s0-0 world-sphere y)) (-> s0-0 world-sphere w))))) - (f30-0 (+ 0.5 (* -0.25 f2-5 f2-5 f2-5) (* 0.75 f2-5))) - ) - (set! (-> s4-0 local-pos 0 y) (* 0.5 (+ f0-2 f1-5))) - (let ((v1-18 (-> obj rbody)) - (a1-1 (-> s4-0 local-pos)) - (a2-0 (-> s4-0 normal)) - ) - (rigid-body-method-22 (-> v1-18 state) (the-as vector a1-1) a2-0) - ) - (let* ((f0-7 (* 0.062831804 (fmin 200.0 (vector-length (-> s4-0 normal))) f30-0)) - (f1-8 (-> s0-0 world-sphere w)) - (f0-8 (* f0-7 (* f1-8 f1-8))) - (f1-11 4096.0) - (f1-13 (* f1-11 f1-11)) - (f0-10 (fmin (* f0-8 (/ 1.0 f1-13)) (/ (-> obj info-override mass) (* 2.0 arg0 (the float s2-0))))) - ) - (vector-float*! (-> s4-0 local-pos 1) (-> s4-0 normal) (* -1.0 f0-10)) - ) - (let ((v1-34 (-> obj rbody)) - (a1-3 (-> s4-0 local-pos)) - (a2-1 (-> s4-0 local-pos 1)) - ) - (rigid-body-method-18 (-> v1-34 state) (the-as vector a1-3) a2-1) - ) - (vector-reset! (-> s4-0 local-pos 1)) - (let* ((f0-12 549018.94) - (f1-19 4096.0) - (f2-13 4096.0) - (f1-20 (* f1-19 (* f2-13 f2-13))) - (f0-16 (* f0-12 (/ 1.0 f1-20) (-> obj info-override buoyancy-factor) f30-0 (-> s0-0 world-sphere w))) - (f1-25 (-> s0-0 world-sphere w)) - ) - (set! (-> s4-0 local-pos 1 y) (* f0-16 (* f1-25 f1-25))) - ) - ) - ) - (let ((v1-46 (-> obj rbody)) - (a1-4 (-> s4-0 local-pos)) - (a2-2 (-> s4-0 local-pos 1)) - ) - (rigid-body-method-18 (-> v1-46 state) (the-as vector a1-4) a2-2) - ) - ) - ) - ) - (&+! s3-0 80) - ) - ) - ) - 0 - (none) - ) - -(deftype vehicle-probe-work (structure) - ((local-pos vector :inline :offset-assert 0) - (local-normal vector :inline :offset-assert 16) - (world-pos vector :inline :offset-assert 32) - (world-normal vector :inline :offset-assert 48) - (probe-pos vector :inline :offset-assert 64) - (ground-pos vector :inline :offset-assert 80) - (ground-normal vector :inline :offset-assert 96) - (velocity vector :inline :offset-assert 112) - (tire-force vector :inline :offset-assert 128) - (wheel-axis vector :inline :offset-assert 144) - ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 - ) - - -(deftype vehicle-physics-work (structure) - ((mat matrix :inline :offset-assert 0) - (force vector :inline :offset-assert 64) - (velocity vector :inline :offset-assert 80) - (world-pos vector :inline :offset-assert 96) - (world-normal vector :inline :offset-assert 112) - (local-pos vector :inline :offset-assert 128) - (steering-axis vector :inline :offset-assert 144) - (lift-dir vector :inline :offset-assert 160) - (normal vector :inline :offset-assert 176) - (tmp vector :inline :offset-assert 192) - (p-body vector :inline :offset-assert 208) - (axis vector :inline :offset-assert 224) - (dir vector :inline :offset-assert 240) - (ground-normal vector :inline :offset-assert 256) - (impulse float :offset-assert 272) - (vel-dot-norm float :offset-assert 276) - (friction-coef float :offset-assert 280) - (speed-factor float :offset-assert 284) - (probe-work-array vehicle-probe-work 2 :inline :offset-assert 288) - ) - :method-count-assert 9 - :size-assert #x260 - :flag-assert #x900000260 - ) - - -(defmethod vehicle-method-100 vehicle ((obj vehicle) (arg0 float) (arg1 vehicle-physics-work)) - (local-vars (v1-81 float) (v1-184 float)) - (rlet ((acc :class vf) - (vf0 :class vf) - (vf1 :class vf) - (vf2 :class vf) - (vf4 :class vf) - (vf5 :class vf) - (vf6 :class vf) - (vf7 :class vf) - ) - (init-vf0-vector) - (+! (-> obj physics-counter) 1) - (let ((s3-0 (-> obj rbody))) - (mem-copy! (the-as pointer (-> arg1 mat)) (the-as pointer (-> s3-0 state matrix)) 64) - (let* ((f28-0 (* -1.0 (-> obj controls steering) (-> obj info-override tire-steering-angle))) - (f30-0 (cos f28-0)) - (f0-2 (sin f28-0)) - ) - (set! (-> arg1 steering-axis x) f30-0) - (set! (-> arg1 steering-axis y) 0.0) - (set! (-> arg1 steering-axis z) f0-2) - ) - (vector-rotate*! (-> arg1 steering-axis) (-> arg1 steering-axis) (-> arg1 mat)) - (logior! (-> obj flags) (rigid-body-object-flag in-air)) - (logclear! (-> obj flags) (rigid-body-object-flag on-ground on-flight-level)) - (vector-reset! (-> arg1 ground-normal)) - (set! (-> arg1 ground-normal y) 1.0) - (let ((f30-1 (-> obj info-override ground-probe-distance))) - (let ((s2-0 (new 'stack-no-clear 'collide-query))) - (vector-reset! (-> arg1 lift-dir)) - (set! (-> arg1 lift-dir y) -1.0) - (set! (-> arg1 speed-factor) - (fmax 0.0 (fmin 0.9 (* 0.000008138021 (+ -40960.0 (vector-length (-> s3-0 state lin-velocity)))))) - ) - (when (logtest? (-> obj info-override flags) 1) - (vector-float*! (-> arg1 tmp) (-> arg1 mat vector 1) -1.0) - (let ((t9-4 vector-lerp!) - (a0-7 (-> arg1 lift-dir)) - (a1-4 (-> arg1 lift-dir)) - (a2-3 (-> arg1 tmp)) - (f0-8 (-> arg1 speed-factor)) - ) - (t9-4 a0-7 a1-4 a2-3 (* f0-8 f0-8)) - ) - (vector-normalize! (-> arg1 lift-dir) 1.0) - ) - (vector-float*! (-> s2-0 move-dist) (-> arg1 lift-dir) (the-as float f30-1)) - (let ((v1-28 s2-0)) - (set! (-> v1-28 radius) 409.6) - (set! (-> v1-28 collide-with) (collide-spec - backgnd - obstacle - hit-by-player-list - hit-by-others-list - water - collectable - blocking-plane - pusher - vehicle-mesh-probeable - ) - ) - (set! (-> v1-28 ignore-process0) #f) - (set! (-> v1-28 ignore-process1) #f) - (set! (-> v1-28 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1)) - (set! (-> v1-28 action-mask) (collide-action solid)) - ) - (dotimes (s1-0 (-> obj info-override lift-thruster-count)) - (let ((v1-31 (-> obj info-override lift-thruster-array s1-0)) - (s0-0 (-> arg1 probe-work-array s1-0)) - ) - (vector-reset! (-> s0-0 tire-force)) - (set! (-> s0-0 local-pos quad) (-> v1-31 local-pos quad)) - (set! (-> s0-0 local-normal quad) (-> v1-31 normal quad)) - (vector-matrix*! (-> s0-0 world-pos) (-> s0-0 local-pos) (-> arg1 mat)) - (let ((a1-9 (-> s0-0 probe-pos))) - (let ((v1-34 (-> s0-0 world-pos))) - (let ((a0-22 (-> arg1 mat vector 1))) - (let ((a2-6 (-> obj info-override ground-probe-offset))) - (.mov vf7 a2-6) - ) - (.lvf vf5 (&-> a0-22 quad)) - ) - (.lvf vf4 (&-> v1-34 quad)) - ) - (.add.x.vf vf6 vf0 vf0 :mask #b1000) - (.mul.x.vf acc vf5 vf7 :mask #b111) - (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) - (.svf (&-> a1-9 quad) vf6) - ) - (let ((v1-35 s3-0) - (a1-10 (-> s0-0 probe-pos)) - (a2-7 (-> s0-0 velocity)) - ) - (rigid-body-method-22 (-> v1-35 state) a1-10 a2-7) - ) - (set! (-> s0-0 wheel-axis quad) (-> (the-as vector (if (< 0.0 (-> s0-0 local-pos z)) - (-> arg1 steering-axis) - (the-as vector (-> arg1 mat)) - ) - ) - quad - ) - ) - (set! (-> s0-0 ground-pos quad) (-> s0-0 probe-pos quad)) - (set! (-> s0-0 ground-pos y) 0.0) - (vector-reset! (-> s0-0 ground-normal)) - (when (logtest? (-> obj flags) (rigid-body-object-flag enable-collision)) - (set! (-> s2-0 start-pos quad) (-> s0-0 probe-pos quad)) - (let ((f0-15 (probe-using-line-sphere *collide-cache* s2-0))) - (cond - ((and (>= f0-15 0.0) (!= (-> s2-0 best-other-tri pat mode) 1)) - (logclear! (-> obj flags) (rigid-body-object-flag in-air)) - (logior! (-> obj flags) (rigid-body-object-flag on-ground)) - (set! (-> s0-0 ground-pos y) (- (-> s0-0 probe-pos y) (* f0-15 f30-1))) - (set! (-> s0-0 ground-normal quad) (-> s2-0 best-other-tri normal quad)) - (set! (-> arg1 ground-normal quad) (-> s0-0 ground-normal quad)) - ) - (else - (set! (-> s0-0 ground-pos y) (+ -81920.0 (-> s3-0 state position y))) - ) - ) - ) - 0 - ) - ) - ) - ) - (set! (-> obj lift-thrust 0) 0.0) - (set! (-> obj lift-thrust 1) 0.0) - (set! (-> obj roll-thrust 0) 0.0) - (set! (-> obj roll-thrust 1) 0.0) - (set! (-> obj roll-thrust 0) 0.0) - (set! (-> obj roll-thrust 1) 0.0) - (when (>= 1 (-> obj force-level)) - (dotimes (s2-1 (-> obj info-override lift-thruster-count)) - (let ((s1-1 (-> arg1 probe-work-array s2-1))) - (set! (-> arg1 world-pos quad) (-> s1-1 world-pos quad)) - (set! (-> arg1 velocity quad) (-> s1-1 velocity quad)) - (let ((f28-1 (-> s1-1 probe-pos y))) - (when (> (-> obj flight-level-index) 0) - (set! f28-1 (- f28-1 (+ 6144.0 (-> obj flight-level)))) - (when (>= 0.0 f28-1) - (logclear! (-> obj flags) (rigid-body-object-flag in-air)) - (logior! (-> obj flags) (rigid-body-object-flag on-flight-level)) - (.lvf vf1 (&-> (-> s1-1 ground-normal) quad)) - (.add.w.vf vf2 vf0 vf0 :mask #b1) - (.mul.vf vf1 vf1 vf1) - (.mul.x.vf acc vf2 vf1 :mask #b1) - (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) - (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) - (.mov v1-81 vf1) - (if (= v1-81 0.0) - (set! (-> s1-1 ground-normal y) 1.0) - ) - ) - ) - (when (or (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) - (and (> (-> obj flight-level-index) 0) (< f28-1 0.0)) - ) - (if (zero? (-> obj flight-level-index)) - (set! f28-1 40960.0) - ) - (let* ((f0-37 (* -1.0 - (-> obj force-scale) - (-> obj info-override inv-lift-thruster-count) - (-> obj info-override mass) - (-> obj info-override gravity) - (+ 1.0 (* 2.0 (the float (-> obj flight-level-index)))) - ) - ) - (f1-17 -1.0) - (f2-4 1.0) - (f3-4 16384.0) - (f3-7 (* f28-1 (/ 1.0 f3-4))) - (f4-2 0.5) - (f5-0 81920.0) - (f0-38 (* f0-37 (fmax f1-17 (fmin f2-4 (+ f3-7 (* f4-2 (/ 1.0 f5-0) (-> arg1 velocity y))))))) - ) - (let ((f1-20 (fmax 0.0 f0-38))) - (+! (-> obj lift-thrust s2-1) f1-20) - (when (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) - (+! (-> obj roll-thrust 0) (* 0.05 f1-20)) - (+! (-> obj roll-thrust 1) (* 0.05 f1-20)) - ) - ) - (vector-reset! (-> arg1 force)) - (set! (-> arg1 force y) f0-38) - ) - (let ((v1-122 s3-0) - (a1-12 (-> arg1 world-pos)) - (a2-8 (-> arg1 force)) - ) - (rigid-body-method-18 (-> v1-122 state) a1-12 a2-8) - ) - (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) - ) - (let ((f0-40 (+ 4096.0 f28-1))) - (when (or (and (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) - (< 0.0 f0-40) - (< 0.0 (-> arg1 velocity y)) - ) - (and (> (-> obj flight-level-index) 0) (< f0-40 0.0) (< (-> arg1 velocity y) 0.0)) - ) - (vector-reset! (-> arg1 force)) - (let ((f0-43 (* -0.25 (-> obj info-override inv-lift-thruster-count))) - (f1-28 arg0) - ) - (set! (-> arg1 force y) (* f0-43 (/ 1.0 f1-28) (-> obj info-override mass) (-> arg1 velocity y))) - ) - (let ((v1-140 s3-0) - (a1-16 (-> arg1 world-pos)) - (a2-9 (-> arg1 force)) - ) - (rigid-body-method-18 (-> v1-140 state) a1-16 a2-9) - ) - (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) - ) - ) - ) - (let* ((f1-36 (fmax 4096.0 (fmin (- (-> s1-1 probe-pos y) (-> s1-1 ground-pos y)) f30-1))) - (f28-2 (- 1.0 (/ (+ -4096.0 f1-36) (+ -4096.0 f30-1)))) - ) - (if (>= (-> obj info-override cos-ground-effect-angle) - (vector-dot (-> s1-1 ground-normal) (-> arg1 mat vector 1)) - ) - (set! f28-2 0.0) - ) - (set! (-> arg1 tmp y) 0.0) - (set! (-> arg1 tmp x) (-> arg1 velocity z)) - (set! (-> arg1 tmp z) (- (-> arg1 velocity x))) - (vector-normalize! (-> arg1 tmp) 1.0) - (vector+float*! - (-> arg1 normal) - (-> s1-1 ground-normal) - (-> arg1 tmp) - (- (vector-dot (-> s1-1 ground-normal) (-> arg1 tmp))) - ) - (let ((v1-155 (-> arg1 force)) - (a0-55 (-> arg1 normal)) - (f0-58 (* 2.0 f28-2)) - (f1-41 arg0) - ) - (vector-float*! v1-155 a0-55 (* f0-58 - (/ 1.0 f1-41) - (-> obj info-override inv-lift-thruster-count) - (-> obj info-override mass) - (fmax 0.0 (- (vector-dot (-> arg1 velocity) (-> arg1 normal)))) - ) - ) - ) - (let ((v1-157 s3-0) - (a1-28 (-> arg1 world-pos)) - (a2-13 (-> arg1 force)) - ) - (rigid-body-method-18 (-> v1-157 state) a1-28 a2-13) - ) - (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) - (let ((f0-72 (* 8.0 - (-> obj info-override mass) - (-> obj info-override gravity) - (-> obj info-override inv-lift-thruster-count) - (+ (* (-> obj info-override spring-lift-factor) f28-2) - (* 0.75 (-> obj jump-thrust) (-> obj info-override jump-thrust-factor)) - ) - (- (+ 1.0 (* 2.0 (rand-vu) (-> obj power-fluctuation-factor))) (-> obj power-fluctuation-factor)) - ) - ) - ) - (+! (-> obj lift-thrust s2-1) f0-72) - (vector-float*! (-> arg1 force) (-> arg1 lift-dir) (* -1.0 f0-72)) - ) - ) - (let ((v1-176 s3-0) - (a1-32 (-> arg1 world-pos)) - (a2-14 (-> arg1 force)) - ) - (rigid-body-method-18 (-> v1-176 state) a1-32 a2-14) - ) - (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) - (when (and (< 0.0 (-> obj info-override tire-friction-factor)) (let ((f0-75 0.0)) - (.lvf vf1 (&-> (-> s1-1 ground-normal) quad)) - (.add.w.vf vf2 vf0 vf0 :mask #b1) - (.mul.vf vf1 vf1 vf1) - (.mul.x.vf acc vf2 vf1 :mask #b1) - (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) - (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) - (.mov v1-184 vf1) - (< f0-75 v1-184) - ) - ) - (vector+float*! - (-> arg1 normal) - (-> s1-1 wheel-axis) - (-> s1-1 ground-normal) - (- (vector-dot (-> s1-1 wheel-axis) (-> s1-1 ground-normal))) - ) - (vector-normalize! (-> arg1 normal) 1.0) - (set! (-> arg1 world-pos quad) (-> s3-0 state position quad)) - (set! (-> arg1 velocity quad) (-> s3-0 state lin-velocity quad)) - (vector-! (-> arg1 p-body) (-> arg1 world-pos) (-> s3-0 state position)) - (vector-cross! (-> arg1 tmp) (-> arg1 p-body) (-> arg1 normal)) - (vector-rotate*! (-> arg1 tmp) (-> arg1 tmp) (-> s3-0 state inv-i-world)) - (vector-cross! (-> arg1 tmp) (-> arg1 tmp) (-> arg1 p-body)) - (set! (-> arg1 vel-dot-norm) (vector-dot (-> arg1 velocity) (-> arg1 normal))) - (let ((f0-82 (fabs (-> arg1 vel-dot-norm)))) - (set! (-> arg1 friction-coef) - (smooth-interp - (-> obj info-override tire-static-friction) - (-> obj info-override tire-dynamic-friction) - f0-82 - (-> obj info-override tire-static-friction-speed) - (-> obj info-override tire-dynamic-friction-speed) - ) - ) - ) - (set! (-> arg1 friction-coef) - (* (-> arg1 friction-coef) (+ 1.0 (* -0.75 (fmax 0.0 (fmin 1.0 (-> obj engine-thrust)))))) - ) - (let ((f0-90 - (* (-> arg1 friction-coef) - (-> obj info-override tire-friction-factor) - (fmax 0.0 (vector-dot (-> s1-1 ground-normal) (-> s1-1 tire-force))) - ) - ) - ) - (set! (-> arg1 impulse) - (/ (* -1.0 (-> arg1 vel-dot-norm)) - (* arg0 (+ (-> s3-0 state info inv-mass) (vector-dot (-> arg1 normal) (-> arg1 tmp)))) - ) - ) - (set! (-> arg1 impulse) (fmax (fmin (-> arg1 impulse) f0-90) (- f0-90))) - ) - (vector-float*! (-> arg1 force) (-> arg1 normal) (-> arg1 impulse)) - (let ((v1-213 s3-0) - (a1-45 (-> arg1 world-pos)) - (a2-19 (-> arg1 force)) - ) - (rigid-body-method-18 (-> v1-213 state) a1-45 a2-19) - ) - ) - ) - ) - ) - ) - ) - 0 - (none) - ) - ) - -(defmethod rigid-body-object-method-29 vehicle ((obj vehicle) (arg0 float)) - (local-vars (sv-624 float) (sv-720 float) (sv-724 float)) - (rlet ((vf0 :class vf)) - (init-vf0-vector) - (let ((gp-0 (new 'stack-no-clear 'inline-array 'matrix 9)) - (s5-0 (-> obj rbody)) - (s4-0 (-> obj info-override)) - ) - (mem-copy! (the-as pointer (-> gp-0 0)) (the-as pointer (-> s5-0 state matrix)) 64) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag dead))) - (vehicle-method-100 obj arg0 (the-as vehicle-physics-work gp-0)) - (when (>= 1 (-> obj force-level)) - (set! sv-624 (* (-> s4-0 mass) (-> s4-0 gravity))) - (when (!= (-> s4-0 pitch-control-factor) 0.0) - (set! (-> gp-0 3 vector 2 quad) (-> gp-0 0 quad 0)) - (set! (-> gp-0 3 vector 2 y) 0.0) - (let ((f30-0 (vector-dot (-> gp-0 3 vector 2) (-> s5-0 state ang-velocity)))) - (dotimes (s1-0 (-> s4-0 lift-thruster-count)) - (let ((s0-0 (-> s4-0 lift-thruster-array s1-0))) - (vector-matrix*! (-> gp-0 1 vector 2) (-> s0-0 local-pos) (-> gp-0 0)) - (vector-rotate*! (-> gp-0 1 trans) (-> s0-0 normal) (-> gp-0 0)) - (let* ((f0-5 -1.0) - (f1-2 1.0) - (f2-0 0.2) - (a0-9 (the-as number (-> s0-0 local-pos z))) - (a1-5 #xffffffff80000000) - (v1-16 #x3f800000) - (f0-7 - (* (fmax - f0-5 - (fmin - f1-2 - (* f2-0 (the-as float (logior (logand (the-as uint a0-9) a1-5) v1-16)) (-> s4-0 pitch-control-factor) f30-0) - ) - ) - sv-624 - ) - ) - ) - (vector-float*! (the-as vector (-> gp-0 1)) (-> gp-0 1 trans) (* -1.0 f0-7)) - ) - ) - (let ((v1-21 s5-0) - (a1-7 (-> gp-0 1 vector 2)) - (a2-4 (-> gp-0 1)) - ) - (rigid-body-method-18 (-> v1-21 state) a1-7 (the-as vector a2-4)) - ) - ) - ) - ) - (let ((s1-1 (new 'stack-no-clear 'inline-array 'vector 5))) - (let ((f0-12 (* -1.0 (-> obj controls steering) (-> gp-0 4 vector 1 w) (-> s4-0 roll-angle)))) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) - (set! f0-12 0.0) - ) - (quaternion-vector-angle! (the-as quaternion (-> s1-1 0)) (-> gp-0 0 vector 2) f0-12) - ) - (quaternion->matrix (the-as matrix (-> s1-1 1)) (the-as quaternion (-> s1-1 0))) - (set! (-> gp-0 3 trans quad) (-> s1-1 2 quad)) - ) - (let ((f0-14 (vector-dot (the-as vector (-> gp-0 0)) (-> gp-0 3 trans)))) - (set! sv-720 (* (-> s4-0 mass) (-> s4-0 gravity))) - (let ((f1-11 f0-14)) - (set! sv-724 - (+ (* f1-11 f1-11 f0-14) (* 0.075 (vector-dot (-> gp-0 0 vector 2) (-> s5-0 state ang-velocity)))) - ) - ) - ) - (dotimes (s1-2 (-> s4-0 roll-thruster-count)) - (let* ((s0-1 (-> s4-0 roll-thruster-array s1-2)) - (f0-17 0.0) - (f1-16 1.0) - (f2-7 -1.0) - (a0-19 (the-as number (-> s0-1 local-pos x))) - (a1-10 #xffffffff80000000) - (v1-44 #x3f800000) - (f30-1 - (fmax f0-17 (fmin f1-16 (* f2-7 (the-as float (logior (logand (the-as uint a0-19) a1-10) v1-44)) sv-724))) - ) - ) - (when (< 0.0 f30-1) - (let ((f30-2 - (* (+ f30-1 (+ (- (-> obj power-fluctuation-factor)) (* 2.0 (rand-vu) (-> obj power-fluctuation-factor)))) - (-> s4-0 roll-control-factor) - sv-720 - ) - ) - ) - (+! (-> obj roll-thrust s1-2) (fmax 0.0 f30-2)) - (vector-matrix*! (-> gp-0 1 vector 2) (-> s0-1 local-pos) (-> gp-0 0)) - (vector-rotate*! (-> gp-0 1 trans) (-> s0-1 normal) (-> gp-0 0)) - (vector-float*! (the-as vector (-> gp-0 1)) (-> gp-0 1 trans) (* -1.0 f30-2)) - ) - (let ((v1-56 s5-0) - (a1-14 (-> gp-0 1 vector 2)) - (a2-8 (-> gp-0 1)) - ) - (rigid-body-method-18 (-> v1-56 state) a1-14 (the-as vector a2-8)) - ) - 0 - ) - ) - ) - ) - (when #t - (let* ((f0-30 (-> obj controls steering)) - (f1-23 (-> s4-0 steering-thruster-half-gain-speed)) - (f2-10 (-> s4-0 steering-thruster-half-gain-speed)) - (v1-65 (-> s5-0 state lin-velocity)) - (f2-12 (/ f1-23 (+ f2-10 (sqrtf (+ (* (-> v1-65 x) (-> v1-65 x)) (* (-> v1-65 z) (-> v1-65 z))))))) - ) - (if (< (-> obj controls throttle) 0.0) - (set! f0-30 (* -1.0 f0-30)) - ) - (set! (-> gp-0 3 vector 2 quad) (-> gp-0 0 vector 1 quad)) - (let ((f30-3 (* 8192.0 - (-> s4-0 mass) - (-> obj power-level) - (- (* f0-30 f2-12 (-> s4-0 steering-thruster-max-gain)) - (vector-dot (-> gp-0 3 vector 2) (-> s5-0 state ang-velocity)) - ) - (-> s4-0 steering-thruster-factor) - ) - ) - ) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) - (set! f30-3 (* f30-3 (-> s4-0 air-steering-factor))) - ) - (let ((s1-3 (the-as object (-> s4-0 steering-thruster-array)))) - (countdown (s0-2 (-> s4-0 steering-thruster-count)) - (vector-matrix*! (-> gp-0 1 vector 2) (-> (the-as vehicle-control-point s1-3) local-pos) (-> gp-0 0)) - (vector-rotate*! - (-> gp-0 1 trans) - (-> (the-as (inline-array vehicle-control-point) s1-3) 0 normal) - (-> gp-0 0) - ) - (vector-float*! (the-as vector (-> gp-0 1)) (-> gp-0 1 trans) f30-3) - (let ((v1-80 s5-0) - (a1-17 (-> gp-0 1 vector 2)) - (a2-11 (-> gp-0 1)) - ) - (rigid-body-method-18 (-> v1-80 state) a1-17 (the-as vector a2-11)) - ) - (set! s1-3 (-> (the-as (inline-array vehicle-control-point) s1-3) 1)) - ) - ) - ) - ) - ) - (seek! (-> obj jump-thrust) 0.0 (* 6.0 arg0)) - (when (logtest? (rigid-body-object-flag ignition) (-> obj flags)) - (vector-matrix*! (-> gp-0 1 vector 2) (-> s4-0 engine-thrust-local-pos) (-> gp-0 0)) - (set! (-> gp-0 3 trans quad) (-> gp-0 0 vector 2 quad)) - (let ((f0-45 (* (-> obj engine-thrust) - (-> s4-0 max-engine-thrust) - (-> s4-0 mass) - (-> obj power-level) - (-> obj force-scale) - ) - ) - ) - (vector-float*! (the-as vector (-> gp-0 1)) (-> gp-0 3 trans) f0-45) - ) - (when #t - (let ((v1-94 s5-0) - (a1-20 (-> gp-0 1 vector 2)) - (a2-14 (-> gp-0 1)) - ) - (rigid-body-method-18 (-> v1-94 state) a1-20 (the-as vector a2-14)) - ) - ) - ) - (let ((f30-4 (-> obj controls brake))) - (when (< 0.0 f30-4) - (vector-matrix*! (-> gp-0 1 vector 2) (-> s4-0 brake-local-pos) (-> gp-0 0)) - (let ((v1-98 s5-0) - (a1-22 (-> gp-0 1 vector 2)) - (a2-16 (-> gp-0 1 vector 1)) - ) - (rigid-body-method-22 (-> v1-98 state) a1-22 a2-16) - ) - (let* ((v1-101 (-> gp-0 1 vector 1)) - (f1-38 (sqrtf (+ (* (-> v1-101 x) (-> v1-101 x)) (* (-> v1-101 z) (-> v1-101 z))))) - (f0-53 (* -98304.0 (-> s4-0 brake-factor) (-> s4-0 mass))) - (f1-39 (fmax 16384.0 f1-38)) - (f0-55 (* f0-53 (/ 1.0 f1-39) f30-4)) - ) - (vector-float*! (the-as vector (-> gp-0 1)) (-> gp-0 1 vector 1) f0-55) - ) - (let ((v1-109 s5-0) - (a1-23 (-> gp-0 1 vector 2)) - (a2-17 (-> gp-0 1)) - ) - (rigid-body-method-18 (-> v1-109 state) a1-23 (the-as vector a2-17)) - ) - ) - ) - ) - (let ((s1-4 (new 'stack-no-clear 'rigid-body-vehicle-constants))) - (quad-copy! - (the-as pointer s1-4) - (the-as pointer (-> s4-0 stabilizer-array)) - (* (-> s4-0 stabilizer-count) 2) - ) - (let ((s0-3 (-> s1-4 info inertial-tensor))) - (let ((f0-57 (* -3640.889 (-> obj controls lean-z)))) - (vector-rotate-around-x! (the-as vector s0-3) (the-as vector s0-3) f0-57) - ) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) - (set! (-> s0-3 vector 0 w) (* 10.0 (-> s0-3 vector 0 w))) - ) - (if (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) - (set! (-> s0-3 vector 0 w) 0.0) - ) - ) - (let ((f30-5 (* -0.0000006103516 (-> obj force-scale) (-> s4-0 mass) (-> s4-0 drag-force-factor)))) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) - (set! f30-5 (* f30-5 (-> s4-0 air-drag-factor))) - ) - (let ((s1-5 (&-> s1-4 mass))) - (countdown (s0-4 (-> s4-0 stabilizer-count)) - (vector-matrix*! (-> gp-0 1 vector 2) (the-as vector (&-> s1-5 0)) (-> gp-0 0)) - (vector-rotate*! (-> gp-0 1 trans) (the-as vector (&-> s1-5 4)) (-> gp-0 0)) - (let ((v1-128 s5-0) - (a1-28 (-> gp-0 1 vector 2)) - (a2-22 (-> gp-0 1 vector 1)) - ) - (rigid-body-method-22 (-> v1-128 state) a1-28 a2-22) - ) - (let ((f0-70 - (* -0.06125 - (vector-dot (-> gp-0 1 trans) (-> gp-0 1 vector 1)) - (-> s1-5 7) - (-> obj force-scale) - (-> s4-0 mass) - (-> s4-0 airfoil-factor) - ) - ) - ) - (vector-float*! (the-as vector (-> gp-0 1)) (-> gp-0 1 trans) f0-70) - ) - (when (<= (-> obj force-level) 0) - (let ((v1-138 s5-0) - (a1-29 (-> gp-0 1 vector 2)) - (a2-23 (-> gp-0 1)) - ) - (rigid-body-method-18 (-> v1-138 state) a1-29 (the-as vector a2-23)) - ) - ) - (vector-float*! - (the-as vector (-> gp-0 1)) - (-> gp-0 1 vector 1) - (* f30-5 - (-> s1-5 7) - (+ (* 0.15 (vector-length (-> gp-0 1 vector 1))) (fabs (vector-dot (-> gp-0 1 trans) (-> gp-0 1 vector 1)))) - ) - ) - (when (<= (-> obj force-level) 0) - (let ((v1-145 s5-0) - (a1-35 (-> gp-0 1 vector 2)) - (a2-25 (-> gp-0 1)) - ) - (rigid-body-method-18 (-> v1-145 state) a1-35 (the-as vector a2-25)) - ) - ) - (set! s1-5 (&-> s1-5 8)) - ) - ) - ) - ) - (.svf (&-> (-> gp-0 1) quad 0) vf0) - (set! (-> gp-0 1 vector 0 y) (* -1.0 - (-> s4-0 gravity) - (if (< 1 (-> obj force-level)) - 2.0 - 1.0 - ) - (-> s4-0 mass) - ) - ) - (let ((v1-154 s5-0) - (a1-36 (-> gp-0 1)) - ) - (rigid-body-method-20 (-> v1-154 state) (the-as vector a1-36)) - ) - (when (logtest? (-> obj flags) (rigid-body-object-flag riding)) - (set! (-> gp-0 2 quad 0) (-> s4-0 cm-joint quad)) - (+! (-> gp-0 2 vector 0 x) (* (-> obj controls steering) (-> s4-0 player-shift-x))) - (+! (-> gp-0 2 vector 0 z) (* (-> obj controls lean-z) (-> s4-0 player-shift-z))) - (vector-matrix*! (-> gp-0 1 vector 2) (the-as vector (-> gp-0 2)) (-> gp-0 0)) - (.svf (&-> (-> gp-0 1) quad 0) vf0) - (set! (-> gp-0 1 vector 0 y) (- (-> s4-0 player-weight))) - (let ((v1-162 s5-0) - (a1-38 (-> gp-0 1 vector 2)) - (a2-27 (-> gp-0 1)) - ) - (rigid-body-method-18 (-> v1-162 state) a1-38 (the-as vector a2-27)) - ) - 0 - ) - (rigid-body-object-method-50 obj arg0) - (vehicle-method-99 obj arg0) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag dead))) - (set! (-> gp-0 1 trans quad) (-> s5-0 state lin-momentum quad)) - (set! (-> gp-0 1 trans y) 0.0) - (vector-normalize! (-> gp-0 1 trans) 1.0) - (let* ((v1-174 (-> s5-0 state lin-velocity)) - (f0-90 (/ (sqrtf (+ (* (-> v1-174 x) (-> v1-174 x)) (* (-> v1-174 z) (-> v1-174 z)))) (-> s4-0 max-xz-speed))) - (v1-176 (-> gp-0 1)) - (a0-65 (-> gp-0 1 trans)) - (f1-67 -1.0) - (f2-29 (* (-> s4-0 speed-limiting-drag) (vector-dot (-> s5-0 state force) (-> gp-0 1 trans)))) - (f3-19 - (* (fabs (-> obj engine-thrust)) (-> s4-0 speed-scrubbing-drag) (vector-length (-> s5-0 state lin-momentum))) - ) - (f4-6 (- 1.0 (fabs (vector-dot (-> s5-0 state matrix vector 2) (-> gp-0 1 trans))))) - ) - (vector-float*! (the-as vector v1-176) a0-65 (* f1-67 (+ f2-29 (* f3-19 (* f4-6 f4-6))) (sqrtf f0-90))) - ) - (let ((a1-51 (-> gp-0 1))) - (rigid-body-method-20 (-> s5-0 state) (the-as vector a1-51)) - ) - ) - ) - 0 - (none) - ) - ) - -(defmethod vehicle-method-125 vehicle ((obj vehicle) (arg0 float)) - (rigid-body-object-method-29 obj arg0) - (none) - ) - -(defmethod vehicle-method-126 vehicle ((obj vehicle) (arg0 float)) - (rigid-body-object-method-29 obj arg0) - (none) - ) diff --git a/goal_src/jak2/levels/city/common/vehicle-states.gc b/goal_src/jak2/levels/city/common/vehicle-states.gc index 26237efb3..775db859e 100644 --- a/goal_src/jak2/levels/city/common/vehicle-states.gc +++ b/goal_src/jak2/levels/city/common/vehicle-states.gc @@ -323,7 +323,7 @@ (cond ((logtest? (-> self rbody state flags) (rigid-body-flag enable-physics)) (let ((gp-2 (new 'stack-no-clear 'rigid-body-info))) - (mem-copy! (&-> gp-2 mass) (&-> (-> self info-override) mass) 188) + (mem-copy! (&-> gp-2 mass) (the-as pointer (-> self info-override info)) 188) (set! (-> self rbody state info) (the-as rigid-body-info (&-> gp-2 mass))) (set! (-> gp-2 bounce-mult-factor) 0.0) (set! (-> gp-2 bounce-factor) 0.4) @@ -332,7 +332,7 @@ (set! (-> gp-2 friction-factor) 0.05) ) (vehicle-method-121 self) - (set! (-> self rbody state info) (the-as rigid-body-info (&-> (-> self info-override) mass))) + (set! (-> self rbody state info) (-> self info-override info)) (when (logtest? (-> self flags) (rigid-body-object-flag disturbed)) (let* ((f0-14 (* 0.0033333334 (the float (- (-> self clock frame-counter) (-> self disturbed-time))))) (f0-17 (* f0-14 f0-14 (-> self camera-dist2))) diff --git a/goal_src/jak2/levels/city/common/vehicle-util.gc b/goal_src/jak2/levels/city/common/vehicle-util.gc index 59bfee85c..463388f9f 100644 --- a/goal_src/jak2/levels/city/common/vehicle-util.gc +++ b/goal_src/jak2/levels/city/common/vehicle-util.gc @@ -308,13 +308,13 @@ This commonly includes things such as: (vector-matrix*! (the-as vector (-> s5-0 matrices)) (-> s5-0 matrices 0 vector 1) (-> s5-0 matrices 2)) (set! (-> s5-0 floats 0) 81920.0) (dotimes (s2-1 (-> obj info-override grab-rail-count)) - (let ((s1-0 (+ (-> obj info-override grab-rail-array) (* 48 s2-1)))) - (vector-! (-> s5-0 matrices 0 trans) (the-as vector (-> s5-0 matrices)) (the-as vector (+ s1-0 0))) + (let ((s1-0 (-> obj info-override grab-rail-array s2-1))) + (vector-! (-> s5-0 matrices 0 trans) (the-as vector (-> s5-0 matrices)) (the-as vector (-> s1-0 local-pos))) (when #t (let ((f30-0 (vector-segment-distance-point! (the-as vector (-> s5-0 matrices)) - (the-as vector (+ s1-0 0)) - (the-as vector (+ s1-0 16)) + (the-as vector (-> s1-0 local-pos)) + (-> s1-0 local-pos 1) (-> s5-0 matrices 0 trans) ) ) @@ -322,7 +322,7 @@ This commonly includes things such as: (when (< f30-0 (-> s5-0 floats 0)) (set! (-> s5-0 floats 0) f30-0) (set! (-> s5-0 vectors 0 quad) (-> s5-0 matrices 0 trans quad)) - (vector-! (-> s5-0 vectors 1) (the-as vector (+ s1-0 16)) (the-as vector (+ s1-0 0))) + (vector-! (-> s5-0 vectors 1) (-> s1-0 local-pos 1) (the-as vector (-> s1-0 local-pos))) (vector-normalize! (-> s5-0 vectors 1) 1.0) (set! s3-0 #t) (set! (-> s5-0 floats 3) (* (-> obj hit-points) (/ 40960.0 f30-0))) @@ -699,9 +699,7 @@ This commonly includes things such as: ) (set! (-> obj lights-factor) 0.0) (let ((a0-8 (-> obj info-override color-option-select))) - (set! (-> obj draw color-mult quad) - (-> (the-as (pointer uint128) (+ (the-as uint (-> obj info-override color-option-array)) (* a0-8 16)))) - ) + (set! (-> obj draw color-mult quad) (-> obj info-override color-option-array a0-8 quad)) ) (+! (-> obj info-override color-option-select) 1) (when (>= (-> obj info-override color-option-select) (-> obj info-override color-option-count)) @@ -1054,7 +1052,11 @@ This commonly includes things such as: (when (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) (logior! (-> obj rbody state flags) (rigid-body-flag enable-physics)) (rigid-body-method-26 (-> obj rbody state) (-> obj root-override-2 trans) (-> obj root-override-2 quat)) - (vector-float*! (-> obj rbody state lin-momentum) (-> obj root-override-2 transv) (-> obj info-override mass)) + (vector-float*! + (-> obj rbody state lin-momentum) + (-> obj root-override-2 transv) + (-> obj info-override info mass) + ) (vector-reset! (-> obj rbody state ang-momentum)) (vector-reset! (-> obj lin-acceleration)) ) @@ -1217,7 +1219,7 @@ This commonly includes things such as: (let ((v1-0 (-> arg0 behavior))) (cond ((= v1-0 1) - ((method-of-object obj vehicle-method-135)) + (vehicle-method-135 obj arg0) (vehicle-method-113 obj) ) ((zero? v1-0) diff --git a/goal_src/jak2/levels/city/common/vehicle.gc b/goal_src/jak2/levels/city/common/vehicle.gc index 1167d94c7..b292f9a30 100644 --- a/goal_src/jak2/levels/city/common/vehicle.gc +++ b/goal_src/jak2/levels/city/common/vehicle.gc @@ -90,8 +90,8 @@ (let* ((f0-0 1.0) (f1-0 (-> arg0 impulse)) (f2-0 61440.0) - (f30-0 (fmin f0-0 (* f1-0 (/ 1.0 f2-0) (-> obj info-override inv-mass)))) - (f28-0 (* (-> obj info-override mass) (-> obj info-override toughness-factor))) + (f30-0 (fmin f0-0 (* f1-0 (/ 1.0 f2-0) (-> obj info-override info inv-mass)))) + (f28-0 (* (-> obj info-override info mass) (-> obj info-override toughness-factor))) ) (set! (-> obj crash-impulse) (-> arg0 impulse)) (cond @@ -131,7 +131,7 @@ ) (if (< 0.1 f30-0) (sound-play-by-name - (the-as sound-name (-> obj info-override glance-sound)) + (-> obj info-override glance-sound) (new-sound-id) (the int (* 1024.0 f30-0)) 0 @@ -144,7 +144,7 @@ ) (when (< (* 102400.0 f28-0) (-> arg0 impulse)) (sound-play-by-name - (the-as sound-name (-> obj info-override impact-sound)) + (-> obj info-override impact-sound) (new-sound-id) (the int (* 1024.0 f30-0)) 0 @@ -1541,13 +1541,13 @@ (and (logtest? (-> arg1 mask) (attack-info-mask mode)) (= (-> arg1 mode) 'eco-dark)) ) (set! (-> s5-0 vector 2 y) (* 0.1 (-> s5-0 vector 2 y))) - (set! f0-2 (* 409600.0 (-> obj info-override mass))) + (set! f0-2 (* 409600.0 (-> obj info-override info mass))) (/ 0.4 (-> obj info-override damage-factor)) ) ((or (logtest? (penetrate dark-punch dark-bomb) arg3) (and (logtest? (penetrate dark-skin) arg3) (logtest? arg3 (penetrate punch spin))) ) - (set! f0-2 (* 204800.0 (-> obj info-override mass))) + (set! f0-2 (* 204800.0 (-> obj info-override info mass))) (/ 0.2 (-> obj info-override damage-factor)) ) ((logtest? (penetrate enemy-yellow-shot) arg3) @@ -1679,7 +1679,7 @@ ) (let ((f0-1 (vector-dot (-> s5-0 velocity) (-> s5-0 normal)))) (b! (>= f0-1 0.0) cfg-32 :delay #f) - (set! (-> s5-0 impulse) (/ f0-1 (+ f30-0 (-> obj info-override inv-mass)))) + (set! (-> s5-0 impulse) (/ f0-1 (+ f30-0 (-> obj info-override info inv-mass)))) ) (vector+float*! s2-0 s2-0 (-> s5-0 normal) (* -3.1 f30-0 (-> s5-0 impulse))) (set! (-> s2-0 y) (fmax (* 49152.0 f30-0) (-> s2-0 y))) @@ -1884,7 +1884,7 @@ (none) ) -(defmethod vehicle-method-135 vehicle () +(defmethod vehicle-method-135 vehicle ((obj vehicle) (arg0 traffic-object-spawn-params)) 0 (none) ) diff --git a/goal_src/jak2/levels/city/industrial/ctyinda-obs.gc b/goal_src/jak2/levels/city/industrial/ctyinda-obs.gc index fceef69b1..66304604d 100644 --- a/goal_src/jak2/levels/city/industrial/ctyinda-obs.gc +++ b/goal_src/jak2/levels/city/industrial/ctyinda-obs.gc @@ -6,4 +6,3 @@ ;; dgos: CIA ;; DECOMP BEGINS - diff --git a/goal_src/jak2/levels/city/industrial/ctyindb-obs.gc b/goal_src/jak2/levels/city/industrial/ctyindb-obs.gc index 001c76bbc..dcf840de3 100644 --- a/goal_src/jak2/levels/city/industrial/ctyindb-obs.gc +++ b/goal_src/jak2/levels/city/industrial/ctyindb-obs.gc @@ -6,4 +6,3 @@ ;; dgos: CIB ;; DECOMP BEGINS - diff --git a/goal_src/jak2/levels/city/market/east/ashelin/ctyasha-obs.gc b/goal_src/jak2/levels/city/market/east/ashelin/ctyasha-obs.gc index f63e7e987..9b602a5f9 100644 --- a/goal_src/jak2/levels/city/market/east/ashelin/ctyasha-obs.gc +++ b/goal_src/jak2/levels/city/market/east/ashelin/ctyasha-obs.gc @@ -7,3 +7,2177 @@ ;; DECOMP BEGINS +(defpartgroup group-ctyasha-dust-explosion + :id 1062 + :duration (seconds 1) + :linger-duration (seconds 3.5) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4639 :period 900 :length 40) + (sp-item 4640 :period 900 :length 60) + (sp-item 4641 :period 900 :length 10) + (sp-item 4642 :period 900 :length 35 :offset 20) + ) + ) + +(defpart 4639 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 64.0) + (sp-rnd-flt spt-x (meters 0) (meters 8) 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 2) (meters 6) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 64.0 128.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-flt spt-a 0.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.4) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.006666667) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a 0.08 0.08 1.0) + (sp-rnd-flt spt-accel-y -1.3653333 -8.192 1.0) + (sp-rnd-flt spt-friction 0.88 0.02 1.0) + (sp-int spt-timer 1250) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-int spt-next-time 150) + (sp-launcher-by-id spt-next-launcher 4643) + (sp-rnd-flt spt-conerot-x (degrees 30.0) (degrees 75.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 45.0) (degrees 180.0) 1.0) + ) + ) + +(defpart 4640 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 16.0) + (sp-rnd-flt spt-x (meters 0) (meters 8) 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 2) (meters 6) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 64.0 128.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-flt spt-a 0.0) + (sp-rnd-flt spt-vel-y (meters 0.4) (meters 0.4) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.01) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a 0.08 0.08 1.0) + (sp-rnd-flt spt-accel-y -12.288 -6.826667 1.0) + (sp-rnd-flt spt-friction 0.88 0.04 1.0) + (sp-int spt-timer 1250) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-int spt-next-time 150) + (sp-launcher-by-id spt-next-launcher 4643) + (sp-rnd-flt spt-conerot-x (degrees 60.0) (degrees 25.000002) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 150.0) (degrees 40.0) 1.0) + ) + ) + +(defpart 4643 + :init-specs ((sp-rnd-flt spt-fade-a -0.032 -0.032 1.0)) + ) + +(defpart 4641 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc)) + (sp-rnd-flt spt-num 32.0 8.0 1.0) + (sp-flt spt-x (meters 0.25)) + (sp-flt spt-y (meters -2.5)) + (sp-rnd-flt spt-scale-x (meters 4) (meters 3) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 16.0 48.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.4) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.006666667) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -0.18) + (sp-flt spt-fade-b -2.12) + (sp-rnd-flt spt-accel-y -5.4613333 -9.557333 1.0) + (sp-rnd-flt spt-friction 0.88 0.05 1.0) + (sp-int spt-timer 3000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4644) + (sp-rnd-flt spt-conerot-x (degrees -90.0) (degrees 60.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees -30.0) (degrees 60.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 3) (meters 5) 1.0) + ) + ) + +(defpart 4642 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 16.0) + (sp-rnd-flt spt-x (meters 0) (meters 8) 1.0) + (sp-rnd-flt spt-y (meters -3.5) (meters 2) 1.0) + (sp-flt spt-scale-x (meters 2.5)) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-scale-y (meters 0.1) (meters 0.2) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-omega 6.144 6.144 1.0) + (sp-rnd-flt spt-vel-y (meters 0.26666668) (meters 0.2) 1.0) + (sp-rnd-flt spt-fade-a -0.10666667 -0.10666667 1.0) + (sp-rnd-flt spt-accel-y -13.653334 -6.826667 1.0) + (sp-rnd-flt spt-friction 0.9 0.08 1.0) + (sp-int-plain-rnd spt-timer 450 299 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 4645) + (sp-rnd-flt spt-conerot-x (degrees 30.0) (degrees 75.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 45.0) (degrees 180.0) 1.0) + ) + ) + +(defpartgroup group-ctyasha-large-explosion + :id 1063 + :duration (seconds 3) + :linger-duration (seconds 2) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 32) + :parts ((sp-item 4646 :fade-after (meters 200) :falloff-to (meters 200) :period 9600 :length 25) + (sp-item 4647 :period 9600 :length 10 :offset 10) + (sp-item 4648 :fade-after (meters 120) :falloff-to (meters 120) :period 9600 :length 100 :offset 25) + (sp-item 4649 :fade-after (meters 60) :period 9600 :length 35 :offset 10) + (sp-item 4650 :period 9600 :length 50 :offset 15) + (sp-item 4651 :period 9600 :length 5) + (sp-item 4652 :period 9600 :length 50 :offset 15) + (sp-item 4653 :period 9600 :length 5) + ) + ) + +(defpart 4651 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters -2.5)) + (sp-flt spt-scale-x (meters 32)) + (sp-flt spt-rot-x 8192.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 96.0) + (sp-flt spt-scalevel-x (meters 0.5)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -1.28) + (sp-flt spt-fade-b -5.1) + (sp-flt spt-fade-a 0.0) + (sp-int spt-timer 65) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 40960.0) + (sp-int spt-next-time 30) + (sp-launcher-by-id spt-next-launcher 4654) + ) + ) + +(defpart 4654 + :init-specs ((sp-flt spt-scalevel-x (meters -0.2857143)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -3.6571429) + (sp-flt spt-fade-b 0.0) + (sp-flt spt-fade-a -2.7428572) + ) + ) + +(defpart 4653 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 120)) + (sp-flt spt-rot-x 8192.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 24.0) + (sp-flt spt-scalevel-x (meters 0.13333334)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -4.266667) + (sp-flt spt-fade-b -4.266667) + (sp-flt spt-fade-a 0.0) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 40960.0) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 4655) + ) + ) + +(defpart 4655 + :init-specs ((sp-flt spt-scalevel-x (meters 0)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.85333335) + (sp-flt spt-fade-g -1.7066667) + (sp-flt spt-fade-b -1.7066667) + (sp-flt spt-fade-a -0.64) + ) + ) + +(defpart 4649 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 16.0) + (sp-rnd-flt spt-y (meters -3.5) (meters 2) 1.0) + (sp-flt spt-scale-x (meters 2.5)) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-scale-y (meters 0.1) (meters 0.2) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-flt spt-omega 12.288) + (sp-rnd-flt spt-vel-y (meters 0.26666668) (meters 0.2) 1.0) + (sp-flt spt-fade-b -8.0) + (sp-rnd-flt spt-accel-y -13.653334 -6.826667 1.0) + (sp-rnd-flt spt-friction 0.9 0.08 1.0) + (sp-int-plain-rnd spt-timer 450 299 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 4656) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 140.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 10000.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 4656 + :init-specs ((sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -2.6133332) + (sp-flt spt-fade-b -1.7066667) + (sp-rnd-flt spt-fade-a -0.096 -0.096 1.0) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 4657) + ) + ) + +(defpart 4657 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + ) + +(defpart 4652 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x34 :page #xc)) + (sp-rnd-flt spt-num 5.0 5.0 1.0) + (sp-flt spt-y (meters -2.5)) + (sp-rnd-flt spt-scale-x (meters 3) (meters 2) 1.0) + (sp-int spt-rot-x 4) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-rot-z) + :flags (sp-flag spflag7) + :random-rangef 65536.0 + :random-multf 1.0 + ) + (sp-rnd-flt spt-scale-y (meters 8) (meters 4) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.033333335) (meters 0.13333334) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -0.36) + (sp-flt spt-fade-b -4.24) + (sp-flt spt-fade-a -0.26666668) + (sp-rnd-flt spt-friction 0.92 0.02 1.0) + (sp-int spt-timer 1000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-func spt-func 'sparticle-motion-blur) + (sp-int spt-next-time 25) + (sp-launcher-by-id spt-next-launcher 4658) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-conerot-x) + :flags (sp-flag from-pointer) + :func '*sp-temp* + ) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 2) 1.0) + ) + ) + +(defpart 4658 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.55) + (sp-flt spt-fade-g -2.95) + (sp-flt spt-fade-b -3.3) + (sp-int-plain-rnd spt-next-time 30 9 1) + (sp-launcher-by-id spt-next-launcher 4659) + ) + ) + +(defpart 4659 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.008333334) (meters 0.008333334) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -1.2944444) + (sp-flt spt-fade-g -0.7111111) + (sp-flt spt-fade-b -0.2) + (sp-rnd-flt spt-fade-a -0.225 -0.225 1.0) + ) + ) + +(defpart 4650 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x33 :page #xc)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 16.0 10.0 1.0) + (sp-flt spt-y (meters -2.5)) + (sp-rnd-flt spt-scale-x (meters 3) (meters 2) 1.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-rnd-flt spt-scale-y (meters 6.8) (meters 1.2) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.13333334) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.06666667) (meters 0.13333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -0.36) + (sp-flt spt-fade-b -4.24) + (sp-flt spt-fade-a -0.32) + (sp-flt spt-friction 0.94) + (sp-int spt-timer 1000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 40 1 0 #xc00000 #xc03300) + ) + (sp-int spt-next-time 25) + (sp-launcher-by-id spt-next-launcher 4660) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 8) 1.0) + ) + ) + +(defpart 4660 + :init-specs ((sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g 0.0) + (sp-flt spt-fade-b 0.0) + (sp-int-plain-rnd spt-next-time 5 19 1) + (sp-launcher-by-id spt-next-launcher 4661) + ) + ) + +(defpart 4661 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.44) + (sp-flt spt-fade-g -2.36) + (sp-flt spt-fade-b -2.64) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4662) + ) + ) + +(defpart 4662 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.008333334) (meters 0.008333334) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -1.2) + (sp-flt spt-fade-g -0.7111111) + (sp-flt spt-fade-b -0.2) + (sp-rnd-flt spt-fade-a -0.06545454 -0.06545454 1.0) + (sp-int-plain-rnd spt-next-time 150 29 1) + (sp-launcher-by-id spt-next-launcher 4663) + ) + ) + +(defpart 4663 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.1125)) + ) + +(defpart 4648 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc)) + (sp-rnd-flt spt-num 6.0 8.0 1.0) + (sp-flt spt-x (meters 0.25)) + (sp-flt spt-y (meters -2.5)) + (sp-rnd-flt spt-scale-x (meters 3) (meters 5) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 16.0 48.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.4) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.013333334) (meters 0.013333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -0.18) + (sp-flt spt-fade-b -2.12) + (sp-rnd-flt spt-accel-y -1.3653333 -9.557333 1.0) + (sp-rnd-flt spt-friction 0.88 0.02 1.0) + (sp-int spt-timer 3000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4644) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 3) (meters 5) 1.0) + ) + ) + +(defpart 4644 + :init-specs ((sp-flt spt-scalevel-x (meters 0.0016666667)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g 0.02) + (sp-flt spt-fade-b 0.23555556) + (sp-int-plain-rnd spt-next-time 45 14 1) + (sp-launcher-by-id spt-next-launcher 4664) + ) + ) + +(defpart 4664 + :init-specs ((sp-flt spt-fade-r -0.5543478) + (sp-flt spt-fade-g -0.5543478) + (sp-flt spt-fade-b -0.5543478) + (sp-rnd-flt spt-fade-a -0.10666667 -0.10666667 1.0) + ) + ) + +(defpart 4646 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 4.0 8.0 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 0.6) 1.0) + (sp-flt spt-y (meters -2.5)) + (sp-rnd-flt spt-scale-x (meters 8.5) (meters 8) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 70.0 20.0 1.0) + (sp-rnd-flt spt-g 70.0 20.0 1.0) + (sp-rnd-flt spt-b 70.0 20.0 1.0) + (sp-rnd-flt spt-a 0.0 40.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.2) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.033333335) (meters 0.086666666) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 3.3) + (sp-flt spt-fade-g 3.12) + (sp-flt spt-fade-b 1.18) + (sp-flt spt-fade-a 1.76) + (sp-flt spt-friction 0.89) + (sp-int spt-timer 710) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4665) + (sp-rnd-flt spt-conerot-x (degrees -1440.0) (degrees 2880.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 4665 + :init-specs ((sp-flt spt-scalevel-x (meters 0.0033333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.53333336) + (sp-flt spt-fade-g -1.9666667) + (sp-flt spt-fade-b -2.2) + (sp-flt spt-fade-a -0.41666666) + (sp-int-plain-rnd spt-next-time 45 14 1) + (sp-launcher-by-id spt-next-launcher 4666) + ) + ) + +(defpart 4666 + :init-specs ((sp-flt spt-scalevel-x (meters 0)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.38833332) + (sp-flt spt-fade-g -0.21333334) + (sp-flt spt-fade-b -0.028333334) + (sp-flt spt-fade-a -0.38833332) + ) + ) + +(defpart 4647 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #xc)) + (sp-flt spt-num 9.0) + (sp-flt spt-y (meters -2.5)) + (sp-rnd-flt spt-scale-x (meters 4) (meters 8) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 1) (meters 0.5) 1.0) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-flt spt-g 96.0) + (sp-flt spt-b 64.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.13333334) (meters 0.4) 1.0) + (sp-flt spt-fade-g 1.6) + (sp-flt spt-fade-b 3.2) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + ) + ) + +(defpartgroup group-ctyasha-explosion + :id 1064 + :duration (seconds 3) + :linger-duration (seconds 2) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 32) + :parts ((sp-item 4667 :flags (bit6) :period 900 :length 5) + (sp-item 4668 :flags (bit6) :period 900 :length 5) + (sp-item 4669 :period 900 :length 15) + (sp-item 4670 :fade-after (meters 60) :period 900 :length 10 :offset 10) + (sp-item 4671 :fade-after (meters 60) :falloff-to (meters 60) :period 900 :length 50 :offset 20) + (sp-item 4672 :fade-after (meters 200) :falloff-to (meters 200) :period 900 :length 25 :offset 20) + (sp-item 4673 :fade-after (meters 150) :falloff-to (meters 150) :period 900 :length 20 :offset 30) + ) + ) + +(defpart 4668 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2)) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 24.0) + (sp-flt spt-scalevel-x (meters 0.10666667)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -4.266667) + (sp-flt spt-fade-b -4.266667) + (sp-flt spt-fade-a 0.0) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 4674) + ) + ) + +(defpart 4674 + :init-specs ((sp-flt spt-scalevel-x (meters 0)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.85333335) + (sp-flt spt-fade-g -1.7066667) + (sp-flt spt-fade-b -1.7066667) + (sp-flt spt-fade-a -0.64) + ) + ) + +(defpart 4673 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x34 :page #xc)) + (sp-rnd-flt spt-num 2.0 0.2 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-rot-z) + :flags (sp-flag spflag7) + :random-rangef 655360.0 + :random-multf 1.0 + ) + (sp-rnd-flt spt-scale-y (meters 0.8) (meters 0.2) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.01) (meters 0.13333334) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -0.36) + (sp-flt spt-fade-b -4.24) + (sp-flt spt-fade-a -0.22068965) + (sp-flt spt-friction 0.95) + (sp-int spt-timer 1000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-int spt-next-time 25) + (sp-launcher-by-id spt-next-launcher 4675) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-conerot-x) + :flags (sp-flag from-pointer) + :func '*sp-temp* + ) + ) + ) + +(defpart 4672 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x33 :page #xc)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 1.0 0.2 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.02) (meters 0.01) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.01) (meters 0.13333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -0.36) + (sp-flt spt-fade-b -4.24) + (sp-flt spt-fade-a -0.22068965) + (sp-flt spt-friction 0.95) + (sp-int spt-timer 1000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 40 1 0 #xc00000 #xc03300) + ) + (sp-int spt-next-time 25) + (sp-launcher-by-id spt-next-launcher 4675) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 4675 + :init-specs ((sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g 0.0) + (sp-flt spt-fade-b 0.0) + (sp-int-plain-rnd spt-next-time 5 19 1) + (sp-launcher-by-id spt-next-launcher 4676) + ) + ) + +(defpart 4676 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.44) + (sp-flt spt-fade-g -2.36) + (sp-flt spt-fade-b -2.64) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4677) + ) + ) + +(defpart 4677 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.008333334) (meters 0.008333334) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -1.2944444) + (sp-flt spt-fade-g -0.7111111) + (sp-flt spt-fade-b -0.094444446) + (sp-rnd-flt spt-fade-a -0.06545454 -0.06545454 1.0) + (sp-int-plain-rnd spt-next-time 150 29 1) + (sp-launcher-by-id spt-next-launcher 4678) + ) + ) + +(defpart 4678 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.1125)) + ) + +(defpart 4667 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 5)) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 96.0) + (sp-flt spt-scalevel-x (meters 0.5)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -1.28) + (sp-flt spt-fade-b -5.1) + (sp-flt spt-fade-a 0.0) + (sp-int spt-timer 65) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-int spt-next-time 30) + (sp-launcher-by-id spt-next-launcher 4679) + ) + ) + +(defpart 4679 + :init-specs ((sp-flt spt-scalevel-x (meters -0.2857143)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -3.6571429) + (sp-flt spt-fade-b 0.0) + (sp-flt spt-fade-a -2.7428572) + ) + ) + +(defpart 4671 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc)) + (sp-rnd-flt spt-num 8.0 2.0 1.0) + (sp-flt spt-x (meters 0.25)) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.25) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 16.0 48.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.083333336) (meters 0.083333336) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.006666667) (meters 0.0016666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -0.18) + (sp-flt spt-fade-b -2.12) + (sp-rnd-flt spt-accel-y -0.68266666 -1.3653333 1.0) + (sp-flt spt-friction 0.87) + (sp-int spt-timer 1000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4680) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 4680 + :init-specs ((sp-flt spt-scalevel-x (meters 0.0016666667)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g 0.02) + (sp-flt spt-fade-b 0.23555556) + (sp-int-plain-rnd spt-next-time 45 14 1) + (sp-launcher-by-id spt-next-launcher 4681) + ) + ) + +(defpart 4681 + :init-specs ((sp-flt spt-fade-r -0.5543478) (sp-flt spt-fade-g -0.5543478) (sp-flt spt-fade-a -0.13913043)) + ) + +(defpart 4669 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 2.0 1.0 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 0.6) 1.0) + (sp-rnd-flt spt-scale-x (meters 2.5) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 70.0 20.0 1.0) + (sp-rnd-flt spt-g 70.0 20.0 1.0) + (sp-rnd-flt spt-b 70.0 20.0 1.0) + (sp-rnd-flt spt-a 0.0 40.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.1) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.033333335) (meters 0.02) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 3.3) + (sp-flt spt-fade-g 3.12) + (sp-flt spt-fade-b 1.18) + (sp-flt spt-fade-a 1.76) + (sp-flt spt-friction 0.88) + (sp-int spt-timer 710) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4682) + (sp-rnd-flt spt-conerot-x (degrees -1440.0) (degrees 2880.0) 1.0) + ) + ) + +(defpart 4682 + :init-specs ((sp-flt spt-scalevel-x (meters 0.0033333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.53333336) + (sp-flt spt-fade-g -1.9666667) + (sp-flt spt-fade-b -2.2) + (sp-flt spt-fade-a -0.41666666) + (sp-int-plain-rnd spt-next-time 45 14 1) + (sp-launcher-by-id spt-next-launcher 4683) + ) + ) + +(defpart 4683 + :init-specs ((sp-flt spt-scalevel-x (meters 0)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.38833332) + (sp-flt spt-fade-g -0.21333334) + (sp-flt spt-fade-b -0.028333334) + (sp-flt spt-fade-a -0.38833332) + ) + ) + +(defpart 4670 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #xc)) + (sp-rnd-flt spt-num 4.0 2.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-flt spt-g 96.0) + (sp-flt spt-b 64.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.13333334) (meters 0.02) 1.0) + (sp-flt spt-fade-g 1.6) + (sp-flt spt-fade-b 3.2) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + ) + ) + +(defpartgroup group-ctyasha-smoke-trail + :id 1065 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 4684 :fade-after (meters 300) :falloff-to (meters 300))) + ) + +(defpart 4684 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 0.5) + (sp-rnd-flt spt-scale-x (meters 1.2) (meters 1.8) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 1.2) (meters 1.8) 1.0) + (sp-rnd-flt spt-r 64.0 128.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-vel-x (meters -0.0033333334) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-vel-y (meters -0.006666667) (meters -0.006666667) 1.0) + (sp-rnd-flt spt-vel-z (meters -0.0033333334) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.0033333334) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.10666667 -0.10666667 1.0) + (sp-rnd-flt spt-accel-y 0.13653333 0.27306667 1.0) + (sp-flt spt-friction 0.99) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 40 1 0 #xc00000 #xc00000 #xc03300) + ) + ) + ) + +(defskelgroup skel-tanker tanker tanker-lod0-jg -1 + ((tanker-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + :origin-joint-index 6 + ) + +(defskelgroup skel-tanker-container tanker-container tanker-container-lod0-jg -1 + ((tanker-container-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 9) + :origin-joint-index 3 + ) + +(defskelgroup skel-tanker-barrels tanker-barrels tanker-barrels-lod0-jg -1 + ((tanker-barrels-lod0-mg (meters 999999))) + :bounds (static-spherem 7 0 0 30) + :origin-joint-index 3 + ) + +(defskelgroup skel-tanker-one-barrel tanker-one-barrel tanker-one-barrel-lod0-jg -1 + ((tanker-one-barrel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + :origin-joint-index 3 + ) + +(defskelgroup skel-tanker-roof-break tanker-roof-break tanker-roof-break-lod0-jg -1 + ((tanker-roof-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100) + :origin-joint-index 4 + ) + +(deftype tanker-grunt (grunt) + ((expensive-gnd-collide? symbol :offset 692) + ) + :heap-base #x240 + :method-count-assert 186 + :size-assert #x2b8 + :flag-assert #xba024002b8 + ) + + +(defmethod general-event-handler tanker-grunt ((obj tanker-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Handles various events for the enemy +@TODO - unsure if there is a pattern for the events and this should have a more specific name" + (case arg2 + (('skip-intro) + (when (and (-> obj next-state) + (let ((v1-4 (-> obj next-state name))) + (or (= v1-4 'ambush) (= v1-4 'jumping-ambush) (= v1-4 'dormant) (= v1-4 'jump) (= v1-4 'jump-blocked)) + ) + ) + (let ((s5-0 (-> obj intro-path))) + (when (nonzero? s5-0) + (let ((f30-0 (get-num-segments s5-0)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (get-point-at-percent-along-path! s5-0 (-> obj root-override2 trans) f30-0 'interp) + (displacement-between-points-at-percent-normalized! s5-0 s4-0 f30-0) + (forward-up->quaternion (-> obj root-override2 quat) s4-0 *up-vector*) + ) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) + (set! (-> obj enemy-flags) (logior (enemy-flag dangerous-backup) (-> obj enemy-flags))) + (logclear! (-> obj mask) (process-mask actor-pause)) + (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) + (set-vector! (-> obj root-override2 scale) 1.0 1.0 1.0 1.0) + (go-hostile obj) + #t + ) + ) + ) + ) + (else + ((method-of-type grunt general-event-handler) obj arg0 arg1 arg2 arg3) + ) + ) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod init-enemy! tanker-grunt ((obj tanker-grunt)) + "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" + (set! (-> obj expensive-gnd-collide?) #t) + (let ((t9-0 (method-of-type grunt init-enemy!))) + (t9-0 obj) + ) + (set-vector! (-> obj root-override2 scale) 0.0 0.0 0.0 1.0) + (none) + ) + +;; WARN: Return type mismatch uint vs collide-spec. +(defmethod enemy-method-124 tanker-grunt ((obj tanker-grunt)) + "TODO" + (let ((t9-0 (method-of-type grunt enemy-method-124))) + (t9-0 obj) + ) + (the-as collide-spec (when (-> obj expensive-gnd-collide?) + (let ((v0-1 (logior (-> obj gnd-collide) 577))) + (set! (-> obj gnd-collide) v0-1) + v0-1 + ) + ) + ) + ) + +(defmethod go-hostile tanker-grunt ((obj tanker-grunt)) + (set! (-> obj expensive-gnd-collide?) #f) + (enemy-method-124 obj) + ((method-of-type grunt go-hostile) obj) + (none) + ) + +(defstate jump (tanker-grunt) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type grunt jump) exit))) + (if t9-0 + (t9-0) + ) + ) + (set-vector! (-> self root-override2 scale) 1.0 1.0 1.0 1.0) + (none) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type grunt jump) trans))) + (if t9-0 + (t9-0) + ) + ) + (let* ((f0-0 (-> self root-override2 scale x)) + (f0-3 (seek f0-0 1.0 (* 1.5 (-> self clock seconds-per-frame)))) + ) + (set-vector! (-> self root-override2 scale) f0-3 f0-3 f0-3 1.0) + ) + 0 + (none) + ) + ) + +(deftype tanker-juicer (juicer) + ((expensive-gnd-collide? symbol :offset-assert 848) + ) + :heap-base #x2e0 + :method-count-assert 185 + :size-assert #x354 + :flag-assert #xb902e00354 + ) + + +(defmethod general-event-handler tanker-juicer ((obj tanker-juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Handles various events for the enemy +@TODO - unsure if there is a pattern for the events and this should have a more specific name" + (case arg2 + (('skip-intro) + (when (and (-> obj next-state) (let ((v1-4 (-> obj next-state name))) + (or (= v1-4 'ambush) (= v1-4 'dormant) (= v1-4 'jump) (= v1-4 'jump-blocked)) + ) + ) + (let ((s5-0 (-> obj intro-path))) + (when (nonzero? s5-0) + (let ((f30-0 (get-num-segments s5-0)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (get-point-at-percent-along-path! s5-0 (-> obj root-override2 trans) f30-0 'interp) + (displacement-between-points-at-percent-normalized! s5-0 s4-0 f30-0) + (forward-up->quaternion (-> obj root-override2 quat) s4-0 *up-vector*) + ) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) + (set! (-> obj enemy-flags) (logior (enemy-flag dangerous-backup) (-> obj enemy-flags))) + (logclear! (-> obj mask) (process-mask actor-pause)) + (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) + (set-vector! (-> obj root-override2 scale) 1.0 1.0 1.0 1.0) + (go-hostile obj) + #t + ) + ) + ) + ) + (else + ((method-of-type juicer general-event-handler) obj arg0 arg1 arg2 arg3) + ) + ) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod init-enemy! tanker-juicer ((obj tanker-juicer)) + "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" + (set! (-> obj expensive-gnd-collide?) #t) + (let ((t9-0 (method-of-type juicer init-enemy!))) + (t9-0 obj) + ) + (set-vector! (-> obj root-override2 scale) 0.0 0.0 0.0 1.0) + (none) + ) + +;; WARN: Return type mismatch uint vs collide-spec. +(defmethod enemy-method-124 tanker-juicer ((obj tanker-juicer)) + "TODO" + (let ((t9-0 (method-of-type juicer enemy-method-124))) + (t9-0 obj) + ) + (the-as collide-spec (when (-> obj expensive-gnd-collide?) + (let ((v0-1 (logior (-> obj gnd-collide) 577))) + (set! (-> obj gnd-collide) v0-1) + v0-1 + ) + ) + ) + ) + +(defmethod go-hostile tanker-juicer ((obj tanker-juicer)) + (set! (-> obj expensive-gnd-collide?) #f) + (enemy-method-124 obj) + ((method-of-type juicer go-hostile) obj) + (none) + ) + +(defstate jump (tanker-juicer) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type juicer jump) exit))) + (if t9-0 + (t9-0) + ) + ) + (set-vector! (-> self root-override2 scale) 1.0 1.0 1.0 1.0) + (none) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type juicer jump) trans))) + (if t9-0 + (t9-0) + ) + ) + (let* ((f0-0 (-> self root-override2 scale x)) + (f0-3 (seek f0-0 1.0 (* 1.15 (-> self clock seconds-per-frame)))) + ) + (set-vector! (-> self root-override2 scale) f0-3 f0-3 f0-3 1.0) + ) + 0 + (none) + ) + ) + +(deftype tanker-container (process-drawable) + ((root-override collide-shape :offset 128) + ) + :heap-base #x50 + :method-count-assert 23 + :size-assert #xc8 + :flag-assert #x17005000c8 + (:methods + (dormant () _type_ :state 20) + (idle () _type_ :state 21) + (tanker-container-method-22 (_type_) none 22) + ) + ) + + +;; WARN: Return type mismatch (pointer process) vs none. +(defmethod tanker-container-method-22 tanker-container ((obj tanker-container)) + (process-spawn + simple-nav-sphere + #x46733333 + (new 'static 'vector :x 1719500.8 :y 35225.6 :z 1837465.6 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x46a00000 + (new 'static 'vector :x 1730560.0 :y 35225.6 :z 1855488.0 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x46b00000 + (new 'static 'vector :x 1738752.0 :y 35225.6 :z 1884160.0 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x46b00000 + (new 'static 'vector :x 1751040.0 :y 35225.6 :z 1910374.4 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x46b00000 + (new 'static 'vector :x 1763737.6 :y 35225.6 :z 1936588.8 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x46880000 + (new 'static 'vector :x 1853849.6 :y 35225.6 :z 1918566.4 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x46880000 + (new 'static 'vector :x 1867776.0 :y 35225.6 :z 1934131.2 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x458ccccd + (new 'static 'vector :x 1962803.2 :y 35225.6 :z 1739980.8 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x45e66666 + (new 'static 'vector :x 1916108.8 :y 35225.6 :z 1705164.8 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x45e66666 + (new 'static 'vector :x 1863270.4 :y 35225.6 :z 1699430.4 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x45e66666 + (new 'static 'vector :x 1862860.8 :y 35225.6 :z 1814118.4 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x45e66666 + (new 'static 'vector :x 1810841.6 :y 35225.6 :z 1800192.0 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x45e66666 + (new 'static 'vector :x 1781350.4 :y 35225.6 :z 1774387.2 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x45e66666 + (new 'static 'vector :x 1771110.4 :y 35225.6 :z 1799782.4 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x45e66666 + (new 'static 'vector :x 1784217.6 :y 35225.6 :z 1828864.0 :w 1.0) + #f + -1 + :to obj + ) + (none) + ) + +(defbehavior tanker-container-event-handler tanker-container ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('trigger) + (let ((v1-2 (-> self root-override root-prim))) + (set! (-> v1-2 prim-core collide-as) (-> self root-override backup-collide-as)) + (set! (-> v1-2 prim-core collide-with) (-> self root-override backup-collide-with)) + ) + (go-virtual idle) + ) + (('draw) + (let ((v0-0 (the-as object (logclear (-> self draw status) (draw-control-status no-draw))))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + v0-0 + ) + ) + ) + ) + +(defstate dormant (tanker-container) + :virtual #t + :event tanker-container-event-handler + :enter (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (logior! (-> self draw status) (draw-control-status no-draw)) + (none) + ) + :code (the-as (function none :behavior tanker-container) sleep-code) + ) + +(defstate idle (tanker-container) + :virtual #t + :event tanker-container-event-handler + :enter (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (let ((v1-3 (-> self root-override root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root-override backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root-override backup-collide-with)) + ) + (tanker-container-method-22 self) + (none) + ) + :code (the-as (function none :behavior tanker-container) sleep-code) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tanker-container ((obj tanker-container) (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" + (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) + (set! (-> s4-0 total-prims) (the-as uint 4)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 8192.0 0.0 36864.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 -10240.0 12288.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 0.0 0.0 28672.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle-for-jak)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) 0.0 8192.0 0.0 36864.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-15 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tanker-container" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (let ((s5-2 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-2 + (the-as art-joint-anim (-> obj draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-2 frame-num) 0.0) + ) + (transform-post) + (let ((v1-26 (-> obj root-override root-prim))) + (set! (-> v1-26 prim-core collide-as) (collide-spec)) + (set! (-> v1-26 prim-core collide-with) (collide-spec)) + ) + 0 + (logclear! (-> obj mask) (process-mask actor-pause)) + (if (task-node-closed? (game-task-node city-intercept-tanker-introduction)) + (go (method-of-object obj idle)) + (go (method-of-object obj dormant)) + ) + (none) + ) + +(defskelgroup skel-tanker-crash tanker-crash tanker-crash-lod0-jg -1 + ((tanker-crash-lod0-mg (meters 999999))) + :bounds (static-spherem 7 2 0 21) + :origin-joint-index 4 + ) + +(deftype tanker-crash (process-drawable) + ((root-override collide-shape :offset 128) + ) + :heap-base #x50 + :method-count-assert 22 + :size-assert #xc8 + :flag-assert #x16005000c8 + (:methods + (dormant () _type_ :state 20) + (idle () _type_ :state 21) + ) + ) + + +(defstate dormant (tanker-crash) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger) + (go-virtual idle) + ) + ) + ) + :enter (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (logior! (-> self draw status) (draw-control-status no-draw)) + (none) + ) + :code (the-as (function none :behavior tanker-crash) sleep-code) + ) + +(defstate idle (tanker-crash) + :virtual #t + :enter (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (let ((v1-3 (-> self root-override root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root-override backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root-override backup-collide-with)) + ) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (none) + ) + :code (the-as (function none :behavior tanker-crash) sleep-code) + :post (the-as (function none :behavior tanker-crash) ja-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tanker-crash ((obj tanker-crash) (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" + (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) + (set! (-> s4-0 total-prims) (the-as uint 4)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 4) + (set-vector! (-> s3-0 local-sphere) 28672.0 8192.0 0.0 86016.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 6) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 -28672.0 32768.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 7) + (set-vector! (-> v1-10 local-sphere) 0.0 0.0 -26624.0 32768.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 8) + (set-vector! (-> v1-12 local-sphere) 0.0 8192.0 4096.0 28672.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-15 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tanker-crash" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (let ((s5-2 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-2 + (the-as art-joint-anim (-> obj draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-2 frame-num) 0.0) + ) + (transform-post) + (let ((v1-26 (-> obj root-override root-prim))) + (set! (-> v1-26 prim-core collide-as) (collide-spec)) + (set! (-> v1-26 prim-core collide-with) (collide-spec)) + ) + 0 + (logclear! (-> obj mask) (process-mask actor-pause)) + (if (task-node-closed? (game-task-node city-intercept-tanker-introduction)) + (go (method-of-object obj idle)) + (go (method-of-object obj dormant)) + ) + (none) + ) + +(deftype tanker-deadly (process-drawable) + ((root-override collide-shape :offset 128) + (track-joint int32 :offset-assert 200) + (attack-id uint32 :offset-assert 204) + (die-time time-frame :offset-assert 208) + (prev-pos vector :inline :offset-assert 224) + ) + :heap-base #x70 + :method-count-assert 22 + :size-assert #xf0 + :flag-assert #x16007000f0 + (:methods + (active () _type_ :state 20) + (die-fast () _type_ :state 21) + ) + ) + + +(defmethod run-logic? tanker-deadly ((obj tanker-deadly)) + #t + ) + +(defstate active (tanker-deadly) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('touched) + (let ((a2-1 (-> event param 0)) + (v1-1 (new 'stack-no-clear 'vector)) + ) + (vector-! v1-1 (-> self root-override trans) (-> self prev-pos)) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer self)) + (set! (-> a1-4 num-params) 2) + (set! (-> a1-4 message) 'attack) + (set! (-> a1-4 param 0) a2-1) + (let ((a2-2 (new 'static 'attack-info :mask (attack-info-mask mode id attacker-velocity damage knock)))) + (set! (-> a2-2 id) (-> self attack-id)) + (set! (-> a2-2 mode) 'eco-red) + (set! (-> a2-2 attacker-velocity quad) (-> v1-1 quad)) + (set! (-> a2-2 damage) 2.0) + (set! (-> a2-2 knock) (the-as uint 2)) + (set! (-> a1-4 param 1) (the-as uint a2-2)) + ) + (send-event-function proc a1-4) + ) + ) + ) + ) + ) + :code (the-as (function none :behavior tanker-deadly) sleep-code) + :post (behavior () + (set! (-> self prev-pos quad) (-> self root-override trans quad)) + (let ((v1-1 (ppointer->process (-> self parent))) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (vector<-cspace! gp-0 (-> (the-as process-drawable v1-1) node-list data (-> self track-joint))) + (move-to-point! (-> self root-override) gp-0) + ) + (let ((a1-5 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-5 options) (overlaps-others-options)) + (set! (-> a1-5 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-5 tlist) *touching-list*) + (find-overlapping-shapes (-> self root-override) a1-5) + ) + (if (>= (-> self clock frame-counter) (-> self die-time)) + (go-virtual die-fast) + ) + (none) + ) + ) + +(defstate die-fast (tanker-deadly) + :virtual #t + :code (behavior () + (cleanup-for-death self) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior tanker-deadly-init-by-other tanker-deadly ((arg0 vector) (arg1 int) (arg2 int)) + (set! (-> self track-joint) arg1) + (set! (-> self die-time) (+ (-> self clock frame-counter) arg2)) + (let* ((v1-3 *game-info*) + (a0-2 (+ (-> v1-3 attack-id) 1)) + ) + (set! (-> v1-3 attack-id) a0-2) + (set! (-> self attack-id) a0-2) + ) + (let ((gp-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (let ((v1-6 (new 'process 'collide-shape-prim-sphere gp-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-with) (collide-spec crate civilian hit-by-others-list)) + (set! (-> v1-6 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> gp-0 total-prims) (the-as uint 1)) + (set! (-> gp-0 root-prim) v1-6) + ) + (set! (-> gp-0 nav-radius) (* 0.75 (-> gp-0 root-prim local-sphere w))) + (let ((v1-9 (-> gp-0 root-prim))) + (set! (-> gp-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> gp-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> gp-0 event-self) 'touched) + (set! (-> gp-0 root-prim local-sphere quad) (-> arg0 quad)) + (let ((v1-14 (ppointer->process (-> self parent)))) + (vector<-cspace! (-> gp-0 trans) (-> (the-as process-drawable v1-14) node-list data (-> self track-joint))) + ) + (vector-identity! (-> gp-0 scale)) + (quaternion-identity! (-> gp-0 quat)) + (update-transforms gp-0) + (set! (-> self root-override) gp-0) + ) + (set! (-> self prev-pos quad) (-> self root-override trans quad)) + (logclear! (-> self mask) (process-mask actor-pause enemy)) + (go-virtual active) + (none) + ) + +(defun tanker-spawn-deadly-barrels ((arg0 process-tree)) + (let ((s5-0 (new 'static 'vector :w 6553.6))) + (process-spawn tanker-deadly s5-0 3 1041 :to arg0) + (process-spawn tanker-deadly s5-0 4 1041 :to arg0) + (process-spawn tanker-deadly s5-0 5 1041 :to arg0) + (process-spawn tanker-deadly s5-0 6 1041 :to arg0) + (process-spawn tanker-deadly s5-0 7 1041 :to arg0) + (process-spawn tanker-deadly s5-0 8 1041 :to arg0) + (process-spawn tanker-deadly s5-0 9 1041 :to arg0) + (process-spawn tanker-deadly s5-0 10 1041 :to arg0) + (process-spawn tanker-deadly s5-0 11 1041 :to arg0) + (process-spawn tanker-deadly s5-0 12 1041 :to arg0) + (process-spawn tanker-deadly s5-0 13 1041 :to arg0) + (process-spawn tanker-deadly s5-0 14 1041 :to arg0) + (process-spawn tanker-deadly s5-0 15 1041 :to arg0) + (process-spawn tanker-deadly s5-0 16 1041 :to arg0) + ) + ) + +(defun tanker-spawn-deadly-cab ((arg0 process-tree)) + (let ((s5-0 (new 'static 'vector :w 22937.6))) + (process-spawn tanker-deadly s5-0 5 600 :to arg0) + ) + ) + +(defun tanker-spawn-deadly-trailers ((arg0 process-tree)) + (let ((s5-0 (new 'static 'vector :z 32768.0 :w 22937.6))) + (process-spawn tanker-deadly s5-0 9 600 :to arg0) + (process-spawn tanker-deadly s5-0 8 600 :to arg0) + ) + ) + +(defun tanker-spawn-deadly-container ((arg0 process-tree)) + (let ((s5-0 (new 'static 'vector :w 22937.6))) + (process-spawn tanker-deadly s5-0 3 510 :to arg0) + ) + ) + +(scene-method-16 + (new 'static 'scene + :name "city-intercept-tanker-intro" + :extra #f + :info #f + :mask-to-clear #x1202000 + :entity "scene-stage-57" + :art-group "scenecamera" + :anim "city-intercept-tanker-intro" + :parts 16 + :command-list '((-25 + (send-event "ashelin-tanker-1" 'hide #t) + (task-close! "city-intercept-tanker-roof-explode") + (send-event *traffic-manager* 'set-guard-target-level (unbox 0)) + (send-event *traffic-manager* 'set-max-alert-level (unbox 0)) + (send-event *traffic-manager* 'set-alert-level (unbox 0)) + (send-event *traffic-manager* 'set-alert-duration (unbox 10800000)) + (send-event *traffic-manager* 'deactivate-by-type (unbox 6)) + (send-event *traffic-manager* 'deactivate-by-type (unbox 18)) + (send-event *traffic-manager* 'deactivate-by-type (unbox 19)) + (fma-sphere + (nav kill-once) + sphere + (new 'static 'vector :x 1952972.8 :y 35635.2 :z 1853849.6 :w 19660.8) + duration + (frame-range (new 'static 'bfloat :data -25.0) (new 'static 'bfloat :data 57.5)) + ) + (fma-sphere (nav kill-once) sphere (new 'static 'vector :x 1919795.2 :y 35635.2 :z 1836646.4 :w 32768.0)) + (fma-sphere + (nav kill-once) + sphere + (new 'static 'vector :x 1857126.4 :y 35635.2 :z 1807974.4 :w 12288.0) + duration + (frame-range (new 'static 'bfloat :data -25.0) (new 'static 'bfloat :data 585.0)) + ) + (fma-sphere + (nav kill-once) + sphere + (new 'static 'vector :x 1839923.2 :y 35635.2 :z 1839923.2 :w 12288.0) + duration + (frame-range (new 'static 'bfloat :data -25.0) (new 'static 'bfloat :data 585.0)) + ) + (fma-sphere + (nav kill-once) + sphere + (new 'static 'vector :x 1886617.6 :y 35635.2 :z 1830912.0 :w 12288.0) + duration + (frame-range (new 'static 'bfloat :data -25.0) (new 'static 'bfloat :data 105.0)) + ) + (fma-sphere (nav kill-once) sphere (new 'static 'vector :x 1918976.0 :y 35225.6 :z 1802240.0 :w 16384.0)) + (fadein (frame-time-30 5)) + ) + (538 (part-tracker "group-ctyasha-dust-explosion" entity "tanker" joint "tractor")) + (546 (part-tracker "group-ctyasha-dust-explosion" entity "tanker" joint "tractor")) + (570 (joint-eval tanker-spawn-deadly-cab entity "tanker" joint "chain1")) + (574 (fma-sphere (danger) danger (new 'static 'vector :x 1837465.6 :y 34406.4 :z 1868103.6 :w 225280.0))) + (575 (joint-eval tanker-spawn-deadly-trailers entity "tanker" joint "chain1")) + (576 + (joint-eval tanker-spawn-deadly-barrels entity "tanker-barrels" joint "aa") + (joint-eval tanker-spawn-deadly-container entity "tanker-container" joint "main") + ) + (577 + (part-tracker + "group-ctyasha-large-explosion" + entity + "tanker" + joint + "explode_a" + track + #t + duration + (frame-range (new 'static 'bfloat :data 577.0) (new 'static 'bfloat :data 590.0)) + ) + ) + (581 + (part-tracker + "group-ctyasha-explosion" + entity + "tanker" + joint + "explode_b" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 582.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "aa" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "bb" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "cc" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "dd" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "ee" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "ff" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "gg" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "hh" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "ii" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "jj" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "kk" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "ll" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "mm" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "nn" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker" + joint + "chain1" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + ) + (645 (send-event "tanker-container-1" 'trigger)) + (660 (send-event "tanker-juicer-4" 'cue-chase)) + (695 (send-event "tanker-grunt-3" 'cue-chase)) + (725 (send-event "tanker-juicer-3" 'cue-chase)) + (10000 + (send-event "ashelin-tanker-1" 'hide #f) + (send-event "tanker-container-1" 'draw) + (send-event "tanker-crash-1" 'trigger) + (send-event "tanker-juicer-4" 'skip-intro) + (send-event "tanker-grunt-3" 'skip-intro) + (send-event "tanker-juicer-3" 'skip-intro) + (task-close! "city-intercept-tanker-introduction") + ) + ) + :cut-list '(10 91 169 511 628 668 770 845) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'ctyasha + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'ctyasha + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'ctyasha + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tanker" + :level 'ctyasha + :art-group "skel-tanker" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tanker-container" + :level 'ctyasha + :art-group "skel-tanker-container" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tanker-barrels" + :level 'ctyasha + :art-group "skel-tanker-barrels" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tanker-one-barrel" + :level 'ctyasha + :art-group "skel-tanker-one-barrel" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tanker-roof-break" + :level 'ctyasha + :art-group "skel-tanker-roof-break" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "crimson-guard-lowres" + :level 'ctyasha + :art-group "skel-crimson-guard-lowres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x4 + ) + (new 'static 'scene-actor + :name "crimson-guard-lowres" + :level 'ctyasha + :art-group "skel-crimson-guard-lowres" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x4 + ) + (new 'static 'scene-actor + :name "crimson-guard-highres" + :level 'ctyasha + :art-group "skel-crimson-guard-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "ctymarkb-tanker" + :end-point-obj (new 'static 'continue-point + :name "ctymarkb-tanker" + :level #f + :flags (continue-flags cf2) + :trans (new 'static 'vector :x 1928400.1 :y 34444.902 :z 1788676.5 :w 1.0) + :quat (new 'static 'vector :y 0.3641 :w -0.9313) + :camera-trans (new 'static 'vector :x 1960564.4 :y 55543.81 :z 1760002.0 :w 1.0) + :camera-rot (new 'static 'inline-array vector3s 3 + (new 'static 'vector3s :data (new 'static 'array float 3 0.6676 0.0 0.7444)) + (new 'static 'vector3s :data (new 'static 'array float 3 -0.1301 0.9846 0.1167)) + (new 'static 'vector3s :data (new 'static 'array float 3 -0.7329 -0.1747 0.6574)) + ) + :on-goto #f + :vis-nick 'default-level + :want (new 'static 'inline-array level-buffer-state 6 + (new 'static 'level-buffer-state :name 'ctymarkb :display? 'display :force-vis? #f :force-inside? #f) + (new 'static 'level-buffer-state :name 'ctywide :display? 'display :force-vis? #f :force-inside? #f) + (new 'static 'level-buffer-state :name 'ctyasha :display? 'display :force-vis? #f :force-inside? #f) + (new 'static 'level-buffer-state :name #f :display? #f :force-vis? #f :force-inside? #f) + (new 'static 'level-buffer-state :name #f :display? #f :force-vis? #f :force-inside? #f) + (new 'static 'level-buffer-state :name #f :display? #f :force-vis? #f :force-inside? #f) + ) + :want-sound (new 'static 'array symbol 3 'ctywide1 'ashtan1 'ashtan2) + ) + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #f + :save #t + ) + ) + +(scene-method-16 + (new 'static 'scene + :name "city-intercept-tanker-res" + :extra #f + :info #f + :mask-to-clear #x1282000 + :entity "scene-stage-57" + :art-group "scenecamera" + :anim "city-intercept-tanker-res" + :parts 4 + :command-list '((0 + (send-event *target* 'change-mode 'normal) + (send-event + *traffic-manager* + 'kill-traffic-sphere + (new 'static 'vector :x 1841152.0 :y 28672.0 :z 1865728.0 :w 260096.0) + ) + (fma-sphere (nav kill-once) sphere (new 'static 'vector :x 1895219.2 :y 36044.8 :z 1804697.6 :w 20480.0)) + (fma-sphere (nav kill-once) sphere (new 'static 'vector :x 1885388.8 :y 37683.2 :z 1783808.0 :w 16384.0)) + (fma-sphere (nav kill-once) sphere (new 'static 'vector :x 1920614.4 :y 35225.6 :z 1799372.8 :w 16384.0)) + ) + (445 (fadeout (frame-time-30 5))) + (10000 + (task-close! "city-intercept-tanker-resolution") + (send-event *traffic-manager* 'restore-default-settings) + ) + ) + :cut-list '(192 359) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'ctyasha + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'ctyasha + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'ctyasha + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min 359)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tanker-one-barrel" + :level 'ctyasha + :art-group "skel-tanker-one-barrel" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "ctymarkb-tanker" + :end-point-obj "ctymarkb-movie-end" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :music-delay 1500.0 + :save #t + ) + ) diff --git a/goal_src/jak2/levels/city/palace/ctypal-obs.gc b/goal_src/jak2/levels/city/palace/ctypal-obs.gc index 9ee25db00..a1bc0b3df 100644 --- a/goal_src/jak2/levels/city/palace/ctypal-obs.gc +++ b/goal_src/jak2/levels/city/palace/ctypal-obs.gc @@ -7,3 +7,270 @@ ;; DECOMP BEGINS +(deftype water-anim-ctypal (water-anim) + () + :heap-base #x80 + :method-count-assert 29 + :size-assert #x100 + :flag-assert #x1d00800100 + ) + + +(define ripple-for-water-anim-ctypal (new 'static 'ripple-wave-set + :count 3 + :converted #f + :normal-scale 1.0 + :wave (new 'static 'inline-array ripple-wave 4 + (new 'static 'ripple-wave :scale 20.0 :xdiv 1 :speed 1.5) + (new 'static 'ripple-wave :scale 20.0 :xdiv -1 :zdiv 1 :speed 1.5) + (new 'static 'ripple-wave :scale 10.0 :xdiv 5 :zdiv 3 :speed 0.75) + (new 'static 'ripple-wave) + ) + ) + ) + +(define ripple-ctypal-smlground-pool (new 'static 'ripple-wave-set + :count 3 + :converted #f + :normal-scale 1.0 + :wave (new 'static 'inline-array ripple-wave 4 + (new 'static 'ripple-wave :scale 10.0 :xdiv 1 :speed 1.5) + (new 'static 'ripple-wave :scale 10.0 :xdiv -1 :zdiv 1 :speed 1.5) + (new 'static 'ripple-wave :scale 10.0 :xdiv 1 :zdiv 1 :speed 0.75) + (new 'static 'ripple-wave) + ) + ) + ) + +;; WARN: Return type mismatch ripple-wave-set vs none. +(defmethod init-water! water-anim-ctypal ((obj water-anim-ctypal)) + "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" + (let ((t9-0 (method-of-type water-anim init-water!))) + (t9-0 obj) + ) + (let ((v1-2 (new 'process 'ripple-control))) + (set! (-> obj draw ripple) v1-2) + (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> v1-2 global-scale) 3072.0) + (set! (-> v1-2 close-fade-dist) 163840.0) + (set! (-> v1-2 far-fade-dist) 245760.0) + (set! (-> v1-2 waveform) ripple-for-water-anim-ctypal) + (case (-> obj look) + ((32 30) + (set! (-> v1-2 waveform) ripple-ctypal-smlground-pool) + ) + ) + ) + (none) + ) + +(defskelgroup skel-palace-door palace-door palace-door-lod0-jg palace-door-idle-ja + ((palace-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 30 0 36) + ) + +(deftype palace-door (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! palace-door ((obj palace-door) (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" + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 122880.0 0.0 147456.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set! (-> v1-7 transform-index) 3) + (set-vector! (-> v1-7 local-sphere) 0.0 57344.0 0.0 90112.0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 5) + (set-vector! (-> v1-9 local-sphere) 0.0 -61440.0 0.0 73728.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-12 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-palace-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj pre-open-frame) 48.0) + (set! (-> obj lock-frame) 60.0) + (set! (-> obj open-frame) 60.0) + (set! (-> obj sound-pre-open) (static-sound-spec "pal-door-open-1")) + (set! (-> obj sound-open) (static-sound-spec "pal-door-open-2")) + (set! (-> obj sound-close) (static-sound-spec "pal-door-close")) + (set! (-> obj sound-post-close) (static-sound-spec "pal-door-close2")) + (set! (-> obj sound-behind?) #t) + (set! (-> obj door-radius) 40960.0) + (go (method-of-object obj close) #t) + (none) + ) + +(deftype ctypal-broke-wall (process-drawable) + ((ent basic :offset-assert 200) + ) + :heap-base #x50 + :method-count-assert 22 + :size-assert #xcc + :flag-assert #x16005000cc + (:methods + (idle () _type_ :state 20) + (done () _type_ :state 21) + ) + ) + + +(defskelgroup skel-ctypal-broke-wall ctypal-broke-wall ctypal-broke-wall-lod0-jg ctypal-broke-wall-idle-ja + ((ctypal-broke-wall-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 20) + ) + +(defstate idle (ctypal-broke-wall) + :virtual #t + :trans (behavior () + (when (task-node-closed? (game-task-node canyon-insert-items-resolution)) + (format 0 "~A canyon-insert-items-resolution done~%" (-> self name)) + (process-drawable-from-entity! self (the-as entity-actor (-> self ent))) + (go-virtual done) + ) + (none) + ) + :code (the-as (function none :behavior ctypal-broke-wall) sleep-code) + :post (behavior () + (transform-post) + (none) + ) + ) + +(defstate done (ctypal-broke-wall) + :virtual #t + :code (the-as (function none :behavior ctypal-broke-wall) sleep-code) + :post (behavior () + (transform-post) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! ctypal-broke-wall ((obj ctypal-broke-wall) (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" + (format #t "~A initialising~%" (-> obj name)) + (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 40960.0 0.0 122880.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> obj root) s4-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctypal-broke-wall" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-10 (-> obj root))) + (format + 0 + "trans ~F ~F ~F~%" + (* 0.00024414062 (-> v1-10 trans x)) + (* 0.00024414062 (-> v1-10 trans y)) + (* 0.00024414062 (-> v1-10 trans z)) + ) + ) + (set! (-> obj ent) arg0) + (go (method-of-object obj idle)) + (none) + ) + +(deftype ctypal-baron-statue-broken (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-ctypal-baron-statue-broken ctypal-baron-statue-broken ctypal-baron-statue-broken-lod0-jg ctypal-baron-statue-broken-idle-ja + ((ctypal-baron-statue-broken-lod0-mg (meters 999999))) + :bounds (static-spherem 0 5 0 72) + ) + +(defmethod run-logic? ctypal-baron-statue-broken ((obj ctypal-baron-statue-broken)) + #t + ) + +(defstate idle (ctypal-baron-statue-broken) + :virtual #t + :code (the-as (function none :behavior ctypal-baron-statue-broken) sleep-code) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! ctypal-baron-statue-broken ((obj ctypal-baron-statue-broken) (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" + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ctypal-baron-statue-broken" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (if (not (task-node-closed? (game-task-node canyon-insert-items-resolution))) + (logior! (-> obj draw status) (draw-control-status no-draw)) + ) + (ja-post) + (go (method-of-object obj idle)) + (none) + ) diff --git a/goal_src/jak2/levels/city/port/mines/portrun.gc b/goal_src/jak2/levels/city/port/mines/portrun.gc index 173316ba3..1b1141a0b 100644 --- a/goal_src/jak2/levels/city/port/mines/portrun.gc +++ b/goal_src/jak2/levels/city/port/mines/portrun.gc @@ -7,3 +7,1972 @@ ;; DECOMP BEGINS +(defpartgroup group-cargo-explosion + :id 1057 + :duration (seconds 0.067) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4595 :flags (bit7) :period 150 :length 30) + (sp-item 4596 :flags (is-3d bit7) :period 150 :length 15) + (sp-item 4597 :flags (is-3d bit7) :period 150 :length 15) + (sp-item 4598 :flags (bit7) :period 150 :length 15) + (sp-item 784 :flags (bit6) :period 900 :length 5) + (sp-item 785 :flags (bit6) :period 900 :length 5) + (sp-item 786 :period 900 :length 15) + (sp-item 787 :fade-after (meters 60) :period 900 :length 10 :offset 10) + ) + ) + +(defpart 4595 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 12.0) + (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 64.0 128.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 16.0 16.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.053333335) (meters 0.01) 1.0) + (sp-flt spt-scalevel-x (meters 0.0033333334)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.16) + (sp-flt spt-accel-y -1.3653333) + (sp-rnd-flt spt-friction 0.85 0.1 1.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +(defpart 4596 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2b :page #x52d)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-flt spt-num 8.0) + (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 32.0) + (sp-rnd-flt spt-g 32.0 16.0 1.0) + (sp-rnd-flt spt-b 48.0 16.0 1.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.053333335) (meters 0.04) 1.0) + (sp-rnd-flt spt-rotvel-x (degrees -4.8) (degrees 9.6) 1.0) + (sp-rnd-flt spt-rotvel-y (degrees -4.8) (degrees 9.6) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -4.8) (degrees 9.6) 1.0) + (sp-flt spt-fade-a -0.21333334) + (sp-rnd-flt spt-accel-y -13.653334 6.826667 1.0) + (sp-rnd-flt spt-friction 0.94 0.04 1.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 40 1 0 #x52d02b00 #x52d02a00 #xb09b00) + ) + (sp-int-plain-rnd spt-next-time 25 149 1) + (sp-launcher-by-id spt-next-launcher 4599) + (sp-rnd-flt spt-conerot-x (degrees 40.0) (degrees 40.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.1) 1.0) + ) + ) + +(defpart 4597 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-flt spt-num 16.0) + (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.4) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.1) (meters 0.4) 1.0) + (sp-rnd-flt spt-r 16.0 8.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-rnd-flt spt-b 24.0 8.0 1.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-rotvel-x (degrees -4.8) (degrees 9.6) 1.0) + (sp-rnd-flt spt-rotvel-y (degrees -4.8) (degrees 9.6) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -4.8) (degrees 9.6) 1.0) + (sp-rnd-flt spt-accel-y -13.653334 6.826667 1.0) + (sp-rnd-flt spt-friction 0.92 0.04 1.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-func spt-func 'check-cargo-piece-ground) + (sp-int spt-next-time 120) + (sp-launcher-by-id spt-next-launcher 4600) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.1) 1.0) + ) + ) + +;; WARN: Return type mismatch number vs none. +(defun check-cargo-piece-ground ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (if (and (>= 0.0 (-> arg2 vector 0 y)) (>= 0.0 (-> arg1 vel-sxvel y))) + (set! (-> arg2 vector 0 y) 0.0) + (set! (-> arg1 next-time) + (the-as uint (* (max 1 (the-as int (-> *display* clock (-> arg1 clock-index) sparticle-data x))) 2)) + ) + ) + (none) + ) + +(defpart 4600 + :init-specs ((sp-flt spt-rot-x 0.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-rotvel-x (degrees 0.0)) + (sp-flt spt-rotvel-y (degrees 0.0)) + (sp-flt spt-rotvel-z (degrees 0.0)) + (sp-flt spt-accel-y 0.0) + (sp-rnd-flt spt-friction 0.8 0.1 1.0) + (sp-int spt-timer 1200) + (sp-int-plain-rnd spt-next-time 300 299 1) + (sp-launcher-by-id spt-next-launcher 4601) + ) + ) + +(defpart 4601 + :init-specs ((sp-flt spt-fade-a -0.21333334) (sp-cpuinfo-flags sp-cpuinfo-flag-2 left-multiply-quat)) + ) + +(defpart 4598 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x52d)) + (sp-flt spt-num 8.0) + (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.05) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-omega 4.096 2.048 1.0) + (sp-rnd-flt spt-vel-y (meters 0.10666667) (meters 0.053333335) 1.0) + (sp-flt spt-fade-a -0.21333334) + (sp-rnd-flt spt-accel-y -13.653334 6.826667 1.0) + (sp-rnd-flt spt-friction 0.94 0.04 1.0) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-func spt-func 'sparticle-motion-blur) + (sp-int-plain-rnd spt-next-time 25 149 1) + (sp-launcher-by-id spt-next-launcher 4599) + (sp-rnd-flt spt-conerot-x (degrees 40.0) (degrees 40.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.1) 1.0) + ) + ) + +(defpart 4599 + :init-specs ((sp-rnd-flt spt-r 64.0 32.0 1.0) + (sp-rnd-flt spt-g 96.0 32.0 1.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-vel-y (meters 0.0033333334) (meters 0.013333334) 1.0) + (sp-int-plain-rnd spt-next-time 5 14 1) + (sp-launcher-by-id spt-next-launcher 4602) + ) + ) + +(defpart 4602 + :init-specs ((sp-flt spt-r 32.0) (sp-rnd-flt spt-g 32.0 16.0 1.0) (sp-rnd-flt spt-b 48.0 16.0 1.0)) + ) + +(defmethod draw hud-cargo ((obj hud-cargo)) + (set-hud-piece-position! + (the-as hud-sprite (-> obj sprites)) + (the int (+ 457.0 (* 130.0 (-> obj offset)))) + 205 + ) + (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -19 27) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +(defmethod update-values hud-cargo ((obj hud-cargo)) + (set! (-> obj values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +(defmethod init-callback hud-cargo ((obj hud-cargo)) + (set! (-> obj level) (level-get *level* 'ctywide)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #x679))) + (set! (-> obj sprites 0 scale-x) 1.2) + (set! (-> obj sprites 0 scale-y) 1.2) + (set! (-> obj sprites 0 flags) (the-as uint 4)) + (alloc-string-if-needed obj 0) + (set! (-> obj strings 0 scale) 0.6) + (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + 0 + (none) + ) + +(set-subtask-hook! + *game-info* + 119 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (or (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 30)) + (let ((a0-3 (level-get-target-inside *level*))) + (when (not (and a0-3 (logtest? (-> a0-3 info level-flags) 1))) + (set! (-> self state-time) (-> self clock frame-counter)) + #t + ) + ) + ) + (suspend) + ) + (talker-spawn-func (-> *talker-speech* 93) *entity-pool* (target-pos 0) (the-as region #f)) + (send-event self 'complete) + (none) + ) + ) + ) + +(deftype city-port-run-mine-info (structure) + ((handle handle :offset-assert 0) + (pos1-x float :offset-assert 8) + (pos1-y float :offset-assert 12) + (pos1-z float :offset-assert 16) + (type uint32 :offset-assert 20) + (pos2-x float :offset-assert 24) + (pos2-y float :offset-assert 28) + (pos2-z float :offset-assert 32) + (speed float :offset-assert 36) + (offset float :offset-assert 40) + (center-x float :offset 8) + (center-y float :offset 12) + (center-z float :offset 16) + (radius float :offset 24) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + + +(define *city-port-run-mine-info* + (new 'static 'boxed-array :type city-port-run-mine-info + (new 'static 'city-port-run-mine-info + :pos1-x 20480.0 + :pos1-y 8192.0 + :pos1-z 6082560.0 + :type #x1 + :pos2-x 20480.0 + :speed 60.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 20480.0 + :pos1-y 8192.0 + :pos1-z 6082560.0 + :type #x1 + :pos2-x 20480.0 + :speed 60.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 914145.25 + :pos1-y 8192.0 + :pos1-z 6415237.0 + :type #x1 + :pos2-x 20480.0 + :speed 60.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 914145.25 + :pos1-y 8192.0 + :pos1-z 6415237.0 + :type #x1 + :pos2-x 20480.0 + :speed 60.0 + :offset 0.1 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 914145.25 + :pos1-y 8192.0 + :pos1-z 6415237.0 + :type #x1 + :pos2-x 32768.0 + :speed -60.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 914145.25 + :pos1-y 8192.0 + :pos1-z 6415237.0 + :type #x1 + :pos2-x 32768.0 + :speed -60.0 + :offset 0.6 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 290611.2 + :pos1-y 8192.0 + :pos1-z 6656123.0 + :type #x1 + :pos2-x 20480.0 + :speed 60.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 290611.2 + :pos1-y 8192.0 + :pos1-z 6656123.0 + :type #x1 + :pos2-x 32768.0 + :speed -60.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 957644.8 + :pos1-y 8192.0 + :pos1-z 7131013.0 + :type #x1 + :pos2-x 28672.0 + :speed 60.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 957644.8 + :pos1-y 8192.0 + :pos1-z 7131013.0 + :type #x1 + :pos2-x 28672.0 + :speed 60.0 + :offset 0.0666 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 957644.8 + :pos1-y 8192.0 + :pos1-z 7131013.0 + :type #x1 + :pos2-x 28672.0 + :speed 60.0 + :offset 0.13333 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 957644.8 + :pos1-y 8192.0 + :pos1-z 7131013.0 + :type #x1 + :pos2-x 28672.0 + :speed 60.0 + :offset 0.2 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 957644.8 + :pos1-y 8192.0 + :pos1-z 7131013.0 + :type #x1 + :pos2-x 28672.0 + :speed 60.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 957644.8 + :pos1-y 8192.0 + :pos1-z 7131013.0 + :type #x1 + :pos2-x 28672.0 + :speed 60.0 + :offset 0.5666 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 957644.8 + :pos1-y 8192.0 + :pos1-z 7131013.0 + :type #x1 + :pos2-x 28672.0 + :speed 60.0 + :offset 0.6333 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 957644.8 + :pos1-y 8192.0 + :pos1-z 7131013.0 + :type #x1 + :pos2-x 28672.0 + :speed 60.0 + :offset 0.7 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 638976.0 + :pos1-y 8192.0 + :pos1-z 7199539.0 + :pos2-x 565248.0 + :pos2-y 8192.0 + :pos2-z 7199539.0 + :speed 3.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 638976.0 + :pos1-y 8192.0 + :pos1-z 7179059.0 + :pos2-x 565248.0 + :pos2-y 8192.0 + :pos2-z 7179059.0 + :speed 3.0 + :offset 0.25 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 638976.0 + :pos1-y 8192.0 + :pos1-z 7138099.0 + :pos2-x 565248.0 + :pos2-y 8192.0 + :pos2-z 7138099.0 + :speed 3.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 638976.0 + :pos1-y 8192.0 + :pos1-z 7117619.0 + :pos2-x 565248.0 + :pos2-y 8192.0 + :pos2-z 7117619.0 + :speed 3.0 + :offset 0.75 + ) + (new 'static 'city-port-run-mine-info + :pos1-x -675840.0 + :pos1-y 8192.0 + :pos1-z 6148096.0 + :pos2-x -634880.0 + :pos2-y 8192.0 + :pos2-z 6184960.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x -659456.0 + :pos1-y 8192.0 + :pos1-z 6193152.0 + :pos2-x -704512.0 + :pos2-y 8192.0 + :pos2-z 6180864.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x -496640.0 + :pos1-y 8192.0 + :pos1-z 6527836.0 + :type #x1 + :pos2-x 20480.0 + :speed 60.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x -496640.0 + :pos1-y 8192.0 + :pos1-z 6527836.0 + :type #x1 + :pos2-x 20480.0 + :speed 60.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info :pos1-x -904806.4 :pos1-y 8192.0 :pos1-z 7407862.0 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -850124.8 :pos1-y 8192.0 :pos1-z 7420231.5 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -862330.9 :pos1-y 8192.0 :pos1-z 7395492.0 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -858193.94 :pos1-y 8192.0 :pos1-z 7370055.5 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -874618.9 :pos1-y 8192.0 :pos1-z 7351255.0 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -890634.25 :pos1-y 8192.0 :pos1-z 7317954.5 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -888340.5 :pos1-y 8192.0 :pos1-z 7338475.5 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -941260.8 :pos1-y 8192.0 :pos1-z 7326597.0 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -937369.6 :pos1-y 8192.0 :pos1-z 7359037.5 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -914432.0 :pos1-y 8192.0 :pos1-z 7380254.5 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -904601.6 :pos1-y 8192.0 :pos1-z 7444848.5 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -841850.9 :pos1-y 8192.0 :pos1-z 7431291.0 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -815595.5 :pos1-y 8192.0 :pos1-z 7410524.0 :type #x1) + (new 'static 'city-port-run-mine-info + :pos1-x -252436.48 + :pos1-y 8192.0 + :pos1-z 7127122.0 + :type #x1 + :pos2-x 24576.0 + :speed 90.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x -252436.48 + :pos1-y 8192.0 + :pos1-z 7127122.0 + :type #x1 + :pos2-x 24576.0 + :speed 90.0 + :offset 0.25 + ) + (new 'static 'city-port-run-mine-info + :pos1-x -252436.48 + :pos1-y 8192.0 + :pos1-z 7127122.0 + :type #x1 + :pos2-x 24576.0 + :speed 90.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info + :pos1-x -252436.48 + :pos1-y 8192.0 + :pos1-z 7127122.0 + :type #x1 + :pos2-x 24576.0 + :speed 90.0 + :offset 0.75 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1124556.8 + :pos1-y 8192.0 + :pos1-z 7651123.0 + :type #x1 + :pos2-x 24576.0 + :speed 90.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1124556.8 + :pos1-y 8192.0 + :pos1-z 7651123.0 + :type #x1 + :pos2-x 36864.0 + :speed 90.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1124556.8 + :pos1-y 8192.0 + :pos1-z 7651123.0 + :type #x1 + :pos2-x 24576.0 + :speed 90.0 + :offset 0.33 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1124556.8 + :pos1-y 8192.0 + :pos1-z 7651123.0 + :type #x1 + :pos2-x 36864.0 + :speed 90.0 + :offset 0.33 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1124556.8 + :pos1-y 8192.0 + :pos1-z 7651123.0 + :type #x1 + :pos2-x 24576.0 + :speed 90.0 + :offset 0.66 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1124556.8 + :pos1-y 8192.0 + :pos1-z 7651123.0 + :type #x1 + :pos2-x 36864.0 + :speed 90.0 + :offset 0.66 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1269760.0 + :pos1-y 8192.0 + :pos1-z 6209536.0 + :pos2-x 1269760.0 + :pos2-y 8192.0 + :pos2-z 6225920.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1269760.0 + :pos1-y 8192.0 + :pos1-z 6221824.0 + :pos2-x 1269760.0 + :pos2-y 8192.0 + :pos2-z 6238208.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1269760.0 + :pos1-y 8192.0 + :pos1-z 6234112.0 + :pos2-x 1269760.0 + :pos2-y 8192.0 + :pos2-z 6250496.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1269760.0 + :pos1-y 8192.0 + :pos1-z 6393856.0 + :pos2-x 1269760.0 + :pos2-y 8192.0 + :pos2-z 6410240.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1269760.0 + :pos1-y 8192.0 + :pos1-z 6406144.0 + :pos2-x 1269760.0 + :pos2-y 8192.0 + :pos2-z 6422528.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1269760.0 + :pos1-y 8192.0 + :pos1-z 6418432.0 + :pos2-x 1269760.0 + :pos2-y 8192.0 + :pos2-z 6434816.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1302528.0 + :pos1-y 8192.0 + :pos1-z 6209536.0 + :pos2-x 1302528.0 + :pos2-y 8192.0 + :pos2-z 6225920.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1302528.0 + :pos1-y 8192.0 + :pos1-z 6221824.0 + :pos2-x 1302528.0 + :pos2-y 8192.0 + :pos2-z 6238208.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1302528.0 + :pos1-y 8192.0 + :pos1-z 6234112.0 + :pos2-x 1302528.0 + :pos2-y 8192.0 + :pos2-z 6250496.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1302528.0 + :pos1-y 8192.0 + :pos1-z 6393856.0 + :pos2-x 1302528.0 + :pos2-y 8192.0 + :pos2-z 6410240.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1302528.0 + :pos1-y 8192.0 + :pos1-z 6406144.0 + :pos2-x 1302528.0 + :pos2-y 8192.0 + :pos2-z 6422528.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1302528.0 + :pos1-y 8192.0 + :pos1-z 6418432.0 + :pos2-x 1302528.0 + :pos2-y 8192.0 + :pos2-z 6434816.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1286144.0 + :pos1-y 8192.0 + :pos1-z 6332416.0 + :type #x1 + :pos2-x 20480.0 + :speed 60.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1207746.5 + :pos1-y 8192.0 + :pos1-z 5807309.0 + :type #x1 + :pos2-x 32768.0 + :speed 60.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1207746.5 + :pos1-y 8192.0 + :pos1-z 5807309.0 + :type #x1 + :pos2-x 32768.0 + :speed 60.0 + :offset 0.25 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1207746.5 + :pos1-y 8192.0 + :pos1-z 5807309.0 + :type #x1 + :pos2-x 32768.0 + :speed 60.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1207746.5 + :pos1-y 8192.0 + :pos1-z 5807309.0 + :type #x1 + :pos2-x 32768.0 + :speed 60.0 + :offset 0.75 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1573314.5 + :pos1-y 8192.0 + :pos1-z 5622292.5 + :type #x1 + :pos2-x 32768.0 + :speed 120.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1573314.5 + :pos1-y 8192.0 + :pos1-z 5622292.5 + :type #x1 + :pos2-x 32768.0 + :speed 120.0 + :offset 0.1 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1573314.5 + :pos1-y 8192.0 + :pos1-z 5622292.5 + :type #x1 + :pos2-x 32768.0 + :speed 120.0 + :offset 0.2 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1822064.6 + :pos1-y 8192.0 + :pos1-z 6100050.0 + :type #x1 + :pos2-x 32768.0 + :speed 90.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1822064.6 + :pos1-y 8192.0 + :pos1-z 6100050.0 + :type #x1 + :pos2-x 32768.0 + :speed 90.0 + :offset 0.25 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1822064.6 + :pos1-y 8192.0 + :pos1-z 6100050.0 + :type #x1 + :pos2-x 32768.0 + :speed 90.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1822064.6 + :pos1-y 8192.0 + :pos1-z 6100050.0 + :type #x1 + :pos2-x 32768.0 + :speed 90.0 + :offset 0.75 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1822064.6 + :pos1-y 8192.0 + :pos1-z 6100050.0 + :type #x1 + :pos2-x 45056.0 + :speed 90.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1822064.6 + :pos1-y 8192.0 + :pos1-z 6100050.0 + :type #x1 + :pos2-x 45056.0 + :speed 90.0 + :offset 0.25 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1822064.6 + :pos1-y 8192.0 + :pos1-z 6100050.0 + :type #x1 + :pos2-x 45056.0 + :speed 90.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1822064.6 + :pos1-y 8192.0 + :pos1-z 6100050.0 + :type #x1 + :pos2-x 45056.0 + :speed 90.0 + :offset 0.75 + ) + ) + ) + +(defskelgroup skel-ctyport-mine ctyport-mine ctyport-mine-lod0-jg ctyport-mine-idle-ja + ((ctyport-mine-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + ) + +(deftype ctyport-mine (process-drawable) + ((root-override collide-shape-moving :offset 128) + (info city-port-run-mine-info :offset-assert 200) + (base-height float :offset-assert 204) + (center vector :inline :offset-assert 208) + (time-skew uint64 :offset-assert 224) + (period float :offset-assert 232) + (trans-y float :offset-assert 236) + (speed-y float :offset-assert 240) + (acc-y float :offset-assert 244) + (beep basic :offset-assert 248) + (beep-time time-frame :offset-assert 256) + (beep-color vector :inline :offset-assert 272) + ) + :heap-base #xa0 + :method-count-assert 24 + :size-assert #x120 + :flag-assert #x1800a00120 + (:methods + (idle () _type_ :state 20) + (die () _type_ :state 21) + (fall () _type_ :state 22) + (ctyport-mine-method-23 (_type_) none 23) + ) + ) + + +;; WARN: Return type mismatch float vs none. +(defmethod ctyport-mine-method-23 ctyport-mine ((obj ctyport-mine)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (get-base-height *ocean-map-city*) + (let ((f0-1 (-> obj period)) + (t9-1 sin-rad) + (f1-0 -3.1415925) + (f2-0 6.283185) + (f3-1 (the float (+ (-> pp clock frame-counter) (the-as time-frame (-> obj time-skew))))) + ) + (t9-1 (+ f1-0 (* f2-0 (/ (- f3-1 (* (the float (the int (/ f3-1 f0-1))) f0-1)) f0-1)))) + ) + (let ((s5-0 (-> obj info))) + (cond + ((zero? (-> obj info type)) + (let* ((f0-8 + (+ (* 2.0 (-> s5-0 offset)) (/ (* 0.0033333334 (the float (-> pp clock frame-counter))) (-> s5-0 speed))) + ) + (f0-9 (- f0-8 (* (the float (the int (/ f0-8 2.0))) 2.0))) + ) + (if (< 1.0 f0-9) + (set! f0-9 (- 2.0 f0-9)) + ) + (let ((f0-13 (* 0.5 (- 1.0 (cos (* 32768.0 f0-9)))))) + (let ((v1-23 (-> obj root-override trans)) + (a0-5 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-5 x) (-> s5-0 pos1-x)) + (set! (-> a0-5 y) (-> s5-0 pos1-y)) + (set! (-> a0-5 z) (-> s5-0 pos1-z)) + (set! (-> a0-5 w) 1.0) + (vector-float*! v1-23 a0-5 f0-13) + ) + (let ((s4-0 (-> obj root-override trans))) + (let ((v1-27 (-> obj root-override trans))) + (let ((a0-6 (new 'stack-no-clear 'vector))) + (set! (-> a0-6 x) (-> s5-0 pos2-x)) + (set! (-> a0-6 y) (-> s5-0 pos2-y)) + (set! (-> a0-6 z) (-> s5-0 pos2-z)) + (set! (-> a0-6 w) 1.0) + (let ((a1-3 (- 1.0 f0-13))) + (.mov vf7 a1-3) + ) + (.lvf vf5 (&-> a0-6 quad)) + ) + (.lvf vf4 (&-> v1-27 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s4-0 quad) vf6) + ) + ) + ) + ) + (else + (let ((s4-1 (-> obj root-override trans))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 x) (-> s5-0 pos1-x)) + (set! (-> s3-0 y) (-> s5-0 pos1-y)) + (set! (-> s3-0 z) (-> s5-0 pos1-z)) + (set! (-> s3-0 w) 1.0) + (let ((v1-35 (vector-rotate-around-y! + (new 'stack-no-clear 'vector) + *x-vector* + (+ (* 182.04445 (* 360.0 (-> s5-0 offset))) + (* 0.60681486 (-> s5-0 speed) (the float (-> pp clock frame-counter))) + ) + ) + ) + ) + (let ((a0-8 (-> s5-0 pos2-x))) + (.mov vf7 a0-8) + ) + (.lvf vf5 (&-> v1-35 quad)) + ) + (.lvf vf4 (&-> s3-0 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s4-1 quad) vf6) + ) + ) + ) + ) + (+! (-> obj speed-y) (* 10.0 + (-> pp clock seconds-per-frame) + (- (get-height *ocean* (-> obj root-override trans) #t) (-> obj trans-y)) + ) + ) + (set! (-> obj speed-y) (- (-> obj speed-y) (* (-> obj speed-y) (-> pp clock seconds-per-frame)))) + (set! (-> obj speed-y) (- (-> obj speed-y) (* 4096.0 (-> pp clock seconds-per-frame)))) + (+! (-> obj trans-y) (* (-> obj speed-y) (-> pp clock seconds-per-frame))) + (set! (-> obj root-override trans y) (+ 2048.0 (-> obj trans-y))) + (none) + ) + ) + ) + +(defstate die (ctyport-mine) + :virtual #t + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self beep-time) 0) + 0 + (none) + ) + :code (behavior () + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 3)) + (suspend) + ) + ) + (cleanup-for-death self) + (none) + ) + :post (behavior () + (cond + ((and (-> self beep) (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1))) + (vector-seek! (-> self beep-color) *null-vector* (* 4.0 (-> self clock seconds-per-frame))) + (when (< (-> self beep-time) (-> self clock frame-counter)) + (sound-play "cargo-beep") + (set-vector! (-> self beep-color) 1.0 1.0 1.0 1.0) + (set! (-> self beep-time) + (+ (-> self clock frame-counter) + (the int (* 0.2 (the float (- (seconds 1) (- (-> self clock frame-counter) (-> self state-time)))))) + ) + ) + ) + (set! (-> self draw color-emissive quad) (-> self beep-color quad)) + ) + ((not (logtest? (-> self draw status) (draw-control-status no-draw))) + (send-event (ppointer->process (-> self parent)) 'mine-dead) + (let ((v1-27 (-> self root-override root-prim))) + (set! (-> v1-27 prim-core collide-as) (collide-spec)) + (set! (-> v1-27 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (sound-play "port-cargo-mine") + (cond + ((-> self beep) + (let ((gp-2 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-2 spawn-point quad) (-> self root-override trans quad)) + (quaternion-copy! (-> gp-2 spawn-quat) (-> self root-override quat)) + (set! (-> gp-2 radius) 32768.0) + (set! (-> gp-2 group) (-> *part-group-id-table* 161)) + (set! (-> gp-2 collide-with) (collide-spec jak crate hit-by-others-list player-list)) + (set! (-> gp-2 penetrate-using) (penetrate explode)) + (explosion-spawn self explosion gp-2) + ) + ) + (else + (process-spawn touch-tracker :init touch-tracker-init (-> self root-override trans) #x46400000 30 :to self) + (let ((gp-4 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-4 + (let ((t9-12 (method-of-type part-tracker activate))) + (t9-12 (the-as part-tracker gp-4) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-13 run-function-in-process) + (a0-31 gp-4) + (a1-14 part-tracker-init) + (a2-14 (-> *part-group-id-table* 161)) + (a3-5 0) + (t0-3 #f) + (t1-2 #f) + (t2-2 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> self root-override trans quad)) + ((the-as (function object object object object object object object object none) t9-13) + a0-31 + a1-14 + a2-14 + a3-5 + t0-3 + t1-2 + t2-2 + t3-0 + ) + ) + (-> gp-4 ppointer) + ) + ) + ) + ) + ) + ) + (ctyport-mine-method-23 self) + (transform-post) + (none) + ) + ) + +(defstate fall (ctyport-mine) + :virtual #t + :enter (behavior () + (set! (-> self acc-y) (* 4096.0 (+ 8.0 (* 8.0 (rand-vu))))) + (none) + ) + :code (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (until #f + (suspend) + (when (< (-> self trans-y) -163840.0) + #t + (goto cfg-5) + ) + ) + #f + (label cfg-5) + (deactivate self) + (none) + ) + :post (behavior () + (set! (-> self speed-y) (- (-> self speed-y) (* (-> self speed-y) (-> self clock seconds-per-frame)))) + (set! (-> self speed-y) (- (-> self speed-y) (* (-> self acc-y) (-> self clock seconds-per-frame)))) + (+! (-> self trans-y) (* (-> self speed-y) (-> self clock seconds-per-frame))) + (set! (-> self root-override trans y) (+ 2048.0 (-> self trans-y))) + (transform-post) + (none) + ) + ) + +(defstate idle (ctyport-mine) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('touched 'touch 'attack) + (cond + ((logtest? (process-mask projectile vehicle) (-> proc mask)) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer self)) + (set! (-> a1-7 num-params) 2) + (set! (-> a1-7 message) 'attack) + (set! (-> a1-7 param 0) (-> event param 0)) + (let ((v1-7 (new 'static 'attack-info :mask (attack-info-mask mode id)))) + (let* ((a2-4 *game-info*) + (a3-2 (+ (-> a2-4 attack-id) 1)) + ) + (set! (-> a2-4 attack-id) a3-2) + (set! (-> v1-7 id) a3-2) + ) + (set! (-> v1-7 mode) 'mine) + (set! (-> a1-7 param 1) (the-as uint v1-7)) + ) + (send-event-function proc a1-7) + ) + (set! (-> self beep) #f) + ) + (else + (set! (-> self beep) (the-as basic #t)) + ) + ) + (go-virtual die) + ) + (('fall) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual fall) + ) + ) + ) + :code (the-as (function none :behavior ctyport-mine) transform-and-sleep-code) + :post (behavior () + (ctyport-mine-method-23 self) + (transform-post) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior ctyport-mine-init-by-other ctyport-mine ((arg0 city-port-run-mine-info)) + (stack-size-set! (-> self main-thread) 32) + (let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list tobot)) + (set! (-> v1-8 prim-core action) (collide-action solid deadly)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 8192.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> s5-0 event-self) 'touched) + (set! (-> self root-override) s5-0) + ) + (set! (-> self info) arg0) + (set! (-> arg0 handle) (process->handle self)) + (logior! (-> self mask) (process-mask actor-pause)) + (set! (-> self mask) (logior (process-mask crate) (-> self mask))) + (set-vector! (-> self root-override trans) (-> arg0 pos1-x) (-> arg0 pos1-y) (-> arg0 pos1-z) 1.0) + (quaternion-copy! (-> self root-override quat) *unity-quaternion*) + (vector-identity! (-> self root-override scale)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyport-mine" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> self base-height) 0.0) + (set! (-> self time-skew) (the-as uint (the int (* 300.0 (rand-vu-float-range 0.1 1.4))))) + (set! (-> self period) (* 300.0 (rand-vu-float-range 1.2 1.8))) + (set! (-> self center quad) (-> self root-override trans quad)) + (set! (-> self root-override pause-adjust-distance) 532480.0) + (set! (-> self trans-y) (-> self root-override trans y)) + (go-virtual idle) + (none) + ) + +(defun ctyport-mine-spawn ((arg0 task-manager) (arg1 city-port-run-mine-info)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn ctyport-mine arg1 :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + gp-0 + ) + ) + +(deftype ctyport-spy (process-drawable) + ((trans-y float :offset-assert 200) + ) + :heap-base #x50 + :method-count-assert 21 + :size-assert #xcc + :flag-assert #x15005000cc + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-ctyport-spy ctyport-spy ctyport-spy-lod0-jg ctyport-spy-idle-ja + ((ctyport-spy-lod0-mg (meters 20)) (ctyport-spy-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defstate idle (ctyport-spy) + :virtual #t + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.3)) + (+! (-> self trans-y) (* (-> self root transv y) (-> self clock seconds-per-frame))) + (+! (-> self root transv y) (* -8.0 (-> self clock seconds-per-frame) (-> self root transv y))) + (set! (-> self root trans y) + (+ (-> self trans-y) + (* 1024.0 + (+ (sin (* 182.04445 (* 50.0 (+ 10.0 (* 0.0033333334 (the float (-> self clock frame-counter))))))) + (cos (* 182.04445 (* -80.0 (- 40.0 (* 0.0033333334 (the float (-> self clock frame-counter))))))) + ) + ) + ) + ) + (let ((gp-0 (new 'stack-no-clear 'quaternion))) + (let ((s5-0 quaternion-zxy!) + (s4-0 gp-0) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 x) + (* 182.04445 (* 5.0 (sin (* 182.04445 (* 0.33333334 (the float (-> self clock frame-counter))))))) + ) + (set! (-> s3-0 y) + (* 182.04445 + (* 5.0 (sin (* 182.04445 (* 50.0 (+ 10.0 (* 0.0033333334 (the float (-> self clock frame-counter)))))))) + ) + ) + (set! (-> s3-0 z) 0.0) + (set! (-> s3-0 w) 1.0) + (s5-0 s4-0 s3-0) + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) gp-0 0.1) + ) + ) + (none) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) + :num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior ctyport-spy) ja-post) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior ctyport-spy-init-by-other ctyport-spy ((arg0 vector)) + (stack-size-set! (-> self main-thread) 32) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + (set! (-> self mask) (logior (process-mask crate) (-> self mask))) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyport-spy" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> self trans-y) (-> self root trans y)) + (set-vector! (-> self root transv) 0.0 81920.0 0.0 1.0) + (go-virtual idle) + (none) + ) + +(defun ctyport-spy-spawn ((arg0 process) (arg1 vector) (arg2 vector) (arg3 float)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn ctyport-spy arg1 :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + gp-0 + ) + ) + +(deftype ctyport-cargo (process-focusable) + ((minimap connection-minimap :offset-assert 204) + (trans-y float :offset-assert 208) + (speed-y float :offset-assert 212) + ) + :heap-base #x60 + :method-count-assert 31 + :size-assert #xd8 + :flag-assert #x1f006000d8 + (:methods + (idle () _type_ :state 27) + (focus-camera () _type_ :state 28) + (die () _type_ :state 29) + (ctyport-cargo-method-30 (_type_) none 30) + ) + ) + + +(define *city-port-position* (new 'static 'vector :x 413696.0 :y 32768.0 :z 6676480.0 :w 1.0)) + +(defskelgroup skel-ctyport-cargo ctyport-cargo ctyport-cargo-lod0-jg ctyport-cargo-idle-ja + ((ctyport-cargo-lod0-mg (meters 20)) (ctyport-cargo-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defskelgroup skel-ctyport-cargo-explode ctyport-cargo ctyport-cargo-explode-lod0-jg ctyport-cargo-explode-idle-ja + ((ctyport-cargo-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +(define *ctyport-cargo-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + ) + :collide-spec #x1 + ) + ) + +(defstate idle (ctyport-cargo) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (case event-type + (('attack) + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-0 fountain-rand-transv-lo quad) (-> (target-pos 0) quad)) + (set! (-> gp-0 fountain-rand-transv-hi x) 40960.0) + (set! (-> gp-0 fountain-rand-transv-hi y) 122880.0) + (set! (-> self draw bounds w) 163840.0) + (let ((v1-9 (-> self root-override root-prim))) + (set! (-> v1-9 prim-core collide-as) (collide-spec)) + (set! (-> v1-9 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when s5-1 + (let ((t9-3 (method-of-type part-tracker activate))) + (t9-3 + (the-as part-tracker s5-1) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((t9-4 run-function-in-process) + (a0-8 s5-1) + (a1-4 part-tracker-init) + (a2-6 (-> *part-group-id-table* 1057)) + (a3-2 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> self root-override trans quad)) + ((the-as (function object object object object object object object object none) t9-4) + a0-8 + a1-4 + a2-6 + a3-2 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> s5-1 ppointer) + ) + ) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-ctyport-cargo-explode" (the-as (pointer uint32) #f)) + 6 + gp-0 + *ctyport-cargo-exploder-params* + :to self + ) + ) + (sound-play "cargo-explode") + (go-virtual die) + ) + (('spy) + (let ((t9-12 ctyport-spy-spawn) + (a0-17 self) + (a1-10 (new 'stack-no-clear 'vector)) + (v1-33 (-> self root-override trans)) + (a2-14 *up-vector*) + (a3-7 4096.0) + ) + (.mov vf7 a3-7) + (.lvf vf5 (&-> a2-14 quad)) + (.lvf vf4 (&-> v1-33 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-10 quad) vf6) + (t9-12 a0-17 a1-10 a2-14 a3-7) + ) + ) + (('focus-camera) + (go-virtual focus-camera) + ) + ) + ) + ) + :trans (behavior () + (+! (-> self speed-y) (* 10.0 + (-> self clock seconds-per-frame) + (- (get-height *ocean* (-> self root-override trans) #t) (-> self trans-y)) + ) + ) + (set! (-> self speed-y) (- (-> self speed-y) (* (-> self speed-y) (-> self clock seconds-per-frame)))) + (set! (-> self speed-y) (- (-> self speed-y) (* 409.6 (-> self clock seconds-per-frame)))) + (+! (-> self trans-y) (* (-> self speed-y) (-> self clock seconds-per-frame))) + (set! (-> self root-override trans y) (-> self trans-y)) + (none) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior ctyport-cargo) transform-post) + ) + +(defmethod ctyport-cargo-method-30 ctyport-cargo ((obj ctyport-cargo)) + (send-event *camera* 'change-target obj) + (let ((gp-0 (new 'stack 'transformq))) + (vector+! (-> gp-0 trans) (-> obj root-override trans) (new 'static 'vector :y 16384.0 :z 28672.0 :w 1.0)) + (set-vector! (-> gp-0 scale) 1.0 1.0 1.0 1.0) + (quaternion-zxy! (-> gp-0 quat) (new 'static 'vector :x 1820.4445 :y 32768.0 :w 1.0)) + (send-event *camera* 'teleport-to-transformq gp-0) + ) + 0 + (none) + ) + +(defstate focus-camera (ctyport-cargo) + :virtual #t + :exit (behavior () + (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) + (remove-setting! 'interp-time) + (remove-setting! 'mode-name) + (none) + ) + :trans (behavior () + (set! (-> self root-override trans y) + (+ (-> self trans-y) + (* 1024.0 + (+ (sin (* 182.04445 (* 150.0 (+ 10.0 (* 0.0033333334 (the float (-> self clock frame-counter))))))) + (cos (* 182.04445 (* -80.0 (- 40.0 (* 0.0033333334 (the float (-> self clock frame-counter))))))) + ) + ) + ) + ) + (none) + ) + :code (behavior () + (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'mode-name 'cam-fixed 0 0) + (suspend) + (ctyport-cargo-method-30 self) + (ja-no-eval :group! (ja-group) + :num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (suspend) + ) + #f + (none) + ) + :post (the-as (function none :behavior ctyport-cargo) ja-post) + ) + +(defstate die (ctyport-cargo) + :virtual #t + :code (behavior () + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 1)) + (suspend) + ) + ) + (cleanup-for-death self) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior ctyport-cargo-init-by-other ctyport-cargo ((arg0 vector) (arg1 nav-mesh)) + (stack-size-set! (-> self main-thread) 32) + (let ((s4-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list tobot)) + (set! (-> v1-8 prim-core action) (collide-action solid rideable)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 4096.0 0.0 6144.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-8) + ) + (set! (-> s4-0 nav-radius) 40960.0) + (let ((v1-10 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> s4-0 penetrated-by) + (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + dark-punch + dark-giant + knocked + ) + ) + (set! (-> self root-override) s4-0) + ) + (add-process-drawable-to-navmesh arg1 self #t) + (set! (-> self root-override trans quad) (-> arg0 quad)) + (set-vector! (-> self root-override scale) 1.0 1.0 1.0 1.0) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 16) (the-as int #f) (the-as vector #t) 0)) + (set! (-> self mask) (logior (process-mask crate) (-> self mask))) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyport-cargo" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> self trans-y) (-> self root-override trans y)) + (go-virtual idle) + (none) + ) + +(defun ctyport-cargo-spawn ((arg0 task-manager) (arg1 vector) (arg2 nav-mesh)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn ctyport-cargo arg1 arg2 :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + gp-0 + ) + ) + +(deftype city-port-run-cargo-info (structure) + ((pos vector :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +(define *city-port-run-cargo-info* + (new 'static 'boxed-array :type city-port-run-cargo-info + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 20480.0 :y 8192.0 :z 6082560.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 290611.2 :y 8192.0 :z 6656123.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 957644.8 :y 8192.0 :z 7131013.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 611450.9 :y 8192.0 :z 7158579.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x -496640.0 :y 8192.0 :z 6527836.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 1207746.5 :y 8192.0 :z 5807309.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 1822064.6 :y 8192.0 :z 6100050.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 1286144.0 :y 8192.0 :z 6332416.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 1286144.0 :y 8192.0 :z 6415769.5 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 1286144.0 :y 8192.0 :z 6229811.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 914145.25 :y 8192.0 :z 6415237.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 1124556.8 :y 8192.0 :z 7651123.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x -252436.48 :y 8192.0 :z 7127122.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x -898539.5 :y 8192.0 :z 7363748.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x -674406.4 :y 8192.0 :z 6178652.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 1573314.5 :y 8192.0 :z 5622292.5 :w 1.0)) + ) + ) + +(set-subtask-hook! + *game-info* + 120 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (if (task-node-closed? (game-task-node city-port-run-resolution)) + (go-virtual complete) + ) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) + (let ((gp-0 *traffic-manager*) + (s5-0 (new 'stack 'traffic-object-spawn-params)) + ) + (set! (-> s5-0 position quad) (-> self begin-pos quad)) + (quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 0.0) + (set! (-> s5-0 object-type) (the-as uint 13)) + (set! (-> s5-0 behavior) (the-as uint 0)) + (set! (-> s5-0 id) (the-as uint 0)) + (set! (-> s5-0 proc) #f) + (send-event gp-0 'spawn-object s5-0) + ) + (set! (-> self max-count) (-> *city-port-run-cargo-info* length)) + (set! (-> self count) (-> self max-count)) + (set! (-> *game-info* counter) (the float (-> self max-count))) + (dotimes (v1-17 (-> *city-port-run-mine-info* length)) + (set! (-> *city-port-run-mine-info* v1-17 handle) (the-as handle #f)) + ) + (set! (-> self minimap 0) #f) + (dotimes (v1-20 (-> self max-count)) + (set! (-> self data-int32 v1-20) 0) + (set! (-> self slave v1-20) (the-as handle #f)) + ) + (set! (-> self data-int32 20) 0) + (set! (-> self data-int32 21) 0) + (set! (-> self data-int32 22) 0) + 0 + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 120 + 1 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *traffic-manager* 'restore-default-settings) + (dotimes (v1-3 (-> *city-port-run-mine-info* length)) + (set! (-> *city-port-run-mine-info* v1-3 handle) (the-as handle #f)) + ) + (set! (-> self minimap 0) #f) + (dotimes (v1-6 (-> self max-count)) + (set! (-> self data-int32 v1-6) 0) + (set! (-> self slave v1-6) (the-as handle #f)) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 120 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (when (task-node-open? (game-task-node city-port-run-resolution)) + (check-time self) + (cond + ((= (level-status *level* 'ctyport) 'active) + (when (zero? (-> self data-int32 21)) + (set! (-> self data-int32 21) 1) + (dotimes (gp-1 (-> *city-port-run-mine-info* length)) + (let ((a1-1 (-> *city-port-run-mine-info* gp-1))) + (if (or (zero? (-> a1-1 handle)) (not (handle->process (-> a1-1 handle)))) + (ctyport-mine-spawn self a1-1) + ) + ) + ) + ) + ) + (else + (dotimes (gp-2 (-> *city-port-run-mine-info* length)) + (let ((s5-0 (-> *city-port-run-mine-info* gp-2))) + (when (and (nonzero? (-> s5-0 handle)) (handle->process (-> s5-0 handle))) + (deactivate (-> s5-0 handle process 0)) + (set! (-> s5-0 handle) (the-as handle #f)) + ) + ) + ) + ) + ) + (cond + ((zero? (-> self data-int32 20)) + (cond + ((= (level-status *level* 'ctyport) 'active) + (let ((gp-4 (get-nav-mesh (the-as actor-id #x65e1)))) + (dotimes (s5-1 (-> self max-count)) + (cond + ((zero? (-> self data-int32 s5-1)) + (when (not (-> self slave s5-1)) + (let ((a0-18 (ctyport-cargo-spawn self (-> *city-port-run-cargo-info* s5-1 pos) gp-4))) + (if a0-18 + (set! (-> self slave s5-1) (process->handle a0-18)) + ) + ) + ) + ) + (else + (set! (-> self slave s5-1) (the-as handle #f)) + ) + ) + ) + ) + (set! (-> self count) 0) + (dotimes (v1-61 (-> self max-count)) + (if (or (not (-> self slave v1-61)) (handle->process (-> self slave v1-61))) + (+! (-> self count) 1) + (set! (-> self data-int32 v1-61) 1) + ) + ) + (when (-> self minimap 0) + (logior! (-> self minimap 0 flags) (minimap-flag fade-out)) + (set! (-> self minimap 0) #f) + ) + ) + (else + (dotimes (gp-5 (-> self max-count)) + (when (-> self slave gp-5) + (deactivate (-> self slave gp-5 process 0)) + (set! (-> self slave gp-5) (the-as handle #f)) + ) + ) + (set! (-> self data-int32 21) 0) + (if (not (-> self minimap 0)) + (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 15) (the-as int #f) *city-port-position* 0)) + ) + ) + ) + ) + (else + (set! (-> self count) 0) + (dotimes (v1-90 (-> self max-count)) + (if (handle->process (-> self slave v1-90)) + (+! (-> self count) 1) + (set! (-> self data-int32 v1-90) 1) + ) + ) + ) + ) + (let ((v1-93 0)) + (dotimes (a0-48 (-> *city-port-run-mine-info* length)) + (let ((a1-21 (-> *city-port-run-mine-info* a0-48))) + (if (and (nonzero? (-> a1-21 handle)) (handle->process (-> a1-21 handle))) + (+! v1-93 1) + ) + ) + ) + ) + (cond + ((and (= (-> self count) (-> self max-count)) (zero? (-> self data-int32 22))) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + ((and (or (and (zero? (-> self data-int32 20)) (= (-> self count) (+ (-> self max-count) -1))) + (= (-> self data-int32 22) 1) + ) + (task-node-open? (game-task-node city-port-run-resolution)) + ) + (set-setting! 'exclusive-task #f 0 (-> self node-info task)) + (set! (-> self data-int32 20) 1) + (+! (-> self data-int32 22) 1) + (set! (-> self time-limit) (seconds 135)) + (set! (-> self start-time) (-> self clock frame-counter)) + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-cargo :init hud-init-by-other :to self))) + ) + ) + (set! (-> *game-info* counter) (the float (-> self count))) + (when (= (-> self data-int32 20) 1) + (let ((v1-130 (level-get *level* 'ctyport))) + (when (or (not v1-130) (!= (-> v1-130 display?) 'display)) + (backup-load-state-and-set-cmds *load-state* '()) + (eval! + (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) + '(want-display 'ctyport 'display) + ) + (restore-load-state-and-cleanup *load-state*) + (go-virtual fail) + ) + ) + ) + ) + (when (zero? (-> self count)) + (cond + ((not (task-node-closed? (game-task-node city-port-run-resolution))) + (talker-spawn-func (-> *talker-speech* 94) *entity-pool* (target-pos 0) (the-as region #f)) + (task-node-close! (game-task-node city-port-run-resolution)) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + (send-event (handle->process (-> self hud-counter)) 'hide-and-die) + (set! (-> self fail-on-death?) #f) + (dotimes (gp-8 (-> *city-port-run-mine-info* length)) + (let ((v1-161 (-> *city-port-run-mine-info* gp-8))) + (if (handle->process (-> v1-161 handle)) + (send-event (handle->process (-> v1-161 handle)) 'fall) + ) + ) + ) + ) + (else + (let ((v1-168 0)) + (dotimes (a0-96 (-> *city-port-run-mine-info* length)) + (if (handle->process (-> *city-port-run-mine-info* a0-96 handle)) + (+! v1-168 1) + ) + ) + (if (zero? v1-168) + (go-virtual complete) + ) + ) + ) + ) + ) + (none) + ) + ) + ) + +(set-subtask-hook! *game-info* 120 6 (the-as (function object) (lambda :behavior task-manager + ((arg0 object) (arg1 object) (arg2 symbol)) + (case arg2 + (('mine-dead) + (format #t "mine-dead~%") + (+! (-> self data-int32 22) 1) + ) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 120 + 3 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *traffic-manager* 'set-target-level #x3f800000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (send-event *traffic-manager* 'set-alert-level 1) + (send-event *traffic-manager* 'set-alert-duration #xa4cb80) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 120 + 5 + (the-as + (function object) + (lambda :behavior task-manager + () + (when (< (- (-> self time-limit) (- (-> self clock frame-counter) (-> self start-time))) 0) + (let ((gp-0 #f)) + (dotimes (s5-0 (-> self max-count)) + (when (zero? (-> self data-int32 s5-0)) + (when (-> self slave s5-0) + (let* ((s3-0 (handle->process (-> self slave s5-0))) + (s4-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when (not gp-0) + (set! gp-0 #t) + (send-event s4-0 'focus-camera) + ) + (send-event s4-0 'spy) + ) + ) + ) + ) + ) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 2)) + (suspend) + ) + ) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 120 + 4 + (the-as (function object) (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (suspend) + ) + (task-node-close! (game-task-node city-port-run-post-win)) + (none) + ) + ) + ) diff --git a/goal_src/jak2/levels/common/entities/com-elevator.gc b/goal_src/jak2/levels/common/entities/com-elevator.gc index 108d79832..3f3a91298 100644 --- a/goal_src/jak2/levels/common/entities/com-elevator.gc +++ b/goal_src/jak2/levels/common/entities/com-elevator.gc @@ -7,3 +7,334 @@ ;; DECOMP BEGINS +(deftype com-elevator (elevator) + ((camera-startup vector 2 :inline :offset-assert 368) + (use-camera-startup? symbol 2 :offset-assert 400) + (sound-id sound-id :offset-assert 408) + ) + :heap-base #x120 + :method-count-assert 50 + :size-assert #x19c + :flag-assert #x320120019c + (:methods + (com-elevator-method-49 (_type_ symbol) none 49) + ) + ) + + +(defskelgroup skel-com-elevator com-elevator com-elevator-lod0-jg com-elevator-idle-ja + ((com-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 5.6 9.2) + ) + +(defmethod get-art-group com-elevator ((obj com-elevator)) + "@returns The associated [[art-group]]" + (art-group-get-by-name *level* "skel-com-elevator" (the-as (pointer uint32) #f)) + ) + +(defmethod move-between-points com-elevator ((obj com-elevator) (arg0 vector) (arg1 float) (arg2 float)) + "Move between two points on the elevator's path +@param vec TODO not sure +@param point-a The first point fetched from the elevator's path +@param point-b The second point fetched from the path +@see [[path-control]] and [[elevator]]" + (let ((s4-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg1 'interp)) + (a0-3 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg2 'interp)) + (v1-3 (-> obj root-override trans)) + ) + (when (and (< (-> a0-3 y) (-> s4-0 y)) (< (-> arg0 y) (+ -8192.0 (-> v1-3 y)))) + (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) arg0 v1-3))) + (vector-inv-orient-by-quat! s4-2 s4-2 (-> obj root-override quat)) + (and (< (fabs (-> s4-2 x)) 24576.0) (< 0.0 (-> s4-2 z)) (< (-> s4-2 z) 49152.0)) + ) + ) + ) + ) + +(defmethod commited-to-ride? com-elevator ((obj com-elevator)) + "@returns if the target is considered within the elevator area enough to begin descending/ascending" + (with-pp + (let* ((s5-0 *target*) + (a0-2 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (and (when a0-2 + (let* ((v1-2 (get-trans a0-2 0)) + (s5-2 (vector-! (new 'stack-no-clear 'vector) v1-2 (-> obj root-override trans))) + ) + (vector-inv-orient-by-quat! s5-2 s5-2 (-> obj root-override quat)) + (and (< (fabs (-> s5-2 x)) 20480.0) (< 0.0 (-> s5-2 z)) (< (-> s5-2 z) 40960.0)) + ) + ) + (let ((gp-1 (res-lump-struct (-> obj entity) 'on-notice structure))) + (not (if gp-1 + (eval! + (new 'stack 'script-context (the-as basic (process->ppointer pp)) pp (the-as vector #f)) + (the-as pair gp-1) + ) + ) + ) + ) + ) + ) + ) + ) + +(defmethod com-elevator-method-49 com-elevator ((obj com-elevator) (arg0 symbol)) + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> obj root-override root-prim)) child 1))) + (cond + (arg0 + (set! (-> v1-3 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-3 prim-core collide-with) (collide-spec jak player-list)) + ) + (else + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + 0 + ) + ) + ) + (none) + ) + +(defstate dormant (com-elevator) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (the-as state (find-parent-method com-elevator 34)) enter))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (none) + ) + ) + +(defstate running (com-elevator) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type elevator running) enter))) + (if t9-0 + (t9-0) + ) + ) + (com-elevator-method-49 self #t) + (if (not (logtest? (-> self elevator-status) (elevator-status moving))) + (set-setting! 'allow-look-around #f 0 0) + ) + (none) + ) + :exit (behavior () + (sound-stop (-> self sound-id)) + (sound-play "com-elevator-e") + (let ((t9-3 (-> (method-of-type elevator running) exit))) + (if t9-3 + (t9-3) + ) + ) + (com-elevator-method-49 self #f) + (remove-setting! 'allow-look-around) + (none) + ) + :code (behavior () + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 1)) + (suspend) + ) + ) + (sound-play "com-elevator-s") + (logior! (-> self elevator-status) (elevator-status waiting-to-ascend)) + (until #f + (suspend) + (sound-play "com-elevator-lp" :id (-> self sound-id)) + (when (= (-> self path-pos) 1.0) + (let ((v1-11 (the int (-> self move-pos 1)))) + (if (-> self use-camera-startup? v1-11) + (persist-with-delay + *setting-control* + 'string-startup-vector + (seconds 0.05) + 'string-startup-vector + 'abs + (the-as float (-> self camera-startup v1-11)) + 0 + ) + ) + ) + (logclear! (-> self elevator-status) (elevator-status waiting-to-ascend)) + ) + ) + #f + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod activate-elevator com-elevator ((obj com-elevator)) + "Puts the elevator initially into the correct state. This is typically based upon game completion" + (cond + ((logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object obj dormant)) + ) + ((logtest? (-> obj params flags) (elevator-flags elevator-flags-6)) + (go (method-of-object obj arrived)) + ) + (else + (go (method-of-object obj waiting)) + ) + ) + (none) + ) + +(defmethod deactivate com-elevator ((obj com-elevator)) + (sound-stop (-> obj sound-id)) + ((the-as (function elevator none) (find-parent-method com-elevator 10)) obj) + (none) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod init-plat! com-elevator ((obj com-elevator)) + "Does any necessary initial platform setup. +For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." + (dotimes (s5-0 (-> obj path curve num-cverts)) + (let ((a1-1 (res-lump-struct (-> obj entity) 'string-startup-vector structure :time (the float s5-0)))) + (cond + (a1-1 + (vector-normalize-copy! (-> obj camera-startup s5-0) (the-as vector a1-1) 1.0) + (set! (-> obj use-camera-startup? s5-0) #t) + ) + (else + (set! (-> obj use-camera-startup? s5-0) #f) + ) + ) + ) + ) + (set! (-> obj sound-id) (new-sound-id)) + (none) + ) + +(defmethod init-plat-collision! com-elevator ((obj com-elevator)) + "TODO - collision stuff for setting up the platform" + (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) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 22937.6 37683.2) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 22937.6 37683.2) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 3) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 22937.6 39321.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-20 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (com-elevator-method-49 obj #f) + (none) + ) + +(deftype tomb-trans-elevator (com-elevator) + ((unknown-gijh1bn2i3hb1 int32 :offset-assert 412) + ) + :heap-base #x120 + :method-count-assert 50 + :size-assert #x1a0 + :flag-assert #x32012001a0 + ) + + +(defstate running (tomb-trans-elevator) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type com-elevator running) enter))) + (if t9-0 + (t9-0) + ) + ) + (if (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) + (set-setting! 'jump #f 0 0) + ) + (none) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type com-elevator running) exit))) + (if t9-0 + (t9-0) + ) + ) + (sound-stop (-> self sound-id)) + (sound-play "tmb-elev-stop") + (if (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) + (remove-setting! 'jump) + ) + (none) + ) + :code (behavior () + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 1)) + (suspend) + ) + ) + (logior! (-> self elevator-status) (elevator-status waiting-to-ascend)) + (until #f + (sound-play "tmb-elevator-lp" :id (-> self sound-id)) + (suspend) + (when (= (-> self path-pos) 1.0) + (let ((v1-10 (the int (-> self move-pos 1)))) + (if (-> self use-camera-startup? v1-10) + (persist-with-delay + *setting-control* + 'string-startup-vector + (seconds 0.05) + 'string-startup-vector + 'abs + (the-as float (-> self camera-startup v1-10)) + 0 + ) + ) + ) + (logclear! (-> self elevator-status) (elevator-status waiting-to-ascend)) + ) + ) + #f + (none) + ) + ) + +(defmethod deactivate tomb-trans-elevator ((obj tomb-trans-elevator)) + (sound-stop (-> obj sound-id)) + ((the-as (function com-elevator none) (find-parent-method tomb-trans-elevator 10)) obj) + (none) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod init-plat! tomb-trans-elevator ((obj tomb-trans-elevator)) + "Does any necessary initial platform setup. +For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." + ((the-as (function com-elevator none) (find-parent-method tomb-trans-elevator 33)) obj) + (set! (-> obj sound-id) (new-sound-id)) + (none) + ) diff --git a/goal_src/jak2/levels/common/races/race-manager.gc b/goal_src/jak2/levels/common/races/race-manager.gc index 3e0b8537f..835968139 100644 --- a/goal_src/jak2/levels/common/races/race-manager.gc +++ b/goal_src/jak2/levels/common/races/race-manager.gc @@ -5,7 +5,7 @@ ;; name in dgo: race-manager ;; dgos: STD, STC, LERLCHAL, STB, LPRTRACE -(define-extern race-start (function int symbol symbol object)) +(define-extern race-start (function int symbol symbol process)) ;; DECOMP BEGINS diff --git a/goal_src/jak2/levels/dig/dig-obs.gc b/goal_src/jak2/levels/dig/dig-obs.gc index 1372a6e50..a57df0c7a 100644 --- a/goal_src/jak2/levels/dig/dig-obs.gc +++ b/goal_src/jak2/levels/dig/dig-obs.gc @@ -66,15 +66,15 @@ ) (define *dig-sinking-platform-constants* (new 'static 'rigid-body-object-constants - :mass 4.0 - :inv-mass 0.25 - :cm-joint (new 'static 'vector :y -8192.0 :w 1.0) - :linear-damping 0.9 - :angular-damping 0.48 - :friction-factor 0.1 - :inertial-tensor-x (meters 6) - :inertial-tensor-y (meters 4) - :inertial-tensor-z (meters 6) + :info (new 'static 'rigid-body-info + :mass 4.0 + :inv-mass 0.25 + :linear-damping 0.9 + :angular-damping 0.48 + :friction-factor 0.1 + :cm-offset-joint (new 'static 'vector :y -8192.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 6) (meters 4) (meters 6)) + ) :max-time-step 0.02 :gravity (meters 80) :idle-distance (meters 200) diff --git a/goal_src/jak2/levels/dig/dig1-obs.gc b/goal_src/jak2/levels/dig/dig1-obs.gc index 6a66c823f..345a6a91a 100644 --- a/goal_src/jak2/levels/dig/dig1-obs.gc +++ b/goal_src/jak2/levels/dig/dig1-obs.gc @@ -373,24 +373,25 @@ :bounds (static-spherem 0 0 0 1.5) ) -(define *dig-bomb-crate-cylinder-constants* (new 'static 'rigid-body-object-constants - :mass 1.0 - :inv-mass 1.0 - :cm-joint (new 'static 'vector :w 1.0) - :linear-damping 0.99 - :angular-damping 0.9 - :bounce-factor 0.5 - :friction-factor 0.1 - :inertial-tensor-x (meters 1) - :inertial-tensor-y (meters 3) - :inertial-tensor-z (meters 1) - :max-time-step 0.02 - :gravity (meters 80) - :idle-distance (meters 200) - :attack-force-scale 2.0 - :name '*dig-bomb-crate-cylinder-constants* - ) - ) +(define *dig-bomb-crate-cylinder-constants* + (new 'static 'rigid-body-object-constants + :info (new 'static 'rigid-body-info + :mass 1.0 + :inv-mass 1.0 + :linear-damping 0.99 + :angular-damping 0.9 + :bounce-factor 0.5 + :friction-factor 0.1 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 1) (meters 3) (meters 1)) + ) + :max-time-step 0.02 + :gravity (meters 80) + :idle-distance (meters 200) + :attack-force-scale 2.0 + :name '*dig-bomb-crate-cylinder-constants* + ) + ) (defstate idle (dig-bomb-crate-cylinder) :virtual #t @@ -656,9 +657,9 @@ (defmethod rigid-body-object-method-45 dig-bomb-crate-cylinder ((obj dig-bomb-crate-cylinder) (arg0 rigid-body-impact)) (let* ((f0-0 (-> arg0 impulse)) (f1-0 28672.0) - (f30-0 (* f0-0 (/ 1.0 f1-0) (-> obj info inv-mass))) + (f30-0 (* f0-0 (/ 1.0 f1-0) (-> obj info info inv-mass))) ) - (if (< (* 28672.0 (-> obj info mass)) (-> arg0 impulse)) + (if (< (* 28672.0 (-> obj info info mass)) (-> arg0 impulse)) (sound-play-by-name (static-sound-name "barrel-bomb-hit") (new-sound-id) @@ -781,8 +782,8 @@ (quaternion-copy! (-> self root-override-2 quat) (-> arg0 quat)) (rigid-body-object-method-33 self) (set! (-> self mask) (logior (process-mask platform) (-> self mask))) - (vector-float*! (-> self rbody state lin-momentum) (-> arg0 vel) (-> self info mass)) - (vector-float*! (-> self rbody state ang-momentum) (-> arg0 avel) (-> self info mass)) + (vector-float*! (-> self rbody state lin-momentum) (-> arg0 vel) (-> self info info mass)) + (vector-float*! (-> self rbody state ang-momentum) (-> arg0 avel) (-> self info info mass)) (go-virtual idle) (none) ) diff --git a/goal_src/jak2/levels/dig/dig3-obs.gc b/goal_src/jak2/levels/dig/dig3-obs.gc index 661afa014..40b81fc35 100644 --- a/goal_src/jak2/levels/dig/dig3-obs.gc +++ b/goal_src/jak2/levels/dig/dig3-obs.gc @@ -524,8 +524,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch time-frame vs sound-id. (defmethod play-impact-sound! dig-spikey-sphere ((obj dig-spikey-sphere)) - "Plays impact sound -:virtual" + "Plays impact sound" (let* ((a0-1 (-> obj root-override)) (s5-0 (-> a0-1 status)) ) @@ -622,8 +621,7 @@ This commonly includes things such as: ) (defmethod init-proj-settings! dig-spikey-sphere ((obj dig-spikey-sphere)) - "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc -:virtual" + "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (with-pp (set! (-> obj attack-mode) 'eco-dark) (initialize-skeleton @@ -1340,15 +1338,15 @@ This commonly includes things such as: (define *dig-tipping-rock-constants* (new 'static 'rigid-body-platform-constants - :mass 4.0 - :inv-mass 0.25 - :cm-joint (new 'static 'vector :z -24576.0 :w 1.0) - :linear-damping 0.9 - :angular-damping 0.48 - :friction-factor 0.1 - :inertial-tensor-x (meters 4) - :inertial-tensor-y (meters 3) - :inertial-tensor-z (meters 21) + :info (new 'static 'rigid-body-info + :mass 4.0 + :inv-mass 0.25 + :linear-damping 0.9 + :angular-damping 0.48 + :friction-factor 0.1 + :cm-offset-joint (new 'static 'vector :z -24576.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 4) (meters 3) (meters 21)) + ) :max-time-step 0.02 :gravity (meters 80) :idle-distance (meters 50) @@ -1613,16 +1611,16 @@ This commonly includes things such as: ) (define *dig-stomp-block-constants* (new 'static 'rigid-body-object-constants - :mass 1.0 - :inv-mass 1.0 - :cm-joint (new 'static 'vector :w 1.0) - :linear-damping 0.99 - :angular-damping 0.9 - :bounce-factor 0.5 - :friction-factor 0.1 - :inertial-tensor-x (meters 1) - :inertial-tensor-y (meters 3) - :inertial-tensor-z (meters 1) + :info (new 'static 'rigid-body-info + :mass 1.0 + :inv-mass 1.0 + :linear-damping 0.99 + :angular-damping 0.9 + :bounce-factor 0.5 + :friction-factor 0.1 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 1) (meters 3) (meters 1)) + ) :max-time-step 0.02 :gravity (meters 80) :idle-distance (meters 200) @@ -1706,11 +1704,11 @@ This commonly includes things such as: (set! (-> s5-0 x) (rand-vu-float-range -40960.0 40960.0)) (set! (-> s5-0 y) (rand-vu-float-range -40960.0 0.0)) (set! (-> s5-0 z) (rand-vu-float-range -40960.0 40960.0)) - (vector-float*! (-> self rbody state lin-momentum) s5-0 (-> self info mass)) + (vector-float*! (-> self rbody state lin-momentum) s5-0 (-> self info info mass)) (set! (-> gp-0 x) (rand-vu-float-range -10000.0 10000.0)) (set! (-> gp-0 y) (rand-vu-float-range -10000.0 10000.0)) (set! (-> gp-0 z) (rand-vu-float-range -10000.0 10000.0)) - (vector-float*! (-> self rbody state ang-momentum) gp-0 (-> self info mass)) + (vector-float*! (-> self rbody state ang-momentum) gp-0 (-> self info info mass)) ) (none) ) diff --git a/goal_src/jak2/levels/outro/outro-scenes.gc b/goal_src/jak2/levels/outro/outro-scenes.gc index e066a9c72..69aa25f14 100644 --- a/goal_src/jak2/levels/outro/outro-scenes.gc +++ b/goal_src/jak2/levels/outro/outro-scenes.gc @@ -7,3 +7,1811 @@ ;; DECOMP BEGINS +;; definition for symbol death-precursor, type death-info +(define death-precursor + (new 'static 'death-info :vertex-skip #x8 :timer #xe0 :overlap #xff :effect #x1539 :sound 'temp-enemy-die) + ) + +(defun start-precursor-effect ((arg0 manipy)) + (let ((v1-0 (-> arg0 draw)) + (a1-0 death-precursor) + ) + (set! (-> v1-0 death-vertex-skip) (-> a1-0 vertex-skip)) + (set! (-> v1-0 death-effect) (-> a1-0 effect)) + (set! (-> v1-0 death-timer) (+ (-> a1-0 timer) 1)) + (set! (-> v1-0 death-timer-org) (-> v1-0 death-timer)) + (set! (-> v1-0 death-draw-overlap) (-> a1-0 overlap)) + ) + (send-event + arg0 + 'trans-hook + (lambda :behavior scene-player + () + (set! (-> self draw death-timer) (the-as uint 200)) + (set! (-> self draw death-vertex-skip) (the-as uint (the int (rand-vu-float-range 8.0 24.0)))) + (none) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 5433 + :init-specs ((sp-flt spt-scale-x (meters 0.08)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 196.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 64.0) + (sp-rnd-flt spt-accel-y 0.0 2.7306666 1.0) + (sp-int-plain-rnd spt-timer 5 99 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-texture-glow-soft) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 5434) + ) + ) + +;; failed to figure out what this is: +(defpart 5434 + :init-specs ((sp-flt spt-r 64.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 64.0) + (sp-flt spt-scalevel-x (meters -0.0008)) + (sp-rnd-flt spt-scalevel-y (meters 0) (meters 0.0026666666) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-precursor-entity + :id 1276 + :duration (seconds 0.017) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 5435 :flags (bit6))) + ) + +;; failed to figure out what this is: +(defpart 5435 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2)) + (sp-flt spt-rot-x 819.2) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 8.0 2.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-crocadog crocadog 0 -1 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-brutter-balloon-norift brutter-balloon-norift brutter-balloon-norift-lod0-jg -1 + ((brutter-balloon-norift-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 23) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-metalkor-chopped metalkor-chopped metalkor-chopped-lod0-jg metalkor-chopped-idle-ja + ((metalkor-chopped-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 2 8) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-rift-break-ring rift-break-ring rift-break-ring-lod0-jg -1 + ((rift-break-ring-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100) + :origin-joint-index 4 + ) + +;; failed to figure out what this is: +(defskelgroup skel-kid-medallion kid-medallion kid-medallion-lod0-jg kid-medallion-idle-ja + ((kid-medallion-lod0-mg (meters 200))) + :bounds (static-spherem 0 0 0 1) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-precursor precursor precursor-lod0-jg -1 + ((precursor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-rift-ring + :id 1277 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :flags (unk-6) + :bounds (static-bspherem 0 0 0 128) + :rotate ((degrees 4) (degrees 0) (degrees 0)) + :parts ((sp-item 5436 :flags (is-3d bit6 bit7)) + (sp-item 5437 :flags (bit7)) + (sp-item 5438 :flags (bit6)) + (sp-item 5439 :flags (bit6)) + (sp-item 5440 :flags (bit7)) + ) + ) + +;; failed to figure out what this is: +(defpart 5440 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-flt spt-x (meters 30)) + (sp-flt spt-y (meters 10)) + (sp-rnd-flt spt-scale-x (meters 0.25) (meters 0.25) 1.0) + (sp-int spt-rot-x 4) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 64.0) + (sp-rnd-flt spt-omega 4.096 4.096 1.0) + (sp-flt spt-vel-x (meters -0.36666667)) + (sp-flt spt-vel-y (meters -0.123333335)) + (sp-flt spt-fade-r 0.32) + (sp-flt spt-fade-g 0.64) + (sp-flt spt-fade-b 0.0) + (sp-flt spt-fade-a 0.32) + (sp-flt spt-friction 0.95) + (sp-int spt-timer 200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5438 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 5)) + (sp-flt spt-rot-x 8192.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 48.0 32.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 5439 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 48)) + (sp-flt spt-rot-x 8192.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 48.0 4.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 65536.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5436 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.0 0.1 1.0) + (sp-flt spt-z (meters 0.2)) + (sp-rnd-flt spt-scale-x (meters 2) (meters 24) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 196.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 196.0) + (sp-flt spt-a 0.0) + (sp-rnd-flt spt-fade-a 0.4 0.4 1.0) + (sp-int spt-timer 320) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat) + (sp-int spt-next-time 80) + (sp-launcher-by-id spt-next-launcher 5441) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5441 + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 160) (sp-launcher-by-id spt-next-launcher 5442)) + ) + +;; failed to figure out what this is: +(defpart 5442 + :init-specs ((sp-flt spt-fade-a -0.8)) + ) + +;; failed to figure out what this is: +(defpart 5437 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 16.0) + (sp-flt spt-x (meters 12)) + (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 196.0 1.0) + (sp-flt spt-g 0.0) + (sp-rnd-flt spt-b 128.0 128.0 1.0) + (sp-rnd-flt spt-a 16.0 16.0 1.0) + (sp-rnd-flt spt-omega 8.192 8.192 1.0) + (sp-flt spt-vel-x (meters -0.10666667)) + (sp-rnd-flt spt-fade-r -0.42666668 0.6533333 1.0) + (sp-flt spt-fade-g 0.42666668) + (sp-rnd-flt spt-fade-b 0.0 -0.21333334 1.0) + (sp-flt spt-friction 0.96) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-magic-birth + :id 1278 + :linger-duration (seconds 0.5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 5443 :flags (launch-asap bit6))) + ) + +;; failed to figure out what this is: +(defpart 5443 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0)) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 196.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 196.0) + (sp-flt spt-a 96.0) + (sp-flt spt-omega 821248.0) + (sp-flt spt-scalevel-x (meters 0.004)) + (sp-flt spt-rotvel-z (degrees -0.5625)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-timer 80) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 8192.0) + (sp-func spt-func 'sparticle-track-root) + (sp-int spt-next-time 25) + (sp-launcher-by-id spt-next-launcher 5444) + ) + ) + +;; failed to figure out what this is: +(defpart 5444 + :init-specs ((sp-flt spt-scalevel-x (meters -0.0009090909)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -1.7454545) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-magic-birth2 + :id 1279 + :linger-duration (seconds 0.5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 5445 :flags (launch-asap bit6))) + ) + +;; failed to figure out what this is: +(defpart 5445 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0)) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 196.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 196.0) + (sp-flt spt-a 96.0) + (sp-flt spt-omega 821248.0) + (sp-flt spt-scalevel-x (meters 0.005)) + (sp-flt spt-rotvel-z (degrees -0.75000006)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-timer 60) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 8192.0) + (sp-func spt-func 'sparticle-track-root) + (sp-int spt-next-time 20) + (sp-launcher-by-id spt-next-launcher 5446) + ) + ) + +;; failed to figure out what this is: +(defpart 5446 + :init-specs ((sp-flt spt-scalevel-x (meters -0.00125)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -2.4)) + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-onin-finger-blast + :id 1280 + :duration (seconds 0.167) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5447) (sp-item 5448) (sp-item 5449 :flags (launch-asap bit6))) + ) + +;; failed to figure out what this is: +(defpart 5449 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-flt spt-rot-x 204.8) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-r -12.75) + (sp-flt spt-fade-g -3.1875) + (sp-flt spt-fade-a -1.25) + (sp-int spt-timer 80) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5447 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 64.0) + (sp-rnd-flt spt-scale-x (meters 0.03) (meters 0.01) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 64.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.06666667) 1.0) + (sp-flt spt-scalevel-x (meters -0.0002)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.85333335) + (sp-flt spt-fade-g -0.85333335) + (sp-rnd-flt spt-accel-y 0.0 -0.34133333 1.0) + (sp-rnd-flt spt-friction 0.9 0.01 1.0) + (sp-int-plain-rnd spt-timer 300 599 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int-plain-rnd spt-next-time 0 149 1) + (sp-launcher-by-id spt-next-launcher 5450) + (sp-rnd-flt spt-conerot-x (degrees 82.0) (degrees 10.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees -10.0) (degrees 10.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5448 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x66 :page #x3e6)) + (sp-flt spt-num 16.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.05) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 8.0 4.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.06666667) 1.0) + (sp-flt spt-scalevel-x (meters 0.00016666666)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.008888889 -0.008888889 1.0) + (sp-rnd-flt spt-accel-y 0.0 -0.06826667 1.0) + (sp-rnd-flt spt-friction 0.9 0.01 1.0) + (sp-int spt-timer 900) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-rnd-flt spt-conerot-x (degrees 82.0) (degrees 10.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees -10.0) (degrees 10.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-onin-finger-effect + :id 1281 + :duration (seconds 0.15) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5451 :falloff-to (meters 20)) (sp-item 5452 :falloff-to (meters 20))) + ) + +;; failed to figure out what this is: +(defpart 5451 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-rnd-flt spt-num 0.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.03) (meters 0.02) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 64.0) + (sp-flt spt-scalevel-x (meters -0.00013333333)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.85333335) + (sp-flt spt-fade-g -0.85333335) + (sp-rnd-flt spt-accel-y 0.0 -0.06826667 1.0) + (sp-int-plain-rnd spt-timer 300 899 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int-plain-rnd spt-next-time 0 149 1) + (sp-launcher-by-id spt-next-launcher 5450) + ) + ) + +;; failed to figure out what this is: +(defpart 5450 + :init-specs ((sp-rnd-flt spt-scale-x (meters 0.01) (meters 0.02) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 255.0) + (sp-flt spt-scalevel-x (meters 0)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g 0.0) + (sp-int spt-next-time 5) + (sp-launcher-by-id spt-next-launcher 5453) + ) + ) + +;; failed to figure out what this is: +(defpart 5453 + :init-specs ((sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 64.0) + (sp-int-plain-rnd spt-next-time 0 449 1) + (sp-launcher-by-id spt-next-launcher 5450) + ) + ) + +;; failed to figure out what this is: +(defpart 5452 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x66 :page #x3e6)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 8.0 8.0 1.0) + (sp-flt spt-scalevel-x (meters 0.00033333333)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.026666667 -0.026666667 1.0) + (sp-int-plain-rnd spt-timer 150 449 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-precursor-stone-glow + :id 1282 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 5454 :flags (bit6))) + ) + +;; failed to figure out what this is: +(defpart 5454 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 3.5)) + (sp-flt spt-rot-x 8192.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 16.0) + (sp-flt spt-g 192.0) + (sp-flt spt-b 16.0) + (sp-flt spt-a 24.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags glow) + (sp-flt spt-userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-port-feathers-n-fur-impact + :id 1283 + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 5455 :flags (bit7)) (sp-item 5456 :flags (bit7))) + ) + +;; failed to figure out what this is: +(defpart 5455 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xdd8)) + (sp-func spt-birth-func 'birth-func-pecker-feather-color) + (sp-flt spt-num 3.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.125) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 86.0) + (sp-rnd-flt spt-vel-x (meters -0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-vel-y (meters 0.05) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-vel-z (meters 0.05) (meters 0.01) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -2.4) (degrees 4.8) 1.0) + (sp-rnd-flt spt-accel-y -1.3653333 -1.3653333 1.0) + (sp-rnd-flt spt-friction 0.82 0.07 1.0) + (sp-int spt-timer 800) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-conerot-x (degrees -25.000002) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-z (degrees -25.000002) (degrees 50.000004) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5456 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 25.0) + (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.015) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.0025) (meters 0.015) 1.0) + (sp-flt spt-r 242.0) + (sp-rnd-flt spt-g 64.0 32.0 1.0) + (sp-flt spt-b 20.0) + (sp-flt spt-a 255.0) + (sp-rnd-flt spt-vel-x (meters -0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.008333334) 1.0) + (sp-rnd-flt spt-vel-z (meters 0.05) (meters 0.01) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -2.4) (degrees 4.8) 1.0) + (sp-rnd-flt spt-accel-y -1.3653333 -1.3653333 1.0) + (sp-rnd-flt spt-friction 0.82 0.07 1.0) + (sp-int spt-timer 800) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-conerot-x (degrees -25.000002) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-z (degrees -25.000002) (degrees 50.000004) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-port-feathers-n-fur + :id 1284 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 5457) (sp-item 5458)) + ) + +;; failed to figure out what this is: +(defpart 5457 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xdd8)) + (sp-func spt-birth-func 'birth-func-pecker-feather-color) + (sp-flt spt-num 0.15) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.125) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 86.0) + (sp-rnd-flt spt-vel-x (meters -0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -2.4) (degrees 4.8) 1.0) + (sp-rnd-flt spt-accel-y -1.3653333 -1.3653333 1.0) + (sp-rnd-flt spt-friction 0.82 0.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-conerot-x (degrees -25.000002) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-z (degrees -25.000002) (degrees 50.000004) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5458 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 2.5) + (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.015) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.0025) (meters 0.015) 1.0) + (sp-flt spt-r 242.0) + (sp-rnd-flt spt-g 64.0 32.0 1.0) + (sp-flt spt-b 20.0) + (sp-flt spt-a 255.0) + (sp-rnd-flt spt-vel-x (meters -0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-vel-y (meters 0.05) (meters 0.016666668) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -2.4) (degrees 4.8) 1.0) + (sp-rnd-flt spt-accel-y -1.3653333 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.82 0.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-int spt-next-time 150) + (sp-launcher-by-id spt-next-launcher 5459) + (sp-rnd-flt spt-conerot-x (degrees -25.000002) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-z (degrees -25.000002) (degrees 50.000004) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5459 + :init-specs ((sp-flt spt-vel-y (meters 0)) (sp-flt spt-friction 1.0)) + ) + +;; definition for function birth-func-pecker-feather-color +;; WARN: Return type mismatch int vs none. +(defun birth-func-pecker-feather-color ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((v1-0 (rand-vu-int-count 3))) + (cond + ((zero? v1-0) + (set! (-> arg2 rotate-x) 179.0) + (set! (-> arg2 rotate-y) 49.0) + (set! (-> arg2 rotate-z) 41.0) + ) + ((= v1-0 1) + (set! (-> arg2 rotate-x) 252.0) + (set! (-> arg2 rotate-y) 161.0) + (set! (-> arg2 rotate-z) 12.0) + ) + ((= v1-0 2) + (set! (-> arg2 rotate-x) 29.0) + (set! (-> arg2 rotate-y) 60.0) + (set! (-> arg2 rotate-z) 108.0) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(scene-method-16 + (new 'static 'scene + :name "outro-nest" + :extra #f + :info #f + :mask-to-clear #x1282000 + :entity "scene-stage-91" + :art-group "scenecamera" + :anim "outro-nest" + :parts 50 + :command-list '((0 + (task-close! "nest-boss-resolution") + (task-close! "city-win-introduction") + (kill "rift-ring-ingame-1") + (kill "crate-942") + (kill "crate-943") + (kill "crate-944") + (kill "crate-945") + (kill "crate-946") + (kill "crate-947") + (kill "crate-948") + (kill "crate-949") + (fadein (frame-time-30 (new 'static 'bfloat :data 10.0))) + (apply + ,(lambda () + (set! (-> palout memory-mode) (load-buffer-mode borrow)) + (set! (-> hiphog memory-mode) (load-buffer-mode small-center)) + (none) + ) + ) + ;; (send-event "darkjak-highres" 'trans-hook ,(lambda () (set-darkjak-highres-nest-texture-morph! 0) (none))) + (part-tracker + "group-outro-rift-ring" + entity + "rift-break-ring" + joint + "gate" + track + #t + duration + (frame-range 0 2795) + ) + (part-tracker + "group-outro-precursor-stone-glow" + entity + "precursor-stone" + joint + "main" + track + #t + duration + (frame-range 0 275) + ) + ) + (206 + (part-tracker + "group-outro-magic-birth" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 206 222) + ) + (part-tracker + "group-outro-magic-birth" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 206 222) + ) + ) + (207 + (joint-eval start-precursor-effect entity "precursor") + (send-event + "precursor" + 'eval + ,(lambda :behavior scene-player + () + (let* ((v1-3 (-> self draw lod-set lod (-> self draw cur-lod) geo num-joints)) + (gp-0 3) + (s5-0 (+ v1-3 1)) + ) + (while (>= s5-0 gp-0) + (if (not (or (and (>= gp-0 13) (>= 21 gp-0)) (and (>= gp-0 26) (>= 34 gp-0)))) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1276) + 5140 + #f + #f + self + gp-0 + :to *entity-pool* + ) + ) + (+! gp-0 1) + ) + ) + #f + ) + ) + ) + (223 + (part-tracker + "group-outro-magic-birth2" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 223 235) + ) + (part-tracker + "group-outro-magic-birth2" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 223 235) + ) + ) + (236 + (part-tracker + "group-outro-magic-birth2" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 236 242) + ) + (part-tracker + "group-outro-magic-birth2" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 236 242) + ) + ) + (2795 + (apply + ,(lambda :behavior scene-player + () + (send-event (process-by-name "metalkor-1" *active-pool*) 'occlude-off) + (none) + ) + ) + ) + (2990 (fadeout (frame-time-30 10))) + (10000 + (task-close! "nest-boss-introduction") + (apply ,(lambda :behavior scene-player + () + (when (-> self aborted?) + (set! (-> palout memory-mode) (load-buffer-mode small-edge)) + (set! (-> hiphog memory-mode) (load-buffer-mode small-edge)) + 0 + ) + (none) + ) + ) + ) + ) + :cut-list '(0 + 81 + 167 + 237 + 332 + 542 + 721 + 811 + 891 + 1011 + 1131 + 1293 + 1416 + 1467 + 1568 + 1701 + 1896 + 1957 + 2071 + 2177 + 2261 + 2358 + 2481 + 2601 + 2846 + 2921 + 3000 + ) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'nestb + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "darkjak-highres" + :level 'nestb + :art-group "skel-darkjak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "kid-highres" + :level 'loutcstb + :art-group "skel-kid-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "keira-highres" + :level 'outrocst + :art-group "skel-keira-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((2261 2358)) + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'outrocst + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min 1568) (1701 max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "youngsamos-highres" + :level 'loutcstb + :art-group "skel-youngsamos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "brutter-highres" + :level 'loutcstb + :art-group "skel-brutter-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "brutter-balloon-norift" + :level 'loutcstb + :art-group "skel-brutter-balloon-norift" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((721 811) (1131 1416) (1467 1800) (1957 2358) (2601 2846) (2921 3000)) + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "rift-rider" + :level 'loutcstb + :art-group "skel-rift-rider" + :prefix "" + :draw-frames '((min 2627)) + :scissor-frames '((2071 2177)) + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "precursor-stone" + :level 'loutcstb + :art-group "skel-precursor-stone" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-chopped" + :level 'loutcstb + :art-group "skel-metalkor-chopped" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'loutcstb + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "rift-break-ring" + :level 'outrocst + :art-group "skel-rift-break-ring" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "precursor" + :level 'outrocst + :art-group "skel-precursor" + :prefix "" + :draw-frames '((200 721)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "nestb-outro" + :end-point-obj "ctyport-hiphog" + :borrow '((outrocst 0 loutcstb special)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :music-delay 1500.0 + :save #t + :scene-task #xf5 + ) + ) + +;; failed to figure out what this is: +(scene-method-16 (new 'static 'scene + :name "outro-palace" + :extra #f + :info #f + :mask-to-clear #x1282000 + :entity "scene-stage-54" + :art-group "scenecamera" + :anim "outro-palace" + :parts 9 + :command-list '((0 + (fadein (frame-time-30 10)) + (want-load 'outrocst 'throne 'hiphog) + (kill "throne-part-132") + (kill "throne-part-133") + (kill "throne-part-134") + (kill "throne-part-135") + (kill "throne-part-136") + (kill "throne-part-137") + (kill "throne-part-138") + (kill "throne-part-139") + (kill "throne-part-140") + (kill "throne-part-141") + (kill "throne-part-158") + (kill "throne-part-155") + (kill "throne-part-152") + (kill "throne-part-149") + (kill "throne-part-143") + (kill "throne-part-144") + (kill "throne-part-142") + (kill "throne-part-147") + (kill "throne-part-145") + (kill "throne-part-148") + (kill "throne-part-150") + (kill "throne-part-151") + (kill "throne-part-153") + (kill "throne-part-154") + (kill "throne-part-156") + (kill "throne-part-157") + (kill "throne-part-159") + (kill "throne-part-160") + ) + (1000 (fadeout (frame-time-30 5))) + (10000 (apply ,(lambda :behavior scene-player + () + (when (-> self aborted?) + (set! (-> palout memory-mode) (load-buffer-mode small-edge)) + (set! (-> hiphog memory-mode) (load-buffer-mode small-edge)) + 0 + ) + (none) + ) + ) + ) + ) + :cut-list '(96 241 838 951) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "torn-highres" + :level 'lthrnout + :art-group "skel-torn-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'lthrnout + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "palmpilot" + :level 'lthrnout + :art-group "skel-palmpilot" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "throne-outro" + :end-point-obj "ctyport-hiphog" + :borrow '((outrocst 0 palout display) (throne 0 lthrnout display) (hiphog 0 lhipout special)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :music-delay 1500.0 + :save #t + ) + ) + +;; failed to figure out what this is: +(scene-method-16 + (new 'static 'scene + :name "outro-hiphog" + :extra #f + :info #f + :mask-to-clear #x1282000 + :entity "scene-stage-24" + :art-group "scenecamera" + :anim "outro-hiphog" + :parts 33 + :command-list '((0 + (fadein (frame-time-30 2)) + (apply + ,(lambda () + (let ((gp-0 (level-get *level* 'outrocst))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 mood-func) (the-as (function mood-context float int none) update-mood-copy-hiphog)) + (set! (-> gp-0 info sky) #f) + #f + ) + ) + ) + ) + (apply ,(lambda () (set! (-> palout memory-mode) (load-buffer-mode small-edge)) 0 (none))) + (want-load 'outrocst 'hiphog 'ctyport) + (kill "hip-door-b-1") + (send-event "sidekick-highres" 'draw-mirror #f) + (send-event "jak-highres" 'draw-mirror #f) + (send-event "keira-highres" 'draw-mirror #f) + (send-event "tess-highres" 'draw-mirror #f) + (send-event "pecker-highres" 'draw-mirror #f) + (send-event "onin-highres" 'draw-mirror #f) + ) + (141 (send-event "onin-highres" 'draw-mirror #t) (send-event "pecker-highres" 'draw-mirror #t)) + (180 (want-display 'ctyport 'display) (kill "hip-door-a-6") (kill "hip-door-b-1")) + (186 (send-event "onin-highres" 'draw-mirror #f) (send-event "pecker-highres" 'draw-mirror #f)) + (476 (send-event "onin-highres" 'draw-mirror #t) (send-event "pecker-highres" 'draw-mirror #t)) + (560 (send-event "onin-highres" 'draw-mirror #f) (send-event "pecker-highres" 'draw-mirror #f)) + (1156 (send-event "onin-highres" 'draw-mirror #t)) + (1160 + (part-tracker + "group-outro-onin-finger-effect" + entity + "onin-highres" + joint + "RindexC" + track + #t + duration + (frame-range 1160 1250) + ) + ) + (1226 + (part-tracker + "group-outro-onin-finger-blast" + entity + "onin-highres" + joint + "RindexC" + track + #t + duration + (frame-range 1226 1236) + ) + ) + (1246 (send-event "onin-highres" 'draw-mirror #f)) + (1436 (send-event "onin-highres" 'draw-mirror #t)) + (1491 (send-event "onin-highres" 'draw-mirror #f)) + (1955 (fadeout (frame-time-30 5))) + (10000 (apply ,(lambda :behavior scene-player + () + (when (-> self aborted?) + (set! (-> hiphog memory-mode) (load-buffer-mode small-edge)) + 0 + ) + (none) + ) + ) + ) + ) + :cut-list '(91 + 141 + 186 + 259 + 401 + 476 + 596 + 691 + 781 + 846 + 971 + 1081 + 1156 + 1246 + 1291 + 1342 + 1436 + 1491 + 1536 + 1581 + 1631 + 1666 + 1701 + 1776 + 1841 + 1891 + ) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'hiphog + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x3 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'hiphog + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min 1840) (1891 max)) + :scissor-frames '((741 846)) + :flags #x3 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "keira-highres" + :level 'outrocst + :art-group "skel-keira-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x3 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'outrocst + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tess-highres" + :level 'outrocst + :art-group "skel-tess-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x3 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'lhipout + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x3 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "onin-highres" + :level 'outrocst + :art-group "skel-onin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x3 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sig-highres" + :level 'lhipout + :art-group "skel-sig-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "hip-mug" + :level 'lhipout + :art-group "skel-hip-mug" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "hip-mug" + :level 'lhipout + :art-group "skel-hip-mug" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "hip-mug" + :level 'lhipout + :art-group "skel-hip-mug" + :prefix "c-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "hip-bottle-c" + :level 'lhipout + :art-group "skel-hip-bottle-c" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "kid-medallion" + :level 'lhipout + :art-group "skel-kid-medallion" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'lhipout + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-chopped" + :level 'lhipout + :art-group "skel-metalkor-chopped" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "hiphog-outro" + :end-point-obj "ctyport-hiphog" + :borrow '((outrocst 0 portwall special) (hiphog 0 lhipout special)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :music-delay 1500.0 + :save #t + ) + ) + +;; failed to figure out what this is: +(scene-method-16 + (new 'static 'scene + :name "outro-port" + :extra #f + :info #f + :mask-to-clear #x1282000 + :entity "scene-stage-93" + :art-group "scenecamera" + :anim "outro-port" + :parts 28 + :command-list '((0 + (want-sound 'outro1 #f #f) + (setting-unset sound-bank-load) + (time-of-day 23) + (fadein (frame-time-30 10)) + (apply ,(lambda () + (let ((gp-0 (level-get *level* 'hiphog))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 mood-func) update-mood-default) + (set! (-> gp-0 info sky) #f) + ) + ) + (let ((gp-1 (level-get *level* 'lhipout))) + (when gp-1 + (clear-mood-context (-> gp-1 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-1 mood-context)) + ) + (set! (-> gp-1 mood-func) update-mood-default) + (set! (-> gp-1 info sky) #f) + ) + ) + (let ((gp-2 (level-get *level* 'outrocst))) + (when gp-2 + (clear-mood-context (-> gp-2 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-2 mood-context)) + ) + (set! (-> gp-2 mood-func) update-mood-default) + (set! (-> gp-2 info sky) #f) + ) + ) + (let ((gp-3 (level-get *level* 'portwall))) + (when gp-3 + (clear-mood-context (-> gp-3 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-3 mood-context)) + ) + (set! (-> gp-3 mood-func) update-mood-default) + (set! (-> gp-3 info sky) #f) + #f + ) + ) + ) + ) + (want-display 'outrocst 'display) + (apply + ,(lambda () + (with-pp + (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-0 + (let ((t9-1 (method-of-type part-tracker activate))) + (t9-1 (the-as part-tracker gp-0) pp (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-2 run-function-in-process) + (a0-2 gp-0) + (a1-2 part-tracker-init) + (a2-4 (-> *part-group-id-table* 1272)) + (a3-1 #x2d96) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> (new 'static 'vector :x 180224.0 :y 81920.0 :z 5660672.0 :w 1.0) quad)) + ((the-as (function object object object object object object object object none) t9-2) + a0-2 + a1-2 + a2-4 + a3-1 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> gp-0 ppointer) + ) + ) + ) + ) + ) + ) + (200 (setting-reset sfx-volume mode 'rel value (new 'static 'bfloat :data 0.3))) + (300 (setting-reset sfx-volume mode 'rel value (new 'static 'bfloat :data 0.2))) + (514 (setting-reset sfx-volume mode 'rel value (new 'static 'bfloat :data 0.3))) + (610 (setting-reset sfx-volume mode 'rel value (new 'static 'bfloat :data 0.2))) + (2042 + (part-tracker + "group-outro-port-feathers-n-fur-impact" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 2042 2043) + ) + ) + (2105 + (part-tracker + "group-outro-port-feathers-n-fur" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 2105 2300) + ) + ) + (2334 + (setting-reset sfx-volume mode 'rel value (new 'static 'bfloat :data 0.4)) + (apply + ,(lambda () + (with-pp + (set-setting! 'process-mask 'set 0 (process-mask enemy platform projectile)) + (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-0 + (let ((t9-2 (method-of-type part-tracker activate))) + (t9-2 (the-as part-tracker gp-0) pp (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-3 run-function-in-process) + (a0-3 gp-0) + (a1-3 part-tracker-init) + (a2-5 (-> *part-group-id-table* 1272)) + (a3-2 #x2dc6c0) + (t0-1 #f) + (t1-1 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> (new 'static 'vector :x 860160.0 :y 122880.0 :z 6062080.0 :w 1.0) quad)) + ((the-as (function object object object object object object object object none) t9-3) + a0-3 + a1-3 + a2-5 + a3-2 + t0-1 + t1-1 + t2-0 + t3-0 + ) + ) + (-> gp-0 ppointer) + ) + ) + ) + ) + ) + ) + (2490 + (setting-reset sfx-volume mode 'rel value (new 'static 'bfloat :data 0.5)) + (apply ,(lambda () (with-pp + (start-credits pp) + (none) + ) + ) + ) + ) + (10000 (apply ,(lambda () (set! (-> hiphog memory-mode) (load-buffer-mode small-edge)) 0 (none)))) + ) + :cut-list '(245 + 299 + 358 + 401 + 437 + 493 + 611 + 784 + 881 + 969 + 1003 + 1047 + 1159 + 1212 + 1238 + 1290 + 1394 + 1529 + 1629 + 1725 + 1817 + 1871 + 2032 + 2105 + 2256 + 2334 + ) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'hiphog + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'hiphog + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'outrocst + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sig-highres" + :level 'lhipout + :art-group "skel-sig-highres" + :prefix "" + :draw-frames '((min 881) (969 max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'lhipout + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min 611) (784 max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "crocadog-highres" + :level 'lhipout + :art-group "skel-crocadog-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sew-gold-key" + :level 'lhipout + :art-group "skel-sew-gold-key" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'lhipout + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "ctyport-outro" + :end-point-obj "ctyport-start" + :borrow '((outrocst 0 portwall display) (hiphog 0 lhipout display)) + :sfx-volume 0.2 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :music-delay 1500.0 + :save #t + ) + ) + + + + diff --git a/goal_src/jak2/levels/power_station/power_switches/ctypower.gc b/goal_src/jak2/levels/power_station/power_switches/ctypower.gc index 948d7c2a6..c69a069dd 100644 --- a/goal_src/jak2/levels/power_station/power_switches/ctypower.gc +++ b/goal_src/jak2/levels/power_station/power_switches/ctypower.gc @@ -7,3 +7,283 @@ ;; DECOMP BEGINS +(defmethod draw hud-turret ((obj hud-turret)) + (set-hud-piece-position! + (the-as hud-sprite (-> obj sprites)) + (the int (+ 457.0 (* 130.0 (-> obj offset)))) + 205 + ) + (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -19 22) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +(defmethod update-values hud-turret ((obj hud-turret)) + (set! (-> obj values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +(defmethod init-callback hud-turret ((obj hud-turret)) + (set! (-> obj level) (level-get *level* 'ctywide)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x8 :page #x679))) + (set! (-> obj sprites 0 flags) (the-as uint 4)) + (set! (-> obj sprites 0 scale-x) 1.2) + (set! (-> obj sprites 0 scale-y) 1.2) + (alloc-string-if-needed obj 0) + (set! (-> obj strings 0 scale) 0.6) + (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + 0 + (none) + ) + +(define *city-power-switch-on-position* (new 'static 'boxed-array :type vector + (new 'static 'vector :x 2336358.5 :y 32768.0 :z -935526.4 :w 1.0) + (new 'static 'vector :x 4273357.0 :y 32645.12 :z 4159078.5 :w 1.0) + (new 'static 'vector :x 4059136.0 :y 32768.0 :z 2203648.0 :w 1.0) + (new 'static 'vector :x 3387392.0 :y 32768.0 :z 2748416.0 :w 1.0) + (new 'static 'vector :x 3854336.0 :y 32768.0 :z 745472.0 :w 1.0) + ) + ) + +(set-subtask-hook! + *game-info* + 87 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (when (not (task-node-closed? (game-task-node city-power-resolution))) + (set-setting! 'exclusive-task #f 0 (-> self node-info task)) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) + (set-setting! 'minimap 'clear 0 32) + (set! (-> self max-count) 5) + (set! (-> self count) 0) + (set! (-> *game-info* counter) 5.0) + (dotimes (v1-9 5) + (set! (-> self data-int32 v1-9) 0) + ) + (set! (-> self slave 10) (the-as handle #f)) + (dotimes (gp-0 (-> self max-count)) + (set! (-> self data-vector gp-0 quad) (-> *city-power-switch-on-position* gp-0 quad)) + (set! (-> self minimap gp-0) + (add-icon! *minimap* self (the-as uint 15) (the-as int #f) (-> *city-power-switch-on-position* gp-0) 0) + ) + ) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 87 + 1 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *traffic-manager* 'restore-default-settings) + (dotimes (v1-3 (-> self max-count)) + (when (-> self minimap v1-3) + (logior! (-> self minimap v1-3 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-3) #f) + ) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 87 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (when (not (task-node-closed? (game-task-node city-power-resolution))) + (check-time self) + (set! (-> self count) 0) + (dotimes (v1-3 (-> self max-count)) + (if (>= 1 (-> self data-int32 v1-3)) + (+! (-> self count) 1) + ) + ) + (if (= (-> self count) (-> self max-count)) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (set! (-> *game-info* counter) (the float (-> self count))) + ) + (when (or (zero? (-> self count)) (task-node-closed? (game-task-node city-power-resolution))) + (when (zero? (-> self count)) + (talker-spawn-func (-> *talker-speech* 92) *entity-pool* (target-pos 0) (the-as region #f)) + (task-node-close! (game-task-node city-power-resolution)) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + (send-event (handle->process (-> self hud-counter)) 'hide-and-die) + (set! (-> self fail-on-death?) #f) + ) + (cond + ((handle->process (-> self slave 10)) + (let ((gp-1 (handle->process (-> self slave 10)))) + (when (and gp-1 + (< 40960.0 (vector-vector-xz-distance (-> (the-as process-drawable gp-1) root trans) (target-pos 0))) + ) + (send-event gp-1 'close) + (go-virtual complete) + ) + ) + ) + (else + (go-virtual complete) + ) + ) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 87 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-turret :init hud-init-by-other :to self))) + (send-event *traffic-manager* 'set-target-level #x3f800000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (send-event *traffic-manager* 'set-alert-level 1) + (send-event *traffic-manager* 'set-alert-duration #xa4cb80) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 87 + 5 + (the-as (function object) (lambda :behavior task-manager + () + (dotimes (v1-0 (-> self max-count)) + (when (-> self minimap v1-0) + (logior! (-> self minimap v1-0 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-0) #f) + ) + ) + (kill-all-children self) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 87 + 4 + (the-as (function object) (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (suspend) + ) + (task-node-close! (game-task-node city-power-post-win)) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 87 + 6 + (the-as + (function object) + (lambda :behavior task-manager + ((arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((gp-0 (-> (level-get *level* 'lpower) entity data 0 entity))) + (cond + ((= arg2 'guard-turret-status) + (let ((v1-5 (-> arg3 param 0))) + (let ((a0-2 (the-as object (-> arg3 param 1)))) + (set! (-> *city-power-switch-on-position* v1-5 quad) (-> (the-as vector a0-2) quad)) + ) + (-> self data-int32 v1-5) + ) + ) + ((= arg2 'guard-turret-killed) + (let ((s4-1 (-> arg3 param 0))) + (set! (-> self data-int32 s4-1) 1) + (let ((v1-12 (process-spawn + cty-guard-turret-button + :init basebutton-init-by-other + gp-0 + (-> arg0 root trans) + (-> arg0 root quat) + (-> arg0 entity) + #f + 0 + :to self + ) + ) + ) + (set! (-> self slave (-> self data-int32 s4-1)) (ppointer->handle v1-12)) + (set! (-> (the-as basebutton (-> v1-12 0)) event-down) 'button-down) + ) + ) + #t + ) + ((= arg2 'guard-turret-button-pushed) + (let ((v1-21 (-> arg3 param 0))) + (set! (-> self data-int32 v1-21) 2) + (set! (-> self slave 10) (process->handle arg0)) + (logior! (-> self minimap v1-21 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-21) #f) + ) + #t + ) + ((= arg2 'spawn-button) + (let ((s4-2 (-> arg3 param 0)) + (s3-2 (-> arg3 param 1)) + ) + (when (not (handle->process (-> self slave (-> self data-int32 s4-2)))) + (let ((v0-1 (the-as object (ppointer->handle (process-spawn + cty-guard-turret-button + :init basebutton-init-by-other + gp-0 + (-> arg0 root trans) + (-> arg0 root quat) + (-> arg0 entity) + s3-2 + 0 + :to self + ) + ) + ) + ) + ) + (set! (-> self slave (-> self data-int32 s4-2)) (the-as handle v0-1)) + v0-1 + ) + ) + ) + ) + ) + ) + ) + ) + ) diff --git a/goal_src/jak2/levels/power_station/vinroom-obs.gc b/goal_src/jak2/levels/power_station/vinroom-obs.gc index bf3c53718..1c42273d8 100644 --- a/goal_src/jak2/levels/power_station/vinroom-obs.gc +++ b/goal_src/jak2/levels/power_station/vinroom-obs.gc @@ -7,3 +7,301 @@ ;; DECOMP BEGINS +(deftype vin-turbine (process-drawable) + ((dont-draw-outside? symbol :offset-assert 200) + (lightning-timer uint64 :offset-assert 208) + (outside-plane plane :inline :offset-assert 224) + (lightning-plane plane :inline :offset-assert 240) + ) + :heap-base #x80 + :method-count-assert 22 + :size-assert #x100 + :flag-assert #x1600800100 + (:methods + (idle () _type_ :state 20) + (dormant () _type_ :state 21) + ) + ) + + +(defpart 1245 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 60)) + (sp-flt spt-rot-x 2048.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 64.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 64.0 1.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 32.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 1638.4) + (sp-int spt-next-time 5) + (sp-launcher-by-id spt-next-launcher 167) + ) + ) + +(defpart 1246 + :init-specs ((sp-flt spt-scale-x (meters 60)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 64.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 64.0 1.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 24.0 32.0 1.0) + (sp-int spt-next-time 5) + (sp-launcher-by-id spt-next-launcher 167) + ) + ) + +(set! (-> *lightning-spec-id-table* 17) (new 'static 'lightning-spec + :name "lightning-turbine" + :flags (lightning-spec-flags lsf2) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x83 :page #xc) + :reduction 0.42 + :num-points 16 + :box-size 12288.0 + :merge-factor 0.5 + :merge-count 4 + :radius 2048.0 + :duration 300.0 + :sound #f + ) + ) + +(defskelgroup skel-vin-turbine vin-turbine vin-turbine-lod0-jg vin-turbine-idle-ja + ((vin-turbine-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + ) + +(defstate dormant (vin-turbine) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + (none) + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + (none) + ) + :trans (behavior () + (if (>= (vector4-dot (the-as vector (-> self outside-plane)) (math-camera-pos)) 0.0) + (go-virtual idle) + ) + (none) + ) + :code (the-as (function none :behavior vin-turbine) sleep-code) + ) + +(defstate idle (vin-turbine) + :virtual #t + :trans (behavior () + (if (and (-> self dont-draw-outside?) + (< (vector4-dot (the-as vector (-> self outside-plane)) (math-camera-pos)) 0.0) + ) + (go-virtual dormant) + ) + (none) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) + :num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (behavior () + (when (and (or (not (-> self dont-draw-outside?)) + (>= (vector4-dot (the-as vector (-> self lightning-plane)) (math-camera-pos)) 0.0) + ) + (< (the-as time-frame (-> self lightning-timer)) (-> self clock frame-counter)) + ) + (let ((s4-0 (new 'stack-no-clear 'matrix)) + (s3-1 + (vector-rotate-x! (new 'stack-no-clear 'vector) *y-vector* (* 182.04445 (rand-vu-float-range 10.0 40.0))) + ) + (gp-2 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'collide-query)) + ) + (if (rand-vu-percent? 0.5) + (vector-negate! s3-1 s3-1) + ) + (vector-rotate-y! s3-1 s3-1 (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (vector+float*! gp-2 (-> self root trans) s3-1 15564.8) + (set! (-> s5-1 start-pos quad) (-> gp-2 quad)) + (set-vector! + (-> s5-1 move-dist) + (rand-vu-float-range -4551.1113 4551.1113) + 0.0 + (rand-vu-float-range -910.2222 910.2222) + 1.0 + ) + (matrix-rotate-zyx! s4-0 (-> s5-1 move-dist)) + (let ((s4-1 (vector-rotate*! (new 'stack-no-clear 'vector) s3-1 s4-0))) + (vector-normalize! s4-1 6144.0) + (vector+! (-> s5-1 start-pos) (-> s5-1 start-pos) s4-1) + (vector-normalize-copy! (-> s5-1 move-dist) s4-1 81920.0) + ) + (let ((v1-17 s5-1)) + (set! (-> v1-17 radius) 409.6) + (set! (-> v1-17 collide-with) (collide-spec backgnd)) + (set! (-> v1-17 ignore-process0) self) + (set! (-> v1-17 ignore-process1) #f) + (set! (-> v1-17 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-17 action-mask) (collide-action solid)) + ) + (when (>= (fill-and-probe-using-line-sphere *collide-cache* s5-1) 0.0) + (set! (-> self lightning-timer) + (the-as uint (+ (-> self clock frame-counter) (the int (* 300.0 (rand-vu-float-range 0.1 0.4))))) + ) + (let ((s4-3 (new 'stack-no-clear 'vector))) + (set! (-> s4-3 quad) (-> s5-1 best-other-tri intersect quad)) + (when (< 8192.0 (vector-vector-distance gp-2 s4-3)) + (let ((s3-2 (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> *lightning-spec-id-table* 17) + 0 + #f + self + gp-2 + s4-3 + :to self + ) + ) + (v1-36 (get-field-spec-by-id (-> *part-id-table* 1245) (sp-field-id spt-timer))) + ) + (if v1-36 + (set! (-> v1-36 initial-valuef) (the-as float (-> (the-as lightning-tracker (-> s3-2 0)) duration))) + ) + ) + (let ((t9-20 sp-launch-particles-var) + (a0-33 *sp-particle-system-2d*) + (a1-21 (-> *part-id-table* 1245)) + (a2-10 *launch-matrix*) + ) + (set! (-> a2-10 trans quad) (-> s4-3 quad)) + (t9-20 a0-33 a1-21 a2-10 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + ) + ) + (ja-post) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! vin-turbine ((obj vin-turbine) (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" + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-vin-turbine" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set-vector! (-> obj outside-plane) 0.707 0.0 0.707 -6377922.5) + (set! (-> obj lightning-plane quad) (-> obj outside-plane quad)) + (set! (-> obj lightning-plane w) -6419865.5) + (set! (-> obj dont-draw-outside?) + (nonzero? (res-lump-value (-> obj entity) 'extra-id uint128 :time -1000000000.0)) + ) + (set! (-> obj lightning-timer) (the-as uint 0)) + (if (and (-> obj dont-draw-outside?) + (< (vector4-dot (the-as vector (-> obj outside-plane)) (math-camera-pos)) 0.0) + ) + (go (method-of-object obj dormant)) + (go (method-of-object obj idle)) + ) + (none) + ) + +(defskelgroup skel-vin-door vin-door vin-door-lod0-jg vin-door-idle-ja + ((vin-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3 0 6) + ) + +(deftype vin-door (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! vin-door ((obj vin-door) (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" + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 12288.0 0.0 24576.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 8192.0 16384.0 0.0 20480.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) -8192.0 16384.0 0.0 20480.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-vin-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (static-sound-spec "wood-door-open")) + (set! (-> obj sound-open-stop) (static-sound-spec "wood-open-hit")) + (set! (-> obj sound-close-loop) (static-sound-spec "wood-door-close")) + (set! (-> obj sound-close-stop) (static-sound-spec "wood-close-hit")) + (set! (-> obj door-radius) 12288.0) + (go (method-of-object obj close) #t) + (none) + ) diff --git a/goal_src/jak2/levels/ruins/ruins-obs.gc b/goal_src/jak2/levels/ruins/ruins-obs.gc index cd1484d28..d4df3b3ca 100644 --- a/goal_src/jak2/levels/ruins/ruins-obs.gc +++ b/goal_src/jak2/levels/ruins/ruins-obs.gc @@ -58,15 +58,15 @@ ) (define *ruins-sinking-platform-constants* (new 'static 'rigid-body-platform-constants - :mass 1.48 - :inv-mass 0.6756757 - :cm-joint (new 'static 'vector :w 1.0) - :linear-damping 0.8 - :angular-damping 1.0 - :friction-factor 0.1 - :inertial-tensor-x (meters 2) - :inertial-tensor-y (meters 1) - :inertial-tensor-z (meters 2) + :info (new 'static 'rigid-body-info + :mass 1.48 + :inv-mass 0.6756757 + :linear-damping 0.8 + :angular-damping 1.0 + :friction-factor 0.1 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 2) (meters 1) (meters 2)) + ) :max-time-step 0.02 :gravity (meters 80) :idle-distance (meters 50) @@ -135,7 +135,7 @@ ) :post (behavior () (set! (-> self info-override) *ruins-sinking-platform-constants*) - (set! (-> self rbody state info) (the-as rigid-body-info (&-> (-> self info-override) mass))) + (set! (-> self rbody state info) (-> self info-override info)) (rigid-body-object-method-37 self) (none) ) diff --git a/goal_src/jak2/levels/stadium/stadium-scenes.gc b/goal_src/jak2/levels/stadium/stadium-scenes.gc index 371aea8e8..89f672d43 100644 --- a/goal_src/jak2/levels/stadium/stadium-scenes.gc +++ b/goal_src/jak2/levels/stadium/stadium-scenes.gc @@ -1945,7 +1945,7 @@ (set! (-> gp-0 info sky) #f) ) ) - (race-start 2 #f #t) + (the-as object (race-start 2 #f #t)) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc index 071bd09f2..9d89ba44c 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc @@ -29,16 +29,16 @@ (goto cfg-4) ) (format #t "[~8x] ~A~%" obj 'rigid-body-platform-constants) - (format #t "~1Tinfo: #~%" (&-> obj mass)) - (format #t "~1Tmass: ~f~%" (-> obj mass)) - (format #t "~1Tinv-mass: ~f~%" (-> obj inv-mass)) - (format #t "~1Tcm-joint-x: (meters ~m)~%" (-> obj cm-joint x)) - (format #t "~1Tcm-joint-y: (meters ~m)~%" (-> obj cm-joint y)) - (format #t "~1Tcm-joint-z: (meters ~m)~%" (-> obj cm-joint z)) - (format #t "~1Tlinear-damping: ~f~%" (-> obj linear-damping)) - (format #t "~1Tangular-damping: ~f~%" (-> obj angular-damping)) - (format #t "~1Tbounce-factor: ~f~%" (-> obj bounce-factor)) - (format #t "~1Tfriction-factor: ~f~%" (-> obj friction-factor)) + (format #t "~1Tinfo: #~%" (-> obj info)) + (format #t "~1Tmass: ~f~%" (-> obj info mass)) + (format #t "~1Tinv-mass: ~f~%" (-> obj info inv-mass)) + (format #t "~1Tcm-joint-x: (meters ~m)~%" (-> obj info cm-offset-joint x)) + (format #t "~1Tcm-joint-y: (meters ~m)~%" (-> obj info cm-offset-joint y)) + (format #t "~1Tcm-joint-z: (meters ~m)~%" (-> obj info cm-offset-joint z)) + (format #t "~1Tlinear-damping: ~f~%" (-> obj info linear-damping)) + (format #t "~1Tangular-damping: ~f~%" (-> obj info angular-damping)) + (format #t "~1Tbounce-factor: ~f~%" (-> obj info bounce-factor)) + (format #t "~1Tfriction-factor: ~f~%" (-> obj info friction-factor)) (format #t "~1Tinertial-tensor-x: (meters ~m)~%" (-> obj inertial-tensor-x)) (format #t "~1Tinertial-tensor-y: (meters ~m)~%" (-> obj inertial-tensor-y)) (format #t "~1Tinertial-tensor-z: (meters ~m)~%" (-> obj inertial-tensor-z)) @@ -464,12 +464,12 @@ ) (update-transforms (-> obj root-override-2)) (let ((v1-5 (-> obj rbody)) - (a1-3 (&-> (-> obj info-override) mass)) + (a1-3 (-> obj info-override info)) (a2-2 (-> obj root-override-2 trans)) (a3-0 (-> obj root-override-2 quat)) (t0-0 (method-of-object obj rigid-body-object-method-29)) ) - (rigid-body-method-25 (-> v1-5 state) (the-as rigid-body-info a1-3) a2-2 a3-0 t0-0) + (rigid-body-method-25 (-> v1-5 state) a1-3 a2-2 a3-0 t0-0) ) (set! (-> obj player-bonk-timeout) (the-as uint (-> pp clock frame-counter))) (set! (-> obj player-force quad) (-> *null-vector* quad)) @@ -515,16 +515,16 @@ ;; definition for symbol *rigid-body-platform-constants*, type rigid-body-platform-constants (define *rigid-body-platform-constants* (new 'static 'rigid-body-platform-constants - :mass 2.0 - :inv-mass 0.5 - :cm-joint (new 'static 'vector :w 1.0) - :linear-damping 1.0 - :angular-damping 1.0 - :bounce-factor 0.5 - :friction-factor 0.1 - :inertial-tensor-x (meters 4) - :inertial-tensor-y (meters 4) - :inertial-tensor-z (meters 4) + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.5 + :friction-factor 0.1 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 4) (meters 4) (meters 4)) + ) :max-time-step 0.033333335 :gravity (meters 80) :idle-distance (meters 50) diff --git a/test/decompiler/reference/jak2/engine/entity/entity-table_REF.gc b/test/decompiler/reference/jak2/engine/entity/entity-table_REF.gc index e01645dea..79dbb7650 100644 --- a/test/decompiler/reference/jak2/engine/entity/entity-table_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/entity-table_REF.gc @@ -95,7 +95,7 @@ :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref burning-bush :method-count 35) + :ptype (type-ref burning-bush :method-count 33) :package "game" :art-group '() :pool '*16k-dead-pool* @@ -109,14 +109,14 @@ :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref barge :method-count 151) + :ptype (type-ref barge :method-count 149) :package "game" :art-group '() :pool '*16k-dead-pool* :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref propa :method-count 35) + :ptype (type-ref propa :method-count 32) :package "game" :art-group '() :pool '*16k-dead-pool* @@ -137,7 +137,7 @@ :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref parking-spot :method-count 27) + :ptype (type-ref parking-spot :method-count 25) :package "game" :art-group '() :pool '*16k-dead-pool* @@ -151,14 +151,14 @@ :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref cty-guard-turret :method-count 39) + :ptype (type-ref cty-guard-turret :method-count 36) :package "game" :art-group '() :pool '*16k-dead-pool* :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref cty-fruit-stand :method-count 31) + :ptype (type-ref cty-fruit-stand :method-count 30) :package "game" :art-group '() :pool '*16k-dead-pool* diff --git a/test/decompiler/reference/jak2/engine/game/task/task-control-h_REF.gc b/test/decompiler/reference/jak2/engine/game/task/task-control-h_REF.gc index e3462d84f..d61c8f1af 100644 --- a/test/decompiler/reference/jak2/engine/game/task/task-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/task/task-control-h_REF.gc @@ -1424,7 +1424,7 @@ (data-float float 32 :offset-assert 672) (data-vector vector 32 :inline :offset-assert 800) (actor-group (pointer entity-actor) 4 :offset-assert 1312) - (minimap uint32 8 :offset-assert 1328) + (minimap connection-minimap 8 :offset-assert 1328) (hud handle 4 :offset-assert 1360) (hud-timer handle :offset 1360) (hud-counter handle :offset 1368) diff --git a/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc b/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc index fdb7c09d9..1e9ca5223 100644 --- a/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc @@ -1960,7 +1960,7 @@ ) (set! (-> obj arrow) (the-as handle #f)) (countdown (v1-8 4) - (set! (-> obj minimap v1-8) (the-as uint #f)) + (set! (-> obj minimap v1-8) #f) ) (countdown (v1-11 4) (set! (-> obj actor-group v1-11) (the-as (pointer entity-actor) #f)) diff --git a/test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc b/test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc index 5f4f79ecb..e8a3ce960 100644 --- a/test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc @@ -109,16 +109,16 @@ (goto cfg-4) ) (format #t "[~8x] ~A~%" obj 'rigid-body-object-constants) - (format #t "~1Tinfo: #~%" (&-> obj mass)) - (format #t "~1Tmass: ~f~%" (-> obj mass)) - (format #t "~1Tinv-mass: ~f~%" (-> obj inv-mass)) - (format #t "~1Tcm-joint-x: (meters ~m)~%" (-> obj cm-joint x)) - (format #t "~1Tcm-joint-y: (meters ~m)~%" (-> obj cm-joint y)) - (format #t "~1Tcm-joint-z: (meters ~m)~%" (-> obj cm-joint z)) - (format #t "~1Tlinear-damping: ~f~%" (-> obj linear-damping)) - (format #t "~1Tangular-damping: ~f~%" (-> obj angular-damping)) - (format #t "~1Tbounce-factor: ~f~%" (-> obj bounce-factor)) - (format #t "~1Tfriction-factor: ~f~%" (-> obj friction-factor)) + (format #t "~1Tinfo: #~%" (-> obj info)) + (format #t "~1Tmass: ~f~%" (-> obj info mass)) + (format #t "~1Tinv-mass: ~f~%" (-> obj info inv-mass)) + (format #t "~1Tcm-joint-x: (meters ~m)~%" (-> obj info cm-offset-joint x)) + (format #t "~1Tcm-joint-y: (meters ~m)~%" (-> obj info cm-offset-joint y)) + (format #t "~1Tcm-joint-z: (meters ~m)~%" (-> obj info cm-offset-joint z)) + (format #t "~1Tlinear-damping: ~f~%" (-> obj info linear-damping)) + (format #t "~1Tangular-damping: ~f~%" (-> obj info angular-damping)) + (format #t "~1Tbounce-factor: ~f~%" (-> obj info bounce-factor)) + (format #t "~1Tfriction-factor: ~f~%" (-> obj info friction-factor)) (format #t "~1Tinertial-tensor-x: (meters ~m)~%" (-> obj inertial-tensor-x)) (format #t "~1Tinertial-tensor-y: (meters ~m)~%" (-> obj inertial-tensor-y)) (format #t "~1Tinertial-tensor-z: (meters ~m)~%" (-> obj inertial-tensor-z)) diff --git a/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc b/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc index 8ece07d20..30113dd7a 100644 --- a/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc @@ -910,7 +910,7 @@ ;; definition for method 26 of type rigid-body-object (defmethod get-inv-mass rigid-body-object ((obj rigid-body-object)) - (-> obj info inv-mass) + (-> obj info info inv-mass) ) ;; definition for method 35 of type rigid-body-object @@ -919,10 +919,10 @@ (let ((a0-1 (-> obj info name))) (when (nonzero? a0-1) (set! (-> obj info) (the-as rigid-body-object-constants (-> a0-1 value))) - (set! (-> obj rbody state info) (the-as rigid-body-info (&-> (-> obj info) mass))) + (set! (-> obj rbody state info) (-> obj info info)) ) ) - ((method-of-type rigid-body-info rigid-body-info-method-9) (the-as rigid-body-info (&-> (-> obj info) mass))) + (rigid-body-info-method-9 (-> obj info info)) (set! (-> obj rbody state force-callback) (method-of-object obj rigid-body-object-method-29)) 0 (none) @@ -1002,7 +1002,7 @@ (update-transforms (-> obj root-override-2)) (rigid-body-method-25 (-> obj rbody state) - (the-as rigid-body-info (&-> (-> obj info) mass)) + (-> obj info info) (-> obj root-override-2 trans) (-> obj root-override-2 quat) (method-of-object obj rigid-body-object-method-29) @@ -1050,16 +1050,16 @@ ;; definition for symbol *rigid-body-object-constants*, type rigid-body-object-constants (define *rigid-body-object-constants* (new 'static 'rigid-body-object-constants - :mass 2.0 - :inv-mass 0.5 - :cm-joint (new 'static 'vector :w 1.0) - :linear-damping 1.0 - :angular-damping 1.0 - :bounce-factor 0.5 - :friction-factor 0.1 - :inertial-tensor-x (meters 4) - :inertial-tensor-y (meters 4) - :inertial-tensor-z (meters 4) + :info (new 'static 'rigid-body-info + :mass 2.0 + :inv-mass 0.5 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.5 + :friction-factor 0.1 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 4) (meters 4) (meters 4)) + ) :max-time-step 0.033333335 :gravity (meters 80) :idle-distance (meters 50) @@ -1146,7 +1146,7 @@ This commonly includes things such as: (when (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) (logior! (-> obj rbody state flags) (rigid-body-flag enable-physics)) (rigid-body-method-26 (-> obj rbody state) (-> obj root-override-2 trans) (-> obj root-override-2 quat)) - (vector-float*! (-> obj rbody state lin-momentum) (-> obj root-override-2 transv) (-> obj info mass)) + (vector-float*! (-> obj rbody state lin-momentum) (-> obj root-override-2 transv) (-> obj info info mass)) (vector-reset! (-> obj rbody state ang-momentum)) ) 0 @@ -1345,7 +1345,7 @@ This commonly includes things such as: ) (let ((f0-1 (vector-dot (-> s5-0 velocity) (-> s5-0 normal)))) (when (< f0-1 0.0) - (set! (-> s5-0 impulse) (/ f0-1 (+ f30-0 (-> obj info inv-mass)))) + (set! (-> s5-0 impulse) (/ f0-1 (+ f30-0 (-> obj info info inv-mass)))) (vector+float*! s4-0 s4-0 (-> s5-0 normal) (* -3.1 f30-0 (-> s5-0 impulse))) (set! (-> s4-0 y) (fmax (* 49152.0 f30-0) (-> s4-0 y))) (rigid-body-object-method-42 obj) diff --git a/test/decompiler/reference/jak2/engine/ui/credits_REF.gc b/test/decompiler/reference/jak2/engine/ui/credits_REF.gc new file mode 100644 index 000000000..590f7c448 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ui/credits_REF.gc @@ -0,0 +1,1070 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function draw-end-credits +(defun draw-end-credits ((arg0 level) (arg1 float)) + (let ((f30-0 (- 416.0 arg1)) + (s5-0 3839) + (f28-0 0.0) + (s3-0 #t) + (s4-0 (new + 'stack + 'font-context + *font-default-matrix* + 6 + 0 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + ) + (let ((v1-2 s4-0)) + (set! (-> v1-2 width) (the float 500)) + ) + (let ((v1-3 s4-0)) + (set! (-> v1-3 height) (the float 150)) + ) + (let ((v1-4 s4-0)) + (set! (-> v1-4 scale) 0.8) + ) + (set! (-> s4-0 flags) (font-flags shadow kerning middle large)) + (while (or s3-0 (and (< f30-0 (- f28-0)) (< (the-as uint s5-0) (the-as uint 4272)))) + (+! f30-0 f28-0) + (+! s5-0 1) + (let ((a0-6 (lookup-text arg0 (the-as game-text-id s5-0) #t))) + (while (and a0-6 (zero? (-> a0-6 data 0)) (< (the-as uint s5-0) (the-as uint 4272))) + (+! s5-0 1) + (set! a0-6 (lookup-text arg0 (the-as game-text-id s5-0) #t)) + ) + (set! f28-0 (if a0-6 + (+ 5.0 (print-game-text a0-6 s4-0 #t 35 (bucket-id progress))) + 40.0 + ) + ) + ) + (set! s3-0 #f) + ) + (cond + ((and (< (the-as uint 3895) (the-as uint s5-0)) (cpad-pressed? 0 triangle circle x)) + #t + ) + ((and (= s5-0 4272) (< f30-0 (- f28-0))) + #t + ) + (else + (set! (-> s4-0 origin y) f30-0) + (while (< (-> s4-0 origin y) 416.0) + (let ((a0-15 (lookup-text arg0 (the-as game-text-id s5-0) #t))) + (while (and a0-15 (zero? (-> a0-15 data 0)) (< (the-as uint s5-0) (the-as uint 4272))) + (+! s5-0 1) + (set! a0-15 (lookup-text arg0 (the-as game-text-id s5-0) #t)) + ) + (let ((f0-10 (if a0-15 + (+ 5.0 (print-game-text a0-15 s4-0 #f 35 (bucket-id progress))) + 40.0 + ) + ) + ) + (+! (-> s4-0 origin y) f0-10) + ) + ) + (+! s5-0 1) + ) + #f + ) + ) + ) + ) + +;; definition for function start-credits +;; WARN: Return type mismatch int vs none. +(defun start-credits ((arg0 process)) + (remove-setting! 'movie) + (remove-setting! 'music-volume) + (persist-with-delay *setting-control* 'music-volume (seconds 3) 'music-volume 'abs 0.001 0) + (process-spawn-function + process + (lambda :behavior scene-player + () + (set-setting! 'allow-pause #f 0 0) + (set-setting! 'allow-progress #f 0 0) + (set-setting! 'music 'forest 0 0) + (set-setting! 'sound-mode #f 0 1) + (apply-settings *setting-control*) + (let ((gp-0 (ppointer->process (-> self parent)))) + (when (type? gp-0 scene-player) + (if (lookup-gui-connection + *gui-control* + (the-as process gp-0) + (gui-channel art-load) + (the-as string #f) + (new 'static 'sound-id) + ) + (sound-group-pause (sound-group dialog)) + ) + ) + ) + (let ((gp-1 (-> self clock frame-counter))) + (while (let ((a0-9 (level-get *level* 'outrocst))) + (and a0-9 (not (draw-end-credits a0-9 (* 0.15 (the float (- (-> self clock frame-counter) gp-1)))))) + ) + (suspend) + ) + ) + (let ((gp-2 (ppointer->process (-> self parent)))) + (when (type? gp-2 scene-player) + (if (lookup-gui-connection + *gui-control* + (the-as process gp-2) + (gui-channel art-load) + (the-as string #f) + (new 'static 'sound-id) + ) + (sound-group-continue (sound-group dialog)) + ) + ) + ) + (none) + ) + :to arg0 + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-fireworks + :id 1272 + :duration (seconds 169.6) + :flags (always-draw) + :bounds (static-bspherem 0 0 0 2500) + :parts ((sp-item 5406 :binding 5402) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5402 :flags (start-dead)) + (sp-item 5407 :binding 5403) + (sp-item 5403 :flags (start-dead launch-asap) :binding 5404) + (sp-item 5403 :flags (start-dead launch-asap) :binding 5404) + (sp-item 5403 :flags (start-dead launch-asap) :binding 5404) + (sp-item 5403 :flags (start-dead launch-asap) :binding 5404) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5404 :flags (start-dead)) + (sp-item 5408 :binding 5405) + (sp-item 5405 :flags (start-dead)) + (sp-item 5405 :flags (start-dead)) + (sp-item 5405 :flags (start-dead)) + (sp-item 5405 :flags (start-dead)) + (sp-item 5405 :flags (start-dead)) + (sp-item 5405 :flags (start-dead)) + (sp-item 5405 :flags (start-dead)) + ) + ) + +;; failed to figure out what this is: +(defpart 5408 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xdb9)) + (sp-flt spt-num 0.01) + (sp-sound (static-sound-spec "whistle-green")) + (sp-flt spt-scale-x (meters 2.5)) + (sp-flt spt-scale-y (meters 4.5)) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-flt spt-omega 28.672) + (sp-rnd-flt spt-vel-y (meters 0.4) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -720.0) (degrees 1440.0) 1.0) + (sp-flt spt-friction 0.96) + (sp-int spt-timer 750) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-flt spt-userdata 4096000.0) + (sp-func spt-func 'check-pop-level-firework-green-userdata) + (sp-int-plain-rnd spt-next-time 200 99 1) + (sp-launcher-by-id spt-next-launcher 5409) + (sp-rnd-flt spt-conerot-x (degrees 20.0) (degrees 60.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5405 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #xdb9)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 64.0 64.0 1.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 64.0) + (sp-rnd-flt spt-a 16.0 48.0 1.0) + (sp-rnd-flt spt-vel-y (meters -0.04) (meters 0.12) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.01) (meters 0.01) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.15) (degrees 0.3) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.10666667 -0.21333334 1.0) + (sp-rnd-flt spt-accel-y -0.68266666 -1.3653333 1.0) + (sp-rnd-flt spt-friction 0.9 0.02 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 use-global-acc) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-z (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-firework-green-pop + :id 1273 + :duration (seconds 0.835) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 120) + :parts ((sp-item 5412 :flags (launch-asap)) + (sp-item 5413 :flags (launch-asap)) + (sp-item 5414 :binding 5410) + (sp-item 5410 :flags (bit1 start-dead launch-asap) :binding 5411) + (sp-item 5410 :flags (bit1 start-dead launch-asap) :binding 5411) + (sp-item 5410 :flags (bit1 start-dead launch-asap) :binding 5411) + (sp-item 5410 :flags (bit1 start-dead launch-asap) :binding 5411) + (sp-item 5410 :flags (bit1 start-dead launch-asap) :binding 5411) + (sp-item 5410 :flags (bit1 start-dead launch-asap) :binding 5411) + (sp-item 5410 :flags (bit1 start-dead launch-asap) :binding 5411) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + (sp-item 5411 :flags (start-dead)) + ) + ) + +;; failed to figure out what this is: +(defpart 5412 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-sound (static-sound-spec "explode-green")) + (sp-rnd-flt spt-scale-x (meters 48) (meters 0.1) 1.0) + (sp-rnd-flt spt-rot-z (degrees -17.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-scalevel-x (meters -1.6)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -10.2) + (sp-flt spt-fade-g 0.0) + (sp-flt spt-fade-b -10.2) + (sp-int spt-timer 350) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 25) + (sp-launcher-by-id spt-next-launcher 5415) + ) + ) + +;; failed to figure out what this is: +(defpart 5415 + :init-specs ((sp-flt spt-scale-x (meters 8)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-scalevel-x (meters -0.026666667)) + (sp-copy-from-other spt-scalevel-y -4) + ) + ) + +;; failed to figure out what this is: +(defpart 5413 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 24) (meters 0.1) 1.0) + (sp-rnd-flt spt-rot-z (degrees -17.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-scalevel-x (meters -0.8)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-timer 350) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 25) + (sp-launcher-by-id spt-next-launcher 5416) + ) + ) + +;; failed to figure out what this is: +(defpart 5416 + :init-specs ((sp-flt spt-scale-x (meters 4)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-scalevel-x (meters -0.013333334)) + (sp-copy-from-other spt-scalevel-y -4) + ) + ) + +;; failed to figure out what this is: +(defpart 5414 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xdb9)) + (sp-rnd-flt spt-num 0.0 1.0 1.0) + (sp-flt spt-scale-x (meters 0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 255.0) + (sp-rnd-flt spt-vel-y (meters 0.2) (meters 0.05) 1.0) + (sp-rnd-flt spt-accel-y -6.826667 3.4133334 1.0) + (sp-rnd-flt spt-friction 0.94 0.02 1.0) + (sp-int spt-timer 250) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-z (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5410 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xdb9)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 160) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 160) 1.0) + (sp-flt spt-z (meters 0.75)) + (sp-flt spt-scale-x (meters 3)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 255.0) + (sp-rnd-flt spt-omega 0.0 655360.0 1.0) + (sp-flt spt-vel-x (meters 0.44444442)) + (sp-flt spt-vel-z (meters 0.006666667)) + (sp-rnd-flt spt-fade-r -2.55 -2.55 1.0) + (sp-flt spt-fade-g -1.7) + (sp-rnd-flt spt-fade-b -10.2 -10.2 1.0) + (sp-flt spt-accel-x -30.340742) + (sp-int-plain-rnd spt-timer 100 199 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-1 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 5411 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xdb9)) + (sp-func spt-birth-func 'birth-func-firework-color) + (sp-flt spt-num 3.0) + (sp-flt spt-scale-x (meters 2.5)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-scalevel-x (meters -0.006666667) (meters -0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.15) (degrees 0.3) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-accel-x -0.68266666 -0.34133333 1.0) + (sp-rnd-flt spt-accel-y -1.3653333 -0.68266666 1.0) + (sp-rnd-flt spt-friction 0.9 0.02 1.0) + (sp-int-plain-rnd spt-timer 150 449 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 use-global-acc) + (sp-int-plain-rnd spt-next-time 150 599 1) + (sp-launcher-by-id spt-next-launcher 5417) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-z (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5417 + :init-specs ((sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-scalevel-x (meters -0.025)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-timer 80) + ) + ) + +;; failed to figure out what this is: +(defpart 5407 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 0.01) + (sp-sound (static-sound-spec "whistle-red")) + (sp-flt spt-scale-x (meters 2.5)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 0.0) + (sp-flt spt-omega 28.672) + (sp-rnd-flt spt-vel-y (meters 0.33333334) (meters 0.06666667) 1.0) + (sp-flt spt-accel-y -3.4133334) + (sp-rnd-flt spt-friction 0.98 0.02 1.0) + (sp-int spt-timer 700) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-flt spt-userdata 4096000.0) + (sp-func spt-func 'check-pop-level-firework-red-userdata) + (sp-int spt-next-time 595) + (sp-launcher-by-id spt-next-launcher 5409) + (sp-rnd-flt spt-conerot-x (degrees -10.0) (degrees 30.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5403 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xdb9)) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 0)) + (sp-flt spt-y (meters 0)) + (sp-flt spt-z (meters 0.75)) + (sp-rnd-flt spt-scale-x (meters 2.5) (meters 0.3) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-omega 0.0) + (sp-flt spt-vel-x (meters 0.7407408)) + (sp-flt spt-vel-y (meters 0.14814815)) + (sp-flt spt-vel-z (meters 0)) + (sp-flt spt-accel-x -30.340742) + (sp-int spt-timer 590) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 5404 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #xdb9)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 3) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters -0.01) (meters 0.03) 1.0) + (sp-rnd-flt spt-scalevel-x (meters -0.006666667) (meters -0.013333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.15) (degrees 0.3) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-accel-y -2.048 -1.3653333 1.0) + (sp-rnd-flt spt-friction 0.9 0.02 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 use-global-acc) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-z (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-firework-red-pop + :id 1274 + :duration (seconds 0.75) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 120) + :parts ((sp-item 5419 :flags (launch-asap)) (sp-item 5420 :flags (launch-asap) :binding 5418)) + ) + +;; failed to figure out what this is: +(defpart 5419 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-sound (static-sound-spec "explode-red")) + (sp-rnd-flt spt-scale-x (meters 48) (meters 0.1) 1.0) + (sp-rnd-flt spt-rot-z (degrees -17.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-scalevel-x (meters -1.28)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -5.12) + (sp-flt spt-fade-b -10.2) + (sp-int spt-timer 200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 25) + (sp-launcher-by-id spt-next-launcher 5421) + ) + ) + +;; failed to figure out what this is: +(defpart 5421 + :init-specs ((sp-flt spt-scalevel-x (meters -0.09142857)) (sp-copy-from-other spt-scalevel-y -4)) + ) + +;; failed to figure out what this is: +(defpart 5420 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #xdb9)) + (sp-flt spt-num 128.0) + (sp-rnd-flt spt-scale-x (meters 0.75) (meters 0.25) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-omega 40.96 40.96 1.0) + (sp-rnd-flt spt-vel-y (meters 0.26666668) (meters 0.06666667) 1.0) + (sp-flt spt-fade-r 0.0) + (sp-rnd-flt spt-fade-g -0.85 -0.85 1.0) + (sp-rnd-flt spt-fade-b -1.7 -1.7 1.0) + (sp-rnd-flt spt-accel-y -6.826667 3.4133334 1.0) + (sp-rnd-flt spt-friction 0.94 0.02 1.0) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-motion-blur) + (sp-int-plain-rnd spt-next-time 175 49 1) + (sp-launcher-by-id spt-next-launcher 5422) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-z (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5422 + :init-specs ((sp-flt spt-scale-x (meters 2.5)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-scalevel-x (meters -0.016666668)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g 0.0) + (sp-func spt-func 'nothing) + (sp-int-plain-rnd spt-next-time 5 149 1) + (sp-launcher-by-id spt-next-launcher 5423) + ) + ) + +;; failed to figure out what this is: +(defpart 5423 + :init-specs ((sp-flt spt-scale-x (meters 3)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 255.0) + (sp-int spt-timer 100) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 5424) + ) + ) + +;; failed to figure out what this is: +(defpart 5424 + :init-specs ((sp-flt spt-scale-x (meters 2)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-fade-a -0.8 -0.8 1.0) + ) + ) + +;; definition for function check-pop-level-firework-userdata +;; INFO: Used lq/sq +(defun check-pop-level-firework-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (when (< (-> arg1 user-float) (-> arg2 launchrot y)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s3-0 (-> arg2 launchrot x) (-> arg2 launchrot y) (-> arg2 launchrot z) 1.0) + (let ((s2-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when s2-0 + (let ((t9-2 (method-of-type part-tracker activate))) + (t9-2 + (the-as part-tracker s2-0) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((t9-3 run-function-in-process) + (a0-5 s2-0) + (a1-4 part-tracker-init) + (a2-5 (-> *part-group-id-table* 1275)) + (a3-1 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> s3-0 quad)) + ((the-as (function object object object object object object object object none) t9-3) + a0-5 + a1-4 + a2-5 + a3-1 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> s2-0 ppointer) + ) + ) + ) + ) + (sparticle-motion-blur arg0 arg1 (the-as vector arg2)) + (none) + ) + +;; definition for function check-pop-level-firework-red-userdata +;; INFO: Used lq/sq +(defun check-pop-level-firework-red-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (when (< (-> arg1 user-float) (-> arg2 launchrot y)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s3-0 (-> arg2 launchrot x) (-> arg2 launchrot y) (-> arg2 launchrot z) 1.0) + (let ((s2-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when s2-0 + (let ((t9-2 (method-of-type part-tracker activate))) + (t9-2 + (the-as part-tracker s2-0) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((t9-3 run-function-in-process) + (a0-5 s2-0) + (a1-4 part-tracker-init) + (a2-5 (-> *part-group-id-table* 1274)) + (a3-1 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> s3-0 quad)) + ((the-as (function object object object object object object object object none) t9-3) + a0-5 + a1-4 + a2-5 + a3-1 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> s2-0 ppointer) + ) + ) + ) + ) + (sparticle-motion-blur arg0 arg1 (the-as vector arg2)) + (none) + ) + +;; definition for function check-pop-level-firework-green-userdata +;; INFO: Used lq/sq +(defun check-pop-level-firework-green-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (when (< (-> arg1 user-float) (-> arg2 launchrot y)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s3-0 (-> arg2 launchrot x) (-> arg2 launchrot y) (-> arg2 launchrot z) 1.0) + (let ((s2-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when s2-0 + (let ((t9-2 (method-of-type part-tracker activate))) + (t9-2 + (the-as part-tracker s2-0) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((t9-3 run-function-in-process) + (a0-5 s2-0) + (a1-4 part-tracker-init) + (a2-5 (-> *part-group-id-table* 1273)) + (a3-1 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> s3-0 quad)) + ((the-as (function object object object object object object object object none) t9-3) + a0-5 + a1-4 + a2-5 + a3-1 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> s2-0 ppointer) + ) + ) + ) + ) + (sparticle-motion-blur arg0 arg1 (the-as vector arg2)) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyport-firework-pop + :id 1275 + :duration (seconds 0.75) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 120) + :parts ((sp-item 5425 :flags (launch-asap)) + (sp-item 5426 :flags (launch-asap) :binding 5418) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + (sp-item 5418 :flags (start-dead)) + ) + ) + +;; definition for function birth-func-firework-color +;; WARN: Return type mismatch int vs none. +(defun birth-func-firework-color ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (let ((v1-0 (-> arg4 sprite))) + (set! (-> arg2 r-g-b-a x) (-> v1-0 sprite r-g-b-a x)) + (set! (-> arg2 r-g-b-a y) (-> v1-0 sprite r-g-b-a y)) + (set! (-> arg2 r-g-b-a z) (-> v1-0 sprite r-g-b-a z)) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 5418 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #xdb9)) + (sp-func spt-birth-func 'birth-func-firework-color) + (sp-rnd-flt spt-num 0.25 0.5 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters -0.01) (meters 0.03) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.0033333334) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.15) (degrees 0.3) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) + (sp-rnd-flt spt-accel-x -0.68266666 -0.34133333 1.0) + (sp-rnd-flt spt-accel-y -1.3653333 -0.68266666 1.0) + (sp-rnd-flt spt-friction 0.9 0.02 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 use-global-acc) + (sp-int spt-next-time 50) + (sp-launcher-by-id spt-next-launcher 5427) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5427 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.0016666667) (meters 0.0033333334) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-next-time 50) + (sp-launcher-by-id spt-next-launcher 5428) + ) + ) + +;; failed to figure out what this is: +(defpart 5428 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters -0.00083333335) (meters -0.0016666667) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int-plain-rnd spt-next-time 150 599 1) + (sp-launcher-by-id spt-next-launcher 5429) + ) + ) + +;; failed to figure out what this is: +(defpart 5429 + :init-specs ((sp-flt spt-scale-x (meters 1)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 128.0 128.0 1.0) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 5430) + ) + ) + +;; failed to figure out what this is: +(defpart 5430 + :init-specs ((sp-flt spt-r 128.0) (sp-flt spt-g 128.0) (sp-flt spt-b 128.0) (sp-flt spt-a 64.0) (sp-flt spt-fade-a -0.8)) + ) + +;; failed to figure out what this is: +(defpart 5425 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-sound (static-sound-spec "explode-blue")) + (sp-rnd-flt spt-scale-x (meters 48) (meters 0.1) 1.0) + (sp-rnd-flt spt-rot-z (degrees -17.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-scalevel-x (meters -1.28)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -5.12) + (sp-flt spt-fade-b -10.2) + (sp-int spt-timer 200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 25) + (sp-launcher-by-id spt-next-launcher 5431) + ) + ) + +;; failed to figure out what this is: +(defpart 5431 + :init-specs ((sp-flt spt-r 0.0) + (sp-flt spt-scalevel-x (meters -0.09142857)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -1.6) + (sp-flt spt-fade-b 0.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5426 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xdb9)) + (sp-rnd-flt spt-num 24.0 12.0 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 0.3) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-omega 40.96) + (sp-rnd-flt spt-vel-y (meters 0.26666668) (meters 0.06666667) 1.0) + (sp-flt spt-fade-r -3.4) + (sp-flt spt-fade-g -1.7) + (sp-flt spt-fade-b -0.85) + (sp-rnd-flt spt-accel-y -6.826667 3.4133334 1.0) + (sp-rnd-flt spt-friction 0.94 0.02 1.0) + (sp-int-plain-rnd spt-timer 300 74 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-motion-blur) + (sp-int-plain-rnd spt-next-time 175 24 1) + (sp-launcher-by-id spt-next-launcher 5432) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-z (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5432 + :init-specs ((sp-flt spt-fade-g 0.0) (sp-rnd-flt spt-fade-a -0.85333335 -0.85333335 1.0)) + ) + +;; failed to figure out what this is: +(defpart 5406 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #xdb9)) + (sp-flt spt-num 0.01) + (sp-sound (static-sound-spec "whistle--blue")) + (sp-rnd-flt spt-scale-x (meters 4.5) (meters 0.3) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-omega 28.672) + (sp-rnd-flt spt-vel-y (meters 0.4) (meters 0.06666667) 1.0) + (sp-flt spt-accel-y -6.826667) + (sp-rnd-flt spt-friction 0.98 0.02 1.0) + (sp-int spt-timer 750) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-flt spt-userdata 4096000.0) + (sp-func spt-func 'check-pop-level-firework-userdata) + (sp-int-plain-rnd spt-next-time 300 299 1) + (sp-launcher-by-id spt-next-launcher 5409) + (sp-rnd-flt spt-conerot-x (degrees -20.0) (degrees 60.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5409 + :init-specs ((sp-flt spt-userdata -4096000.0)) + ) + +;; failed to figure out what this is: +(defpart 5402 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #xdb9)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters -0.01) (meters 0.03) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.01) (meters 0.01) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.15) (degrees 0.3) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.21333334 -0.42666668 1.0) + (sp-rnd-flt spt-accel-y -0.68266666 -1.3653333 1.0) + (sp-rnd-flt spt-friction 0.9 0.02 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 use-global-acc) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-z (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/castle/pad/castle-tasks_REF.gc b/test/decompiler/reference/jak2/levels/castle/pad/castle-tasks_REF.gc new file mode 100644 index 000000000..da0f8fd9b --- /dev/null +++ b/test/decompiler/reference/jak2/levels/castle/pad/castle-tasks_REF.gc @@ -0,0 +1,40 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 219 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> self info end-sphere quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 (the-as task-arrow self)))) + ) + (until #f + (when (< (vector-vector-distance (target-pos 0) (-> self info end-sphere)) (-> self info end-sphere r)) + (send-event (handle->process (-> self arrow)) 'leave) + (let ((gp-2 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-2) (seconds 0.007)) + (suspend) + ) + ) + (go-virtual complete) + ) + (suspend) + ) + #f + (none) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/city/common/ctyport-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/common/ctyport-obs_REF.gc new file mode 100644 index 000000000..cb5c235c1 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/city/common/ctyport-obs_REF.gc @@ -0,0 +1,1056 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type boat-manager +(deftype boat-manager (process) + ((mesh basic :offset-assert 128) + (paths path-control 4 :offset-assert 132) + ) + :heap-base #x20 + :method-count-assert 16 + :size-assert #x94 + :flag-assert #x1000200094 + (:methods + (idle () _type_ :state 14) + (boat-manager-method-15 (_type_) none 15) + ) + ) + +;; definition for method 3 of type boat-manager +(defmethod inspect boat-manager ((obj boat-manager)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Tmesh: ~A~%" (-> obj mesh)) + (format #t "~2Tpaths[4] @ #x~X~%" (-> obj paths)) + (label cfg-4) + obj + ) + +;; definition for symbol *barge-constants*, type rigid-body-vehicle-constants +(define *barge-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 100.0 + :inv-mass 0.01 + :linear-damping 0.9 + :angular-damping 0.9 + :bounce-factor 0.1 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :z 8192.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 16) (meters 6) (meters 20)) + ) + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + :name '*barge-constants* + :flags #x8 + :object-type #x11 + :guard-type #x7 + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 1.0 + :turbo-boost-factor 1.0 + :max-xz-speed (meters 30) + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261824 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 1274.3112 + :tire-friction-factor 1.0 + :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 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.7 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 0.5 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :turning-accel (meters 20) + :toughness-factor 1.0 + :damage-factor 0.5 + :camera-string-min-height (meters 4.5) + :camera-string-max-height (meters 4.5) + :camera-string-min-length (meters 5) + :camera-string-max-length (meters 12.5) + :camera-min-fov 15109.688 + :camera-max-fov 17476.268 + :camera-head-offset 8192.0 + :camera-foot-offset 4096.0 + :camera-normal-max-angle-offset 182.04445 + :camera-air-max-angle-offset 5461.3335 + :camera-max-lookaround-speed 40960.0 + :rider-stance #x1 + :grab-rail-array #f + :rider-hand-offset (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :explosion #f + :engine-pitch-scale 0.25 + :engine-pitch-mod-amp 0.05 + :engine-sound (static-sound-name "vehicle-engine") + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "car-scrape-stn") + :glance-sound (static-sound-name "car-glance-stn") + :impact-sound (static-sound-name "car-impact-stn") + :extra-sound (static-sound-name "car-by-1") + :explosion-part #xa1 + :thruster-flame-width (meters 0.25) + :thruster-flame-length (meters 4) + :thruster-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :exhaust-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :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 :w 1.0) (new 'static 'vector :w 1.0)) + :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :z 22118.4 :w 1.0) + :brake-local-pos (new 'static 'vector :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 of type boat-base +(deftype boat-base (vehicle) + ((angle float :offset-assert 880) + (y-rot float :offset-assert 884) + (path-num uint32 :offset-assert 888) + (path-index float :offset-assert 892) + ) + :heap-base #x300 + :method-count-assert 149 + :size-assert #x380 + :flag-assert #x9503000380 + (:methods + (boat-base-method-144 (_type_ nav-control) none 144) + (boat-base-method-145 (_type_ nav-control) none 145) + (boat-base-method-146 (_type_ nav-control) none 146) + (boat-base-method-147 (_type_ nav-control) none 147) + (boat-base-method-148 (_type_ nav-control) none 148) + ) + ) + +;; definition for method 3 of type boat-base +(defmethod inspect boat-base ((obj boat-base)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type vehicle inspect))) + (t9-0 obj) + ) + (format #t "~2Tangle: ~f~%" (-> obj angle)) + (format #t "~2Ty-rot: ~f~%" (-> obj y-rot)) + (format #t "~2Tpath-num: ~D~%" (-> obj path-num)) + (format #t "~2Tpath-index: ~f~%" (-> obj path-index)) + (label cfg-4) + obj + ) + +;; definition for method 144 of type boat-base +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod boat-base-method-144 boat-base ((obj boat-base) (arg0 nav-control)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> arg0 state))) + (set! (-> gp-0 rotation-rate) (-> gp-0 nav max-rotation-rate)) + (if (< 0.0 (-> gp-0 speed)) + (set! (-> gp-0 rotation-rate) + (fmin + (-> gp-0 rotation-rate) + (* (/ (-> gp-0 nav turning-acceleration) (-> gp-0 speed)) (-> gp-0 mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> gp-0 nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> gp-0 heading) (-> gp-0 nav shape quat)) + (set! (-> gp-0 heading y) 0.0) + (let ((v1-12 (-> gp-0 heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((a1-2 (new 'stack-no-clear 'vector))) + (set! (-> a1-2 quad) (-> gp-0 nav shape trans quad)) + (if (or (not (-> gp-0 current-poly)) + (!= (-> gp-0 current-pos x) (-> a1-2 x)) + (!= (-> gp-0 current-pos z) (-> a1-2 z)) + ) + (do-navigation-to-destination gp-0 a1-2) + ) + ) + (logclear! + (-> gp-0 flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap) + ) + ) + 0 + 0 + (none) + ) + ) + +;; definition for method 145 of type boat-base +;; WARN: Return type mismatch int vs none. +(defmethod boat-base-method-145 boat-base ((obj boat-base) (arg0 nav-control)) + (navigate-using-route-portals (-> arg0 state)) + 0 + 0 + (none) + ) + +;; definition for method 146 of type boat-base +;; WARN: Return type mismatch int vs none. +(defmethod boat-base-method-146 boat-base ((obj boat-base) (arg0 nav-control)) + (navigate-using-best-dir-recompute-avoid-spheres-2 (-> arg0 state)) + 0 + (none) + ) + +;; definition for method 147 of type boat-base +;; WARN: Return type mismatch int vs none. +(defmethod boat-base-method-147 boat-base ((obj boat-base) (arg0 nav-control)) + (update-travel-dir-from-spheres (-> arg0 state)) + 0 + (none) + ) + +;; definition for method 148 of type boat-base +;; WARN: Return type mismatch int vs none. +(defmethod boat-base-method-148 boat-base ((obj boat-base) (arg0 nav-control)) + (compute-speed-simple (-> arg0 state)) + 0 + (none) + ) + +;; definition for symbol *boat-nav-callback-info*, type nav-callback-info +(define *boat-nav-callback-info* + (new 'static 'nav-callback-info + :callback-count 5 + :callback-array (new 'static 'array (function object nav-control none) 10 + (lambda ((arg0 object) (arg1 nav-control)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> arg1 state))) + (set! (-> gp-0 rotation-rate) (-> gp-0 nav max-rotation-rate)) + (if (< 0.0 (-> gp-0 speed)) + (set! (-> gp-0 rotation-rate) + (fmin + (-> gp-0 rotation-rate) + (* (/ (-> gp-0 nav turning-acceleration) (-> gp-0 speed)) (-> gp-0 mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> gp-0 nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> gp-0 heading) (-> gp-0 nav shape quat)) + (set! (-> gp-0 heading y) 0.0) + (let ((v1-14 (-> gp-0 heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-14 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-14 quad) vf1) + ) + ) + (let ((a1-2 (new 'stack-no-clear 'vector))) + (set! (-> a1-2 quad) (-> gp-0 nav shape trans quad)) + (if (or (not (-> gp-0 current-poly)) + (!= (-> gp-0 current-pos x) (-> a1-2 x)) + (!= (-> gp-0 current-pos z) (-> a1-2 z)) + ) + (do-navigation-to-destination gp-0 a1-2) + ) + ) + (logclear! + (-> gp-0 flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap) + ) + ) + 0 + 0 + 0 + (none) + ) + ) + (lambda ((arg0 object) (arg1 nav-control)) (navigate-using-route-portals (-> arg1 state)) 0 0 0 (none)) + (lambda ((arg0 object) (arg1 nav-control)) + (let* ((v1-0 arg1) + (a2-2 (-> v1-0 state mesh sphere-hash sphere-array)) + (a3-0 (-> v1-0 sphere-id-array)) + (t0-1 (-> v1-0 state mesh bounds)) + (t1-0 (-> v1-0 root-nav-sphere)) + (t2-0 (-> v1-0 sphere-count)) + ) + (dotimes (t3-0 t2-0) + (let ((t5-0 (-> a2-2 (-> a3-0 t3-0))) + (t4-4 (-> v1-0 sphere-array t3-0)) + ) + (vector-! (the-as vector t4-4) (the-as vector t5-0) t0-1) + (set! (-> t4-4 r) (+ (-> t5-0 r) (-> t1-0 w))) + ) + ) + ) + 0 + (navigate-using-best-dir-recompute-avoid-spheres-2 (-> arg1 state)) + 0 + 0 + (none) + ) + (lambda ((arg0 object) (arg1 nav-control)) + (let* ((v1-0 arg1) + (a2-2 (-> v1-0 state mesh sphere-hash sphere-array)) + (a3-0 (-> v1-0 sphere-id-array)) + (t0-1 (-> v1-0 state mesh bounds)) + (t1-0 (-> v1-0 root-nav-sphere)) + (t2-0 (-> v1-0 sphere-count)) + ) + (dotimes (t3-0 t2-0) + (let ((t5-0 (-> a2-2 (-> a3-0 t3-0))) + (t4-4 (-> v1-0 sphere-array t3-0)) + ) + (vector-! (the-as vector t4-4) (the-as vector t5-0) t0-1) + (set! (-> t4-4 r) (+ (-> t5-0 r) (-> t1-0 w))) + ) + ) + ) + 0 + (update-travel-dir-from-spheres (-> arg1 state)) + 0 + 0 + (none) + ) + (lambda ((arg0 object) (arg1 nav-control)) (compute-speed-simple (-> arg1 state)) 0 0 (none)) + ) + ) + ) + +;; definition for method 44 of type boat-base +;; WARN: Return type mismatch int vs none. +(defmethod apply-damage boat-base ((obj boat-base) (arg0 float) (arg1 rigid-body-impact)) + 0 + (none) + ) + +;; definition for method 47 of type boat-base +(defmethod rigid-body-object-method-47 boat-base ((obj boat-base) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) + ((method-of-type vehicle rigid-body-object-method-47) obj arg0 arg1 arg2 arg3) + #f + ) + +;; definition for method 120 of type boat-base +;; INFO: Used lq/sq +(defmethod vehicle-method-120 boat-base ((obj boat-base)) + (with-pp + (let ((t9-0 (method-of-type vehicle vehicle-method-120))) + (t9-0 obj) + ) + (when (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) + (let ((a1-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override-2 quat))) + (s5-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-from-two-vectors-max-angle! s5-0 a1-1 *up-vector* (* 728.1778 (-> pp clock seconds-per-frame))) + (quaternion*! (-> obj root-override-2 quat) s5-0 (-> obj root-override-2 quat)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override-2 quat))) + ) + (new 'stack-no-clear 'vector) + (let ((a1-4 (-> obj nav state))) + (set! (-> s4-0 quad) (-> a1-4 velocity quad)) + ) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (let ((s0-0 (-> obj nav state current-poly))) + (vector-xz-normalize-copy! s1-0 s4-0 163840.0) + (set! (-> s2-0 quad) (-> s1-0 quad)) + (clamp-vector-to-mesh-no-gaps (-> obj nav) (-> obj root-override-2 trans) s0-0 s2-0 s3-0) + ) + (when (-> s3-0 found-boundary) + (let ((f30-0 (vector-length s4-0))) + (vector-flatten! s4-0 s4-0 (-> s3-0 boundary-normal)) + (vector-rotate90-around-y! s4-0 (-> s3-0 boundary-normal)) + (vector-normalize! s4-0 f30-0) + ) + (when (= obj *debug-actor*) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> obj root-override-2 trans) s4-0 (meters 10) *color-blue*) + (format *stdcon* "avoid border~%") + ) + ) + ) + (set! (-> obj y-rot) (- (-> obj y-rot) (* 2.0 (-> pp clock seconds-per-frame) (-> obj y-rot)))) + (+! (-> obj y-rot) + (* 10.0 + (-> pp clock seconds-per-frame) + (deg- (deg- (vector-y-angle s4-0) (quaternion-y-angle (-> obj root-override-2 quat))) (-> obj y-rot)) + ) + ) + (set! (-> obj y-rot) (fmax -10922.667 (fmin 10922.667 (-> obj y-rot)))) + (set! (-> obj y-rot) (deg- (vector-y-angle s4-0) (quaternion-y-angle (-> obj root-override-2 quat)))) + (quaternion-rotate-local-y! + (-> obj root-override-2 quat) + (-> obj root-override-2 quat) + (* (-> obj y-rot) (-> pp clock seconds-per-frame)) + ) + (vector-v*float+! (-> obj root-override-2 trans) (-> obj root-override-2 trans) s5-1 8954.266) + ) + (seek! (-> obj root-override-2 trans y) 4096.0 (* 4096.0 (-> pp clock seconds-per-frame))) + (when (= obj *debug-actor*) + (format *stdcon* "no physics~%") + (format *stdcon* "~M~%" (-> obj root-override-2 trans y)) + ) + ) + (if (= obj *debug-actor*) + (format *stdcon* "speed ~M~%" (vector-length (-> obj root-override-2 transv))) + ) + (let ((s4-2 (ppointer->process (-> obj parent))) + (s5-2 (new 'stack-no-clear 'vector)) + ) + (when s4-2 + (let ((a1-24 (-> obj nav state))) + (set! (-> s5-2 quad) (-> a1-24 target-post quad)) + ) + (when (< (vector-vector-xz-distance (-> obj root-override-2 trans) s5-2) 163840.0) + (set! (-> obj path-index) (+ 0.01 (-> obj path-index))) + (let ((f0-22 (-> obj path-index))) + (set! (-> obj path-index) (- f0-22 (* (the float (the int (/ f0-22 1.0))) 1.0))) + ) + ) + (get-point-at-percent-along-path! + (-> (the-as boat-manager (+ (* (-> obj path-num) 4) (the-as uint s4-2))) paths 0) + s5-2 + (-> obj path-index) + 'interp + ) + (let ((v1-76 (-> obj nav state))) + (logclear! (-> v1-76 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-76 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-76 target-post quad) (-> s5-2 quad)) + ) + 0 + ) + ) + (vehicle-method-85 obj) + (none) + ) + ) + +;; definition for method 29 of type boat-base +;; INFO: Used lq/sq +(defmethod rigid-body-object-method-29 boat-base ((obj boat-base) (arg0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s3-0 (-> obj rbody)) + (s2-0 (-> obj info-override)) + (s4-0 (new 'stack-no-clear 'matrix)) + ) + (let ((a1-1 (-> obj nav state))) + (set! (-> s4-0 vector 1 quad) (-> a1-1 velocity quad)) + ) + (vector-! (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1) (-> s3-0 state lin-velocity)) + (vector-float*! (the-as vector (-> s4-0 vector)) (the-as vector (-> s4-0 vector)) (* 4.0 (-> s2-0 info mass))) + (let ((s1-0 (-> s4-0 vector 2))) + (let ((s0-0 (-> obj root-override-2 trans))) + (let ((v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override-2 quat)))) + (let ((a0-6 40960.0)) + (.mov vf7 a0-6) + ) + (.lvf vf5 (&-> v1-7 quad)) + ) + (.lvf vf4 (&-> s0-0 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s1-0 quad) vf6) + ) + (let ((s0-1 (-> s4-0 vector 2))) + (let ((s1-1 (-> s4-0 vector 2))) + (let ((v1-9 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override-2 quat)))) + (let ((a0-9 -32768.0)) + (.mov vf7 a0-9) + ) + (.lvf vf5 (&-> v1-9 quad)) + ) + (.lvf vf4 (&-> s1-1 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s0-1 quad) vf6) + ) + (let ((v1-10 s3-0) + (a1-9 (-> s4-0 vector 2)) + (a2-0 (-> s4-0 vector)) + ) + (rigid-body-method-18 (-> v1-10 state) a1-9 (the-as vector a2-0)) + ) + (.svf (&-> (-> s4-0 vector) 0 quad) vf0) + (set! (-> s4-0 vector 0 y) (* -4.0 (-> s2-0 gravity) (-> s2-0 info mass))) + (let ((a1-10 (-> s4-0 vector))) + (rigid-body-method-20 (-> s3-0 state) (the-as vector a1-10)) + ) + ) + (rigid-body-object-method-50 obj arg0) + (vehicle-method-99 obj arg0) + (none) + ) + ) + +;; definition for method 96 of type boat-base +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-96 boat-base ((obj boat-base)) + 0 + (none) + ) + +;; definition for method 36 of type boat-base +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-36 boat-base ((obj boat-base)) + 0 + (none) + ) + +;; definition for method 135 of type boat-base +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-135 boat-base ((obj boat-base) (arg0 traffic-object-spawn-params)) + (get-nav-control obj (-> arg0 nav-mesh)) + (set! (-> obj nav callback-info) *boat-nav-callback-info*) + (logior! (-> obj nav flags) (nav-control-flag display-marks limit-rotation-rate update-heading-from-facing)) + (let ((v1-4 (-> obj nav))) + (set! (-> v1-4 target-speed) 40960.0) + ) + 0 + (let ((v1-6 (-> obj nav))) + (set! (-> v1-6 acceleration) 8192.0) + ) + 0 + (let ((v1-8 (-> obj nav))) + (set! (-> v1-8 turning-acceleration) 8192.0) + ) + 0 + (let ((v1-10 (-> obj nav))) + (set! (-> v1-10 max-rotation-rate) 9102.223) + ) + 0 + (let ((v1-12 (-> obj nav))) + (set! (-> v1-12 nav-cull-radius) 122880.0) + ) + 0 + (let ((v1-14 (-> obj nav))) + (set! (-> v1-14 sphere-mask) (the-as uint 64)) + ) + 0 + (set! (-> obj path-num) (-> arg0 user-data)) + (set! (-> obj path-index) (+ 0.05 (-> arg0 position w))) + (set! (-> obj root-override-2 root-prim prim-core collide-as) + (logior (collide-spec pusher) (-> obj root-override-2 root-prim prim-core collide-as)) + ) + (let ((v1-21 (-> obj root-override-2 root-prim))) + (set! (-> obj root-override-2 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> obj root-override-2 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + 0 + (none) + ) + +;; definition for method 31 of type boat-base +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-31 boat-base ((obj boat-base) (arg0 rigid-body-vehicle-constants)) + ((method-of-type vehicle rigid-body-object-method-31) obj arg0) + 0 + (none) + ) + +;; definition for method 113 of type boat-base +;; WARN: Return type mismatch object vs none. +(defmethod vehicle-method-113 boat-base ((obj boat-base)) + (go (method-of-object obj idle)) + (none) + ) + +;; failed to figure out what this is: +(defstate waiting (boat-base) + :virtual #t + :enter (behavior () + (go-virtual idle) + (none) + ) + :exit (behavior () + '() + (none) + ) + ) + +;; failed to figure out what this is: +(defstate inactive (boat-base) + :virtual #t + :enter (behavior () + (go-virtual idle) + (none) + ) + :exit (behavior () + '() + (none) + ) + ) + +;; failed to figure out what this is: +(defstate idle (boat-base) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior boat-base) vehicle-event-handler) + :enter (behavior () + (logior! (-> self flags) (rigid-body-object-flag riding)) + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :exit (behavior () + '() + (none) + ) + :trans (behavior () + '() + (none) + ) + :post (behavior () + (rigid-body-object-method-37 self) + (update-transforms (-> self root-override-2)) + (none) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-barge barge barge-lod0-jg barge-idle-ja + ((barge-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) + +;; definition of type barge +(deftype barge (boat-base) + ((engine uint32 :offset-assert 896) + (bow-wash uint32 :offset-assert 900) + ) + :heap-base #x310 + :method-count-assert 149 + :size-assert #x388 + :flag-assert #x9503100388 + ) + +;; definition for method 3 of type barge +(defmethod inspect barge ((obj barge)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type boat-base inspect))) + (t9-0 obj) + ) + (format #t "~2Tengine: ~D~%" (-> obj engine)) + (format #t "~2Tbow-wash: ~D~%" (-> obj bow-wash)) + (label cfg-4) + obj + ) + +;; definition for method 120 of type barge +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-120 barge ((obj barge)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((t9-0 (method-of-type boat-base vehicle-method-120))) + (t9-0 obj) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (-> obj root-override-2 trans))) + (let ((v1-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override-2 quat)))) + (let ((a0-4 -61440.0)) + (.mov vf7 a0-4) + ) + (.lvf vf5 (&-> v1-3 quad)) + ) + (.lvf vf4 (&-> s4-0 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s5-0 quad) vf6) + (cond + ((< (vector-vector-distance s5-0 (camera-pos)) 614400.0) + (let ((a0-6 (static-sound-spec "barge-engine"))) + (sound-play-by-spec a0-6 (the-as sound-id (-> obj engine)) s5-0) + ) + ) + (else + (sound-stop (the-as sound-id (-> obj engine))) + ) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (let ((s4-2 (-> obj root-override-2 trans))) + (let ((v1-9 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override-2 quat)))) + (let ((a0-10 61440.0)) + (.mov vf7 a0-10) + ) + (.lvf vf5 (&-> v1-9 quad)) + ) + (.lvf vf4 (&-> s4-2 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s5-1 quad) vf6) + (cond + ((< (vector-vector-distance s5-1 (camera-pos)) 614400.0) + (let ((a0-12 (static-sound-spec "bow-wash"))) + (sound-play-by-spec a0-12 (the-as sound-id (-> obj bow-wash)) s5-1) + ) + ) + (else + (sound-stop (the-as sound-id (-> obj bow-wash))) + ) + ) + ) + (none) + ) + ) + +;; definition for method 32 of type barge +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-32 barge ((obj barge)) + (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 19) 0))) + (set! (-> s5-0 total-prims) (the-as uint 20)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 81920.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-11 prim-core action) (collide-action solid rideable)) + (set! (-> v1-11 transform-index) 3) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 81920.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-13 prim-core action) (collide-action solid rideable)) + (set! (-> v1-13 transform-index) 3) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 81920.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 -32768.0 16384.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 -8192.0 16384.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 16384.0 16384.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 0) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 40960.0 16384.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core action) (collide-action solid)) + (set! (-> v1-23 transform-index) 0) + (set-vector! (-> v1-23 local-sphere) 24576.0 0.0 -32768.0 16384.0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-25 prim-core action) (collide-action solid)) + (set! (-> v1-25 transform-index) 0) + (set-vector! (-> v1-25 local-sphere) 24576.0 0.0 -8192.0 16384.0) + ) + (let ((v1-27 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-27 prim-core action) (collide-action solid)) + (set! (-> v1-27 transform-index) 0) + (set-vector! (-> v1-27 local-sphere) 24576.0 0.0 16384.0 16384.0) + ) + (let ((v1-29 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-29 prim-core action) (collide-action solid)) + (set! (-> v1-29 transform-index) 0) + (set-vector! (-> v1-29 local-sphere) 24576.0 0.0 40960.0 16384.0) + ) + (let ((v1-31 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-31 prim-core action) (collide-action solid)) + (set! (-> v1-31 transform-index) 0) + (set-vector! (-> v1-31 local-sphere) -24576.0 0.0 -32768.0 16384.0) + ) + (let ((v1-33 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-33 prim-core action) (collide-action solid)) + (set! (-> v1-33 transform-index) 0) + (set-vector! (-> v1-33 local-sphere) -24576.0 0.0 -8192.0 16384.0) + ) + (let ((v1-35 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-35 prim-core action) (collide-action solid)) + (set! (-> v1-35 transform-index) 0) + (set-vector! (-> v1-35 local-sphere) -24576.0 0.0 16384.0 16384.0) + ) + (let ((v1-37 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-37 prim-core action) (collide-action solid)) + (set! (-> v1-37 transform-index) 0) + (set-vector! (-> v1-37 local-sphere) -24576.0 0.0 40960.0 16384.0) + ) + (let ((v1-39 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-39 prim-core action) (collide-action solid)) + (set! (-> v1-39 transform-index) 0) + (set-vector! (-> v1-39 local-sphere) 16384.0 0.0 -57344.0 16384.0) + ) + (let ((v1-41 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-41 prim-core action) (collide-action solid)) + (set! (-> v1-41 transform-index) 0) + (set-vector! (-> v1-41 local-sphere) -16384.0 0.0 -57344.0 16384.0) + ) + (let ((v1-43 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-43 prim-core action) (collide-action solid)) + (set! (-> v1-43 transform-index) 0) + (set-vector! (-> v1-43 local-sphere) 0.0 8192.0 -61440.0 16384.0) + ) + (let ((v1-45 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-45 prim-core action) (collide-action solid)) + (set! (-> v1-45 transform-index) 0) + (set-vector! (-> v1-45 local-sphere) -40960.0 0.0 -53248.0 16384.0) + ) + (let ((v1-47 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-47 prim-core action) (collide-action solid)) + (set! (-> v1-47 transform-index) 0) + (set-vector! (-> v1-47 local-sphere) 40960.0 0.0 -53248.0 16384.0) + ) + (set! (-> s5-0 nav-radius) 81920.0) + (let ((v1-49 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-49 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-49 prim-core collide-with)) + ) + (set! (-> obj root-override-2) s5-0) + ) + 0 + (none) + ) + +;; definition for method 33 of type barge +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-33 barge ((obj barge)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-barge" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (rigid-body-object-method-31 obj *barge-constants*) + (set! (-> obj draw lod-set lod 0 dist) 1228800.0) + (set! (-> obj engine) (the-as uint (new-sound-id))) + (set! (-> obj bow-wash) (the-as uint (new-sound-id))) + (iterate-prims + (-> obj root-override-2) + (lambda ((arg0 collide-shape-prim)) + (case (-> arg0 prim-core prim-type) + (((prim-type sphere)) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-sphere)) + ) + (((prim-type mesh)) + (set! (-> arg0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> arg0 prim-core collide-as) (collide-spec camera-blocker vehicle-mesh vehicle-mesh-probeable)) + ) + (((prim-type group)) + (set! (-> arg0 prim-core collide-with) + (collide-spec + backgnd + jak + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + ) + ) + (set! (-> arg0 prim-core collide-as) + (collide-spec vehicle-sphere camera-blocker vehicle-mesh vehicle-mesh-probeable) + ) + ) + ) + (none) + ) + ) + 0 + (none) + ) + +;; definition for method 7 of type boat-manager +;; WARN: Return type mismatch process vs boat-manager. +(defmethod relocate boat-manager ((obj boat-manager) (arg0 int)) + (dotimes (v1-0 4) + (if (-> obj paths v1-0) + (&+! (-> obj paths v1-0) arg0) + ) + ) + (the-as boat-manager ((method-of-type process relocate) obj arg0)) + ) + +;; failed to figure out what this is: +(defstate idle (boat-manager) + :virtual #t + :enter (behavior () + '() + (none) + ) + :exit (behavior () + '() + (none) + ) + :trans (behavior () + (dotimes (gp-0 4) + (let ((a0-0 (-> self paths gp-0))) + (if a0-0 + (debug-draw a0-0) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior boat-manager) sleep-code) + ) + +;; definition for method 11 of type boat-manager +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! boat-manager ((obj boat-manager) (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" + (set! (-> obj mesh) (nav-mesh-from-res-tag arg0 'nav-mesh-actor 0)) + (set! (-> obj entity) arg0) + (when (-> obj mesh) + (dotimes (s5-1 4) + (set! (-> obj paths s5-1) (new 'process 'curve-control obj 'path (the float s5-1))) + (when (-> obj paths s5-1) + (logior! (-> obj paths s5-1 flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((s4-0 (-> obj paths s5-1)) + (s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (f30-0 0.0) + ) + 1 + (the int (* 0.0000016276042 (total-distance s4-0))) + (while (< f30-0 0.8) + (displacement-between-points-at-percent-normalized! s4-0 s2-0 f30-0) + (get-point-at-percent-along-path! s4-0 s3-0 f30-0 'interp) + (vector-normalize! s2-0 1.0) + (let ((s1-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s1-0 behavior) (the-as uint 1)) + (set! (-> s1-0 id) (the-as uint 0)) + (set! (-> s1-0 nav-mesh) (the-as nav-mesh (-> obj mesh))) + (set! (-> s1-0 position quad) (-> s3-0 quad)) + (quaternion-look-at! (-> s1-0 rotation) s2-0 *up-vector*) + (set! (-> s1-0 user-data) (the-as uint s5-1)) + (set! (-> s1-0 position w) f30-0) + (logior! (-> s1-0 flags) 1) + (process->handle (vehicle-spawn obj barge s1-0)) + ) + (+! f30-0 (/ (* 4096.0 (+ 150.0 (* 150.0 (rand-vu)))) (total-distance s4-0))) + ) + ) + ) + ) + ) + (go (method-of-object obj idle)) + (none) + ) diff --git a/test/decompiler/reference/jak2/levels/city/common/ctywide-obs-h_REF.gc b/test/decompiler/reference/jak2/levels/city/common/ctywide-obs-h_REF.gc index 16c4983ce..da4020140 100644 --- a/test/decompiler/reference/jak2/levels/city/common/ctywide-obs-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/ctywide-obs-h_REF.gc @@ -12,7 +12,7 @@ :size-assert #x18 :flag-assert #xa00000018 (:methods - (city-race-ring-info-method-9 () none 9) + (city-race-ring-info-method-9 (_type_ symbol) none 9) ) ) @@ -56,14 +56,14 @@ ;; definition of type city-ambush-info (deftype city-ambush-info (structure) - ((count int16 :offset-assert 0) - (array uint32 :offset-assert 4) + ((count int16 :offset-assert 0) + (array (inline-array city-ambush-spot) :offset-assert 4) ) :method-count-assert 10 :size-assert #x8 :flag-assert #xa00000008 (:methods - (city-ambush-info-method-9 () none 9) + (city-ambush-info-method-9 (_type_ traffic-object-spawn-params) none 9) ) ) @@ -82,7 +82,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/levels/city/common/ctywide-tasks_REF.gc b/test/decompiler/reference/jak2/levels/city/common/ctywide-tasks_REF.gc new file mode 100644 index 000000000..eb0945184 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/city/common/ctywide-tasks_REF.gc @@ -0,0 +1,913 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 68 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0 32) + (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #f) 0)) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! *game-info* 68 2 (the-as (function object) (lambda :behavior task-manager () (none)))) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 64 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0 32) + (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 39) (the-as int #f) (the-as vector #f) 0)) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 64 + 4 + (the-as (function object) (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 140 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> (new 'static 'vector :x 3132661.8 :y 33669.12 :z -2965708.8 :w 1.0) quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags)) + (set! (-> gp-0 map-icon) (the-as uint 15)) + (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 (the-as task-arrow self)))) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 140 + 2 + (the-as (function object) (lambda :behavior task-manager + () + (when (movie?) + (if (handle->process (-> self arrow)) + (send-event (handle->process (-> self arrow)) 'leave) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 140 + 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) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 4 + 3 + (the-as (function object) (lambda :behavior task-manager + () + (while (not *traffic-manager*) + (suspend) + ) + (suspend) + (let ((gp-0 *traffic-manager*)) + (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 'set-guard-target-level 0) + ) + (set-setting! 'pilot #f 0 0) + (set-setting! 'vehicle-hijacking #f 0 0) + (set-setting! 'exclusive-task #f 0 (-> self node-info task)) + (while (let ((a0-9 (level-get-target-inside *level*))) + (not (and a0-9 (logtest? (-> a0-9 info level-flags) 1))) + ) + (suspend) + ) + (set-setting! 'airlock #f 0 0) + (apply-settings *setting-control*) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! *game-info* 4 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* + 4 + 6 + (the-as (function object) (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('target) + (case (-> arg3 param 0) + (('normal) + (send-event (handle->process (-> self slave 0)) 'request 'scene-player) + ) + ) + ) + ) + ) + ) + ) + +;; definition for function wait-for-speech-end +;; WARN: Return type mismatch symbol vs none. +(defun wait-for-speech-end ((arg0 sound-id)) + (while (nonzero? (get-status *gui-control* arg0)) + (suspend) + ) + (none) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 7 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 38) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (wait-for-speech-end (-> self sound-id 0)) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) + (suspend) + ) + ) + (while (or (not *target*) (logtest? (focus-status dead teleporting) (-> *target* focus-status))) + (suspend) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 39) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (wait-for-speech-end (-> self sound-id 0)) + (go-virtual complete) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 8 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (when (and (= (-> self sub-state) 1) + (not (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 46) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (go-virtual fail) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 8 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (local-vars (v1-1 object)) + (until v1-1 + (suspend) + (set! v1-1 (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) + ) + (set! (-> self slave 0) (-> *target* pilot vehicle)) + (set! (-> self sub-state) (the-as uint 1)) + (while (or (not *target*) (logtest? (focus-status dead teleporting) (-> *target* focus-status))) + (suspend) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 31) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (wait-for-speech-end (-> self sound-id 0)) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) + (suspend) + ) + ) + (while (or (not *target*) (logtest? (focus-status dead teleporting) (-> *target* focus-status))) + (suspend) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 35) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (wait-for-speech-end (-> self sound-id 0)) + (let ((gp-3 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-3) (seconds 1)) + (suspend) + ) + ) + (while (or (not *target*) (logtest? (focus-status dead teleporting) (-> *target* focus-status))) + (suspend) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (while (let ((v1-34 (handle->process (-> self slave 0)))) + (zero? (logand (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-34) flags))) + ) + (suspend) + ) + (wait-for-speech-end (-> self sound-id 0)) + (while (or (not *target*) (logtest? (focus-status dead teleporting) (-> *target* focus-status))) + (suspend) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 37) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (wait-for-speech-end (-> self sound-id 0)) + (set! (-> self sub-state) (the-as uint 2)) + (let ((gp-6 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-6) (seconds 1)) + (suspend) + ) + ) + (go-virtual complete) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 8 + 5 + (the-as (function object) (lambda :behavior task-manager + () + (task-node-close! (game-task-node city-vehicle-training-hover-zone-1)) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 8 + 4 + (the-as (function object) (lambda :behavior task-manager + () + (task-node-close! (game-task-node city-vehicle-training-hover-zone-2)) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 9 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (cond + ((zero? (-> self sub-state)) + (cond + ((and *target* (logtest? (focus-status pilot) (-> *target* focus-status))) + (let ((v1-8 (handle->process (-> *target* pilot vehicle)))) + (if (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-8) flags)) + (go-virtual complete) + ) + ) + ) + (else + (set! (-> self state-time) (-> self clock frame-counter)) + ) + ) + ) + ((= (-> self sub-state) 1) + (if (not (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) + (go-virtual fail) + ) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 9 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 60)) + (suspend) + ) + (set! (-> self sub-state) (the-as uint 1)) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 35) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (wait-for-speech-end (-> self sound-id 0)) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) + (suspend) + ) + ) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (while (let ((v1-15 (handle->process (-> *target* pilot vehicle)))) + (zero? (logand (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-15) flags))) + ) + (suspend) + ) + (wait-for-speech-end (-> self sound-id 0)) + (set! (-> self sound-id 0) + (the-as sound-id (talker-spawn-func (-> *talker-speech* 37) *entity-pool* (target-pos 0) (the-as region #f))) + ) + (wait-for-speech-end (-> self sound-id 0)) + (let ((gp-4 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-4) (seconds 3)) + (suspend) + ) + ) + (go-virtual complete) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 61 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set-setting! 'exclusive-task #f 0 (-> self node-info task)) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -245760.0 :y 45056.0 :z 5468160.0 :w 1.0) quad)) + (set! (-> self end-pos quad) (-> (new 'static 'vector :x 579584.0 :y 49152.0 :z -1985331.2 :w 1.0) quad)) + (set-setting! 'minimap 'clear 0 32) + (let ((s5-0 *traffic-manager*) + (gp-0 (new 'stack 'traffic-object-spawn-params)) + ) + (set! (-> gp-0 position quad) (-> self begin-pos quad)) + (quaternion-axis-angle! (-> gp-0 rotation) 0.0 1.0 0.0 16384.0) + (set! (-> gp-0 object-type) (the-as uint 13)) + (set! (-> gp-0 behavior) (the-as uint 0)) + (set! (-> gp-0 id) (the-as uint 0)) + (set! (-> gp-0 proc) #f) + (send-event s5-0 'spawn-object gp-0) + (if (-> gp-0 proc) + (set! (-> self slave 0) (process->handle (-> gp-0 proc))) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-1 pos quad) (-> self end-pos quad)) + (quaternion-identity! (-> gp-1 quat)) + (set! (-> gp-1 flags) (task-arrow-flags task-arrow-flag-00)) + (set! (-> gp-1 map-icon) (the-as uint 12)) + (label cfg-10) + (let ((a0-20 (task-arrow-spawn gp-1 (the-as task-arrow self)))) + (when (not a0-20) + (suspend) + (goto cfg-10) + ) + (set! (-> self arrow) (process->handle a0-20)) + ) + ) + (set! (-> self start-time) 0) + (set! (-> self time-limit) (seconds 180)) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 61 + 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* + 61 + 2 + (the-as (function object) (lambda :behavior task-manager + () + (check-time self) + (let ((f0-0 (vector-vector-distance-squared (target-pos 0) (-> self end-pos))) + (f1-0 49152.0) + ) + (if (>= (* f1-0 f1-0) f0-0) + (go-virtual complete) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 61 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (local-vars (v1-7 symbol)) + (send-event *traffic-manager* 'set-target-level #x3f800000) + (until (or v1-7 (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) + (suspend) + (let ((f0-0 122880.0)) + (set! v1-7 (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0)))) + ) + ) + (set-setting! 'airlock #f 0 0) + (set! (-> self start-time) (-> self clock frame-counter)) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 61 + 4 + (the-as + (function object) + (lambda :behavior task-manager + () + (send-event *traffic-manager* 'decrease-alert-level 0) + (send-event *traffic-manager* 'set-alert-duration 9000) + (send-event *target* 'end-mode) + (set-setting! 'pilot #f 0 0) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (eval! + (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) + '(send-event "keira-npc-1" 'say) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 136 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0 32) + (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 39) (the-as int #f) (the-as vector #f) 0)) + (set! (-> self sub-state) (the-as uint 0)) + 0 + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 136 + 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* + 136 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (let* ((v1-1 (-> self info index)) + (a1-2 (cond + ((or (zero? v1-1) (= v1-1 4) (= v1-1 9)) + 'stadiumb + ) + ((or (= v1-1 1) (= v1-1 5) (= v1-1 10)) + 'stadiumc + ) + ((or (= v1-1 2) (= v1-1 6) (= v1-1 11)) + 'stadiumd + ) + (else + #f + ) + ) + ) + ) + (cond + ((= (level-status *level* a1-2) 'active) + (when (zero? (-> self sub-state)) + (set! (-> self sub-state) (the-as uint 1)) + (set-setting! 'exclusive-task #f 0 (-> self node-info task)) + (set! (-> self slave 0) (process->handle (race-start (-> self info index) (the-as symbol self) #f))) + ) + ) + (else + (when (nonzero? (-> self sub-state)) + (remove-setting! 'exclusive-task) + (set! (-> self sub-state) (the-as uint 0)) + 0 + ) + ) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 136 + 4 + (the-as (function object) (lambda :behavior task-manager + () + (case (-> self info index) + ((2) + (format #t "kill race manager~%") + (send-event (handle->process (-> self slave 0)) 'die) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(copy-hooks! (-> *game-info* sub-task-list 182) (-> *game-info* sub-task-list 136)) + +;; failed to figure out what this is: +(copy-hooks! (-> *game-info* sub-task-list 210) (-> *game-info* sub-task-list 136)) + +;; failed to figure out what this is: +(copy-hooks! (-> *game-info* sub-task-list 313) (-> *game-info* sub-task-list 136)) + +;; failed to figure out what this is: +(copy-hooks! (-> *game-info* sub-task-list 315) (-> *game-info* sub-task-list 182)) + +;; failed to figure out what this is: +(copy-hooks! (-> *game-info* sub-task-list 317) (-> *game-info* sub-task-list 210)) + +;; failed to figure out what this is: +(copy-hooks! (-> *game-info* sub-task-list 319) (-> *game-info* sub-task-list 136)) + +;; failed to figure out what this is: +(copy-hooks! (-> *game-info* sub-task-list 321) (-> *game-info* sub-task-list 182)) + +;; failed to figure out what this is: +(copy-hooks! (-> *game-info* sub-task-list 323) (-> *game-info* sub-task-list 210)) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 211 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (let ((gp-0 *traffic-manager*)) + (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) + (format #t "class-1 race complete~%") + (send-event gp-0 'set-alert-level 3) + ) + (while (!= (level-status *level* 'lwidea) 'active) + (suspend) + ) + (send-event *traffic-manager* 'spawn-all) + (suspend) + (suspend) + (let ((gp-2 (new 'static 'city-ambush-info + :count 5 + :array (new 'static 'inline-array city-ambush-spot 5 + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 503808.0 :y 49152.0 :z -2805760.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 458752.0 :y 49152.0 :z -2838528.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 450560.0 :y 49152.0 :z -2871296.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 413696.0 :y 49152.0 :z -2879488.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 368640.0 :y 49152.0 :z -2916352.0 :w 1.0) + :obj-type #x6 + ) + ) + ) + ) + (s5-0 (new 'stack-no-clear 'traffic-object-spawn-params)) + ) + (set! (-> s5-0 object-type) (the-as uint 6)) + (set! (-> s5-0 behavior) (the-as uint 9)) + (set! (-> s5-0 id) (the-as uint 0)) + (set! (-> s5-0 nav-mesh) #f) + (set! (-> s5-0 nav-branch) #f) + (set! (-> s5-0 proc) #f) + (set! (-> s5-0 handle) (the-as uint (process->handle *target*))) + (set! (-> s5-0 user-data) (the-as uint 0)) + (set! (-> s5-0 flags) (the-as uint 0)) + (set! (-> s5-0 guard-type) (the-as uint 1)) + (vector-reset! (-> s5-0 velocity)) + (quaternion-identity! (-> s5-0 rotation)) + (city-ambush-info-method-9 gp-2 s5-0) + ) + (go-virtual complete) + (none) + ) + ) + ) + +;; definition of type city-bb-racepoint-info +(deftype city-bb-racepoint-info (structure) + ((bike-pos vector :inline :offset-assert 0) + (end-pos vector :inline :offset-assert 16) + (bike-angle float :offset-assert 32) + (map symbol :offset-assert 36) + (time float :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +;; definition for method 3 of type city-bb-racepoint-info +(defmethod inspect city-bb-racepoint-info ((obj city-bb-racepoint-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'city-bb-racepoint-info) + (format #t "~1Tbike-pos: #~%" (-> obj bike-pos)) + (format #t "~1Tend-pos: #~%" (-> obj end-pos)) + (format #t "~1Tbike-angle: ~f~%" (-> obj bike-angle)) + (format #t "~1Tmap: ~A~%" (-> obj map)) + (format #t "~1Ttime: ~f~%" (-> obj time)) + (label cfg-4) + obj + ) + +;; definition for symbol *city-bb-racepoint-info*, type (array city-bb-racepoint-info) +(define *city-bb-racepoint-info* (new 'static 'boxed-array :type city-bb-racepoint-info + (new 'static 'city-bb-racepoint-info + :bike-pos (new 'static 'vector :x -687431.7 :y 40960.0 :z 3485491.2 :w 1.0) + :end-pos (new 'static 'vector :x 4694794.0 :y 33341.44 :z 137297.92 :w 1.0) + :bike-angle 32768.0 + :map #t + :time 27000.0 + ) + (new 'static 'city-bb-racepoint-info + :bike-pos (new 'static 'vector :x 3399843.8 :y 40960.0 :z 1019863.06 :w 1.0) + :end-pos (new 'static 'vector :x 47308.8 :y 32768.0 :z 573440.0 :w 1.0) + :bike-angle 8192.0 + :map #t + :time 22500.0 + ) + (new 'static 'city-bb-racepoint-info + :bike-pos (new 'static 'vector :x 1773486.1 :y 40960.0 :z -284180.47 :w 1.0) + :end-pos (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) + :bike-angle 8192.0 + :map #f + :time 33000.0 + ) + (new 'static 'city-bb-racepoint-info + :bike-pos (new 'static 'vector :x 3190005.8 :y 40960.0 :z 2962514.0 :w 1.0) + :end-pos (new 'static 'vector :x 2532597.8 :y -9338.88 :z -2062909.5 :w 1.0) + :bike-angle 8192.0 + :map #t + :time 29400.0 + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 271 + 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) + (set-setting! 'minimap 'clear 0 32) + (let ((gp-0 (-> *city-bb-racepoint-info* (-> self info index)))) + (set! (-> self end-pos quad) (-> gp-0 end-pos quad)) + (let ((s4-0 *traffic-manager*) + (s5-0 (new 'stack 'traffic-object-spawn-params)) + ) + (set! (-> s5-0 position quad) (-> gp-0 bike-pos quad)) + (quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 (-> gp-0 bike-angle)) + (set! (-> s5-0 object-type) (the-as uint 11)) + (set! (-> s5-0 behavior) (the-as uint 0)) + (set! (-> s5-0 id) (the-as uint 0)) + (set! (-> s5-0 proc) #f) + (send-event s4-0 'spawn-object s5-0) + (if (-> s5-0 proc) + (set! (-> self slave 0) (process->handle (-> s5-0 proc))) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> s5-1 pos quad) (-> self end-pos quad)) + (quaternion-identity! (-> s5-1 quat)) + (set! (-> s5-1 flags) (task-arrow-flags task-arrow-flag-00)) + (set! (-> s5-1 map-icon) (the-as uint 15)) + (cond + ((-> gp-0 map) + (set! (-> s5-1 map-icon) (the-as uint 15)) + ) + (else + (set! (-> s5-1 map-icon) (the-as uint 0)) + 0 + ) + ) + (label cfg-12) + (let ((a0-20 (task-arrow-spawn s5-1 (the-as task-arrow self)))) + (when (not a0-20) + (suspend) + (goto cfg-12) + ) + (set! (-> self arrow) (process->handle a0-20)) + ) + ) + (set! (-> self start-time) (-> self clock frame-counter)) + (set! (-> self time-limit) (the-as time-frame (the int (-> gp-0 time)))) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 271 + 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* + 271 + 2 + (the-as (function object) (lambda :behavior task-manager + () + (check-time self) + (let ((f0-0 (vector-vector-distance-squared (target-pos 0) (-> self end-pos))) + (f1-0 49152.0) + ) + (if (>= (* f1-0 f1-0) f0-0) + (go-virtual complete) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 271 + 3 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *traffic-manager* 'restore-default-settings) + (send-event *traffic-manager* 'set-target-level #x3f800000) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 271 + 4 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *target* 'end-mode) + (set-setting! 'pilot #f 0 0) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (close! (-> self node-info) 'event) + (none) + ) + ) + ) diff --git a/test/decompiler/reference/jak2/levels/city/common/searchlight_REF.gc b/test/decompiler/reference/jak2/levels/city/common/searchlight_REF.gc new file mode 100644 index 000000000..28aecb203 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/city/common/searchlight_REF.gc @@ -0,0 +1,127 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type searchlight +(deftype searchlight (process-drawable) + ((sync sync-eased :inline :offset-assert 200) + ) + :heap-base #x80 + :method-count-assert 21 + :size-assert #xf4 + :flag-assert #x15008000f4 + (:methods + (idle () _type_ :state 20) + ) + ) + +;; definition for method 3 of type searchlight +(defmethod inspect searchlight ((obj searchlight)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tsync: #~%" (-> obj sync)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-searchlight searchlight searchlight-lod0-jg searchlight-idle-ja + ((searchlight-lod0-mg (meters 999999))) + :bounds (static-spherem 0 60 0 120) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defstate idle (searchlight) + :virtual #t + :code (behavior () + (until #f + (let ((gp-1 (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + (new 'static 'vector :z 1.0 :w 1.0) + (+ -4004.9778 (* 8192.0 (get-norm! (-> self sync) 0))) + ) + ) + (s5-2 (quaternion-axis-angle! + (new 'stack-no-clear 'quaternion) + 0.0 + 1.0 + 0.0 + (vector-y-angle (-> (math-camera-matrix) vector 2)) + ) + ) + ) + (let ((f0-3 (calc-fade-from-fog (-> self root trans)))) + (set-vector! (-> self draw color-emissive) f0-3 f0-3 f0-3 1.0) + ) + (quaternion-normalize! (quaternion*! (-> self root quat) s5-2 gp-1)) + ) + (when (rand-vu-percent? 0.05) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer self)) + (set! (-> a1-4 num-params) 0) + (set! (-> a1-4 message) 'hour) + (let ((v1-13 (send-event-function (ppointer->process *time-of-day*) a1-4))) + (if (and v1-13 (>= (the-as int v1-13) 7) (>= 18 (the-as int v1-13))) + (logior! (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + ) + ) + ) + (suspend) + ) + #f + (none) + ) + :post (the-as (function none :behavior searchlight) ja-post) + ) + +;; definition for method 11 of type searchlight +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! searchlight ((obj searchlight) (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" + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (logclear! (-> obj mask) (process-mask actor-pause)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-searchlight" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (logior! (-> obj draw status) (draw-control-status disable-fog)) + (set! (-> obj root scale y) (rand-vu-float-range 1.8 2.0)) + (set-vector! (-> obj draw color-mult) 0.0 0.0 0.0 0.0) + (let ((s4-1 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-12 0)) + (if #t + (set! v1-12 (logior v1-12 1)) + ) + (set! (-> s4-1 sync-type) 'sync-eased) + (set! (-> s4-1 sync-flags) (the-as sync-flags v1-12)) + ) + (set! (-> s4-1 period) (the-as uint (rand-vu-int-range 3000 6000))) + (set! (-> s4-1 entity) arg0) + (set! (-> s4-1 percent) 0.0) + (set! (-> s4-1 ease-in) 0.15) + (set! (-> s4-1 ease-out) 0.15) + (set! (-> s4-1 pause-in) 0.0) + (set! (-> s4-1 pause-out) 0.0) + (initialize! (-> obj sync) s4-1) + ) + (go (method-of-object obj idle)) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/city/common/vehicle-effects_REF.gc b/test/decompiler/reference/jak2/levels/city/common/vehicle-effects_REF.gc index 9056fd62b..378e3b04b 100644 --- a/test/decompiler/reference/jak2/levels/city/common/vehicle-effects_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/vehicle-effects_REF.gc @@ -23,7 +23,7 @@ (set! (-> obj scrape-sound-id) (new-sound-id)) ) (sound-play-by-name - (the-as sound-name (-> obj info-override scrape-sound)) + (-> obj info-override scrape-sound) (-> obj scrape-sound-id) (the int (* 1024.0 (-> obj scrape-sound-envelope))) 0 @@ -59,7 +59,7 @@ ) (a0-9 (static-sound-spec "vehicle-engine" :volume 0.0 :mask (pitch reg0))) ) - (set! (-> a0-9 sound-name) (the-as sound-name (-> obj info-override engine-sound))) + (set! (-> a0-9 sound-name) (-> obj info-override engine-sound)) (set! (-> obj engine-sound-factor) f30-0) (cond (#f @@ -141,7 +141,7 @@ (f0-38 0.0) ) (sound-play-by-name - (the-as sound-name (-> obj info-override thrust-sound)) + (-> obj info-override thrust-sound) (-> obj thrust-sound-id) (the int (* 1024.0 f1-25)) (the int (* 1524.0 f0-38)) diff --git a/test/decompiler/reference/jak2/levels/city/common/vehicle-h_REF.gc b/test/decompiler/reference/jak2/levels/city/common/vehicle-h_REF.gc index 680d98d94..01306c735 100644 --- a/test/decompiler/reference/jak2/levels/city/common/vehicle-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/vehicle-h_REF.gc @@ -158,122 +158,122 @@ ;; definition of type rigid-body-vehicle-constants (deftype rigid-body-vehicle-constants (rigid-body-object-constants) - ((flags uint32 :offset-assert 208) - (object-type uint8 :offset-assert 212) - (guard-type uint8 :offset-assert 213) - (max-engine-thrust meters :offset-assert 216) - (inv-max-engine-thrust float :offset-assert 220) - (engine-response-rate float :offset-assert 224) - (engine-intake-factor float :offset-assert 228) - (brake-factor float :offset-assert 232) - (turbo-boost-factor float :offset-assert 236) - (max-xz-speed meters :offset-assert 240) - (ground-probe-distance meters :offset-assert 244) - (ground-probe-offset meters :offset-assert 248) - (cos-ground-effect-angle float :offset-assert 252) - (spring-lift-factor float :offset-assert 256) - (air-steering-factor float :offset-assert 260) - (air-drag-factor float :offset-assert 264) - (steering-fin-angle float :offset-assert 268) - (steering-thruster-factor float :offset-assert 272) - (steering-thruster-max-gain float :offset-assert 276) - (steering-thruster-half-gain-speed meters :offset-assert 280) - (tire-steering-angle float :offset-assert 284) - (tire-friction-factor float :offset-assert 288) - (tire-static-friction float :offset-assert 292) - (tire-static-friction-speed meters :offset-assert 296) - (tire-dynamic-friction float :offset-assert 300) - (tire-dynamic-friction-speed meters :offset-assert 304) - (tire-inv-max-friction-speed float :offset-assert 308) - (airfoil-factor float :offset-assert 312) - (drag-force-factor float :offset-assert 316) - (speed-scrubbing-drag float :offset-assert 320) - (speed-limiting-drag float :offset-assert 324) - (pitch-control-factor float :offset-assert 328) - (roll-control-factor float :offset-assert 332) - (roll-angle float :offset-assert 336) - (jump-thrust-factor float :offset-assert 340) - (buoyancy-factor float :offset-assert 344) - (player-weight float :offset-assert 348) - (player-shift-x meters :offset-assert 352) - (player-shift-z meters :offset-assert 356) - (target-speed-offset meters :offset-assert 360) - (turning-accel meters :offset-assert 364) - (toughness-factor float :offset-assert 368) - (damage-factor float :offset-assert 372) - (camera-string-min-height meters :offset-assert 376) - (camera-string-max-height meters :offset-assert 380) - (camera-string-min-length meters :offset-assert 384) - (camera-string-max-length meters :offset-assert 388) - (camera-min-fov float :offset-assert 392) - (camera-max-fov float :offset-assert 396) - (camera-head-offset float :offset-assert 400) - (camera-foot-offset float :offset-assert 404) - (camera-normal-max-angle-offset float :offset-assert 408) - (camera-air-max-angle-offset float :offset-assert 412) - (camera-max-lookaround-speed float :offset-assert 416) - (seat-count int8 :offset-assert 420) - (section-count int8 :offset-assert 421) - (rider-stance uint8 :offset-assert 422) - (grab-rail-count int8 :offset-assert 423) - (grab-rail-array uint32 :offset-assert 424) - (seat-array vehicle-seat-info 4 :inline :offset-assert 432) - (rider-hand-offset vector 2 :inline :offset-assert 496) - (section-array vehicle-section-info 4 :inline :offset-assert 528) - (section-bike-front vehicle-section-info :inline :offset 528) - (section-bike-rear vehicle-section-info :inline :offset 560) - (section-car-front-left vehicle-section-info :inline :offset 528) - (section-car-rear-left vehicle-section-info :inline :offset 560) - (section-car-front-right vehicle-section-info :inline :offset 592) - (section-car-rear-right vehicle-section-info :inline :offset 624) - (explosion vehicle-explosion-info :offset-assert 656) - (engine-pitch-scale float :offset-assert 660) - (engine-pitch-offset float :offset-assert 664) - (engine-pitch-mod-amp float :offset-assert 668) - (engine-sound-select int8 :offset-assert 672) - (engine-sound uint128 :offset-assert 688) - (thrust-sound uint128 :offset-assert 704) - (scrape-sound uint128 :offset-assert 720) - (glance-sound uint128 :offset-assert 736) - (impact-sound uint128 :offset-assert 752) - (extra-sound uint128 :offset-assert 768) - (explosion-part int32 :offset-assert 784) - (headlight-count int8 :offset-assert 788) - (taillight-count int8 :offset-assert 789) - (thruster-flame-width meters :offset-assert 792) - (thruster-flame-length meters :offset-assert 796) - (thruster-local-pos vector 2 :inline :offset-assert 800) - (exhaust-local-pos vector 2 :inline :offset-assert 832) - (exhaust-local-dir vector 2 :inline :offset-assert 864) - (smoke-local-pos vector 2 :inline :offset-assert 896) - (smoke-local-vel vector 2 :inline :offset-assert 928) - (headlight-local-pos vector 3 :inline :offset-assert 960) - (taillight-local-pos vector 2 :inline :offset-assert 1008) - (lift-thruster-count int8 :offset-assert 1040) - (roll-thruster-count int8 :offset-assert 1041) - (steering-thruster-count int8 :offset-assert 1042) - (stabilizer-count int8 :offset-assert 1043) - (inv-lift-thruster-count float :offset-assert 1044) - (pad int8 8 :offset-assert 1048) - (lift-thruster-array vehicle-control-point 2 :inline :offset-assert 1056) - (roll-thruster-array vehicle-control-point 2 :inline :offset-assert 1120) - (steering-thruster-array vehicle-control-point 2 :inline :offset-assert 1184) - (stabilizer-array vehicle-control-point 6 :inline :offset-assert 1248) - (engine-thrust-local-pos vector :inline :offset-assert 1440) - (brake-local-pos vector :inline :offset-assert 1456) - (particle-system-2d basic :offset-assert 1472) - (particle-system-3d basic :offset-assert 1476) - (part-thruster basic :offset-assert 1480) - (part-thruster-scale-x sp-field-init-spec :offset-assert 1484) - (part-thruster-scale-y sp-field-init-spec :offset-assert 1488) - (part-quat quaternion :offset-assert 1492) - (part-vel vector :offset-assert 1496) - (color-option-count int8 :offset-assert 1500) - (color-option-select int8 :offset-assert 1501) - (color-option-array (array rgba) :offset-assert 1504) - (sample-dir vector :inline :offset-assert 1520) - (sample-time time-frame :offset-assert 1536) - (sample-index int32 :offset-assert 1544) + ((flags uint32 :offset-assert 208) + (object-type uint8 :offset-assert 212) + (guard-type uint8 :offset-assert 213) + (max-engine-thrust meters :offset-assert 216) + (inv-max-engine-thrust float :offset-assert 220) + (engine-response-rate float :offset-assert 224) + (engine-intake-factor float :offset-assert 228) + (brake-factor float :offset-assert 232) + (turbo-boost-factor float :offset-assert 236) + (max-xz-speed meters :offset-assert 240) + (ground-probe-distance meters :offset-assert 244) + (ground-probe-offset meters :offset-assert 248) + (cos-ground-effect-angle float :offset-assert 252) + (spring-lift-factor float :offset-assert 256) + (air-steering-factor float :offset-assert 260) + (air-drag-factor float :offset-assert 264) + (steering-fin-angle float :offset-assert 268) + (steering-thruster-factor float :offset-assert 272) + (steering-thruster-max-gain float :offset-assert 276) + (steering-thruster-half-gain-speed meters :offset-assert 280) + (tire-steering-angle float :offset-assert 284) + (tire-friction-factor float :offset-assert 288) + (tire-static-friction float :offset-assert 292) + (tire-static-friction-speed meters :offset-assert 296) + (tire-dynamic-friction float :offset-assert 300) + (tire-dynamic-friction-speed meters :offset-assert 304) + (tire-inv-max-friction-speed float :offset-assert 308) + (airfoil-factor float :offset-assert 312) + (drag-force-factor float :offset-assert 316) + (speed-scrubbing-drag float :offset-assert 320) + (speed-limiting-drag float :offset-assert 324) + (pitch-control-factor float :offset-assert 328) + (roll-control-factor float :offset-assert 332) + (roll-angle float :offset-assert 336) + (jump-thrust-factor float :offset-assert 340) + (buoyancy-factor float :offset-assert 344) + (player-weight float :offset-assert 348) + (player-shift-x meters :offset-assert 352) + (player-shift-z meters :offset-assert 356) + (target-speed-offset meters :offset-assert 360) + (turning-accel meters :offset-assert 364) + (toughness-factor float :offset-assert 368) + (damage-factor float :offset-assert 372) + (camera-string-min-height meters :offset-assert 376) + (camera-string-max-height meters :offset-assert 380) + (camera-string-min-length meters :offset-assert 384) + (camera-string-max-length meters :offset-assert 388) + (camera-min-fov float :offset-assert 392) + (camera-max-fov float :offset-assert 396) + (camera-head-offset float :offset-assert 400) + (camera-foot-offset float :offset-assert 404) + (camera-normal-max-angle-offset float :offset-assert 408) + (camera-air-max-angle-offset float :offset-assert 412) + (camera-max-lookaround-speed float :offset-assert 416) + (seat-count int8 :offset-assert 420) + (section-count int8 :offset-assert 421) + (rider-stance uint8 :offset-assert 422) + (grab-rail-count int8 :offset-assert 423) + (grab-rail-array (inline-array vehicle-grab-rail-info) :offset-assert 424) + (seat-array vehicle-seat-info 4 :inline :offset-assert 432) + (rider-hand-offset vector 2 :inline :offset-assert 496) + (section-array vehicle-section-info 4 :inline :offset-assert 528) + (section-bike-front vehicle-section-info :inline :offset 528) + (section-bike-rear vehicle-section-info :inline :offset 560) + (section-car-front-left vehicle-section-info :inline :offset 528) + (section-car-rear-left vehicle-section-info :inline :offset 560) + (section-car-front-right vehicle-section-info :inline :offset 592) + (section-car-rear-right vehicle-section-info :inline :offset 624) + (explosion vehicle-explosion-info :offset-assert 656) + (engine-pitch-scale float :offset-assert 660) + (engine-pitch-offset float :offset-assert 664) + (engine-pitch-mod-amp float :offset-assert 668) + (engine-sound-select int8 :offset-assert 672) + (engine-sound sound-name :offset-assert 688) + (thrust-sound sound-name :offset-assert 704) + (scrape-sound sound-name :offset-assert 720) + (glance-sound sound-name :offset-assert 736) + (impact-sound sound-name :offset-assert 752) + (extra-sound sound-name :offset-assert 768) + (explosion-part int32 :offset-assert 784) + (headlight-count int8 :offset-assert 788) + (taillight-count int8 :offset-assert 789) + (thruster-flame-width meters :offset-assert 792) + (thruster-flame-length meters :offset-assert 796) + (thruster-local-pos vector 2 :inline :offset-assert 800) + (exhaust-local-pos vector 2 :inline :offset-assert 832) + (exhaust-local-dir vector 2 :inline :offset-assert 864) + (smoke-local-pos vector 2 :inline :offset-assert 896) + (smoke-local-vel vector 2 :inline :offset-assert 928) + (headlight-local-pos vector 3 :inline :offset-assert 960) + (taillight-local-pos vector 2 :inline :offset-assert 1008) + (lift-thruster-count int8 :offset-assert 1040) + (roll-thruster-count int8 :offset-assert 1041) + (steering-thruster-count int8 :offset-assert 1042) + (stabilizer-count int8 :offset-assert 1043) + (inv-lift-thruster-count float :offset-assert 1044) + (pad int8 8 :offset-assert 1048) + (lift-thruster-array vehicle-control-point 2 :inline :offset-assert 1056) + (roll-thruster-array vehicle-control-point 2 :inline :offset-assert 1120) + (steering-thruster-array vehicle-control-point 2 :inline :offset-assert 1184) + (stabilizer-array vehicle-control-point 6 :inline :offset-assert 1248) + (engine-thrust-local-pos vector :inline :offset-assert 1440) + (brake-local-pos vector :inline :offset-assert 1456) + (particle-system-2d basic :offset-assert 1472) + (particle-system-3d basic :offset-assert 1476) + (part-thruster basic :offset-assert 1480) + (part-thruster-scale-x sp-field-init-spec :offset-assert 1484) + (part-thruster-scale-y sp-field-init-spec :offset-assert 1488) + (part-quat quaternion :offset-assert 1492) + (part-vel vector :offset-assert 1496) + (color-option-count int8 :offset-assert 1500) + (color-option-select int8 :offset-assert 1501) + (color-option-array (inline-array vector) :offset-assert 1504) + (sample-dir vector :inline :offset-assert 1520) + (sample-time time-frame :offset-assert 1536) + (sample-index int32 :offset-assert 1544) ) :method-count-assert 11 :size-assert #x60c @@ -292,16 +292,16 @@ (goto cfg-4) ) (format #t "[~8x] ~A~%" obj 'rigid-body-vehicle-constants) - (format #t "~1Tinfo: #~%" (&-> obj mass)) - (format #t "~1Tmass: ~f~%" (-> obj mass)) - (format #t "~1Tinv-mass: ~f~%" (-> obj inv-mass)) - (format #t "~1Tcm-joint-x: (meters ~m)~%" (-> obj cm-joint x)) - (format #t "~1Tcm-joint-y: (meters ~m)~%" (-> obj cm-joint y)) - (format #t "~1Tcm-joint-z: (meters ~m)~%" (-> obj cm-joint z)) - (format #t "~1Tlinear-damping: ~f~%" (-> obj linear-damping)) - (format #t "~1Tangular-damping: ~f~%" (-> obj angular-damping)) - (format #t "~1Tbounce-factor: ~f~%" (-> obj bounce-factor)) - (format #t "~1Tfriction-factor: ~f~%" (-> obj friction-factor)) + (format #t "~1Tinfo: #~%" (-> obj info)) + (format #t "~1Tmass: ~f~%" (-> obj info mass)) + (format #t "~1Tinv-mass: ~f~%" (-> obj info inv-mass)) + (format #t "~1Tcm-joint-x: (meters ~m)~%" (-> obj info cm-offset-joint x)) + (format #t "~1Tcm-joint-y: (meters ~m)~%" (-> obj info cm-offset-joint y)) + (format #t "~1Tcm-joint-z: (meters ~m)~%" (-> obj info cm-offset-joint z)) + (format #t "~1Tlinear-damping: ~f~%" (-> obj info linear-damping)) + (format #t "~1Tangular-damping: ~f~%" (-> obj info angular-damping)) + (format #t "~1Tbounce-factor: ~f~%" (-> obj info bounce-factor)) + (format #t "~1Tfriction-factor: ~f~%" (-> obj info friction-factor)) (format #t "~1Tinertial-tensor-x: (meters ~m)~%" (-> obj inertial-tensor-x)) (format #t "~1Tinertial-tensor-y: (meters ~m)~%" (-> obj inertial-tensor-y)) (format #t "~1Tinertial-tensor-z: (meters ~m)~%" (-> obj inertial-tensor-z)) @@ -719,7 +719,7 @@ (vehicle-method-132 (_type_) none 132) (check-player-get-on (_type_) none 133) (vehicle-method-134 (_type_ process) none 134) - (vehicle-method-135 () none 135) + (vehicle-method-135 (_type_ traffic-object-spawn-params) none 135) (vehicle-method-136 (_type_ traffic-object-spawn-params) none 136) (vehicle-method-137 (_type_ traffic-object-spawn-params) none 137) (vehicle-method-138 (_type_) none 138) diff --git a/test/decompiler/reference/jak2/levels/city/common/vehicle-physics_REF.gc b/test/decompiler/reference/jak2/levels/city/common/vehicle-physics_REF.gc deleted file mode 100644 index 97e174cfa..000000000 --- a/test/decompiler/reference/jak2/levels/city/common/vehicle-physics_REF.gc +++ /dev/null @@ -1,887 +0,0 @@ -;;-*-Lisp-*- -(in-package goal) - -;; definition for method 99 of type vehicle -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-99 vehicle ((obj vehicle) (arg0 float)) - (let ((s4-0 (new 'stack-no-clear 'vehicle-grab-rail-info)) - (s3-0 (-> obj root-override-2 root-prim)) - (s2-0 1) - ) - (when (< (-> obj rbody state position y) (+ (-> obj water-height) (-> s3-0 local-sphere w))) - (when (= (-> s3-0 prim-core prim-type) (prim-type group)) - (let ((v1-5 (the-as collide-shape-prim-group s3-0))) - (set! s3-0 (-> v1-5 child 0)) - (set! s2-0 (the-as int (-> v1-5 num-children))) - ) - ) - (countdown (s1-0 s2-0) - (when (= (-> s3-0 prim-core prim-type) (prim-type sphere)) - (let* ((s0-0 (-> s3-0 prim-core)) - (f0-2 (- (-> s0-0 world-sphere y) (-> s0-0 world-sphere w))) - ) - (when (< f0-2 (-> obj water-height)) - (set! (-> s4-0 local-pos 0 quad) (-> s0-0 world-sphere quad)) - (let ((f1-5 (fmin (-> obj water-height) (+ (-> s0-0 world-sphere y) (-> s0-0 world-sphere w))))) - 0.0 - (let* ((f2-5 (fmax -1.0 (fmin 1.0 (/ (- (-> obj water-height) (-> s0-0 world-sphere y)) (-> s0-0 world-sphere w))))) - (f30-0 (+ 0.5 (* -0.25 f2-5 f2-5 f2-5) (* 0.75 f2-5))) - ) - (set! (-> s4-0 local-pos 0 y) (* 0.5 (+ f0-2 f1-5))) - (let ((v1-18 (-> obj rbody)) - (a1-1 (-> s4-0 local-pos)) - (a2-0 (-> s4-0 normal)) - ) - (rigid-body-method-22 (-> v1-18 state) (the-as vector a1-1) a2-0) - ) - (let* ((f0-7 (* 0.062831804 (fmin 200.0 (vector-length (-> s4-0 normal))) f30-0)) - (f1-8 (-> s0-0 world-sphere w)) - (f0-8 (* f0-7 (* f1-8 f1-8))) - (f1-11 4096.0) - (f1-13 (* f1-11 f1-11)) - (f0-10 (fmin (* f0-8 (/ 1.0 f1-13)) (/ (-> obj info-override mass) (* 2.0 arg0 (the float s2-0))))) - ) - (vector-float*! (-> s4-0 local-pos 1) (-> s4-0 normal) (* -1.0 f0-10)) - ) - (let ((v1-34 (-> obj rbody)) - (a1-3 (-> s4-0 local-pos)) - (a2-1 (-> s4-0 local-pos 1)) - ) - (rigid-body-method-18 (-> v1-34 state) (the-as vector a1-3) a2-1) - ) - (vector-reset! (-> s4-0 local-pos 1)) - (let* ((f0-12 549018.94) - (f1-19 4096.0) - (f2-13 4096.0) - (f1-20 (* f1-19 (* f2-13 f2-13))) - (f0-16 (* f0-12 (/ 1.0 f1-20) (-> obj info-override buoyancy-factor) f30-0 (-> s0-0 world-sphere w))) - (f1-25 (-> s0-0 world-sphere w)) - ) - (set! (-> s4-0 local-pos 1 y) (* f0-16 (* f1-25 f1-25))) - ) - ) - ) - (let ((v1-46 (-> obj rbody)) - (a1-4 (-> s4-0 local-pos)) - (a2-2 (-> s4-0 local-pos 1)) - ) - (rigid-body-method-18 (-> v1-46 state) (the-as vector a1-4) a2-2) - ) - ) - ) - ) - (&+! s3-0 80) - ) - ) - ) - 0 - (none) - ) - -;; definition of type vehicle-probe-work -(deftype vehicle-probe-work (structure) - ((local-pos vector :inline :offset-assert 0) - (local-normal vector :inline :offset-assert 16) - (world-pos vector :inline :offset-assert 32) - (world-normal vector :inline :offset-assert 48) - (probe-pos vector :inline :offset-assert 64) - (ground-pos vector :inline :offset-assert 80) - (ground-normal vector :inline :offset-assert 96) - (velocity vector :inline :offset-assert 112) - (tire-force vector :inline :offset-assert 128) - (wheel-axis vector :inline :offset-assert 144) - ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 - ) - -;; definition for method 3 of type vehicle-probe-work -(defmethod inspect vehicle-probe-work ((obj vehicle-probe-work)) - (when (not obj) - (set! obj obj) - (goto cfg-4) - ) - (format #t "[~8x] ~A~%" obj 'vehicle-probe-work) - (format #t "~1Tlocal-pos: #~%" (-> obj local-pos)) - (format #t "~1Tlocal-normal: #~%" (-> obj local-normal)) - (format #t "~1Tworld-pos: #~%" (-> obj world-pos)) - (format #t "~1Tworld-normal: #~%" (-> obj world-normal)) - (format #t "~1Tprobe-pos: #~%" (-> obj probe-pos)) - (format #t "~1Tground-pos: #~%" (-> obj ground-pos)) - (format #t "~1Tground-normal: #~%" (-> obj ground-normal)) - (format #t "~1Tvelocity: #~%" (-> obj velocity)) - (format #t "~1Ttire-force: #~%" (-> obj tire-force)) - (format #t "~1Twheel-axis: #~%" (-> obj wheel-axis)) - (label cfg-4) - obj - ) - -;; definition of type vehicle-physics-work -(deftype vehicle-physics-work (structure) - ((mat matrix :inline :offset-assert 0) - (force vector :inline :offset-assert 64) - (velocity vector :inline :offset-assert 80) - (world-pos vector :inline :offset-assert 96) - (world-normal vector :inline :offset-assert 112) - (local-pos vector :inline :offset-assert 128) - (steering-axis vector :inline :offset-assert 144) - (lift-dir vector :inline :offset-assert 160) - (normal vector :inline :offset-assert 176) - (tmp vector :inline :offset-assert 192) - (p-body vector :inline :offset-assert 208) - (axis vector :inline :offset-assert 224) - (dir vector :inline :offset-assert 240) - (ground-normal vector :inline :offset-assert 256) - (impulse float :offset-assert 272) - (vel-dot-norm float :offset-assert 276) - (friction-coef float :offset-assert 280) - (speed-factor float :offset-assert 284) - (probe-work-array vehicle-probe-work 2 :inline :offset-assert 288) - ) - :method-count-assert 9 - :size-assert #x260 - :flag-assert #x900000260 - ) - -;; definition for method 3 of type vehicle-physics-work -(defmethod inspect vehicle-physics-work ((obj vehicle-physics-work)) - (when (not obj) - (set! obj obj) - (goto cfg-4) - ) - (format #t "[~8x] ~A~%" obj 'vehicle-physics-work) - (format #t "~1Tmat: #~%" (-> obj mat)) - (format #t "~1Tforce: #~%" (-> obj force)) - (format #t "~1Tvelocity: #~%" (-> obj velocity)) - (format #t "~1Tworld-pos: #~%" (-> obj world-pos)) - (format #t "~1Tworld-normal: #~%" (-> obj world-normal)) - (format #t "~1Tlocal-pos: #~%" (-> obj local-pos)) - (format #t "~1Tsteering-axis: #~%" (-> obj steering-axis)) - (format #t "~1Tlift-dir: #~%" (-> obj lift-dir)) - (format #t "~1Tnormal: #~%" (-> obj normal)) - (format #t "~1Ttmp: #~%" (-> obj tmp)) - (format #t "~1Tp-body: #~%" (-> obj p-body)) - (format #t "~1Taxis: #~%" (-> obj axis)) - (format #t "~1Tdir: #~%" (-> obj dir)) - (format #t "~1Tground-normal: #~%" (-> obj ground-normal)) - (format #t "~1Timpulse: ~f~%" (-> obj impulse)) - (format #t "~1Tvel-dot-norm: ~f~%" (-> obj vel-dot-norm)) - (format #t "~1Tfriction-coef: ~f~%" (-> obj friction-coef)) - (format #t "~1Tspeed-factor: ~f~%" (-> obj speed-factor)) - (format #t "~1Tprobe-work-array[2] @ #x~X~%" (-> obj probe-work-array)) - (label cfg-4) - obj - ) - -;; definition for method 100 of type vehicle -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-100 vehicle ((obj vehicle) (arg0 float) (arg1 vehicle-physics-work)) - (local-vars (v1-81 float) (v1-184 float)) - (rlet ((acc :class vf) - (vf0 :class vf) - (vf1 :class vf) - (vf2 :class vf) - (vf4 :class vf) - (vf5 :class vf) - (vf6 :class vf) - (vf7 :class vf) - ) - (init-vf0-vector) - (+! (-> obj physics-counter) 1) - (let ((s3-0 (-> obj rbody))) - (mem-copy! (the-as pointer (-> arg1 mat)) (the-as pointer (-> s3-0 state matrix)) 64) - (let* ((f28-0 (* -1.0 (-> obj controls steering) (-> obj info-override tire-steering-angle))) - (f30-0 (cos f28-0)) - (f0-2 (sin f28-0)) - ) - (set! (-> arg1 steering-axis x) f30-0) - (set! (-> arg1 steering-axis y) 0.0) - (set! (-> arg1 steering-axis z) f0-2) - ) - (vector-rotate*! (-> arg1 steering-axis) (-> arg1 steering-axis) (-> arg1 mat)) - (logior! (-> obj flags) (rigid-body-object-flag in-air)) - (logclear! (-> obj flags) (rigid-body-object-flag on-ground on-flight-level)) - (vector-reset! (-> arg1 ground-normal)) - (set! (-> arg1 ground-normal y) 1.0) - (let ((f30-1 (-> obj info-override ground-probe-distance))) - (let ((s2-0 (new 'stack-no-clear 'collide-query))) - (vector-reset! (-> arg1 lift-dir)) - (set! (-> arg1 lift-dir y) -1.0) - (set! (-> arg1 speed-factor) - (fmax 0.0 (fmin 0.9 (* 0.000008138021 (+ -40960.0 (vector-length (-> s3-0 state lin-velocity)))))) - ) - (when (logtest? (-> obj info-override flags) 1) - (vector-float*! (-> arg1 tmp) (-> arg1 mat vector 1) -1.0) - (let ((t9-4 vector-lerp!) - (a0-7 (-> arg1 lift-dir)) - (a1-4 (-> arg1 lift-dir)) - (a2-3 (-> arg1 tmp)) - (f0-8 (-> arg1 speed-factor)) - ) - (t9-4 a0-7 a1-4 a2-3 (* f0-8 f0-8)) - ) - (vector-normalize! (-> arg1 lift-dir) 1.0) - ) - (vector-float*! (-> s2-0 move-dist) (-> arg1 lift-dir) (the-as float f30-1)) - (let ((v1-28 s2-0)) - (set! (-> v1-28 radius) 409.6) - (set! (-> v1-28 collide-with) (collide-spec - backgnd - obstacle - hit-by-player-list - hit-by-others-list - water - collectable - blocking-plane - pusher - vehicle-mesh-probeable - ) - ) - (set! (-> v1-28 ignore-process0) #f) - (set! (-> v1-28 ignore-process1) #f) - (set! (-> v1-28 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1)) - (set! (-> v1-28 action-mask) (collide-action solid)) - ) - (dotimes (s1-0 (-> obj info-override lift-thruster-count)) - (let ((v1-31 (-> obj info-override lift-thruster-array s1-0)) - (s0-0 (-> arg1 probe-work-array s1-0)) - ) - (vector-reset! (-> s0-0 tire-force)) - (set! (-> s0-0 local-pos quad) (-> v1-31 local-pos quad)) - (set! (-> s0-0 local-normal quad) (-> v1-31 normal quad)) - (vector-matrix*! (-> s0-0 world-pos) (-> s0-0 local-pos) (-> arg1 mat)) - (let ((a1-9 (-> s0-0 probe-pos))) - (let ((v1-34 (-> s0-0 world-pos))) - (let ((a0-22 (-> arg1 mat vector 1))) - (let ((a2-6 (-> obj info-override ground-probe-offset))) - (.mov vf7 a2-6) - ) - (.lvf vf5 (&-> a0-22 quad)) - ) - (.lvf vf4 (&-> v1-34 quad)) - ) - (.add.x.vf vf6 vf0 vf0 :mask #b1000) - (.mul.x.vf acc vf5 vf7 :mask #b111) - (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) - (.svf (&-> a1-9 quad) vf6) - ) - (let ((v1-35 s3-0) - (a1-10 (-> s0-0 probe-pos)) - (a2-7 (-> s0-0 velocity)) - ) - (rigid-body-method-22 (-> v1-35 state) a1-10 a2-7) - ) - (set! (-> s0-0 wheel-axis quad) (-> (the-as vector (if (< 0.0 (-> s0-0 local-pos z)) - (-> arg1 steering-axis) - (the-as vector (-> arg1 mat)) - ) - ) - quad - ) - ) - (set! (-> s0-0 ground-pos quad) (-> s0-0 probe-pos quad)) - (set! (-> s0-0 ground-pos y) 0.0) - (vector-reset! (-> s0-0 ground-normal)) - (when (logtest? (-> obj flags) (rigid-body-object-flag enable-collision)) - (set! (-> s2-0 start-pos quad) (-> s0-0 probe-pos quad)) - (let ((f0-15 (probe-using-line-sphere *collide-cache* s2-0))) - (cond - ((and (>= f0-15 0.0) (!= (-> s2-0 best-other-tri pat mode) 1)) - (logclear! (-> obj flags) (rigid-body-object-flag in-air)) - (logior! (-> obj flags) (rigid-body-object-flag on-ground)) - (set! (-> s0-0 ground-pos y) (- (-> s0-0 probe-pos y) (* f0-15 f30-1))) - (set! (-> s0-0 ground-normal quad) (-> s2-0 best-other-tri normal quad)) - (set! (-> arg1 ground-normal quad) (-> s0-0 ground-normal quad)) - ) - (else - (set! (-> s0-0 ground-pos y) (+ -81920.0 (-> s3-0 state position y))) - ) - ) - ) - 0 - ) - ) - ) - ) - (set! (-> obj lift-thrust 0) 0.0) - (set! (-> obj lift-thrust 1) 0.0) - (set! (-> obj roll-thrust 0) 0.0) - (set! (-> obj roll-thrust 1) 0.0) - (set! (-> obj roll-thrust 0) 0.0) - (set! (-> obj roll-thrust 1) 0.0) - (when (>= 1 (-> obj force-level)) - (dotimes (s2-1 (-> obj info-override lift-thruster-count)) - (let ((s1-1 (-> arg1 probe-work-array s2-1))) - (set! (-> arg1 world-pos quad) (-> s1-1 world-pos quad)) - (set! (-> arg1 velocity quad) (-> s1-1 velocity quad)) - (let ((f28-1 (-> s1-1 probe-pos y))) - (when (> (-> obj flight-level-index) 0) - (set! f28-1 (- f28-1 (+ 6144.0 (-> obj flight-level)))) - (when (>= 0.0 f28-1) - (logclear! (-> obj flags) (rigid-body-object-flag in-air)) - (logior! (-> obj flags) (rigid-body-object-flag on-flight-level)) - (.lvf vf1 (&-> (-> s1-1 ground-normal) quad)) - (.add.w.vf vf2 vf0 vf0 :mask #b1) - (.mul.vf vf1 vf1 vf1) - (.mul.x.vf acc vf2 vf1 :mask #b1) - (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) - (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) - (.mov v1-81 vf1) - (if (= v1-81 0.0) - (set! (-> s1-1 ground-normal y) 1.0) - ) - ) - ) - (when (or (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) - (and (> (-> obj flight-level-index) 0) (< f28-1 0.0)) - ) - (if (zero? (-> obj flight-level-index)) - (set! f28-1 40960.0) - ) - (let* ((f0-37 (* -1.0 - (-> obj force-scale) - (-> obj info-override inv-lift-thruster-count) - (-> obj info-override mass) - (-> obj info-override gravity) - (+ 1.0 (* 2.0 (the float (-> obj flight-level-index)))) - ) - ) - (f1-17 -1.0) - (f2-4 1.0) - (f3-4 16384.0) - (f3-7 (* f28-1 (/ 1.0 f3-4))) - (f4-2 0.5) - (f5-0 81920.0) - (f0-38 (* f0-37 (fmax f1-17 (fmin f2-4 (+ f3-7 (* f4-2 (/ 1.0 f5-0) (-> arg1 velocity y))))))) - ) - (let ((f1-20 (fmax 0.0 f0-38))) - (+! (-> obj lift-thrust s2-1) f1-20) - (when (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) - (+! (-> obj roll-thrust 0) (* 0.05 f1-20)) - (+! (-> obj roll-thrust 1) (* 0.05 f1-20)) - ) - ) - (vector-reset! (-> arg1 force)) - (set! (-> arg1 force y) f0-38) - ) - (let ((v1-122 s3-0) - (a1-12 (-> arg1 world-pos)) - (a2-8 (-> arg1 force)) - ) - (rigid-body-method-18 (-> v1-122 state) a1-12 a2-8) - ) - (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) - ) - (let ((f0-40 (+ 4096.0 f28-1))) - (when (or (and (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) - (< 0.0 f0-40) - (< 0.0 (-> arg1 velocity y)) - ) - (and (> (-> obj flight-level-index) 0) (< f0-40 0.0) (< (-> arg1 velocity y) 0.0)) - ) - (vector-reset! (-> arg1 force)) - (let ((f0-43 (* -0.25 (-> obj info-override inv-lift-thruster-count))) - (f1-28 arg0) - ) - (set! (-> arg1 force y) (* f0-43 (/ 1.0 f1-28) (-> obj info-override mass) (-> arg1 velocity y))) - ) - (let ((v1-140 s3-0) - (a1-16 (-> arg1 world-pos)) - (a2-9 (-> arg1 force)) - ) - (rigid-body-method-18 (-> v1-140 state) a1-16 a2-9) - ) - (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) - ) - ) - ) - (let* ((f1-36 (fmax 4096.0 (fmin (- (-> s1-1 probe-pos y) (-> s1-1 ground-pos y)) f30-1))) - (f28-2 (- 1.0 (/ (+ -4096.0 f1-36) (+ -4096.0 f30-1)))) - ) - (if (>= (-> obj info-override cos-ground-effect-angle) - (vector-dot (-> s1-1 ground-normal) (-> arg1 mat vector 1)) - ) - (set! f28-2 0.0) - ) - (set! (-> arg1 tmp y) 0.0) - (set! (-> arg1 tmp x) (-> arg1 velocity z)) - (set! (-> arg1 tmp z) (- (-> arg1 velocity x))) - (vector-normalize! (-> arg1 tmp) 1.0) - (vector+float*! - (-> arg1 normal) - (-> s1-1 ground-normal) - (-> arg1 tmp) - (- (vector-dot (-> s1-1 ground-normal) (-> arg1 tmp))) - ) - (let ((v1-155 (-> arg1 force)) - (a0-55 (-> arg1 normal)) - (f0-58 (* 2.0 f28-2)) - (f1-41 arg0) - ) - (vector-float*! v1-155 a0-55 (* f0-58 - (/ 1.0 f1-41) - (-> obj info-override inv-lift-thruster-count) - (-> obj info-override mass) - (fmax 0.0 (- (vector-dot (-> arg1 velocity) (-> arg1 normal)))) - ) - ) - ) - (let ((v1-157 s3-0) - (a1-28 (-> arg1 world-pos)) - (a2-13 (-> arg1 force)) - ) - (rigid-body-method-18 (-> v1-157 state) a1-28 a2-13) - ) - (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) - (let ((f0-72 (* 8.0 - (-> obj info-override mass) - (-> obj info-override gravity) - (-> obj info-override inv-lift-thruster-count) - (+ (* (-> obj info-override spring-lift-factor) f28-2) - (* 0.75 (-> obj jump-thrust) (-> obj info-override jump-thrust-factor)) - ) - (- (+ 1.0 (* 2.0 (rand-vu) (-> obj power-fluctuation-factor))) (-> obj power-fluctuation-factor)) - ) - ) - ) - (+! (-> obj lift-thrust s2-1) f0-72) - (vector-float*! (-> arg1 force) (-> arg1 lift-dir) (* -1.0 f0-72)) - ) - ) - (let ((v1-176 s3-0) - (a1-32 (-> arg1 world-pos)) - (a2-14 (-> arg1 force)) - ) - (rigid-body-method-18 (-> v1-176 state) a1-32 a2-14) - ) - (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) - (when (and (< 0.0 (-> obj info-override tire-friction-factor)) (let ((f0-75 0.0)) - (.lvf vf1 (&-> (-> s1-1 ground-normal) quad)) - (.add.w.vf vf2 vf0 vf0 :mask #b1) - (.mul.vf vf1 vf1 vf1) - (.mul.x.vf acc vf2 vf1 :mask #b1) - (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) - (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) - (.mov v1-184 vf1) - (< f0-75 v1-184) - ) - ) - (vector+float*! - (-> arg1 normal) - (-> s1-1 wheel-axis) - (-> s1-1 ground-normal) - (- (vector-dot (-> s1-1 wheel-axis) (-> s1-1 ground-normal))) - ) - (vector-normalize! (-> arg1 normal) 1.0) - (set! (-> arg1 world-pos quad) (-> s3-0 state position quad)) - (set! (-> arg1 velocity quad) (-> s3-0 state lin-velocity quad)) - (vector-! (-> arg1 p-body) (-> arg1 world-pos) (-> s3-0 state position)) - (vector-cross! (-> arg1 tmp) (-> arg1 p-body) (-> arg1 normal)) - (vector-rotate*! (-> arg1 tmp) (-> arg1 tmp) (-> s3-0 state inv-i-world)) - (vector-cross! (-> arg1 tmp) (-> arg1 tmp) (-> arg1 p-body)) - (set! (-> arg1 vel-dot-norm) (vector-dot (-> arg1 velocity) (-> arg1 normal))) - (let ((f0-82 (fabs (-> arg1 vel-dot-norm)))) - (set! (-> arg1 friction-coef) - (smooth-interp - (-> obj info-override tire-static-friction) - (-> obj info-override tire-dynamic-friction) - f0-82 - (-> obj info-override tire-static-friction-speed) - (-> obj info-override tire-dynamic-friction-speed) - ) - ) - ) - (set! (-> arg1 friction-coef) - (* (-> arg1 friction-coef) (+ 1.0 (* -0.75 (fmax 0.0 (fmin 1.0 (-> obj engine-thrust)))))) - ) - (let ((f0-90 - (* (-> arg1 friction-coef) - (-> obj info-override tire-friction-factor) - (fmax 0.0 (vector-dot (-> s1-1 ground-normal) (-> s1-1 tire-force))) - ) - ) - ) - (set! (-> arg1 impulse) - (/ (* -1.0 (-> arg1 vel-dot-norm)) - (* arg0 (+ (-> s3-0 state info inv-mass) (vector-dot (-> arg1 normal) (-> arg1 tmp)))) - ) - ) - (set! (-> arg1 impulse) (fmax (fmin (-> arg1 impulse) f0-90) (- f0-90))) - ) - (vector-float*! (-> arg1 force) (-> arg1 normal) (-> arg1 impulse)) - (let ((v1-213 s3-0) - (a1-45 (-> arg1 world-pos)) - (a2-19 (-> arg1 force)) - ) - (rigid-body-method-18 (-> v1-213 state) a1-45 a2-19) - ) - ) - ) - ) - ) - ) - ) - 0 - (none) - ) - ) - -;; definition for method 29 of type vehicle -;; INFO: Used lq/sq -;; WARN: Stack slot offset 624 signed mismatch -;; WARN: Stack slot offset 724 signed mismatch -;; WARN: Stack slot offset 720 signed mismatch -;; WARN: Stack slot offset 624 signed mismatch -;; WARN: Stack slot offset 724 signed mismatch -;; WARN: Stack slot offset 720 signed mismatch -;; WARN: Stack slot offset 624 signed mismatch -;; WARN: Stack slot offset 724 signed mismatch -;; WARN: Stack slot offset 720 signed mismatch -;; WARN: Stack slot offset 624 signed mismatch -;; WARN: Stack slot offset 724 signed mismatch -;; WARN: Stack slot offset 720 signed mismatch -;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-29 vehicle ((obj vehicle) (arg0 float)) - (local-vars (sv-624 float) (sv-720 float) (sv-724 float)) - (rlet ((vf0 :class vf)) - (init-vf0-vector) - (let ((gp-0 (new 'stack-no-clear 'inline-array 'matrix 9)) - (s5-0 (-> obj rbody)) - (s4-0 (-> obj info-override)) - ) - (mem-copy! (the-as pointer (-> gp-0 0)) (the-as pointer (-> s5-0 state matrix)) 64) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag dead))) - (vehicle-method-100 obj arg0 (the-as vehicle-physics-work gp-0)) - (when (>= 1 (-> obj force-level)) - (set! sv-624 (* (-> s4-0 mass) (-> s4-0 gravity))) - (when (!= (-> s4-0 pitch-control-factor) 0.0) - (set! (-> gp-0 3 vector 2 quad) (-> gp-0 0 quad 0)) - (set! (-> gp-0 3 vector 2 y) 0.0) - (let ((f30-0 (vector-dot (-> gp-0 3 vector 2) (-> s5-0 state ang-velocity)))) - (dotimes (s1-0 (-> s4-0 lift-thruster-count)) - (let ((s0-0 (-> s4-0 lift-thruster-array s1-0))) - (vector-matrix*! (-> gp-0 1 vector 2) (-> s0-0 local-pos) (-> gp-0 0)) - (vector-rotate*! (-> gp-0 1 trans) (-> s0-0 normal) (-> gp-0 0)) - (let* ((f0-5 -1.0) - (f1-2 1.0) - (f2-0 0.2) - (a0-9 (the-as number (-> s0-0 local-pos z))) - (a1-5 #xffffffff80000000) - (v1-16 #x3f800000) - (f0-7 - (* (fmax - f0-5 - (fmin - f1-2 - (* f2-0 (the-as float (logior (logand (the-as uint a0-9) a1-5) v1-16)) (-> s4-0 pitch-control-factor) f30-0) - ) - ) - sv-624 - ) - ) - ) - (vector-float*! (the-as vector (-> gp-0 1)) (-> gp-0 1 trans) (* -1.0 f0-7)) - ) - ) - (let ((v1-21 s5-0) - (a1-7 (-> gp-0 1 vector 2)) - (a2-4 (-> gp-0 1)) - ) - (rigid-body-method-18 (-> v1-21 state) a1-7 (the-as vector a2-4)) - ) - ) - ) - ) - (let ((s1-1 (new 'stack-no-clear 'inline-array 'vector 5))) - (let ((f0-12 (* -1.0 (-> obj controls steering) (-> gp-0 4 vector 1 w) (-> s4-0 roll-angle)))) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) - (set! f0-12 0.0) - ) - (quaternion-vector-angle! (the-as quaternion (-> s1-1 0)) (-> gp-0 0 vector 2) f0-12) - ) - (quaternion->matrix (the-as matrix (-> s1-1 1)) (the-as quaternion (-> s1-1 0))) - (set! (-> gp-0 3 trans quad) (-> s1-1 2 quad)) - ) - (let ((f0-14 (vector-dot (the-as vector (-> gp-0 0)) (-> gp-0 3 trans)))) - (set! sv-720 (* (-> s4-0 mass) (-> s4-0 gravity))) - (let ((f1-11 f0-14)) - (set! sv-724 - (+ (* f1-11 f1-11 f0-14) (* 0.075 (vector-dot (-> gp-0 0 vector 2) (-> s5-0 state ang-velocity)))) - ) - ) - ) - (dotimes (s1-2 (-> s4-0 roll-thruster-count)) - (let* ((s0-1 (-> s4-0 roll-thruster-array s1-2)) - (f0-17 0.0) - (f1-16 1.0) - (f2-7 -1.0) - (a0-19 (the-as number (-> s0-1 local-pos x))) - (a1-10 #xffffffff80000000) - (v1-44 #x3f800000) - (f30-1 - (fmax f0-17 (fmin f1-16 (* f2-7 (the-as float (logior (logand (the-as uint a0-19) a1-10) v1-44)) sv-724))) - ) - ) - (when (< 0.0 f30-1) - (let ((f30-2 - (* (+ f30-1 (+ (- (-> obj power-fluctuation-factor)) (* 2.0 (rand-vu) (-> obj power-fluctuation-factor)))) - (-> s4-0 roll-control-factor) - sv-720 - ) - ) - ) - (+! (-> obj roll-thrust s1-2) (fmax 0.0 f30-2)) - (vector-matrix*! (-> gp-0 1 vector 2) (-> s0-1 local-pos) (-> gp-0 0)) - (vector-rotate*! (-> gp-0 1 trans) (-> s0-1 normal) (-> gp-0 0)) - (vector-float*! (the-as vector (-> gp-0 1)) (-> gp-0 1 trans) (* -1.0 f30-2)) - ) - (let ((v1-56 s5-0) - (a1-14 (-> gp-0 1 vector 2)) - (a2-8 (-> gp-0 1)) - ) - (rigid-body-method-18 (-> v1-56 state) a1-14 (the-as vector a2-8)) - ) - 0 - ) - ) - ) - ) - (when #t - (let* ((f0-30 (-> obj controls steering)) - (f1-23 (-> s4-0 steering-thruster-half-gain-speed)) - (f2-10 (-> s4-0 steering-thruster-half-gain-speed)) - (v1-65 (-> s5-0 state lin-velocity)) - (f2-12 (/ f1-23 (+ f2-10 (sqrtf (+ (* (-> v1-65 x) (-> v1-65 x)) (* (-> v1-65 z) (-> v1-65 z))))))) - ) - (if (< (-> obj controls throttle) 0.0) - (set! f0-30 (* -1.0 f0-30)) - ) - (set! (-> gp-0 3 vector 2 quad) (-> gp-0 0 vector 1 quad)) - (let ((f30-3 (* 8192.0 - (-> s4-0 mass) - (-> obj power-level) - (- (* f0-30 f2-12 (-> s4-0 steering-thruster-max-gain)) - (vector-dot (-> gp-0 3 vector 2) (-> s5-0 state ang-velocity)) - ) - (-> s4-0 steering-thruster-factor) - ) - ) - ) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) - (set! f30-3 (* f30-3 (-> s4-0 air-steering-factor))) - ) - (let ((s1-3 (the-as object (-> s4-0 steering-thruster-array)))) - (countdown (s0-2 (-> s4-0 steering-thruster-count)) - (vector-matrix*! (-> gp-0 1 vector 2) (-> (the-as vehicle-control-point s1-3) local-pos) (-> gp-0 0)) - (vector-rotate*! - (-> gp-0 1 trans) - (-> (the-as (inline-array vehicle-control-point) s1-3) 0 normal) - (-> gp-0 0) - ) - (vector-float*! (the-as vector (-> gp-0 1)) (-> gp-0 1 trans) f30-3) - (let ((v1-80 s5-0) - (a1-17 (-> gp-0 1 vector 2)) - (a2-11 (-> gp-0 1)) - ) - (rigid-body-method-18 (-> v1-80 state) a1-17 (the-as vector a2-11)) - ) - (set! s1-3 (-> (the-as (inline-array vehicle-control-point) s1-3) 1)) - ) - ) - ) - ) - ) - (seek! (-> obj jump-thrust) 0.0 (* 6.0 arg0)) - (when (logtest? (rigid-body-object-flag ignition) (-> obj flags)) - (vector-matrix*! (-> gp-0 1 vector 2) (-> s4-0 engine-thrust-local-pos) (-> gp-0 0)) - (set! (-> gp-0 3 trans quad) (-> gp-0 0 vector 2 quad)) - (let ((f0-45 (* (-> obj engine-thrust) - (-> s4-0 max-engine-thrust) - (-> s4-0 mass) - (-> obj power-level) - (-> obj force-scale) - ) - ) - ) - (vector-float*! (the-as vector (-> gp-0 1)) (-> gp-0 3 trans) f0-45) - ) - (when #t - (let ((v1-94 s5-0) - (a1-20 (-> gp-0 1 vector 2)) - (a2-14 (-> gp-0 1)) - ) - (rigid-body-method-18 (-> v1-94 state) a1-20 (the-as vector a2-14)) - ) - ) - ) - (let ((f30-4 (-> obj controls brake))) - (when (< 0.0 f30-4) - (vector-matrix*! (-> gp-0 1 vector 2) (-> s4-0 brake-local-pos) (-> gp-0 0)) - (let ((v1-98 s5-0) - (a1-22 (-> gp-0 1 vector 2)) - (a2-16 (-> gp-0 1 vector 1)) - ) - (rigid-body-method-22 (-> v1-98 state) a1-22 a2-16) - ) - (let* ((v1-101 (-> gp-0 1 vector 1)) - (f1-38 (sqrtf (+ (* (-> v1-101 x) (-> v1-101 x)) (* (-> v1-101 z) (-> v1-101 z))))) - (f0-53 (* -98304.0 (-> s4-0 brake-factor) (-> s4-0 mass))) - (f1-39 (fmax 16384.0 f1-38)) - (f0-55 (* f0-53 (/ 1.0 f1-39) f30-4)) - ) - (vector-float*! (the-as vector (-> gp-0 1)) (-> gp-0 1 vector 1) f0-55) - ) - (let ((v1-109 s5-0) - (a1-23 (-> gp-0 1 vector 2)) - (a2-17 (-> gp-0 1)) - ) - (rigid-body-method-18 (-> v1-109 state) a1-23 (the-as vector a2-17)) - ) - ) - ) - ) - (let ((s1-4 (new 'stack-no-clear 'rigid-body-vehicle-constants))) - (quad-copy! - (the-as pointer s1-4) - (the-as pointer (-> s4-0 stabilizer-array)) - (* (-> s4-0 stabilizer-count) 2) - ) - (let ((s0-3 (-> s1-4 info inertial-tensor))) - (let ((f0-57 (* -3640.889 (-> obj controls lean-z)))) - (vector-rotate-around-x! (the-as vector s0-3) (the-as vector s0-3) f0-57) - ) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) - (set! (-> s0-3 vector 0 w) (* 10.0 (-> s0-3 vector 0 w))) - ) - (if (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) - (set! (-> s0-3 vector 0 w) 0.0) - ) - ) - (let ((f30-5 (* -0.0000006103516 (-> obj force-scale) (-> s4-0 mass) (-> s4-0 drag-force-factor)))) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) - (set! f30-5 (* f30-5 (-> s4-0 air-drag-factor))) - ) - (let ((s1-5 (&-> s1-4 mass))) - (countdown (s0-4 (-> s4-0 stabilizer-count)) - (vector-matrix*! (-> gp-0 1 vector 2) (the-as vector (&-> s1-5 0)) (-> gp-0 0)) - (vector-rotate*! (-> gp-0 1 trans) (the-as vector (&-> s1-5 4)) (-> gp-0 0)) - (let ((v1-128 s5-0) - (a1-28 (-> gp-0 1 vector 2)) - (a2-22 (-> gp-0 1 vector 1)) - ) - (rigid-body-method-22 (-> v1-128 state) a1-28 a2-22) - ) - (let ((f0-70 - (* -0.06125 - (vector-dot (-> gp-0 1 trans) (-> gp-0 1 vector 1)) - (-> s1-5 7) - (-> obj force-scale) - (-> s4-0 mass) - (-> s4-0 airfoil-factor) - ) - ) - ) - (vector-float*! (the-as vector (-> gp-0 1)) (-> gp-0 1 trans) f0-70) - ) - (when (<= (-> obj force-level) 0) - (let ((v1-138 s5-0) - (a1-29 (-> gp-0 1 vector 2)) - (a2-23 (-> gp-0 1)) - ) - (rigid-body-method-18 (-> v1-138 state) a1-29 (the-as vector a2-23)) - ) - ) - (vector-float*! - (the-as vector (-> gp-0 1)) - (-> gp-0 1 vector 1) - (* f30-5 - (-> s1-5 7) - (+ (* 0.15 (vector-length (-> gp-0 1 vector 1))) (fabs (vector-dot (-> gp-0 1 trans) (-> gp-0 1 vector 1)))) - ) - ) - (when (<= (-> obj force-level) 0) - (let ((v1-145 s5-0) - (a1-35 (-> gp-0 1 vector 2)) - (a2-25 (-> gp-0 1)) - ) - (rigid-body-method-18 (-> v1-145 state) a1-35 (the-as vector a2-25)) - ) - ) - (set! s1-5 (&-> s1-5 8)) - ) - ) - ) - ) - (.svf (&-> (-> gp-0 1) quad 0) vf0) - (set! (-> gp-0 1 vector 0 y) (* -1.0 - (-> s4-0 gravity) - (if (< 1 (-> obj force-level)) - 2.0 - 1.0 - ) - (-> s4-0 mass) - ) - ) - (let ((v1-154 s5-0) - (a1-36 (-> gp-0 1)) - ) - (rigid-body-method-20 (-> v1-154 state) (the-as vector a1-36)) - ) - (when (logtest? (-> obj flags) (rigid-body-object-flag riding)) - (set! (-> gp-0 2 quad 0) (-> s4-0 cm-joint quad)) - (+! (-> gp-0 2 vector 0 x) (* (-> obj controls steering) (-> s4-0 player-shift-x))) - (+! (-> gp-0 2 vector 0 z) (* (-> obj controls lean-z) (-> s4-0 player-shift-z))) - (vector-matrix*! (-> gp-0 1 vector 2) (the-as vector (-> gp-0 2)) (-> gp-0 0)) - (.svf (&-> (-> gp-0 1) quad 0) vf0) - (set! (-> gp-0 1 vector 0 y) (- (-> s4-0 player-weight))) - (let ((v1-162 s5-0) - (a1-38 (-> gp-0 1 vector 2)) - (a2-27 (-> gp-0 1)) - ) - (rigid-body-method-18 (-> v1-162 state) a1-38 (the-as vector a2-27)) - ) - 0 - ) - (rigid-body-object-method-50 obj arg0) - (vehicle-method-99 obj arg0) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag dead))) - (set! (-> gp-0 1 trans quad) (-> s5-0 state lin-momentum quad)) - (set! (-> gp-0 1 trans y) 0.0) - (vector-normalize! (-> gp-0 1 trans) 1.0) - (let* ((v1-174 (-> s5-0 state lin-velocity)) - (f0-90 (/ (sqrtf (+ (* (-> v1-174 x) (-> v1-174 x)) (* (-> v1-174 z) (-> v1-174 z)))) (-> s4-0 max-xz-speed))) - (v1-176 (-> gp-0 1)) - (a0-65 (-> gp-0 1 trans)) - (f1-67 -1.0) - (f2-29 (* (-> s4-0 speed-limiting-drag) (vector-dot (-> s5-0 state force) (-> gp-0 1 trans)))) - (f3-19 - (* (fabs (-> obj engine-thrust)) (-> s4-0 speed-scrubbing-drag) (vector-length (-> s5-0 state lin-momentum))) - ) - (f4-6 (- 1.0 (fabs (vector-dot (-> s5-0 state matrix vector 2) (-> gp-0 1 trans))))) - ) - (vector-float*! (the-as vector v1-176) a0-65 (* f1-67 (+ f2-29 (* f3-19 (* f4-6 f4-6))) (sqrtf f0-90))) - ) - (let ((a1-51 (-> gp-0 1))) - (rigid-body-method-20 (-> s5-0 state) (the-as vector a1-51)) - ) - ) - ) - 0 - (none) - ) - ) - -;; definition for method 125 of type vehicle -(defmethod vehicle-method-125 vehicle ((obj vehicle) (arg0 float)) - (rigid-body-object-method-29 obj arg0) - (none) - ) - -;; definition for method 126 of type vehicle -(defmethod vehicle-method-126 vehicle ((obj vehicle) (arg0 float)) - (rigid-body-object-method-29 obj arg0) - (none) - ) diff --git a/test/decompiler/reference/jak2/levels/city/common/vehicle-states_REF.gc b/test/decompiler/reference/jak2/levels/city/common/vehicle-states_REF.gc index e8cc0ce63..bcdcc6ebf 100644 --- a/test/decompiler/reference/jak2/levels/city/common/vehicle-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/vehicle-states_REF.gc @@ -327,7 +327,7 @@ (cond ((logtest? (-> self rbody state flags) (rigid-body-flag enable-physics)) (let ((gp-2 (new 'stack-no-clear 'rigid-body-info))) - (mem-copy! (&-> gp-2 mass) (&-> (-> self info-override) mass) 188) + (mem-copy! (&-> gp-2 mass) (the-as pointer (-> self info-override info)) 188) (set! (-> self rbody state info) (the-as rigid-body-info (&-> gp-2 mass))) (set! (-> gp-2 bounce-mult-factor) 0.0) (set! (-> gp-2 bounce-factor) 0.4) @@ -336,7 +336,7 @@ (set! (-> gp-2 friction-factor) 0.05) ) (vehicle-method-121 self) - (set! (-> self rbody state info) (the-as rigid-body-info (&-> (-> self info-override) mass))) + (set! (-> self rbody state info) (-> self info-override info)) (when (logtest? (-> self flags) (rigid-body-object-flag disturbed)) (let* ((f0-14 (* 0.0033333334 (the float (- (-> self clock frame-counter) (-> self disturbed-time))))) (f0-17 (* f0-14 f0-14 (-> self camera-dist2))) diff --git a/test/decompiler/reference/jak2/levels/city/common/vehicle-util_REF.gc b/test/decompiler/reference/jak2/levels/city/common/vehicle-util_REF.gc index 79ee754e2..75911adb7 100644 --- a/test/decompiler/reference/jak2/levels/city/common/vehicle-util_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/vehicle-util_REF.gc @@ -359,13 +359,13 @@ This commonly includes things such as: (vector-matrix*! (the-as vector (-> s5-0 matrices)) (-> s5-0 matrices 0 vector 1) (-> s5-0 matrices 2)) (set! (-> s5-0 floats 0) 81920.0) (dotimes (s2-1 (-> obj info-override grab-rail-count)) - (let ((s1-0 (+ (-> obj info-override grab-rail-array) (* 48 s2-1)))) - (vector-! (-> s5-0 matrices 0 trans) (the-as vector (-> s5-0 matrices)) (the-as vector (+ s1-0 0))) + (let ((s1-0 (-> obj info-override grab-rail-array s2-1))) + (vector-! (-> s5-0 matrices 0 trans) (the-as vector (-> s5-0 matrices)) (the-as vector (-> s1-0 local-pos))) (when #t (let ((f30-0 (vector-segment-distance-point! (the-as vector (-> s5-0 matrices)) - (the-as vector (+ s1-0 0)) - (the-as vector (+ s1-0 16)) + (the-as vector (-> s1-0 local-pos)) + (-> s1-0 local-pos 1) (-> s5-0 matrices 0 trans) ) ) @@ -373,7 +373,7 @@ This commonly includes things such as: (when (< f30-0 (-> s5-0 floats 0)) (set! (-> s5-0 floats 0) f30-0) (set! (-> s5-0 vectors 0 quad) (-> s5-0 matrices 0 trans quad)) - (vector-! (-> s5-0 vectors 1) (the-as vector (+ s1-0 16)) (the-as vector (+ s1-0 0))) + (vector-! (-> s5-0 vectors 1) (-> s1-0 local-pos 1) (the-as vector (-> s1-0 local-pos))) (vector-normalize! (-> s5-0 vectors 1) 1.0) (set! s3-0 #t) (set! (-> s5-0 floats 3) (* (-> obj hit-points) (/ 40960.0 f30-0))) @@ -790,9 +790,7 @@ This commonly includes things such as: ) (set! (-> obj lights-factor) 0.0) (let ((a0-8 (-> obj info-override color-option-select))) - (set! (-> obj draw color-mult quad) - (-> (the-as (pointer uint128) (+ (the-as uint (-> obj info-override color-option-array)) (* a0-8 16)))) - ) + (set! (-> obj draw color-mult quad) (-> obj info-override color-option-array a0-8 quad)) ) (+! (-> obj info-override color-option-select) 1) (when (>= (-> obj info-override color-option-select) (-> obj info-override color-option-count)) @@ -1194,7 +1192,11 @@ This commonly includes things such as: (when (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) (logior! (-> obj rbody state flags) (rigid-body-flag enable-physics)) (rigid-body-method-26 (-> obj rbody state) (-> obj root-override-2 trans) (-> obj root-override-2 quat)) - (vector-float*! (-> obj rbody state lin-momentum) (-> obj root-override-2 transv) (-> obj info-override mass)) + (vector-float*! + (-> obj rbody state lin-momentum) + (-> obj root-override-2 transv) + (-> obj info-override info mass) + ) (vector-reset! (-> obj rbody state ang-momentum)) (vector-reset! (-> obj lin-acceleration)) ) @@ -1386,7 +1388,7 @@ This commonly includes things such as: (let ((v1-0 (-> arg0 behavior))) (cond ((= v1-0 1) - ((method-of-object obj vehicle-method-135)) + (vehicle-method-135 obj arg0) (vehicle-method-113 obj) ) ((zero? v1-0) diff --git a/test/decompiler/reference/jak2/levels/city/common/vehicle_REF.gc b/test/decompiler/reference/jak2/levels/city/common/vehicle_REF.gc index 2af78071e..ea65e80e5 100644 --- a/test/decompiler/reference/jak2/levels/city/common/vehicle_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/vehicle_REF.gc @@ -104,8 +104,8 @@ (let* ((f0-0 1.0) (f1-0 (-> arg0 impulse)) (f2-0 61440.0) - (f30-0 (fmin f0-0 (* f1-0 (/ 1.0 f2-0) (-> obj info-override inv-mass)))) - (f28-0 (* (-> obj info-override mass) (-> obj info-override toughness-factor))) + (f30-0 (fmin f0-0 (* f1-0 (/ 1.0 f2-0) (-> obj info-override info inv-mass)))) + (f28-0 (* (-> obj info-override info mass) (-> obj info-override toughness-factor))) ) (set! (-> obj crash-impulse) (-> arg0 impulse)) (cond @@ -145,7 +145,7 @@ ) (if (< 0.1 f30-0) (sound-play-by-name - (the-as sound-name (-> obj info-override glance-sound)) + (-> obj info-override glance-sound) (new-sound-id) (the int (* 1024.0 f30-0)) 0 @@ -158,7 +158,7 @@ ) (when (< (* 102400.0 f28-0) (-> arg0 impulse)) (sound-play-by-name - (the-as sound-name (-> obj info-override impact-sound)) + (-> obj info-override impact-sound) (new-sound-id) (the int (* 1024.0 f30-0)) 0 @@ -1593,13 +1593,13 @@ (and (logtest? (-> arg1 mask) (attack-info-mask mode)) (= (-> arg1 mode) 'eco-dark)) ) (set! (-> s5-0 vector 2 y) (* 0.1 (-> s5-0 vector 2 y))) - (set! f0-2 (* 409600.0 (-> obj info-override mass))) + (set! f0-2 (* 409600.0 (-> obj info-override info mass))) (/ 0.4 (-> obj info-override damage-factor)) ) ((or (logtest? (penetrate dark-punch dark-bomb) arg3) (and (logtest? (penetrate dark-skin) arg3) (logtest? arg3 (penetrate punch spin))) ) - (set! f0-2 (* 204800.0 (-> obj info-override mass))) + (set! f0-2 (* 204800.0 (-> obj info-override info mass))) (/ 0.2 (-> obj info-override damage-factor)) ) ((logtest? (penetrate enemy-yellow-shot) arg3) @@ -1733,7 +1733,7 @@ ) (let ((f0-1 (vector-dot (-> s5-0 velocity) (-> s5-0 normal)))) (b! (>= f0-1 0.0) cfg-32 :delay #f) - (set! (-> s5-0 impulse) (/ f0-1 (+ f30-0 (-> obj info-override inv-mass)))) + (set! (-> s5-0 impulse) (/ f0-1 (+ f30-0 (-> obj info-override info inv-mass)))) ) (vector+float*! s2-0 s2-0 (-> s5-0 normal) (* -3.1 f30-0 (-> s5-0 impulse))) (set! (-> s2-0 y) (fmax (* 49152.0 f30-0) (-> s2-0 y))) @@ -1942,7 +1942,7 @@ ;; definition for method 135 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-135 vehicle () +(defmethod vehicle-method-135 vehicle ((obj vehicle) (arg0 traffic-object-spawn-params)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/industrial/ctyinda-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/industrial/ctyinda-obs_REF.gc new file mode 100644 index 000000000..8e4b1f21d --- /dev/null +++ b/test/decompiler/reference/jak2/levels/city/industrial/ctyinda-obs_REF.gc @@ -0,0 +1,9 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/levels/city/industrial/ctyindb-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/industrial/ctyindb-obs_REF.gc new file mode 100644 index 000000000..8e4b1f21d --- /dev/null +++ b/test/decompiler/reference/jak2/levels/city/industrial/ctyindb-obs_REF.gc @@ -0,0 +1,9 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/levels/city/market/east/ashelin/ctyasha-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/market/east/ashelin/ctyasha-obs_REF.gc new file mode 100644 index 000000000..72c2723da --- /dev/null +++ b/test/decompiler/reference/jak2/levels/city/market/east/ashelin/ctyasha-obs_REF.gc @@ -0,0 +1,2336 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-ctyasha-dust-explosion + :id 1062 + :duration (seconds 1) + :linger-duration (seconds 3.5) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4639 :period 900 :length 40) + (sp-item 4640 :period 900 :length 60) + (sp-item 4641 :period 900 :length 10) + (sp-item 4642 :period 900 :length 35 :offset 20) + ) + ) + +;; failed to figure out what this is: +(defpart 4639 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 64.0) + (sp-rnd-flt spt-x (meters 0) (meters 8) 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 2) (meters 6) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 64.0 128.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-flt spt-a 0.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.4) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.006666667) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a 0.08 0.08 1.0) + (sp-rnd-flt spt-accel-y -1.3653333 -8.192 1.0) + (sp-rnd-flt spt-friction 0.88 0.02 1.0) + (sp-int spt-timer 1250) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-int spt-next-time 150) + (sp-launcher-by-id spt-next-launcher 4643) + (sp-rnd-flt spt-conerot-x (degrees 30.0) (degrees 75.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 45.0) (degrees 180.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4640 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 16.0) + (sp-rnd-flt spt-x (meters 0) (meters 8) 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 2) (meters 6) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 64.0 128.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-flt spt-a 0.0) + (sp-rnd-flt spt-vel-y (meters 0.4) (meters 0.4) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.01) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a 0.08 0.08 1.0) + (sp-rnd-flt spt-accel-y -12.288 -6.826667 1.0) + (sp-rnd-flt spt-friction 0.88 0.04 1.0) + (sp-int spt-timer 1250) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-int spt-next-time 150) + (sp-launcher-by-id spt-next-launcher 4643) + (sp-rnd-flt spt-conerot-x (degrees 60.0) (degrees 25.000002) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 150.0) (degrees 40.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4643 + :init-specs ((sp-rnd-flt spt-fade-a -0.032 -0.032 1.0)) + ) + +;; failed to figure out what this is: +(defpart 4641 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc)) + (sp-rnd-flt spt-num 32.0 8.0 1.0) + (sp-flt spt-x (meters 0.25)) + (sp-flt spt-y (meters -2.5)) + (sp-rnd-flt spt-scale-x (meters 4) (meters 3) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 16.0 48.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.4) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.006666667) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -0.18) + (sp-flt spt-fade-b -2.12) + (sp-rnd-flt spt-accel-y -5.4613333 -9.557333 1.0) + (sp-rnd-flt spt-friction 0.88 0.05 1.0) + (sp-int spt-timer 3000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4644) + (sp-rnd-flt spt-conerot-x (degrees -90.0) (degrees 60.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees -30.0) (degrees 60.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 3) (meters 5) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4642 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 16.0) + (sp-rnd-flt spt-x (meters 0) (meters 8) 1.0) + (sp-rnd-flt spt-y (meters -3.5) (meters 2) 1.0) + (sp-flt spt-scale-x (meters 2.5)) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-scale-y (meters 0.1) (meters 0.2) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-omega 6.144 6.144 1.0) + (sp-rnd-flt spt-vel-y (meters 0.26666668) (meters 0.2) 1.0) + (sp-rnd-flt spt-fade-a -0.10666667 -0.10666667 1.0) + (sp-rnd-flt spt-accel-y -13.653334 -6.826667 1.0) + (sp-rnd-flt spt-friction 0.9 0.08 1.0) + (sp-int-plain-rnd spt-timer 450 299 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 4645) + (sp-rnd-flt spt-conerot-x (degrees 30.0) (degrees 75.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 45.0) (degrees 180.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyasha-large-explosion + :id 1063 + :duration (seconds 3) + :linger-duration (seconds 2) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 32) + :parts ((sp-item 4646 :fade-after (meters 200) :falloff-to (meters 200) :period 9600 :length 25) + (sp-item 4647 :period 9600 :length 10 :offset 10) + (sp-item 4648 :fade-after (meters 120) :falloff-to (meters 120) :period 9600 :length 100 :offset 25) + (sp-item 4649 :fade-after (meters 60) :period 9600 :length 35 :offset 10) + (sp-item 4650 :period 9600 :length 50 :offset 15) + (sp-item 4651 :period 9600 :length 5) + (sp-item 4652 :period 9600 :length 50 :offset 15) + (sp-item 4653 :period 9600 :length 5) + ) + ) + +;; failed to figure out what this is: +(defpart 4651 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters -2.5)) + (sp-flt spt-scale-x (meters 32)) + (sp-flt spt-rot-x 8192.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 96.0) + (sp-flt spt-scalevel-x (meters 0.5)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -1.28) + (sp-flt spt-fade-b -5.1) + (sp-flt spt-fade-a 0.0) + (sp-int spt-timer 65) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 40960.0) + (sp-int spt-next-time 30) + (sp-launcher-by-id spt-next-launcher 4654) + ) + ) + +;; failed to figure out what this is: +(defpart 4654 + :init-specs ((sp-flt spt-scalevel-x (meters -0.2857143)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -3.6571429) + (sp-flt spt-fade-b 0.0) + (sp-flt spt-fade-a -2.7428572) + ) + ) + +;; failed to figure out what this is: +(defpart 4653 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 120)) + (sp-flt spt-rot-x 8192.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 24.0) + (sp-flt spt-scalevel-x (meters 0.13333334)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -4.266667) + (sp-flt spt-fade-b -4.266667) + (sp-flt spt-fade-a 0.0) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 40960.0) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 4655) + ) + ) + +;; failed to figure out what this is: +(defpart 4655 + :init-specs ((sp-flt spt-scalevel-x (meters 0)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.85333335) + (sp-flt spt-fade-g -1.7066667) + (sp-flt spt-fade-b -1.7066667) + (sp-flt spt-fade-a -0.64) + ) + ) + +;; failed to figure out what this is: +(defpart 4649 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 16.0) + (sp-rnd-flt spt-y (meters -3.5) (meters 2) 1.0) + (sp-flt spt-scale-x (meters 2.5)) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-scale-y (meters 0.1) (meters 0.2) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-flt spt-omega 12.288) + (sp-rnd-flt spt-vel-y (meters 0.26666668) (meters 0.2) 1.0) + (sp-flt spt-fade-b -8.0) + (sp-rnd-flt spt-accel-y -13.653334 -6.826667 1.0) + (sp-rnd-flt spt-friction 0.9 0.08 1.0) + (sp-int-plain-rnd spt-timer 450 299 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 4656) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 140.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 10000.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4656 + :init-specs ((sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -2.6133332) + (sp-flt spt-fade-b -1.7066667) + (sp-rnd-flt spt-fade-a -0.096 -0.096 1.0) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 4657) + ) + ) + +;; failed to figure out what this is: +(defpart 4657 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + ) + +;; failed to figure out what this is: +(defpart 4652 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x34 :page #xc)) + (sp-rnd-flt spt-num 5.0 5.0 1.0) + (sp-flt spt-y (meters -2.5)) + (sp-rnd-flt spt-scale-x (meters 3) (meters 2) 1.0) + (sp-int spt-rot-x 4) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-rot-z) + :flags (sp-flag spflag7) + :random-rangef 65536.0 + :random-multf 1.0 + ) + (sp-rnd-flt spt-scale-y (meters 8) (meters 4) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.033333335) (meters 0.13333334) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -0.36) + (sp-flt spt-fade-b -4.24) + (sp-flt spt-fade-a -0.26666668) + (sp-rnd-flt spt-friction 0.92 0.02 1.0) + (sp-int spt-timer 1000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-func spt-func 'sparticle-motion-blur) + (sp-int spt-next-time 25) + (sp-launcher-by-id spt-next-launcher 4658) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-conerot-x) + :flags (sp-flag from-pointer) + :func '*sp-temp* + ) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 2) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4658 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.55) + (sp-flt spt-fade-g -2.95) + (sp-flt spt-fade-b -3.3) + (sp-int-plain-rnd spt-next-time 30 9 1) + (sp-launcher-by-id spt-next-launcher 4659) + ) + ) + +;; failed to figure out what this is: +(defpart 4659 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.008333334) (meters 0.008333334) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -1.2944444) + (sp-flt spt-fade-g -0.7111111) + (sp-flt spt-fade-b -0.2) + (sp-rnd-flt spt-fade-a -0.225 -0.225 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4650 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x33 :page #xc)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 16.0 10.0 1.0) + (sp-flt spt-y (meters -2.5)) + (sp-rnd-flt spt-scale-x (meters 3) (meters 2) 1.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-rnd-flt spt-scale-y (meters 6.8) (meters 1.2) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.13333334) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.06666667) (meters 0.13333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -0.36) + (sp-flt spt-fade-b -4.24) + (sp-flt spt-fade-a -0.32) + (sp-flt spt-friction 0.94) + (sp-int spt-timer 1000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 40 1 0 #xc00000 #xc03300) + ) + (sp-int spt-next-time 25) + (sp-launcher-by-id spt-next-launcher 4660) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 8) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4660 + :init-specs ((sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g 0.0) + (sp-flt spt-fade-b 0.0) + (sp-int-plain-rnd spt-next-time 5 19 1) + (sp-launcher-by-id spt-next-launcher 4661) + ) + ) + +;; failed to figure out what this is: +(defpart 4661 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.44) + (sp-flt spt-fade-g -2.36) + (sp-flt spt-fade-b -2.64) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4662) + ) + ) + +;; failed to figure out what this is: +(defpart 4662 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.008333334) (meters 0.008333334) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -1.2) + (sp-flt spt-fade-g -0.7111111) + (sp-flt spt-fade-b -0.2) + (sp-rnd-flt spt-fade-a -0.06545454 -0.06545454 1.0) + (sp-int-plain-rnd spt-next-time 150 29 1) + (sp-launcher-by-id spt-next-launcher 4663) + ) + ) + +;; failed to figure out what this is: +(defpart 4663 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.1125)) + ) + +;; failed to figure out what this is: +(defpart 4648 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc)) + (sp-rnd-flt spt-num 6.0 8.0 1.0) + (sp-flt spt-x (meters 0.25)) + (sp-flt spt-y (meters -2.5)) + (sp-rnd-flt spt-scale-x (meters 3) (meters 5) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 16.0 48.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.4) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.013333334) (meters 0.013333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -0.18) + (sp-flt spt-fade-b -2.12) + (sp-rnd-flt spt-accel-y -1.3653333 -9.557333 1.0) + (sp-rnd-flt spt-friction 0.88 0.02 1.0) + (sp-int spt-timer 3000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4644) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 3) (meters 5) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4644 + :init-specs ((sp-flt spt-scalevel-x (meters 0.0016666667)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g 0.02) + (sp-flt spt-fade-b 0.23555556) + (sp-int-plain-rnd spt-next-time 45 14 1) + (sp-launcher-by-id spt-next-launcher 4664) + ) + ) + +;; failed to figure out what this is: +(defpart 4664 + :init-specs ((sp-flt spt-fade-r -0.5543478) + (sp-flt spt-fade-g -0.5543478) + (sp-flt spt-fade-b -0.5543478) + (sp-rnd-flt spt-fade-a -0.10666667 -0.10666667 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4646 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 4.0 8.0 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 0.6) 1.0) + (sp-flt spt-y (meters -2.5)) + (sp-rnd-flt spt-scale-x (meters 8.5) (meters 8) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 70.0 20.0 1.0) + (sp-rnd-flt spt-g 70.0 20.0 1.0) + (sp-rnd-flt spt-b 70.0 20.0 1.0) + (sp-rnd-flt spt-a 0.0 40.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.2) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.033333335) (meters 0.086666666) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 3.3) + (sp-flt spt-fade-g 3.12) + (sp-flt spt-fade-b 1.18) + (sp-flt spt-fade-a 1.76) + (sp-flt spt-friction 0.89) + (sp-int spt-timer 710) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4665) + (sp-rnd-flt spt-conerot-x (degrees -1440.0) (degrees 2880.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4665 + :init-specs ((sp-flt spt-scalevel-x (meters 0.0033333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.53333336) + (sp-flt spt-fade-g -1.9666667) + (sp-flt spt-fade-b -2.2) + (sp-flt spt-fade-a -0.41666666) + (sp-int-plain-rnd spt-next-time 45 14 1) + (sp-launcher-by-id spt-next-launcher 4666) + ) + ) + +;; failed to figure out what this is: +(defpart 4666 + :init-specs ((sp-flt spt-scalevel-x (meters 0)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.38833332) + (sp-flt spt-fade-g -0.21333334) + (sp-flt spt-fade-b -0.028333334) + (sp-flt spt-fade-a -0.38833332) + ) + ) + +;; failed to figure out what this is: +(defpart 4647 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #xc)) + (sp-flt spt-num 9.0) + (sp-flt spt-y (meters -2.5)) + (sp-rnd-flt spt-scale-x (meters 4) (meters 8) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 1) (meters 0.5) 1.0) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-flt spt-g 96.0) + (sp-flt spt-b 64.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.13333334) (meters 0.4) 1.0) + (sp-flt spt-fade-g 1.6) + (sp-flt spt-fade-b 3.2) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyasha-explosion + :id 1064 + :duration (seconds 3) + :linger-duration (seconds 2) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 32) + :parts ((sp-item 4667 :flags (bit6) :period 900 :length 5) + (sp-item 4668 :flags (bit6) :period 900 :length 5) + (sp-item 4669 :period 900 :length 15) + (sp-item 4670 :fade-after (meters 60) :period 900 :length 10 :offset 10) + (sp-item 4671 :fade-after (meters 60) :falloff-to (meters 60) :period 900 :length 50 :offset 20) + (sp-item 4672 :fade-after (meters 200) :falloff-to (meters 200) :period 900 :length 25 :offset 20) + (sp-item 4673 :fade-after (meters 150) :falloff-to (meters 150) :period 900 :length 20 :offset 30) + ) + ) + +;; failed to figure out what this is: +(defpart 4668 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2)) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 24.0) + (sp-flt spt-scalevel-x (meters 0.10666667)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -4.266667) + (sp-flt spt-fade-b -4.266667) + (sp-flt spt-fade-a 0.0) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 4674) + ) + ) + +;; failed to figure out what this is: +(defpart 4674 + :init-specs ((sp-flt spt-scalevel-x (meters 0)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.85333335) + (sp-flt spt-fade-g -1.7066667) + (sp-flt spt-fade-b -1.7066667) + (sp-flt spt-fade-a -0.64) + ) + ) + +;; failed to figure out what this is: +(defpart 4673 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x34 :page #xc)) + (sp-rnd-flt spt-num 2.0 0.2 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-rot-z) + :flags (sp-flag spflag7) + :random-rangef 655360.0 + :random-multf 1.0 + ) + (sp-rnd-flt spt-scale-y (meters 0.8) (meters 0.2) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.01) (meters 0.13333334) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -0.36) + (sp-flt spt-fade-b -4.24) + (sp-flt spt-fade-a -0.22068965) + (sp-flt spt-friction 0.95) + (sp-int spt-timer 1000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-int spt-next-time 25) + (sp-launcher-by-id spt-next-launcher 4675) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-conerot-x) + :flags (sp-flag from-pointer) + :func '*sp-temp* + ) + ) + ) + +;; failed to figure out what this is: +(defpart 4672 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x33 :page #xc)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 1.0 0.2 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.02) (meters 0.01) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.01) (meters 0.13333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -0.36) + (sp-flt spt-fade-b -4.24) + (sp-flt spt-fade-a -0.22068965) + (sp-flt spt-friction 0.95) + (sp-int spt-timer 1000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 40 1 0 #xc00000 #xc03300) + ) + (sp-int spt-next-time 25) + (sp-launcher-by-id spt-next-launcher 4675) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4675 + :init-specs ((sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g 0.0) + (sp-flt spt-fade-b 0.0) + (sp-int-plain-rnd spt-next-time 5 19 1) + (sp-launcher-by-id spt-next-launcher 4676) + ) + ) + +;; failed to figure out what this is: +(defpart 4676 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.44) + (sp-flt spt-fade-g -2.36) + (sp-flt spt-fade-b -2.64) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4677) + ) + ) + +;; failed to figure out what this is: +(defpart 4677 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.008333334) (meters 0.008333334) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -1.2944444) + (sp-flt spt-fade-g -0.7111111) + (sp-flt spt-fade-b -0.094444446) + (sp-rnd-flt spt-fade-a -0.06545454 -0.06545454 1.0) + (sp-int-plain-rnd spt-next-time 150 29 1) + (sp-launcher-by-id spt-next-launcher 4678) + ) + ) + +;; failed to figure out what this is: +(defpart 4678 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.1125)) + ) + +;; failed to figure out what this is: +(defpart 4667 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 5)) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 96.0) + (sp-flt spt-scalevel-x (meters 0.5)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -1.28) + (sp-flt spt-fade-b -5.1) + (sp-flt spt-fade-a 0.0) + (sp-int spt-timer 65) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-int spt-next-time 30) + (sp-launcher-by-id spt-next-launcher 4679) + ) + ) + +;; failed to figure out what this is: +(defpart 4679 + :init-specs ((sp-flt spt-scalevel-x (meters -0.2857143)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -3.6571429) + (sp-flt spt-fade-b 0.0) + (sp-flt spt-fade-a -2.7428572) + ) + ) + +;; failed to figure out what this is: +(defpart 4671 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc)) + (sp-rnd-flt spt-num 8.0 2.0 1.0) + (sp-flt spt-x (meters 0.25)) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.25) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 16.0 48.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.083333336) (meters 0.083333336) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.006666667) (meters 0.0016666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -0.18) + (sp-flt spt-fade-b -2.12) + (sp-rnd-flt spt-accel-y -0.68266666 -1.3653333 1.0) + (sp-flt spt-friction 0.87) + (sp-int spt-timer 1000) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4680) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4680 + :init-specs ((sp-flt spt-scalevel-x (meters 0.0016666667)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g 0.02) + (sp-flt spt-fade-b 0.23555556) + (sp-int-plain-rnd spt-next-time 45 14 1) + (sp-launcher-by-id spt-next-launcher 4681) + ) + ) + +;; failed to figure out what this is: +(defpart 4681 + :init-specs ((sp-flt spt-fade-r -0.5543478) (sp-flt spt-fade-g -0.5543478) (sp-flt spt-fade-a -0.13913043)) + ) + +;; failed to figure out what this is: +(defpart 4669 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 2.0 1.0 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 0.6) 1.0) + (sp-rnd-flt spt-scale-x (meters 2.5) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 70.0 20.0 1.0) + (sp-rnd-flt spt-g 70.0 20.0 1.0) + (sp-rnd-flt spt-b 70.0 20.0 1.0) + (sp-rnd-flt spt-a 0.0 40.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.1) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.033333335) (meters 0.02) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.12) (degrees 0.24) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 3.3) + (sp-flt spt-fade-g 3.12) + (sp-flt spt-fade-b 1.18) + (sp-flt spt-fade-a 1.76) + (sp-flt spt-friction 0.88) + (sp-int spt-timer 710) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4682) + (sp-rnd-flt spt-conerot-x (degrees -1440.0) (degrees 2880.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4682 + :init-specs ((sp-flt spt-scalevel-x (meters 0.0033333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.53333336) + (sp-flt spt-fade-g -1.9666667) + (sp-flt spt-fade-b -2.2) + (sp-flt spt-fade-a -0.41666666) + (sp-int-plain-rnd spt-next-time 45 14 1) + (sp-launcher-by-id spt-next-launcher 4683) + ) + ) + +;; failed to figure out what this is: +(defpart 4683 + :init-specs ((sp-flt spt-scalevel-x (meters 0)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.38833332) + (sp-flt spt-fade-g -0.21333334) + (sp-flt spt-fade-b -0.028333334) + (sp-flt spt-fade-a -0.38833332) + ) + ) + +;; failed to figure out what this is: +(defpart 4670 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #xc)) + (sp-rnd-flt spt-num 4.0 2.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-flt spt-g 96.0) + (sp-flt spt-b 64.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.13333334) (meters 0.02) 1.0) + (sp-flt spt-fade-g 1.6) + (sp-flt spt-fade-b 3.2) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctyasha-smoke-trail + :id 1065 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 4684 :fade-after (meters 300) :falloff-to (meters 300))) + ) + +;; failed to figure out what this is: +(defpart 4684 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 0.5) + (sp-rnd-flt spt-scale-x (meters 1.2) (meters 1.8) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 1.2) (meters 1.8) 1.0) + (sp-rnd-flt spt-r 64.0 128.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-vel-x (meters -0.0033333334) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-vel-y (meters -0.006666667) (meters -0.006666667) 1.0) + (sp-rnd-flt spt-vel-z (meters -0.0033333334) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.0033333334) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.10666667 -0.10666667 1.0) + (sp-rnd-flt spt-accel-y 0.13653333 0.27306667 1.0) + (sp-flt spt-friction 0.99) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 40 1 0 #xc00000 #xc00000 #xc03300) + ) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-tanker tanker tanker-lod0-jg -1 + ((tanker-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + :origin-joint-index 6 + ) + +;; failed to figure out what this is: +(defskelgroup skel-tanker-container tanker-container tanker-container-lod0-jg -1 + ((tanker-container-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 9) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-tanker-barrels tanker-barrels tanker-barrels-lod0-jg -1 + ((tanker-barrels-lod0-mg (meters 999999))) + :bounds (static-spherem 7 0 0 30) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-tanker-one-barrel tanker-one-barrel tanker-one-barrel-lod0-jg -1 + ((tanker-one-barrel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-tanker-roof-break tanker-roof-break tanker-roof-break-lod0-jg -1 + ((tanker-roof-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100) + :origin-joint-index 4 + ) + +;; definition of type tanker-grunt +(deftype tanker-grunt (grunt) + ((expensive-gnd-collide? symbol :offset 692) + ) + :heap-base #x240 + :method-count-assert 186 + :size-assert #x2b8 + :flag-assert #xba024002b8 + ) + +;; definition for method 3 of type tanker-grunt +(defmethod inspect tanker-grunt ((obj tanker-grunt)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type grunt inspect))) + (t9-0 obj) + ) + (format #t "~2Texpensive-gnd-collide?: ~A~%" (-> obj expensive-gnd-collide?)) + (label cfg-4) + obj + ) + +;; definition for method 74 of type tanker-grunt +(defmethod general-event-handler tanker-grunt ((obj tanker-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Handles various events for the enemy +@TODO - unsure if there is a pattern for the events and this should have a more specific name" + (case arg2 + (('skip-intro) + (when (and (-> obj next-state) + (let ((v1-4 (-> obj next-state name))) + (or (= v1-4 'ambush) (= v1-4 'jumping-ambush) (= v1-4 'dormant) (= v1-4 'jump) (= v1-4 'jump-blocked)) + ) + ) + (let ((s5-0 (-> obj intro-path))) + (when (nonzero? s5-0) + (let ((f30-0 (get-num-segments s5-0)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (get-point-at-percent-along-path! s5-0 (-> obj root-override2 trans) f30-0 'interp) + (displacement-between-points-at-percent-normalized! s5-0 s4-0 f30-0) + (forward-up->quaternion (-> obj root-override2 quat) s4-0 *up-vector*) + ) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) + (set! (-> obj enemy-flags) (logior (enemy-flag dangerous-backup) (-> obj enemy-flags))) + (logclear! (-> obj mask) (process-mask actor-pause)) + (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) + (set-vector! (-> obj root-override2 scale) 1.0 1.0 1.0 1.0) + (go-hostile obj) + #t + ) + ) + ) + ) + (else + ((method-of-type grunt general-event-handler) obj arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 115 of type tanker-grunt +;; WARN: Return type mismatch vector vs none. +(defmethod init-enemy! tanker-grunt ((obj tanker-grunt)) + "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" + (set! (-> obj expensive-gnd-collide?) #t) + (let ((t9-0 (method-of-type grunt init-enemy!))) + (t9-0 obj) + ) + (set-vector! (-> obj root-override2 scale) 0.0 0.0 0.0 1.0) + (none) + ) + +;; definition for method 124 of type tanker-grunt +;; WARN: Return type mismatch uint vs collide-spec. +(defmethod enemy-method-124 tanker-grunt ((obj tanker-grunt)) + "TODO" + (let ((t9-0 (method-of-type grunt enemy-method-124))) + (t9-0 obj) + ) + (the-as collide-spec (when (-> obj expensive-gnd-collide?) + (let ((v0-1 (logior (-> obj gnd-collide) 577))) + (set! (-> obj gnd-collide) v0-1) + v0-1 + ) + ) + ) + ) + +;; definition for method 70 of type tanker-grunt +(defmethod go-hostile tanker-grunt ((obj tanker-grunt)) + (set! (-> obj expensive-gnd-collide?) #f) + (enemy-method-124 obj) + ((method-of-type grunt go-hostile) obj) + (none) + ) + +;; failed to figure out what this is: +(defstate jump (tanker-grunt) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type grunt jump) exit))) + (if t9-0 + (t9-0) + ) + ) + (set-vector! (-> self root-override2 scale) 1.0 1.0 1.0 1.0) + (none) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type grunt jump) trans))) + (if t9-0 + (t9-0) + ) + ) + (let* ((f0-0 (-> self root-override2 scale x)) + (f0-3 (seek f0-0 1.0 (* 1.5 (-> self clock seconds-per-frame)))) + ) + (set-vector! (-> self root-override2 scale) f0-3 f0-3 f0-3 1.0) + ) + 0 + (none) + ) + ) + +;; definition of type tanker-juicer +(deftype tanker-juicer (juicer) + ((expensive-gnd-collide? symbol :offset-assert 848) + ) + :heap-base #x2e0 + :method-count-assert 185 + :size-assert #x354 + :flag-assert #xb902e00354 + ) + +;; definition for method 3 of type tanker-juicer +(defmethod inspect tanker-juicer ((obj tanker-juicer)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type juicer inspect))) + (t9-0 obj) + ) + (format #t "~2Texpensive-gnd-collide?: ~A~%" (-> obj expensive-gnd-collide?)) + (label cfg-4) + obj + ) + +;; definition for method 74 of type tanker-juicer +(defmethod general-event-handler tanker-juicer ((obj tanker-juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Handles various events for the enemy +@TODO - unsure if there is a pattern for the events and this should have a more specific name" + (case arg2 + (('skip-intro) + (when (and (-> obj next-state) (let ((v1-4 (-> obj next-state name))) + (or (= v1-4 'ambush) (= v1-4 'dormant) (= v1-4 'jump) (= v1-4 'jump-blocked)) + ) + ) + (let ((s5-0 (-> obj intro-path))) + (when (nonzero? s5-0) + (let ((f30-0 (get-num-segments s5-0)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (get-point-at-percent-along-path! s5-0 (-> obj root-override2 trans) f30-0 'interp) + (displacement-between-points-at-percent-normalized! s5-0 s4-0 f30-0) + (forward-up->quaternion (-> obj root-override2 quat) s4-0 *up-vector*) + ) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) + (set! (-> obj enemy-flags) (logior (enemy-flag dangerous-backup) (-> obj enemy-flags))) + (logclear! (-> obj mask) (process-mask actor-pause)) + (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) + (set-vector! (-> obj root-override2 scale) 1.0 1.0 1.0 1.0) + (go-hostile obj) + #t + ) + ) + ) + ) + (else + ((method-of-type juicer general-event-handler) obj arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 115 of type tanker-juicer +;; WARN: Return type mismatch vector vs none. +(defmethod init-enemy! tanker-juicer ((obj tanker-juicer)) + "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" + (set! (-> obj expensive-gnd-collide?) #t) + (let ((t9-0 (method-of-type juicer init-enemy!))) + (t9-0 obj) + ) + (set-vector! (-> obj root-override2 scale) 0.0 0.0 0.0 1.0) + (none) + ) + +;; definition for method 124 of type tanker-juicer +;; WARN: Return type mismatch uint vs collide-spec. +(defmethod enemy-method-124 tanker-juicer ((obj tanker-juicer)) + "TODO" + (let ((t9-0 (method-of-type juicer enemy-method-124))) + (t9-0 obj) + ) + (the-as collide-spec (when (-> obj expensive-gnd-collide?) + (let ((v0-1 (logior (-> obj gnd-collide) 577))) + (set! (-> obj gnd-collide) v0-1) + v0-1 + ) + ) + ) + ) + +;; definition for method 70 of type tanker-juicer +(defmethod go-hostile tanker-juicer ((obj tanker-juicer)) + (set! (-> obj expensive-gnd-collide?) #f) + (enemy-method-124 obj) + ((method-of-type juicer go-hostile) obj) + (none) + ) + +;; failed to figure out what this is: +(defstate jump (tanker-juicer) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type juicer jump) exit))) + (if t9-0 + (t9-0) + ) + ) + (set-vector! (-> self root-override2 scale) 1.0 1.0 1.0 1.0) + (none) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type juicer jump) trans))) + (if t9-0 + (t9-0) + ) + ) + (let* ((f0-0 (-> self root-override2 scale x)) + (f0-3 (seek f0-0 1.0 (* 1.15 (-> self clock seconds-per-frame)))) + ) + (set-vector! (-> self root-override2 scale) f0-3 f0-3 f0-3 1.0) + ) + 0 + (none) + ) + ) + +;; definition of type tanker-container +(deftype tanker-container (process-drawable) + ((root-override collide-shape :offset 128) + ) + :heap-base #x50 + :method-count-assert 23 + :size-assert #xc8 + :flag-assert #x17005000c8 + (:methods + (dormant () _type_ :state 20) + (idle () _type_ :state 21) + (tanker-container-method-22 (_type_) none 22) + ) + ) + +;; definition for method 3 of type tanker-container +(defmethod inspect tanker-container ((obj tanker-container)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 22 of type tanker-container +;; WARN: Return type mismatch (pointer process) vs none. +(defmethod tanker-container-method-22 tanker-container ((obj tanker-container)) + (process-spawn + simple-nav-sphere + #x46733333 + (new 'static 'vector :x 1719500.8 :y 35225.6 :z 1837465.6 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x46a00000 + (new 'static 'vector :x 1730560.0 :y 35225.6 :z 1855488.0 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x46b00000 + (new 'static 'vector :x 1738752.0 :y 35225.6 :z 1884160.0 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x46b00000 + (new 'static 'vector :x 1751040.0 :y 35225.6 :z 1910374.4 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x46b00000 + (new 'static 'vector :x 1763737.6 :y 35225.6 :z 1936588.8 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x46880000 + (new 'static 'vector :x 1853849.6 :y 35225.6 :z 1918566.4 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x46880000 + (new 'static 'vector :x 1867776.0 :y 35225.6 :z 1934131.2 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x458ccccd + (new 'static 'vector :x 1962803.2 :y 35225.6 :z 1739980.8 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x45e66666 + (new 'static 'vector :x 1916108.8 :y 35225.6 :z 1705164.8 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x45e66666 + (new 'static 'vector :x 1863270.4 :y 35225.6 :z 1699430.4 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x45e66666 + (new 'static 'vector :x 1862860.8 :y 35225.6 :z 1814118.4 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x45e66666 + (new 'static 'vector :x 1810841.6 :y 35225.6 :z 1800192.0 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x45e66666 + (new 'static 'vector :x 1781350.4 :y 35225.6 :z 1774387.2 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x45e66666 + (new 'static 'vector :x 1771110.4 :y 35225.6 :z 1799782.4 :w 1.0) + #f + -1 + :to obj + ) + (process-spawn + simple-nav-sphere + #x45e66666 + (new 'static 'vector :x 1784217.6 :y 35225.6 :z 1828864.0 :w 1.0) + #f + -1 + :to obj + ) + (none) + ) + +;; definition for function tanker-container-event-handler +(defbehavior tanker-container-event-handler tanker-container ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('trigger) + (let ((v1-2 (-> self root-override root-prim))) + (set! (-> v1-2 prim-core collide-as) (-> self root-override backup-collide-as)) + (set! (-> v1-2 prim-core collide-with) (-> self root-override backup-collide-with)) + ) + (go-virtual idle) + ) + (('draw) + (let ((v0-0 (the-as object (logclear (-> self draw status) (draw-control-status no-draw))))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + v0-0 + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate dormant (tanker-container) + :virtual #t + :event tanker-container-event-handler + :enter (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (logior! (-> self draw status) (draw-control-status no-draw)) + (none) + ) + :code (the-as (function none :behavior tanker-container) sleep-code) + ) + +;; failed to figure out what this is: +(defstate idle (tanker-container) + :virtual #t + :event tanker-container-event-handler + :enter (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (let ((v1-3 (-> self root-override root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root-override backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root-override backup-collide-with)) + ) + (tanker-container-method-22 self) + (none) + ) + :code (the-as (function none :behavior tanker-container) sleep-code) + ) + +;; definition for method 11 of type tanker-container +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tanker-container ((obj tanker-container) (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" + (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) + (set! (-> s4-0 total-prims) (the-as uint 4)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 8192.0 0.0 36864.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 -10240.0 12288.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 0.0 0.0 28672.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle-for-jak)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) 0.0 8192.0 0.0 36864.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-15 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tanker-container" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (let ((s5-2 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-2 + (the-as art-joint-anim (-> obj draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-2 frame-num) 0.0) + ) + (transform-post) + (let ((v1-26 (-> obj root-override root-prim))) + (set! (-> v1-26 prim-core collide-as) (collide-spec)) + (set! (-> v1-26 prim-core collide-with) (collide-spec)) + ) + 0 + (logclear! (-> obj mask) (process-mask actor-pause)) + (if (task-node-closed? (game-task-node city-intercept-tanker-introduction)) + (go (method-of-object obj idle)) + (go (method-of-object obj dormant)) + ) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-tanker-crash tanker-crash tanker-crash-lod0-jg -1 + ((tanker-crash-lod0-mg (meters 999999))) + :bounds (static-spherem 7 2 0 21) + :origin-joint-index 4 + ) + +;; definition of type tanker-crash +(deftype tanker-crash (process-drawable) + ((root-override collide-shape :offset 128) + ) + :heap-base #x50 + :method-count-assert 22 + :size-assert #xc8 + :flag-assert #x16005000c8 + (:methods + (dormant () _type_ :state 20) + (idle () _type_ :state 21) + ) + ) + +;; definition for method 3 of type tanker-crash +(defmethod inspect tanker-crash ((obj tanker-crash)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defstate dormant (tanker-crash) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger) + (go-virtual idle) + ) + ) + ) + :enter (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (logior! (-> self draw status) (draw-control-status no-draw)) + (none) + ) + :code (the-as (function none :behavior tanker-crash) sleep-code) + ) + +;; failed to figure out what this is: +(defstate idle (tanker-crash) + :virtual #t + :enter (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (let ((v1-3 (-> self root-override root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root-override backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root-override backup-collide-with)) + ) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (none) + ) + :code (the-as (function none :behavior tanker-crash) sleep-code) + :post (the-as (function none :behavior tanker-crash) ja-post) + ) + +;; definition for method 11 of type tanker-crash +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tanker-crash ((obj tanker-crash) (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" + (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) + (set! (-> s4-0 total-prims) (the-as uint 4)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 4) + (set-vector! (-> s3-0 local-sphere) 28672.0 8192.0 0.0 86016.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 6) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 -28672.0 32768.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 7) + (set-vector! (-> v1-10 local-sphere) 0.0 0.0 -26624.0 32768.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 8) + (set-vector! (-> v1-12 local-sphere) 0.0 8192.0 4096.0 28672.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-15 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tanker-crash" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (let ((s5-2 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-2 + (the-as art-joint-anim (-> obj draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-2 frame-num) 0.0) + ) + (transform-post) + (let ((v1-26 (-> obj root-override root-prim))) + (set! (-> v1-26 prim-core collide-as) (collide-spec)) + (set! (-> v1-26 prim-core collide-with) (collide-spec)) + ) + 0 + (logclear! (-> obj mask) (process-mask actor-pause)) + (if (task-node-closed? (game-task-node city-intercept-tanker-introduction)) + (go (method-of-object obj idle)) + (go (method-of-object obj dormant)) + ) + (none) + ) + +;; definition of type tanker-deadly +(deftype tanker-deadly (process-drawable) + ((root-override collide-shape :offset 128) + (track-joint int32 :offset-assert 200) + (attack-id uint32 :offset-assert 204) + (die-time time-frame :offset-assert 208) + (prev-pos vector :inline :offset-assert 224) + ) + :heap-base #x70 + :method-count-assert 22 + :size-assert #xf0 + :flag-assert #x16007000f0 + (:methods + (active () _type_ :state 20) + (die-fast () _type_ :state 21) + ) + ) + +;; definition for method 3 of type tanker-deadly +(defmethod inspect tanker-deadly ((obj tanker-deadly)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Ttrack-joint: ~D~%" (-> obj track-joint)) + (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) + (format #t "~2Tdie-time: ~D~%" (-> obj die-time)) + (format #t "~2Tprev-pos: #~%" (-> obj prev-pos)) + (label cfg-4) + obj + ) + +;; definition for method 12 of type tanker-deadly +(defmethod run-logic? tanker-deadly ((obj tanker-deadly)) + #t + ) + +;; failed to figure out what this is: +(defstate active (tanker-deadly) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('touched) + (let ((a2-1 (-> event param 0)) + (v1-1 (new 'stack-no-clear 'vector)) + ) + (vector-! v1-1 (-> self root-override trans) (-> self prev-pos)) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer self)) + (set! (-> a1-4 num-params) 2) + (set! (-> a1-4 message) 'attack) + (set! (-> a1-4 param 0) a2-1) + (let ((a2-2 (new 'static 'attack-info :mask (attack-info-mask mode id attacker-velocity damage knock)))) + (set! (-> a2-2 id) (-> self attack-id)) + (set! (-> a2-2 mode) 'eco-red) + (set! (-> a2-2 attacker-velocity quad) (-> v1-1 quad)) + (set! (-> a2-2 damage) 2.0) + (set! (-> a2-2 knock) (the-as uint 2)) + (set! (-> a1-4 param 1) (the-as uint a2-2)) + ) + (send-event-function proc a1-4) + ) + ) + ) + ) + ) + :code (the-as (function none :behavior tanker-deadly) sleep-code) + :post (behavior () + (set! (-> self prev-pos quad) (-> self root-override trans quad)) + (let ((v1-1 (ppointer->process (-> self parent))) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (vector<-cspace! gp-0 (-> (the-as process-drawable v1-1) node-list data (-> self track-joint))) + (move-to-point! (-> self root-override) gp-0) + ) + (let ((a1-5 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-5 options) (overlaps-others-options)) + (set! (-> a1-5 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-5 tlist) *touching-list*) + (find-overlapping-shapes (-> self root-override) a1-5) + ) + (if (>= (-> self clock frame-counter) (-> self die-time)) + (go-virtual die-fast) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die-fast (tanker-deadly) + :virtual #t + :code (behavior () + (cleanup-for-death self) + (none) + ) + ) + +;; definition for function tanker-deadly-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior tanker-deadly-init-by-other tanker-deadly ((arg0 vector) (arg1 int) (arg2 int)) + (set! (-> self track-joint) arg1) + (set! (-> self die-time) (+ (-> self clock frame-counter) arg2)) + (let* ((v1-3 *game-info*) + (a0-2 (+ (-> v1-3 attack-id) 1)) + ) + (set! (-> v1-3 attack-id) a0-2) + (set! (-> self attack-id) a0-2) + ) + (let ((gp-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (let ((v1-6 (new 'process 'collide-shape-prim-sphere gp-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-with) (collide-spec crate civilian hit-by-others-list)) + (set! (-> v1-6 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> gp-0 total-prims) (the-as uint 1)) + (set! (-> gp-0 root-prim) v1-6) + ) + (set! (-> gp-0 nav-radius) (* 0.75 (-> gp-0 root-prim local-sphere w))) + (let ((v1-9 (-> gp-0 root-prim))) + (set! (-> gp-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> gp-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> gp-0 event-self) 'touched) + (set! (-> gp-0 root-prim local-sphere quad) (-> arg0 quad)) + (let ((v1-14 (ppointer->process (-> self parent)))) + (vector<-cspace! (-> gp-0 trans) (-> (the-as process-drawable v1-14) node-list data (-> self track-joint))) + ) + (vector-identity! (-> gp-0 scale)) + (quaternion-identity! (-> gp-0 quat)) + (update-transforms gp-0) + (set! (-> self root-override) gp-0) + ) + (set! (-> self prev-pos quad) (-> self root-override trans quad)) + (logclear! (-> self mask) (process-mask actor-pause enemy)) + (go-virtual active) + (none) + ) + +;; definition for function tanker-spawn-deadly-barrels +(defun tanker-spawn-deadly-barrels ((arg0 process-tree)) + (let ((s5-0 (new 'static 'vector :w 6553.6))) + (process-spawn tanker-deadly s5-0 3 1041 :to arg0) + (process-spawn tanker-deadly s5-0 4 1041 :to arg0) + (process-spawn tanker-deadly s5-0 5 1041 :to arg0) + (process-spawn tanker-deadly s5-0 6 1041 :to arg0) + (process-spawn tanker-deadly s5-0 7 1041 :to arg0) + (process-spawn tanker-deadly s5-0 8 1041 :to arg0) + (process-spawn tanker-deadly s5-0 9 1041 :to arg0) + (process-spawn tanker-deadly s5-0 10 1041 :to arg0) + (process-spawn tanker-deadly s5-0 11 1041 :to arg0) + (process-spawn tanker-deadly s5-0 12 1041 :to arg0) + (process-spawn tanker-deadly s5-0 13 1041 :to arg0) + (process-spawn tanker-deadly s5-0 14 1041 :to arg0) + (process-spawn tanker-deadly s5-0 15 1041 :to arg0) + (process-spawn tanker-deadly s5-0 16 1041 :to arg0) + ) + ) + +;; definition for function tanker-spawn-deadly-cab +(defun tanker-spawn-deadly-cab ((arg0 process-tree)) + (let ((s5-0 (new 'static 'vector :w 22937.6))) + (process-spawn tanker-deadly s5-0 5 600 :to arg0) + ) + ) + +;; definition for function tanker-spawn-deadly-trailers +(defun tanker-spawn-deadly-trailers ((arg0 process-tree)) + (let ((s5-0 (new 'static 'vector :z 32768.0 :w 22937.6))) + (process-spawn tanker-deadly s5-0 9 600 :to arg0) + (process-spawn tanker-deadly s5-0 8 600 :to arg0) + ) + ) + +;; definition for function tanker-spawn-deadly-container +(defun tanker-spawn-deadly-container ((arg0 process-tree)) + (let ((s5-0 (new 'static 'vector :w 22937.6))) + (process-spawn tanker-deadly s5-0 3 510 :to arg0) + ) + ) + +;; failed to figure out what this is: +(scene-method-16 + (new 'static 'scene + :name "city-intercept-tanker-intro" + :extra #f + :info #f + :mask-to-clear #x1202000 + :entity "scene-stage-57" + :art-group "scenecamera" + :anim "city-intercept-tanker-intro" + :parts 16 + :command-list '((-25 + (send-event "ashelin-tanker-1" 'hide #t) + (task-close! "city-intercept-tanker-roof-explode") + (send-event *traffic-manager* 'set-guard-target-level (unbox 0)) + (send-event *traffic-manager* 'set-max-alert-level (unbox 0)) + (send-event *traffic-manager* 'set-alert-level (unbox 0)) + (send-event *traffic-manager* 'set-alert-duration (unbox 10800000)) + (send-event *traffic-manager* 'deactivate-by-type (unbox 6)) + (send-event *traffic-manager* 'deactivate-by-type (unbox 18)) + (send-event *traffic-manager* 'deactivate-by-type (unbox 19)) + (fma-sphere + (nav kill-once) + sphere + (new 'static 'vector :x 1952972.8 :y 35635.2 :z 1853849.6 :w 19660.8) + duration + (frame-range (new 'static 'bfloat :data -25.0) (new 'static 'bfloat :data 57.5)) + ) + (fma-sphere (nav kill-once) sphere (new 'static 'vector :x 1919795.2 :y 35635.2 :z 1836646.4 :w 32768.0)) + (fma-sphere + (nav kill-once) + sphere + (new 'static 'vector :x 1857126.4 :y 35635.2 :z 1807974.4 :w 12288.0) + duration + (frame-range (new 'static 'bfloat :data -25.0) (new 'static 'bfloat :data 585.0)) + ) + (fma-sphere + (nav kill-once) + sphere + (new 'static 'vector :x 1839923.2 :y 35635.2 :z 1839923.2 :w 12288.0) + duration + (frame-range (new 'static 'bfloat :data -25.0) (new 'static 'bfloat :data 585.0)) + ) + (fma-sphere + (nav kill-once) + sphere + (new 'static 'vector :x 1886617.6 :y 35635.2 :z 1830912.0 :w 12288.0) + duration + (frame-range (new 'static 'bfloat :data -25.0) (new 'static 'bfloat :data 105.0)) + ) + (fma-sphere (nav kill-once) sphere (new 'static 'vector :x 1918976.0 :y 35225.6 :z 1802240.0 :w 16384.0)) + (fadein (frame-time-30 5)) + ) + (538 (part-tracker "group-ctyasha-dust-explosion" entity "tanker" joint "tractor")) + (546 (part-tracker "group-ctyasha-dust-explosion" entity "tanker" joint "tractor")) + (570 (joint-eval tanker-spawn-deadly-cab entity "tanker" joint "chain1")) + (574 (fma-sphere (danger) danger (new 'static 'vector :x 1837465.6 :y 34406.4 :z 1868103.6 :w 225280.0))) + (575 (joint-eval tanker-spawn-deadly-trailers entity "tanker" joint "chain1")) + (576 + (joint-eval tanker-spawn-deadly-barrels entity "tanker-barrels" joint "aa") + (joint-eval tanker-spawn-deadly-container entity "tanker-container" joint "main") + ) + (577 + (part-tracker + "group-ctyasha-large-explosion" + entity + "tanker" + joint + "explode_a" + track + #t + duration + (frame-range (new 'static 'bfloat :data 577.0) (new 'static 'bfloat :data 590.0)) + ) + ) + (581 + (part-tracker + "group-ctyasha-explosion" + entity + "tanker" + joint + "explode_b" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 582.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "aa" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "bb" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "cc" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "dd" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "ee" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "ff" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "gg" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "hh" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "ii" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "jj" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "kk" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "ll" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "mm" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker-barrels" + joint + "nn" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + (part-tracker + "group-ctyasha-smoke-trail" + entity + "tanker" + joint + "chain1" + track + #t + duration + (frame-range (new 'static 'bfloat :data 581.0) (new 'static 'bfloat :data 700.0)) + ) + ) + (645 (send-event "tanker-container-1" 'trigger)) + (660 (send-event "tanker-juicer-4" 'cue-chase)) + (695 (send-event "tanker-grunt-3" 'cue-chase)) + (725 (send-event "tanker-juicer-3" 'cue-chase)) + (10000 + (send-event "ashelin-tanker-1" 'hide #f) + (send-event "tanker-container-1" 'draw) + (send-event "tanker-crash-1" 'trigger) + (send-event "tanker-juicer-4" 'skip-intro) + (send-event "tanker-grunt-3" 'skip-intro) + (send-event "tanker-juicer-3" 'skip-intro) + (task-close! "city-intercept-tanker-introduction") + ) + ) + :cut-list '(10 91 169 511 628 668 770 845) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'ctyasha + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'ctyasha + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'ctyasha + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tanker" + :level 'ctyasha + :art-group "skel-tanker" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tanker-container" + :level 'ctyasha + :art-group "skel-tanker-container" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tanker-barrels" + :level 'ctyasha + :art-group "skel-tanker-barrels" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tanker-one-barrel" + :level 'ctyasha + :art-group "skel-tanker-one-barrel" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tanker-roof-break" + :level 'ctyasha + :art-group "skel-tanker-roof-break" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "crimson-guard-lowres" + :level 'ctyasha + :art-group "skel-crimson-guard-lowres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x4 + ) + (new 'static 'scene-actor + :name "crimson-guard-lowres" + :level 'ctyasha + :art-group "skel-crimson-guard-lowres" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x4 + ) + (new 'static 'scene-actor + :name "crimson-guard-highres" + :level 'ctyasha + :art-group "skel-crimson-guard-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "ctymarkb-tanker" + :end-point-obj (new 'static 'continue-point + :name "ctymarkb-tanker" + :level #f + :flags (continue-flags cf2) + :trans (new 'static 'vector :x 1928400.1 :y 34444.902 :z 1788676.5 :w 1.0) + :quat (new 'static 'vector :y 0.3641 :w -0.9313) + :camera-trans (new 'static 'vector :x 1960564.4 :y 55543.81 :z 1760002.0 :w 1.0) + :camera-rot (new 'static 'inline-array vector3s 3 + (new 'static 'vector3s :data (new 'static 'array float 3 0.6676 0.0 0.7444)) + (new 'static 'vector3s :data (new 'static 'array float 3 -0.1301 0.9846 0.1167)) + (new 'static 'vector3s :data (new 'static 'array float 3 -0.7329 -0.1747 0.6574)) + ) + :on-goto #f + :vis-nick 'default-level + :want (new 'static 'inline-array level-buffer-state 6 + (new 'static 'level-buffer-state :name 'ctymarkb :display? 'display :force-vis? #f :force-inside? #f) + (new 'static 'level-buffer-state :name 'ctywide :display? 'display :force-vis? #f :force-inside? #f) + (new 'static 'level-buffer-state :name 'ctyasha :display? 'display :force-vis? #f :force-inside? #f) + (new 'static 'level-buffer-state :name #f :display? #f :force-vis? #f :force-inside? #f) + (new 'static 'level-buffer-state :name #f :display? #f :force-vis? #f :force-inside? #f) + (new 'static 'level-buffer-state :name #f :display? #f :force-vis? #f :force-inside? #f) + ) + :want-sound (new 'static 'array symbol 3 'ctywide1 'ashtan1 'ashtan2) + ) + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #f + :save #t + ) + ) + +;; failed to figure out what this is: +(scene-method-16 + (new 'static 'scene + :name "city-intercept-tanker-res" + :extra #f + :info #f + :mask-to-clear #x1282000 + :entity "scene-stage-57" + :art-group "scenecamera" + :anim "city-intercept-tanker-res" + :parts 4 + :command-list '((0 + (send-event *target* 'change-mode 'normal) + (send-event + *traffic-manager* + 'kill-traffic-sphere + (new 'static 'vector :x 1841152.0 :y 28672.0 :z 1865728.0 :w 260096.0) + ) + (fma-sphere (nav kill-once) sphere (new 'static 'vector :x 1895219.2 :y 36044.8 :z 1804697.6 :w 20480.0)) + (fma-sphere (nav kill-once) sphere (new 'static 'vector :x 1885388.8 :y 37683.2 :z 1783808.0 :w 16384.0)) + (fma-sphere (nav kill-once) sphere (new 'static 'vector :x 1920614.4 :y 35225.6 :z 1799372.8 :w 16384.0)) + ) + (445 (fadeout (frame-time-30 5))) + (10000 + (task-close! "city-intercept-tanker-resolution") + (send-event *traffic-manager* 'restore-default-settings) + ) + ) + :cut-list '(192 359) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'ctyasha + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'ctyasha + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'ctyasha + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min 359)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tanker-one-barrel" + :level 'ctyasha + :art-group "skel-tanker-one-barrel" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "ctymarkb-tanker" + :end-point-obj "ctymarkb-movie-end" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :music-delay 1500.0 + :save #t + ) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc new file mode 100644 index 000000000..372f27269 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc @@ -0,0 +1,340 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type water-anim-ctypal +(deftype water-anim-ctypal (water-anim) + () + :heap-base #x80 + :method-count-assert 29 + :size-assert #x100 + :flag-assert #x1d00800100 + ) + +;; definition for method 3 of type water-anim-ctypal +(defmethod inspect water-anim-ctypal ((obj water-anim-ctypal)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type water-anim inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for symbol ripple-for-water-anim-ctypal, type ripple-wave-set +(define ripple-for-water-anim-ctypal (new 'static 'ripple-wave-set + :count 3 + :converted #f + :normal-scale 1.0 + :wave (new 'static 'inline-array ripple-wave 4 + (new 'static 'ripple-wave :scale 20.0 :xdiv 1 :speed 1.5) + (new 'static 'ripple-wave :scale 20.0 :xdiv -1 :zdiv 1 :speed 1.5) + (new 'static 'ripple-wave :scale 10.0 :xdiv 5 :zdiv 3 :speed 0.75) + (new 'static 'ripple-wave) + ) + ) + ) + +;; definition for symbol ripple-ctypal-smlground-pool, type ripple-wave-set +(define ripple-ctypal-smlground-pool (new 'static 'ripple-wave-set + :count 3 + :converted #f + :normal-scale 1.0 + :wave (new 'static 'inline-array ripple-wave 4 + (new 'static 'ripple-wave :scale 10.0 :xdiv 1 :speed 1.5) + (new 'static 'ripple-wave :scale 10.0 :xdiv -1 :zdiv 1 :speed 1.5) + (new 'static 'ripple-wave :scale 10.0 :xdiv 1 :zdiv 1 :speed 0.75) + (new 'static 'ripple-wave) + ) + ) + ) + +;; definition for method 24 of type water-anim-ctypal +;; WARN: Return type mismatch ripple-wave-set vs none. +(defmethod init-water! water-anim-ctypal ((obj water-anim-ctypal)) + "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" + (let ((t9-0 (method-of-type water-anim init-water!))) + (t9-0 obj) + ) + (let ((v1-2 (new 'process 'ripple-control))) + (set! (-> obj draw ripple) v1-2) + (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> v1-2 global-scale) 3072.0) + (set! (-> v1-2 close-fade-dist) 163840.0) + (set! (-> v1-2 far-fade-dist) 245760.0) + (set! (-> v1-2 waveform) ripple-for-water-anim-ctypal) + (case (-> obj look) + ((32 30) + (set! (-> v1-2 waveform) ripple-ctypal-smlground-pool) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-palace-door palace-door palace-door-lod0-jg palace-door-idle-ja + ((palace-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 30 0 36) + ) + +;; definition of type palace-door +(deftype palace-door (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + +;; definition for method 3 of type palace-door +(defmethod inspect palace-door ((obj palace-door)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type palace-door +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! palace-door ((obj palace-door) (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" + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 122880.0 0.0 147456.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set! (-> v1-7 transform-index) 3) + (set-vector! (-> v1-7 local-sphere) 0.0 57344.0 0.0 90112.0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 5) + (set-vector! (-> v1-9 local-sphere) 0.0 -61440.0 0.0 73728.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-12 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-palace-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj pre-open-frame) 48.0) + (set! (-> obj lock-frame) 60.0) + (set! (-> obj open-frame) 60.0) + (set! (-> obj sound-pre-open) (static-sound-spec "pal-door-open-1")) + (set! (-> obj sound-open) (static-sound-spec "pal-door-open-2")) + (set! (-> obj sound-close) (static-sound-spec "pal-door-close")) + (set! (-> obj sound-post-close) (static-sound-spec "pal-door-close2")) + (set! (-> obj sound-behind?) #t) + (set! (-> obj door-radius) 40960.0) + (go (method-of-object obj close) #t) + (none) + ) + +;; definition of type ctypal-broke-wall +(deftype ctypal-broke-wall (process-drawable) + ((ent basic :offset-assert 200) + ) + :heap-base #x50 + :method-count-assert 22 + :size-assert #xcc + :flag-assert #x16005000cc + (:methods + (idle () _type_ :state 20) + (done () _type_ :state 21) + ) + ) + +;; definition for method 3 of type ctypal-broke-wall +(defmethod inspect ctypal-broke-wall ((obj ctypal-broke-wall)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tent: ~A~%" (-> obj ent)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctypal-broke-wall ctypal-broke-wall ctypal-broke-wall-lod0-jg ctypal-broke-wall-idle-ja + ((ctypal-broke-wall-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 20) + ) + +;; failed to figure out what this is: +(defstate idle (ctypal-broke-wall) + :virtual #t + :trans (behavior () + (when (task-node-closed? (game-task-node canyon-insert-items-resolution)) + (format 0 "~A canyon-insert-items-resolution done~%" (-> self name)) + (process-drawable-from-entity! self (the-as entity-actor (-> self ent))) + (go-virtual done) + ) + (none) + ) + :code (the-as (function none :behavior ctypal-broke-wall) sleep-code) + :post (behavior () + (transform-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate done (ctypal-broke-wall) + :virtual #t + :code (the-as (function none :behavior ctypal-broke-wall) sleep-code) + :post (behavior () + (transform-post) + (none) + ) + ) + +;; definition for method 11 of type ctypal-broke-wall +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! ctypal-broke-wall ((obj ctypal-broke-wall) (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" + (format #t "~A initialising~%" (-> obj name)) + (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 40960.0 0.0 122880.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> obj root) s4-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctypal-broke-wall" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-10 (-> obj root))) + (format + 0 + "trans ~F ~F ~F~%" + (* 0.00024414062 (-> v1-10 trans x)) + (* 0.00024414062 (-> v1-10 trans y)) + (* 0.00024414062 (-> v1-10 trans z)) + ) + ) + (set! (-> obj ent) arg0) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type ctypal-baron-statue-broken +(deftype ctypal-baron-statue-broken (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + +;; definition for method 3 of type ctypal-baron-statue-broken +(defmethod inspect ctypal-baron-statue-broken ((obj ctypal-baron-statue-broken)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctypal-baron-statue-broken ctypal-baron-statue-broken ctypal-baron-statue-broken-lod0-jg ctypal-baron-statue-broken-idle-ja + ((ctypal-baron-statue-broken-lod0-mg (meters 999999))) + :bounds (static-spherem 0 5 0 72) + ) + +;; definition for method 12 of type ctypal-baron-statue-broken +(defmethod run-logic? ctypal-baron-statue-broken ((obj ctypal-baron-statue-broken)) + #t + ) + +;; failed to figure out what this is: +(defstate idle (ctypal-baron-statue-broken) + :virtual #t + :code (the-as (function none :behavior ctypal-baron-statue-broken) sleep-code) + ) + +;; definition for method 11 of type ctypal-baron-statue-broken +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! ctypal-baron-statue-broken ((obj ctypal-baron-statue-broken) (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" + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-ctypal-baron-statue-broken" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (if (not (task-node-closed? (game-task-node canyon-insert-items-resolution))) + (logior! (-> obj draw status) (draw-control-status no-draw)) + ) + (ja-post) + (go (method-of-object obj idle)) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/city/port/mines/portrun_REF.gc b/test/decompiler/reference/jak2/levels/city/port/mines/portrun_REF.gc new file mode 100644 index 000000000..53cb0547d --- /dev/null +++ b/test/decompiler/reference/jak2/levels/city/port/mines/portrun_REF.gc @@ -0,0 +1,2114 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-cargo-explosion + :id 1057 + :duration (seconds 0.067) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4595 :flags (bit7) :period 150 :length 30) + (sp-item 4596 :flags (is-3d bit7) :period 150 :length 15) + (sp-item 4597 :flags (is-3d bit7) :period 150 :length 15) + (sp-item 4598 :flags (bit7) :period 150 :length 15) + (sp-item 784 :flags (bit6) :period 900 :length 5) + (sp-item 785 :flags (bit6) :period 900 :length 5) + (sp-item 786 :period 900 :length 15) + (sp-item 787 :fade-after (meters 60) :period 900 :length 10 :offset 10) + ) + ) + +;; failed to figure out what this is: +(defpart 4595 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 12.0) + (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 64.0 128.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 16.0 16.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.053333335) (meters 0.01) 1.0) + (sp-flt spt-scalevel-x (meters 0.0033333334)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.16) + (sp-flt spt-accel-y -1.3653333) + (sp-rnd-flt spt-friction 0.85 0.1 1.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4596 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2b :page #x52d)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-flt spt-num 8.0) + (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 32.0) + (sp-rnd-flt spt-g 32.0 16.0 1.0) + (sp-rnd-flt spt-b 48.0 16.0 1.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.053333335) (meters 0.04) 1.0) + (sp-rnd-flt spt-rotvel-x (degrees -4.8) (degrees 9.6) 1.0) + (sp-rnd-flt spt-rotvel-y (degrees -4.8) (degrees 9.6) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -4.8) (degrees 9.6) 1.0) + (sp-flt spt-fade-a -0.21333334) + (sp-rnd-flt spt-accel-y -13.653334 6.826667 1.0) + (sp-rnd-flt spt-friction 0.94 0.04 1.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 40 1 0 #x52d02b00 #x52d02a00 #xb09b00) + ) + (sp-int-plain-rnd spt-next-time 25 149 1) + (sp-launcher-by-id spt-next-launcher 4599) + (sp-rnd-flt spt-conerot-x (degrees 40.0) (degrees 40.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.1) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4597 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-flt spt-num 16.0) + (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.4) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.1) (meters 0.4) 1.0) + (sp-rnd-flt spt-r 16.0 8.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-rnd-flt spt-b 24.0 8.0 1.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-rotvel-x (degrees -4.8) (degrees 9.6) 1.0) + (sp-rnd-flt spt-rotvel-y (degrees -4.8) (degrees 9.6) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -4.8) (degrees 9.6) 1.0) + (sp-rnd-flt spt-accel-y -13.653334 6.826667 1.0) + (sp-rnd-flt spt-friction 0.92 0.04 1.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-func spt-func 'check-cargo-piece-ground) + (sp-int spt-next-time 120) + (sp-launcher-by-id spt-next-launcher 4600) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.1) 1.0) + ) + ) + +;; definition for function check-cargo-piece-ground +;; WARN: Return type mismatch number vs none. +(defun check-cargo-piece-ground ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (if (and (>= 0.0 (-> arg2 vector 0 y)) (>= 0.0 (-> arg1 vel-sxvel y))) + (set! (-> arg2 vector 0 y) 0.0) + (set! (-> arg1 next-time) + (the-as uint (* (max 1 (the-as int (-> *display* clock (-> arg1 clock-index) sparticle-data x))) 2)) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defpart 4600 + :init-specs ((sp-flt spt-rot-x 0.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-rotvel-x (degrees 0.0)) + (sp-flt spt-rotvel-y (degrees 0.0)) + (sp-flt spt-rotvel-z (degrees 0.0)) + (sp-flt spt-accel-y 0.0) + (sp-rnd-flt spt-friction 0.8 0.1 1.0) + (sp-int spt-timer 1200) + (sp-int-plain-rnd spt-next-time 300 299 1) + (sp-launcher-by-id spt-next-launcher 4601) + ) + ) + +;; failed to figure out what this is: +(defpart 4601 + :init-specs ((sp-flt spt-fade-a -0.21333334) (sp-cpuinfo-flags sp-cpuinfo-flag-2 left-multiply-quat)) + ) + +;; failed to figure out what this is: +(defpart 4598 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x52d)) + (sp-flt spt-num 8.0) + (sp-rnd-flt spt-x (meters 0) (meters 1) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.05) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-omega 4.096 2.048 1.0) + (sp-rnd-flt spt-vel-y (meters 0.10666667) (meters 0.053333335) 1.0) + (sp-flt spt-fade-a -0.21333334) + (sp-rnd-flt spt-accel-y -13.653334 6.826667 1.0) + (sp-rnd-flt spt-friction 0.94 0.04 1.0) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-func spt-func 'sparticle-motion-blur) + (sp-int-plain-rnd spt-next-time 25 149 1) + (sp-launcher-by-id spt-next-launcher 4599) + (sp-rnd-flt spt-conerot-x (degrees 40.0) (degrees 40.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.1) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4599 + :init-specs ((sp-rnd-flt spt-r 64.0 32.0 1.0) + (sp-rnd-flt spt-g 96.0 32.0 1.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-vel-y (meters 0.0033333334) (meters 0.013333334) 1.0) + (sp-int-plain-rnd spt-next-time 5 14 1) + (sp-launcher-by-id spt-next-launcher 4602) + ) + ) + +;; failed to figure out what this is: +(defpart 4602 + :init-specs ((sp-flt spt-r 32.0) (sp-rnd-flt spt-g 32.0 16.0 1.0) (sp-rnd-flt spt-b 48.0 16.0 1.0)) + ) + +;; definition for method 15 of type hud-cargo +;; WARN: Return type mismatch int vs none. +(defmethod draw hud-cargo ((obj hud-cargo)) + (set-hud-piece-position! + (the-as hud-sprite (-> obj sprites)) + (the int (+ 457.0 (* 130.0 (-> obj offset)))) + 205 + ) + (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -19 27) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +;; definition for method 16 of type hud-cargo +;; WARN: Return type mismatch int vs none. +(defmethod update-values hud-cargo ((obj hud-cargo)) + (set! (-> obj values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +;; definition for method 17 of type hud-cargo +;; WARN: Return type mismatch int vs none. +(defmethod init-callback hud-cargo ((obj hud-cargo)) + (set! (-> obj level) (level-get *level* 'ctywide)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #x679))) + (set! (-> obj sprites 0 scale-x) 1.2) + (set! (-> obj sprites 0 scale-y) 1.2) + (set! (-> obj sprites 0 flags) (the-as uint 4)) + (alloc-string-if-needed obj 0) + (set! (-> obj strings 0 scale) 0.6) + (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + 0 + (none) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 119 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (or (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 30)) + (let ((a0-3 (level-get-target-inside *level*))) + (when (not (and a0-3 (logtest? (-> a0-3 info level-flags) 1))) + (set! (-> self state-time) (-> self clock frame-counter)) + #t + ) + ) + ) + (suspend) + ) + (talker-spawn-func (-> *talker-speech* 93) *entity-pool* (target-pos 0) (the-as region #f)) + (send-event self 'complete) + (none) + ) + ) + ) + +;; definition of type city-port-run-mine-info +(deftype city-port-run-mine-info (structure) + ((handle handle :offset-assert 0) + (pos1-x float :offset-assert 8) + (pos1-y float :offset-assert 12) + (pos1-z float :offset-assert 16) + (type uint32 :offset-assert 20) + (pos2-x float :offset-assert 24) + (pos2-y float :offset-assert 28) + (pos2-z float :offset-assert 32) + (speed float :offset-assert 36) + (offset float :offset-assert 40) + (center-x float :offset 8) + (center-y float :offset 12) + (center-z float :offset 16) + (radius float :offset 24) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +;; definition for method 3 of type city-port-run-mine-info +(defmethod inspect city-port-run-mine-info ((obj city-port-run-mine-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'city-port-run-mine-info) + (format #t "~1Thandle: ~D~%" (-> obj handle)) + (format #t "~1Tpos1-x: ~f~%" (-> obj pos1-x)) + (format #t "~1Tpos1-y: ~f~%" (-> obj pos1-y)) + (format #t "~1Tpos1-z: ~f~%" (-> obj pos1-z)) + (format #t "~1Ttype: ~D~%" (-> obj type)) + (format #t "~1Tpos2-x: ~f~%" (-> obj pos2-x)) + (format #t "~1Tpos2-y: ~f~%" (-> obj pos2-y)) + (format #t "~1Tpos2-z: ~f~%" (-> obj pos2-z)) + (format #t "~1Tspeed: ~f~%" (-> obj speed)) + (format #t "~1Toffset: ~f~%" (-> obj offset)) + (format #t "~1Tcenter-x: ~f~%" (-> obj pos1-x)) + (format #t "~1Tcenter-y: ~f~%" (-> obj pos1-y)) + (format #t "~1Tcenter-z: ~f~%" (-> obj pos1-z)) + (format #t "~1Tradius: ~f~%" (-> obj pos2-x)) + (label cfg-4) + obj + ) + +;; definition for symbol *city-port-run-mine-info*, type (array city-port-run-mine-info) +(define *city-port-run-mine-info* + (new 'static 'boxed-array :type city-port-run-mine-info + (new 'static 'city-port-run-mine-info + :pos1-x 20480.0 + :pos1-y 8192.0 + :pos1-z 6082560.0 + :type #x1 + :pos2-x 20480.0 + :speed 60.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 20480.0 + :pos1-y 8192.0 + :pos1-z 6082560.0 + :type #x1 + :pos2-x 20480.0 + :speed 60.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 914145.25 + :pos1-y 8192.0 + :pos1-z 6415237.0 + :type #x1 + :pos2-x 20480.0 + :speed 60.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 914145.25 + :pos1-y 8192.0 + :pos1-z 6415237.0 + :type #x1 + :pos2-x 20480.0 + :speed 60.0 + :offset 0.1 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 914145.25 + :pos1-y 8192.0 + :pos1-z 6415237.0 + :type #x1 + :pos2-x 32768.0 + :speed -60.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 914145.25 + :pos1-y 8192.0 + :pos1-z 6415237.0 + :type #x1 + :pos2-x 32768.0 + :speed -60.0 + :offset 0.6 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 290611.2 + :pos1-y 8192.0 + :pos1-z 6656123.0 + :type #x1 + :pos2-x 20480.0 + :speed 60.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 290611.2 + :pos1-y 8192.0 + :pos1-z 6656123.0 + :type #x1 + :pos2-x 32768.0 + :speed -60.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 957644.8 + :pos1-y 8192.0 + :pos1-z 7131013.0 + :type #x1 + :pos2-x 28672.0 + :speed 60.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 957644.8 + :pos1-y 8192.0 + :pos1-z 7131013.0 + :type #x1 + :pos2-x 28672.0 + :speed 60.0 + :offset 0.0666 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 957644.8 + :pos1-y 8192.0 + :pos1-z 7131013.0 + :type #x1 + :pos2-x 28672.0 + :speed 60.0 + :offset 0.13333 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 957644.8 + :pos1-y 8192.0 + :pos1-z 7131013.0 + :type #x1 + :pos2-x 28672.0 + :speed 60.0 + :offset 0.2 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 957644.8 + :pos1-y 8192.0 + :pos1-z 7131013.0 + :type #x1 + :pos2-x 28672.0 + :speed 60.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 957644.8 + :pos1-y 8192.0 + :pos1-z 7131013.0 + :type #x1 + :pos2-x 28672.0 + :speed 60.0 + :offset 0.5666 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 957644.8 + :pos1-y 8192.0 + :pos1-z 7131013.0 + :type #x1 + :pos2-x 28672.0 + :speed 60.0 + :offset 0.6333 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 957644.8 + :pos1-y 8192.0 + :pos1-z 7131013.0 + :type #x1 + :pos2-x 28672.0 + :speed 60.0 + :offset 0.7 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 638976.0 + :pos1-y 8192.0 + :pos1-z 7199539.0 + :pos2-x 565248.0 + :pos2-y 8192.0 + :pos2-z 7199539.0 + :speed 3.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 638976.0 + :pos1-y 8192.0 + :pos1-z 7179059.0 + :pos2-x 565248.0 + :pos2-y 8192.0 + :pos2-z 7179059.0 + :speed 3.0 + :offset 0.25 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 638976.0 + :pos1-y 8192.0 + :pos1-z 7138099.0 + :pos2-x 565248.0 + :pos2-y 8192.0 + :pos2-z 7138099.0 + :speed 3.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 638976.0 + :pos1-y 8192.0 + :pos1-z 7117619.0 + :pos2-x 565248.0 + :pos2-y 8192.0 + :pos2-z 7117619.0 + :speed 3.0 + :offset 0.75 + ) + (new 'static 'city-port-run-mine-info + :pos1-x -675840.0 + :pos1-y 8192.0 + :pos1-z 6148096.0 + :pos2-x -634880.0 + :pos2-y 8192.0 + :pos2-z 6184960.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x -659456.0 + :pos1-y 8192.0 + :pos1-z 6193152.0 + :pos2-x -704512.0 + :pos2-y 8192.0 + :pos2-z 6180864.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x -496640.0 + :pos1-y 8192.0 + :pos1-z 6527836.0 + :type #x1 + :pos2-x 20480.0 + :speed 60.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x -496640.0 + :pos1-y 8192.0 + :pos1-z 6527836.0 + :type #x1 + :pos2-x 20480.0 + :speed 60.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info :pos1-x -904806.4 :pos1-y 8192.0 :pos1-z 7407862.0 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -850124.8 :pos1-y 8192.0 :pos1-z 7420231.5 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -862330.9 :pos1-y 8192.0 :pos1-z 7395492.0 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -858193.94 :pos1-y 8192.0 :pos1-z 7370055.5 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -874618.9 :pos1-y 8192.0 :pos1-z 7351255.0 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -890634.25 :pos1-y 8192.0 :pos1-z 7317954.5 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -888340.5 :pos1-y 8192.0 :pos1-z 7338475.5 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -941260.8 :pos1-y 8192.0 :pos1-z 7326597.0 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -937369.6 :pos1-y 8192.0 :pos1-z 7359037.5 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -914432.0 :pos1-y 8192.0 :pos1-z 7380254.5 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -904601.6 :pos1-y 8192.0 :pos1-z 7444848.5 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -841850.9 :pos1-y 8192.0 :pos1-z 7431291.0 :type #x1) + (new 'static 'city-port-run-mine-info :pos1-x -815595.5 :pos1-y 8192.0 :pos1-z 7410524.0 :type #x1) + (new 'static 'city-port-run-mine-info + :pos1-x -252436.48 + :pos1-y 8192.0 + :pos1-z 7127122.0 + :type #x1 + :pos2-x 24576.0 + :speed 90.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x -252436.48 + :pos1-y 8192.0 + :pos1-z 7127122.0 + :type #x1 + :pos2-x 24576.0 + :speed 90.0 + :offset 0.25 + ) + (new 'static 'city-port-run-mine-info + :pos1-x -252436.48 + :pos1-y 8192.0 + :pos1-z 7127122.0 + :type #x1 + :pos2-x 24576.0 + :speed 90.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info + :pos1-x -252436.48 + :pos1-y 8192.0 + :pos1-z 7127122.0 + :type #x1 + :pos2-x 24576.0 + :speed 90.0 + :offset 0.75 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1124556.8 + :pos1-y 8192.0 + :pos1-z 7651123.0 + :type #x1 + :pos2-x 24576.0 + :speed 90.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1124556.8 + :pos1-y 8192.0 + :pos1-z 7651123.0 + :type #x1 + :pos2-x 36864.0 + :speed 90.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1124556.8 + :pos1-y 8192.0 + :pos1-z 7651123.0 + :type #x1 + :pos2-x 24576.0 + :speed 90.0 + :offset 0.33 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1124556.8 + :pos1-y 8192.0 + :pos1-z 7651123.0 + :type #x1 + :pos2-x 36864.0 + :speed 90.0 + :offset 0.33 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1124556.8 + :pos1-y 8192.0 + :pos1-z 7651123.0 + :type #x1 + :pos2-x 24576.0 + :speed 90.0 + :offset 0.66 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1124556.8 + :pos1-y 8192.0 + :pos1-z 7651123.0 + :type #x1 + :pos2-x 36864.0 + :speed 90.0 + :offset 0.66 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1269760.0 + :pos1-y 8192.0 + :pos1-z 6209536.0 + :pos2-x 1269760.0 + :pos2-y 8192.0 + :pos2-z 6225920.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1269760.0 + :pos1-y 8192.0 + :pos1-z 6221824.0 + :pos2-x 1269760.0 + :pos2-y 8192.0 + :pos2-z 6238208.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1269760.0 + :pos1-y 8192.0 + :pos1-z 6234112.0 + :pos2-x 1269760.0 + :pos2-y 8192.0 + :pos2-z 6250496.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1269760.0 + :pos1-y 8192.0 + :pos1-z 6393856.0 + :pos2-x 1269760.0 + :pos2-y 8192.0 + :pos2-z 6410240.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1269760.0 + :pos1-y 8192.0 + :pos1-z 6406144.0 + :pos2-x 1269760.0 + :pos2-y 8192.0 + :pos2-z 6422528.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1269760.0 + :pos1-y 8192.0 + :pos1-z 6418432.0 + :pos2-x 1269760.0 + :pos2-y 8192.0 + :pos2-z 6434816.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1302528.0 + :pos1-y 8192.0 + :pos1-z 6209536.0 + :pos2-x 1302528.0 + :pos2-y 8192.0 + :pos2-z 6225920.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1302528.0 + :pos1-y 8192.0 + :pos1-z 6221824.0 + :pos2-x 1302528.0 + :pos2-y 8192.0 + :pos2-z 6238208.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1302528.0 + :pos1-y 8192.0 + :pos1-z 6234112.0 + :pos2-x 1302528.0 + :pos2-y 8192.0 + :pos2-z 6250496.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1302528.0 + :pos1-y 8192.0 + :pos1-z 6393856.0 + :pos2-x 1302528.0 + :pos2-y 8192.0 + :pos2-z 6410240.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1302528.0 + :pos1-y 8192.0 + :pos1-z 6406144.0 + :pos2-x 1302528.0 + :pos2-y 8192.0 + :pos2-z 6422528.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1302528.0 + :pos1-y 8192.0 + :pos1-z 6418432.0 + :pos2-x 1302528.0 + :pos2-y 8192.0 + :pos2-z 6434816.0 + :speed 2.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1286144.0 + :pos1-y 8192.0 + :pos1-z 6332416.0 + :type #x1 + :pos2-x 20480.0 + :speed 60.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1207746.5 + :pos1-y 8192.0 + :pos1-z 5807309.0 + :type #x1 + :pos2-x 32768.0 + :speed 60.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1207746.5 + :pos1-y 8192.0 + :pos1-z 5807309.0 + :type #x1 + :pos2-x 32768.0 + :speed 60.0 + :offset 0.25 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1207746.5 + :pos1-y 8192.0 + :pos1-z 5807309.0 + :type #x1 + :pos2-x 32768.0 + :speed 60.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1207746.5 + :pos1-y 8192.0 + :pos1-z 5807309.0 + :type #x1 + :pos2-x 32768.0 + :speed 60.0 + :offset 0.75 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1573314.5 + :pos1-y 8192.0 + :pos1-z 5622292.5 + :type #x1 + :pos2-x 32768.0 + :speed 120.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1573314.5 + :pos1-y 8192.0 + :pos1-z 5622292.5 + :type #x1 + :pos2-x 32768.0 + :speed 120.0 + :offset 0.1 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1573314.5 + :pos1-y 8192.0 + :pos1-z 5622292.5 + :type #x1 + :pos2-x 32768.0 + :speed 120.0 + :offset 0.2 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1822064.6 + :pos1-y 8192.0 + :pos1-z 6100050.0 + :type #x1 + :pos2-x 32768.0 + :speed 90.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1822064.6 + :pos1-y 8192.0 + :pos1-z 6100050.0 + :type #x1 + :pos2-x 32768.0 + :speed 90.0 + :offset 0.25 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1822064.6 + :pos1-y 8192.0 + :pos1-z 6100050.0 + :type #x1 + :pos2-x 32768.0 + :speed 90.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1822064.6 + :pos1-y 8192.0 + :pos1-z 6100050.0 + :type #x1 + :pos2-x 32768.0 + :speed 90.0 + :offset 0.75 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1822064.6 + :pos1-y 8192.0 + :pos1-z 6100050.0 + :type #x1 + :pos2-x 45056.0 + :speed 90.0 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1822064.6 + :pos1-y 8192.0 + :pos1-z 6100050.0 + :type #x1 + :pos2-x 45056.0 + :speed 90.0 + :offset 0.25 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1822064.6 + :pos1-y 8192.0 + :pos1-z 6100050.0 + :type #x1 + :pos2-x 45056.0 + :speed 90.0 + :offset 0.5 + ) + (new 'static 'city-port-run-mine-info + :pos1-x 1822064.6 + :pos1-y 8192.0 + :pos1-z 6100050.0 + :type #x1 + :pos2-x 45056.0 + :speed 90.0 + :offset 0.75 + ) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctyport-mine ctyport-mine ctyport-mine-lod0-jg ctyport-mine-idle-ja + ((ctyport-mine-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + ) + +;; definition of type ctyport-mine +(deftype ctyport-mine (process-drawable) + ((root-override collide-shape-moving :offset 128) + (info city-port-run-mine-info :offset-assert 200) + (base-height float :offset-assert 204) + (center vector :inline :offset-assert 208) + (time-skew uint64 :offset-assert 224) + (period float :offset-assert 232) + (trans-y float :offset-assert 236) + (speed-y float :offset-assert 240) + (acc-y float :offset-assert 244) + (beep basic :offset-assert 248) + (beep-time time-frame :offset-assert 256) + (beep-color vector :inline :offset-assert 272) + ) + :heap-base #xa0 + :method-count-assert 24 + :size-assert #x120 + :flag-assert #x1800a00120 + (:methods + (idle () _type_ :state 20) + (die () _type_ :state 21) + (fall () _type_ :state 22) + (ctyport-mine-method-23 (_type_) none 23) + ) + ) + +;; definition for method 3 of type ctyport-mine +(defmethod inspect ctyport-mine ((obj ctyport-mine)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tinfo: #~%" (-> obj info)) + (format #t "~2Tbase-height: ~f~%" (-> obj base-height)) + (format #t "~2Tcenter: #~%" (-> obj center)) + (format #t "~2Ttime-skew: ~D~%" (-> obj time-skew)) + (format #t "~2Tperiod: ~f~%" (-> obj period)) + (format #t "~2Ttrans-y: ~f~%" (-> obj trans-y)) + (format #t "~2Tspeed-y: ~f~%" (-> obj speed-y)) + (format #t "~2Tacc-y: ~f~%" (-> obj acc-y)) + (format #t "~2Tbeep: ~A~%" (-> obj beep)) + (format #t "~2Tbeep-time: ~D~%" (-> obj beep-time)) + (format #t "~2Tbeep-color: #~%" (-> obj beep-color)) + (label cfg-4) + obj + ) + +;; definition for method 23 of type ctyport-mine +;; WARN: Return type mismatch float vs none. +(defmethod ctyport-mine-method-23 ctyport-mine ((obj ctyport-mine)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (get-base-height *ocean-map-city*) + (let ((f0-1 (-> obj period)) + (t9-1 sin-rad) + (f1-0 -3.1415925) + (f2-0 6.283185) + (f3-1 (the float (+ (-> pp clock frame-counter) (the-as time-frame (-> obj time-skew))))) + ) + (t9-1 (+ f1-0 (* f2-0 (/ (- f3-1 (* (the float (the int (/ f3-1 f0-1))) f0-1)) f0-1)))) + ) + (let ((s5-0 (-> obj info))) + (cond + ((zero? (-> obj info type)) + (let* ((f0-8 + (+ (* 2.0 (-> s5-0 offset)) (/ (* 0.0033333334 (the float (-> pp clock frame-counter))) (-> s5-0 speed))) + ) + (f0-9 (- f0-8 (* (the float (the int (/ f0-8 2.0))) 2.0))) + ) + (if (< 1.0 f0-9) + (set! f0-9 (- 2.0 f0-9)) + ) + (let ((f0-13 (* 0.5 (- 1.0 (cos (* 32768.0 f0-9)))))) + (let ((v1-23 (-> obj root-override trans)) + (a0-5 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-5 x) (-> s5-0 pos1-x)) + (set! (-> a0-5 y) (-> s5-0 pos1-y)) + (set! (-> a0-5 z) (-> s5-0 pos1-z)) + (set! (-> a0-5 w) 1.0) + (vector-float*! v1-23 a0-5 f0-13) + ) + (let ((s4-0 (-> obj root-override trans))) + (let ((v1-27 (-> obj root-override trans))) + (let ((a0-6 (new 'stack-no-clear 'vector))) + (set! (-> a0-6 x) (-> s5-0 pos2-x)) + (set! (-> a0-6 y) (-> s5-0 pos2-y)) + (set! (-> a0-6 z) (-> s5-0 pos2-z)) + (set! (-> a0-6 w) 1.0) + (let ((a1-3 (- 1.0 f0-13))) + (.mov vf7 a1-3) + ) + (.lvf vf5 (&-> a0-6 quad)) + ) + (.lvf vf4 (&-> v1-27 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s4-0 quad) vf6) + ) + ) + ) + ) + (else + (let ((s4-1 (-> obj root-override trans))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 x) (-> s5-0 pos1-x)) + (set! (-> s3-0 y) (-> s5-0 pos1-y)) + (set! (-> s3-0 z) (-> s5-0 pos1-z)) + (set! (-> s3-0 w) 1.0) + (let ((v1-35 (vector-rotate-around-y! + (new 'stack-no-clear 'vector) + *x-vector* + (+ (* 182.04445 (* 360.0 (-> s5-0 offset))) + (* 0.60681486 (-> s5-0 speed) (the float (-> pp clock frame-counter))) + ) + ) + ) + ) + (let ((a0-8 (-> s5-0 pos2-x))) + (.mov vf7 a0-8) + ) + (.lvf vf5 (&-> v1-35 quad)) + ) + (.lvf vf4 (&-> s3-0 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s4-1 quad) vf6) + ) + ) + ) + ) + (+! (-> obj speed-y) (* 10.0 + (-> pp clock seconds-per-frame) + (- (get-height *ocean* (-> obj root-override trans) #t) (-> obj trans-y)) + ) + ) + (set! (-> obj speed-y) (- (-> obj speed-y) (* (-> obj speed-y) (-> pp clock seconds-per-frame)))) + (set! (-> obj speed-y) (- (-> obj speed-y) (* 4096.0 (-> pp clock seconds-per-frame)))) + (+! (-> obj trans-y) (* (-> obj speed-y) (-> pp clock seconds-per-frame))) + (set! (-> obj root-override trans y) (+ 2048.0 (-> obj trans-y))) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(defstate die (ctyport-mine) + :virtual #t + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self beep-time) 0) + 0 + (none) + ) + :code (behavior () + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 3)) + (suspend) + ) + ) + (cleanup-for-death self) + (none) + ) + :post (behavior () + (cond + ((and (-> self beep) (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1))) + (vector-seek! (-> self beep-color) *null-vector* (* 4.0 (-> self clock seconds-per-frame))) + (when (< (-> self beep-time) (-> self clock frame-counter)) + (sound-play "cargo-beep") + (set-vector! (-> self beep-color) 1.0 1.0 1.0 1.0) + (set! (-> self beep-time) + (+ (-> self clock frame-counter) + (the int (* 0.2 (the float (- (seconds 1) (- (-> self clock frame-counter) (-> self state-time)))))) + ) + ) + ) + (set! (-> self draw color-emissive quad) (-> self beep-color quad)) + ) + ((not (logtest? (-> self draw status) (draw-control-status no-draw))) + (send-event (ppointer->process (-> self parent)) 'mine-dead) + (let ((v1-27 (-> self root-override root-prim))) + (set! (-> v1-27 prim-core collide-as) (collide-spec)) + (set! (-> v1-27 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (sound-play "port-cargo-mine") + (cond + ((-> self beep) + (let ((gp-2 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-2 spawn-point quad) (-> self root-override trans quad)) + (quaternion-copy! (-> gp-2 spawn-quat) (-> self root-override quat)) + (set! (-> gp-2 radius) 32768.0) + (set! (-> gp-2 group) (-> *part-group-id-table* 161)) + (set! (-> gp-2 collide-with) (collide-spec jak crate hit-by-others-list player-list)) + (set! (-> gp-2 penetrate-using) (penetrate explode)) + (explosion-spawn self explosion gp-2) + ) + ) + (else + (process-spawn touch-tracker :init touch-tracker-init (-> self root-override trans) #x46400000 30 :to self) + (let ((gp-4 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-4 + (let ((t9-12 (method-of-type part-tracker activate))) + (t9-12 (the-as part-tracker gp-4) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-13 run-function-in-process) + (a0-31 gp-4) + (a1-14 part-tracker-init) + (a2-14 (-> *part-group-id-table* 161)) + (a3-5 0) + (t0-3 #f) + (t1-2 #f) + (t2-2 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> self root-override trans quad)) + ((the-as (function object object object object object object object object none) t9-13) + a0-31 + a1-14 + a2-14 + a3-5 + t0-3 + t1-2 + t2-2 + t3-0 + ) + ) + (-> gp-4 ppointer) + ) + ) + ) + ) + ) + ) + (ctyport-mine-method-23 self) + (transform-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate fall (ctyport-mine) + :virtual #t + :enter (behavior () + (set! (-> self acc-y) (* 4096.0 (+ 8.0 (* 8.0 (rand-vu))))) + (none) + ) + :code (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (until #f + (suspend) + (when (< (-> self trans-y) -163840.0) + #t + (goto cfg-5) + ) + ) + #f + (label cfg-5) + (deactivate self) + (none) + ) + :post (behavior () + (set! (-> self speed-y) (- (-> self speed-y) (* (-> self speed-y) (-> self clock seconds-per-frame)))) + (set! (-> self speed-y) (- (-> self speed-y) (* (-> self acc-y) (-> self clock seconds-per-frame)))) + (+! (-> self trans-y) (* (-> self speed-y) (-> self clock seconds-per-frame))) + (set! (-> self root-override trans y) (+ 2048.0 (-> self trans-y))) + (transform-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate idle (ctyport-mine) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('touched 'touch 'attack) + (cond + ((logtest? (process-mask projectile vehicle) (-> proc mask)) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer self)) + (set! (-> a1-7 num-params) 2) + (set! (-> a1-7 message) 'attack) + (set! (-> a1-7 param 0) (-> event param 0)) + (let ((v1-7 (new 'static 'attack-info :mask (attack-info-mask mode id)))) + (let* ((a2-4 *game-info*) + (a3-2 (+ (-> a2-4 attack-id) 1)) + ) + (set! (-> a2-4 attack-id) a3-2) + (set! (-> v1-7 id) a3-2) + ) + (set! (-> v1-7 mode) 'mine) + (set! (-> a1-7 param 1) (the-as uint v1-7)) + ) + (send-event-function proc a1-7) + ) + (set! (-> self beep) #f) + ) + (else + (set! (-> self beep) (the-as basic #t)) + ) + ) + (go-virtual die) + ) + (('fall) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual fall) + ) + ) + ) + :code (the-as (function none :behavior ctyport-mine) transform-and-sleep-code) + :post (behavior () + (ctyport-mine-method-23 self) + (transform-post) + (none) + ) + ) + +;; definition for function ctyport-mine-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior ctyport-mine-init-by-other ctyport-mine ((arg0 city-port-run-mine-info)) + (stack-size-set! (-> self main-thread) 32) + (let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list tobot)) + (set! (-> v1-8 prim-core action) (collide-action solid deadly)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 8192.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> s5-0 event-self) 'touched) + (set! (-> self root-override) s5-0) + ) + (set! (-> self info) arg0) + (set! (-> arg0 handle) (process->handle self)) + (logior! (-> self mask) (process-mask actor-pause)) + (set! (-> self mask) (logior (process-mask crate) (-> self mask))) + (set-vector! (-> self root-override trans) (-> arg0 pos1-x) (-> arg0 pos1-y) (-> arg0 pos1-z) 1.0) + (quaternion-copy! (-> self root-override quat) *unity-quaternion*) + (vector-identity! (-> self root-override scale)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyport-mine" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> self base-height) 0.0) + (set! (-> self time-skew) (the-as uint (the int (* 300.0 (rand-vu-float-range 0.1 1.4))))) + (set! (-> self period) (* 300.0 (rand-vu-float-range 1.2 1.8))) + (set! (-> self center quad) (-> self root-override trans quad)) + (set! (-> self root-override pause-adjust-distance) 532480.0) + (set! (-> self trans-y) (-> self root-override trans y)) + (go-virtual idle) + (none) + ) + +;; definition for function ctyport-mine-spawn +(defun ctyport-mine-spawn ((arg0 task-manager) (arg1 city-port-run-mine-info)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn ctyport-mine arg1 :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + gp-0 + ) + ) + +;; definition of type ctyport-spy +(deftype ctyport-spy (process-drawable) + ((trans-y float :offset-assert 200) + ) + :heap-base #x50 + :method-count-assert 21 + :size-assert #xcc + :flag-assert #x15005000cc + (:methods + (idle () _type_ :state 20) + ) + ) + +;; definition for method 3 of type ctyport-spy +(defmethod inspect ctyport-spy ((obj ctyport-spy)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Ttrans-y: ~f~%" (-> obj trans-y)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctyport-spy ctyport-spy ctyport-spy-lod0-jg ctyport-spy-idle-ja + ((ctyport-spy-lod0-mg (meters 20)) (ctyport-spy-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; failed to figure out what this is: +(defstate idle (ctyport-spy) + :virtual #t + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.3)) + (+! (-> self trans-y) (* (-> self root transv y) (-> self clock seconds-per-frame))) + (+! (-> self root transv y) (* -8.0 (-> self clock seconds-per-frame) (-> self root transv y))) + (set! (-> self root trans y) + (+ (-> self trans-y) + (* 1024.0 + (+ (sin (* 182.04445 (* 50.0 (+ 10.0 (* 0.0033333334 (the float (-> self clock frame-counter))))))) + (cos (* 182.04445 (* -80.0 (- 40.0 (* 0.0033333334 (the float (-> self clock frame-counter))))))) + ) + ) + ) + ) + (let ((gp-0 (new 'stack-no-clear 'quaternion))) + (let ((s5-0 quaternion-zxy!) + (s4-0 gp-0) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 x) + (* 182.04445 (* 5.0 (sin (* 182.04445 (* 0.33333334 (the float (-> self clock frame-counter))))))) + ) + (set! (-> s3-0 y) + (* 182.04445 + (* 5.0 (sin (* 182.04445 (* 50.0 (+ 10.0 (* 0.0033333334 (the float (-> self clock frame-counter)))))))) + ) + ) + (set! (-> s3-0 z) 0.0) + (set! (-> s3-0 w) 1.0) + (s5-0 s4-0 s3-0) + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) gp-0 0.1) + ) + ) + (none) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) + :num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior ctyport-spy) ja-post) + ) + +;; definition for function ctyport-spy-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior ctyport-spy-init-by-other ctyport-spy ((arg0 vector)) + (stack-size-set! (-> self main-thread) 32) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + (set! (-> self mask) (logior (process-mask crate) (-> self mask))) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyport-spy" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> self trans-y) (-> self root trans y)) + (set-vector! (-> self root transv) 0.0 81920.0 0.0 1.0) + (go-virtual idle) + (none) + ) + +;; definition for function ctyport-spy-spawn +(defun ctyport-spy-spawn ((arg0 process) (arg1 vector) (arg2 vector) (arg3 float)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn ctyport-spy arg1 :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + gp-0 + ) + ) + +;; definition of type ctyport-cargo +(deftype ctyport-cargo (process-focusable) + ((minimap connection-minimap :offset-assert 204) + (trans-y float :offset-assert 208) + (speed-y float :offset-assert 212) + ) + :heap-base #x60 + :method-count-assert 31 + :size-assert #xd8 + :flag-assert #x1f006000d8 + (:methods + (idle () _type_ :state 27) + (focus-camera () _type_ :state 28) + (die () _type_ :state 29) + (ctyport-cargo-method-30 (_type_) none 30) + ) + ) + +;; definition for method 3 of type ctyport-cargo +(defmethod inspect ctyport-cargo ((obj ctyport-cargo)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (format #t "~2Tminimap: #~%" (-> obj minimap)) + (format #t "~2Ttrans-y: ~f~%" (-> obj trans-y)) + (format #t "~2Tspeed-y: ~f~%" (-> obj speed-y)) + (label cfg-4) + obj + ) + +;; definition for symbol *city-port-position*, type vector +(define *city-port-position* (new 'static 'vector :x 413696.0 :y 32768.0 :z 6676480.0 :w 1.0)) + +;; failed to figure out what this is: +(defskelgroup skel-ctyport-cargo ctyport-cargo ctyport-cargo-lod0-jg ctyport-cargo-idle-ja + ((ctyport-cargo-lod0-mg (meters 20)) (ctyport-cargo-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; failed to figure out what this is: +(defskelgroup skel-ctyport-cargo-explode ctyport-cargo ctyport-cargo-explode-lod0-jg ctyport-cargo-explode-idle-ja + ((ctyport-cargo-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +;; definition for symbol *ctyport-cargo-exploder-params*, type joint-exploder-static-params +(define *ctyport-cargo-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + ) + :collide-spec #x1 + ) + ) + +;; failed to figure out what this is: +(defstate idle (ctyport-cargo) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (case event-type + (('attack) + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-0 fountain-rand-transv-lo quad) (-> (target-pos 0) quad)) + (set! (-> gp-0 fountain-rand-transv-hi x) 40960.0) + (set! (-> gp-0 fountain-rand-transv-hi y) 122880.0) + (set! (-> self draw bounds w) 163840.0) + (let ((v1-9 (-> self root-override root-prim))) + (set! (-> v1-9 prim-core collide-as) (collide-spec)) + (set! (-> v1-9 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when s5-1 + (let ((t9-3 (method-of-type part-tracker activate))) + (t9-3 + (the-as part-tracker s5-1) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((t9-4 run-function-in-process) + (a0-8 s5-1) + (a1-4 part-tracker-init) + (a2-6 (-> *part-group-id-table* 1057)) + (a3-2 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> self root-override trans quad)) + ((the-as (function object object object object object object object object none) t9-4) + a0-8 + a1-4 + a2-6 + a3-2 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> s5-1 ppointer) + ) + ) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-ctyport-cargo-explode" (the-as (pointer uint32) #f)) + 6 + gp-0 + *ctyport-cargo-exploder-params* + :to self + ) + ) + (sound-play "cargo-explode") + (go-virtual die) + ) + (('spy) + (let ((t9-12 ctyport-spy-spawn) + (a0-17 self) + (a1-10 (new 'stack-no-clear 'vector)) + (v1-33 (-> self root-override trans)) + (a2-14 *up-vector*) + (a3-7 4096.0) + ) + (.mov vf7 a3-7) + (.lvf vf5 (&-> a2-14 quad)) + (.lvf vf4 (&-> v1-33 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-10 quad) vf6) + (t9-12 a0-17 a1-10 a2-14 a3-7) + ) + ) + (('focus-camera) + (go-virtual focus-camera) + ) + ) + ) + ) + :trans (behavior () + (+! (-> self speed-y) (* 10.0 + (-> self clock seconds-per-frame) + (- (get-height *ocean* (-> self root-override trans) #t) (-> self trans-y)) + ) + ) + (set! (-> self speed-y) (- (-> self speed-y) (* (-> self speed-y) (-> self clock seconds-per-frame)))) + (set! (-> self speed-y) (- (-> self speed-y) (* 409.6 (-> self clock seconds-per-frame)))) + (+! (-> self trans-y) (* (-> self speed-y) (-> self clock seconds-per-frame))) + (set! (-> self root-override trans y) (-> self trans-y)) + (none) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek! 0.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior ctyport-cargo) transform-post) + ) + +;; definition for method 30 of type ctyport-cargo +;; WARN: Return type mismatch int vs none. +(defmethod ctyport-cargo-method-30 ctyport-cargo ((obj ctyport-cargo)) + (send-event *camera* 'change-target obj) + (let ((gp-0 (new 'stack 'transformq))) + (vector+! (-> gp-0 trans) (-> obj root-override trans) (new 'static 'vector :y 16384.0 :z 28672.0 :w 1.0)) + (set-vector! (-> gp-0 scale) 1.0 1.0 1.0 1.0) + (quaternion-zxy! (-> gp-0 quat) (new 'static 'vector :x 1820.4445 :y 32768.0 :w 1.0)) + (send-event *camera* 'teleport-to-transformq gp-0) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate focus-camera (ctyport-cargo) + :virtual #t + :exit (behavior () + (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) + (remove-setting! 'interp-time) + (remove-setting! 'mode-name) + (none) + ) + :trans (behavior () + (set! (-> self root-override trans y) + (+ (-> self trans-y) + (* 1024.0 + (+ (sin (* 182.04445 (* 150.0 (+ 10.0 (* 0.0033333334 (the float (-> self clock frame-counter))))))) + (cos (* 182.04445 (* -80.0 (- 40.0 (* 0.0033333334 (the float (-> self clock frame-counter))))))) + ) + ) + ) + ) + (none) + ) + :code (behavior () + (set-setting! 'interp-time 'abs 0 0) + (set-setting! 'mode-name 'cam-fixed 0 0) + (suspend) + (ctyport-cargo-method-30 self) + (ja-no-eval :group! (ja-group) + :num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (suspend) + ) + #f + (none) + ) + :post (the-as (function none :behavior ctyport-cargo) ja-post) + ) + +;; failed to figure out what this is: +(defstate die (ctyport-cargo) + :virtual #t + :code (behavior () + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 1)) + (suspend) + ) + ) + (cleanup-for-death self) + (none) + ) + ) + +;; definition for function ctyport-cargo-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior ctyport-cargo-init-by-other ctyport-cargo ((arg0 vector) (arg1 nav-mesh)) + (stack-size-set! (-> self main-thread) 32) + (let ((s4-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list tobot)) + (set! (-> v1-8 prim-core action) (collide-action solid rideable)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 4096.0 0.0 6144.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-8) + ) + (set! (-> s4-0 nav-radius) 40960.0) + (let ((v1-10 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> s4-0 penetrated-by) + (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + dark-punch + dark-giant + knocked + ) + ) + (set! (-> self root-override) s4-0) + ) + (add-process-drawable-to-navmesh arg1 self #t) + (set! (-> self root-override trans quad) (-> arg0 quad)) + (set-vector! (-> self root-override scale) 1.0 1.0 1.0 1.0) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 16) (the-as int #f) (the-as vector #t) 0)) + (set! (-> self mask) (logior (process-mask crate) (-> self mask))) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyport-cargo" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> self trans-y) (-> self root-override trans y)) + (go-virtual idle) + (none) + ) + +;; definition for function ctyport-cargo-spawn +(defun ctyport-cargo-spawn ((arg0 task-manager) (arg1 vector) (arg2 nav-mesh)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn ctyport-cargo arg1 arg2 :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + gp-0 + ) + ) + +;; definition of type city-port-run-cargo-info +(deftype city-port-run-cargo-info (structure) + ((pos vector :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type city-port-run-cargo-info +(defmethod inspect city-port-run-cargo-info ((obj city-port-run-cargo-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'city-port-run-cargo-info) + (format #t "~1Tpos: #~%" (-> obj pos)) + (label cfg-4) + obj + ) + +;; definition for symbol *city-port-run-cargo-info*, type (array city-port-run-cargo-info) +(define *city-port-run-cargo-info* + (new 'static 'boxed-array :type city-port-run-cargo-info + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 20480.0 :y 8192.0 :z 6082560.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 290611.2 :y 8192.0 :z 6656123.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 957644.8 :y 8192.0 :z 7131013.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 611450.9 :y 8192.0 :z 7158579.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x -496640.0 :y 8192.0 :z 6527836.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 1207746.5 :y 8192.0 :z 5807309.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 1822064.6 :y 8192.0 :z 6100050.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 1286144.0 :y 8192.0 :z 6332416.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 1286144.0 :y 8192.0 :z 6415769.5 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 1286144.0 :y 8192.0 :z 6229811.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 914145.25 :y 8192.0 :z 6415237.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 1124556.8 :y 8192.0 :z 7651123.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x -252436.48 :y 8192.0 :z 7127122.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x -898539.5 :y 8192.0 :z 7363748.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x -674406.4 :y 8192.0 :z 6178652.0 :w 1.0)) + (new 'static 'city-port-run-cargo-info :pos (new 'static 'vector :x 1573314.5 :y 8192.0 :z 5622292.5 :w 1.0)) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 120 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (if (task-node-closed? (game-task-node city-port-run-resolution)) + (go-virtual complete) + ) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) + (let ((gp-0 *traffic-manager*) + (s5-0 (new 'stack 'traffic-object-spawn-params)) + ) + (set! (-> s5-0 position quad) (-> self begin-pos quad)) + (quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 0.0) + (set! (-> s5-0 object-type) (the-as uint 13)) + (set! (-> s5-0 behavior) (the-as uint 0)) + (set! (-> s5-0 id) (the-as uint 0)) + (set! (-> s5-0 proc) #f) + (send-event gp-0 'spawn-object s5-0) + ) + (set! (-> self max-count) (-> *city-port-run-cargo-info* length)) + (set! (-> self count) (-> self max-count)) + (set! (-> *game-info* counter) (the float (-> self max-count))) + (dotimes (v1-17 (-> *city-port-run-mine-info* length)) + (set! (-> *city-port-run-mine-info* v1-17 handle) (the-as handle #f)) + ) + (set! (-> self minimap 0) #f) + (dotimes (v1-20 (-> self max-count)) + (set! (-> self data-int32 v1-20) 0) + (set! (-> self slave v1-20) (the-as handle #f)) + ) + (set! (-> self data-int32 20) 0) + (set! (-> self data-int32 21) 0) + (set! (-> self data-int32 22) 0) + 0 + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 120 + 1 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *traffic-manager* 'restore-default-settings) + (dotimes (v1-3 (-> *city-port-run-mine-info* length)) + (set! (-> *city-port-run-mine-info* v1-3 handle) (the-as handle #f)) + ) + (set! (-> self minimap 0) #f) + (dotimes (v1-6 (-> self max-count)) + (set! (-> self data-int32 v1-6) 0) + (set! (-> self slave v1-6) (the-as handle #f)) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 120 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (when (task-node-open? (game-task-node city-port-run-resolution)) + (check-time self) + (cond + ((= (level-status *level* 'ctyport) 'active) + (when (zero? (-> self data-int32 21)) + (set! (-> self data-int32 21) 1) + (dotimes (gp-1 (-> *city-port-run-mine-info* length)) + (let ((a1-1 (-> *city-port-run-mine-info* gp-1))) + (if (or (zero? (-> a1-1 handle)) (not (handle->process (-> a1-1 handle)))) + (ctyport-mine-spawn self a1-1) + ) + ) + ) + ) + ) + (else + (dotimes (gp-2 (-> *city-port-run-mine-info* length)) + (let ((s5-0 (-> *city-port-run-mine-info* gp-2))) + (when (and (nonzero? (-> s5-0 handle)) (handle->process (-> s5-0 handle))) + (deactivate (-> s5-0 handle process 0)) + (set! (-> s5-0 handle) (the-as handle #f)) + ) + ) + ) + ) + ) + (cond + ((zero? (-> self data-int32 20)) + (cond + ((= (level-status *level* 'ctyport) 'active) + (let ((gp-4 (get-nav-mesh (the-as actor-id #x65e1)))) + (dotimes (s5-1 (-> self max-count)) + (cond + ((zero? (-> self data-int32 s5-1)) + (when (not (-> self slave s5-1)) + (let ((a0-18 (ctyport-cargo-spawn self (-> *city-port-run-cargo-info* s5-1 pos) gp-4))) + (if a0-18 + (set! (-> self slave s5-1) (process->handle a0-18)) + ) + ) + ) + ) + (else + (set! (-> self slave s5-1) (the-as handle #f)) + ) + ) + ) + ) + (set! (-> self count) 0) + (dotimes (v1-61 (-> self max-count)) + (if (or (not (-> self slave v1-61)) (handle->process (-> self slave v1-61))) + (+! (-> self count) 1) + (set! (-> self data-int32 v1-61) 1) + ) + ) + (when (-> self minimap 0) + (logior! (-> self minimap 0 flags) (minimap-flag fade-out)) + (set! (-> self minimap 0) #f) + ) + ) + (else + (dotimes (gp-5 (-> self max-count)) + (when (-> self slave gp-5) + (deactivate (-> self slave gp-5 process 0)) + (set! (-> self slave gp-5) (the-as handle #f)) + ) + ) + (set! (-> self data-int32 21) 0) + (if (not (-> self minimap 0)) + (set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 15) (the-as int #f) *city-port-position* 0)) + ) + ) + ) + ) + (else + (set! (-> self count) 0) + (dotimes (v1-90 (-> self max-count)) + (if (handle->process (-> self slave v1-90)) + (+! (-> self count) 1) + (set! (-> self data-int32 v1-90) 1) + ) + ) + ) + ) + (let ((v1-93 0)) + (dotimes (a0-48 (-> *city-port-run-mine-info* length)) + (let ((a1-21 (-> *city-port-run-mine-info* a0-48))) + (if (and (nonzero? (-> a1-21 handle)) (handle->process (-> a1-21 handle))) + (+! v1-93 1) + ) + ) + ) + ) + (cond + ((and (= (-> self count) (-> self max-count)) (zero? (-> self data-int32 22))) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + ((and (or (and (zero? (-> self data-int32 20)) (= (-> self count) (+ (-> self max-count) -1))) + (= (-> self data-int32 22) 1) + ) + (task-node-open? (game-task-node city-port-run-resolution)) + ) + (set-setting! 'exclusive-task #f 0 (-> self node-info task)) + (set! (-> self data-int32 20) 1) + (+! (-> self data-int32 22) 1) + (set! (-> self time-limit) (seconds 135)) + (set! (-> self start-time) (-> self clock frame-counter)) + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-cargo :init hud-init-by-other :to self))) + ) + ) + (set! (-> *game-info* counter) (the float (-> self count))) + (when (= (-> self data-int32 20) 1) + (let ((v1-130 (level-get *level* 'ctyport))) + (when (or (not v1-130) (!= (-> v1-130 display?) 'display)) + (backup-load-state-and-set-cmds *load-state* '()) + (eval! + (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) + '(want-display 'ctyport 'display) + ) + (restore-load-state-and-cleanup *load-state*) + (go-virtual fail) + ) + ) + ) + ) + (when (zero? (-> self count)) + (cond + ((not (task-node-closed? (game-task-node city-port-run-resolution))) + (talker-spawn-func (-> *talker-speech* 94) *entity-pool* (target-pos 0) (the-as region #f)) + (task-node-close! (game-task-node city-port-run-resolution)) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + (send-event (handle->process (-> self hud-counter)) 'hide-and-die) + (set! (-> self fail-on-death?) #f) + (dotimes (gp-8 (-> *city-port-run-mine-info* length)) + (let ((v1-161 (-> *city-port-run-mine-info* gp-8))) + (if (handle->process (-> v1-161 handle)) + (send-event (handle->process (-> v1-161 handle)) 'fall) + ) + ) + ) + ) + (else + (let ((v1-168 0)) + (dotimes (a0-96 (-> *city-port-run-mine-info* length)) + (if (handle->process (-> *city-port-run-mine-info* a0-96 handle)) + (+! v1-168 1) + ) + ) + (if (zero? v1-168) + (go-virtual complete) + ) + ) + ) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! *game-info* 120 6 (the-as (function object) (lambda :behavior task-manager + ((arg0 object) (arg1 object) (arg2 symbol)) + (case arg2 + (('mine-dead) + (format #t "mine-dead~%") + (+! (-> self data-int32 22) 1) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 120 + 3 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *traffic-manager* 'set-target-level #x3f800000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (send-event *traffic-manager* 'set-alert-level 1) + (send-event *traffic-manager* 'set-alert-duration #xa4cb80) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 120 + 5 + (the-as + (function object) + (lambda :behavior task-manager + () + (when (< (- (-> self time-limit) (- (-> self clock frame-counter) (-> self start-time))) 0) + (let ((gp-0 #f)) + (dotimes (s5-0 (-> self max-count)) + (when (zero? (-> self data-int32 s5-0)) + (when (-> self slave s5-0) + (let* ((s3-0 (handle->process (-> self slave s5-0))) + (s4-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when (not gp-0) + (set! gp-0 #t) + (send-event s4-0 'focus-camera) + ) + (send-event s4-0 'spy) + ) + ) + ) + ) + ) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 2)) + (suspend) + ) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 120 + 4 + (the-as (function object) (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (suspend) + ) + (task-node-close! (game-task-node city-port-run-post-win)) + (none) + ) + ) + ) diff --git a/test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc new file mode 100644 index 000000000..a94c8a382 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc @@ -0,0 +1,383 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type com-elevator +(deftype com-elevator (elevator) + ((camera-startup vector 2 :inline :offset-assert 368) + (use-camera-startup? symbol 2 :offset-assert 400) + (sound-id sound-id :offset-assert 408) + ) + :heap-base #x120 + :method-count-assert 50 + :size-assert #x19c + :flag-assert #x320120019c + (:methods + (com-elevator-method-49 (_type_ symbol) none 49) + ) + ) + +;; definition for method 3 of type com-elevator +(defmethod inspect com-elevator ((obj com-elevator)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type elevator inspect))) + (t9-0 obj) + ) + (format #t "~2Tcamera-startup[2] @ #x~X~%" (-> obj camera-startup)) + (format #t "~2Tuse-camera-startup?[2] @ #x~X~%" (-> obj use-camera-startup?)) + (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-com-elevator com-elevator com-elevator-lod0-jg com-elevator-idle-ja + ((com-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 5.6 9.2) + ) + +;; definition for method 30 of type com-elevator +(defmethod get-art-group com-elevator ((obj com-elevator)) + "@returns The associated [[art-group]]" + (art-group-get-by-name *level* "skel-com-elevator" (the-as (pointer uint32) #f)) + ) + +;; definition for method 43 of type com-elevator +(defmethod move-between-points com-elevator ((obj com-elevator) (arg0 vector) (arg1 float) (arg2 float)) + "Move between two points on the elevator's path +@param vec TODO not sure +@param point-a The first point fetched from the elevator's path +@param point-b The second point fetched from the path +@see [[path-control]] and [[elevator]]" + (let ((s4-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg1 'interp)) + (a0-3 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg2 'interp)) + (v1-3 (-> obj root-override trans)) + ) + (when (and (< (-> a0-3 y) (-> s4-0 y)) (< (-> arg0 y) (+ -8192.0 (-> v1-3 y)))) + (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) arg0 v1-3))) + (vector-inv-orient-by-quat! s4-2 s4-2 (-> obj root-override quat)) + (and (< (fabs (-> s4-2 x)) 24576.0) (< 0.0 (-> s4-2 z)) (< (-> s4-2 z) 49152.0)) + ) + ) + ) + ) + +;; definition for method 45 of type com-elevator +(defmethod commited-to-ride? com-elevator ((obj com-elevator)) + "@returns if the target is considered within the elevator area enough to begin descending/ascending" + (with-pp + (let* ((s5-0 *target*) + (a0-2 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (and (when a0-2 + (let* ((v1-2 (get-trans a0-2 0)) + (s5-2 (vector-! (new 'stack-no-clear 'vector) v1-2 (-> obj root-override trans))) + ) + (vector-inv-orient-by-quat! s5-2 s5-2 (-> obj root-override quat)) + (and (< (fabs (-> s5-2 x)) 20480.0) (< 0.0 (-> s5-2 z)) (< (-> s5-2 z) 40960.0)) + ) + ) + (let ((gp-1 (res-lump-struct (-> obj entity) 'on-notice structure))) + (not (if gp-1 + (eval! + (new 'stack 'script-context (the-as basic (process->ppointer pp)) pp (the-as vector #f)) + (the-as pair gp-1) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 49 of type com-elevator +;; WARN: Return type mismatch int vs none. +(defmethod com-elevator-method-49 com-elevator ((obj com-elevator) (arg0 symbol)) + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> obj root-override root-prim)) child 1))) + (cond + (arg0 + (set! (-> v1-3 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-3 prim-core collide-with) (collide-spec jak player-list)) + ) + (else + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + 0 + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate dormant (com-elevator) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (the-as state (find-parent-method com-elevator 34)) enter))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate running (com-elevator) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type elevator running) enter))) + (if t9-0 + (t9-0) + ) + ) + (com-elevator-method-49 self #t) + (if (not (logtest? (-> self elevator-status) (elevator-status moving))) + (set-setting! 'allow-look-around #f 0 0) + ) + (none) + ) + :exit (behavior () + (sound-stop (-> self sound-id)) + (sound-play "com-elevator-e") + (let ((t9-3 (-> (method-of-type elevator running) exit))) + (if t9-3 + (t9-3) + ) + ) + (com-elevator-method-49 self #f) + (remove-setting! 'allow-look-around) + (none) + ) + :code (behavior () + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 1)) + (suspend) + ) + ) + (sound-play "com-elevator-s") + (logior! (-> self elevator-status) (elevator-status waiting-to-ascend)) + (until #f + (suspend) + (sound-play "com-elevator-lp" :id (-> self sound-id)) + (when (= (-> self path-pos) 1.0) + (let ((v1-11 (the int (-> self move-pos 1)))) + (if (-> self use-camera-startup? v1-11) + (persist-with-delay + *setting-control* + 'string-startup-vector + (seconds 0.05) + 'string-startup-vector + 'abs + (the-as float (-> self camera-startup v1-11)) + 0 + ) + ) + ) + (logclear! (-> self elevator-status) (elevator-status waiting-to-ascend)) + ) + ) + #f + (none) + ) + ) + +;; definition for method 40 of type com-elevator +;; WARN: Return type mismatch object vs none. +(defmethod activate-elevator com-elevator ((obj com-elevator)) + "Puts the elevator initially into the correct state. This is typically based upon game completion" + (cond + ((logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object obj dormant)) + ) + ((logtest? (-> obj params flags) (elevator-flags elevator-flags-6)) + (go (method-of-object obj arrived)) + ) + (else + (go (method-of-object obj waiting)) + ) + ) + (none) + ) + +;; definition for method 10 of type com-elevator +(defmethod deactivate com-elevator ((obj com-elevator)) + (sound-stop (-> obj sound-id)) + ((the-as (function elevator none) (find-parent-method com-elevator 10)) obj) + (none) + ) + +;; definition for method 33 of type com-elevator +;; WARN: Return type mismatch sound-id vs none. +(defmethod init-plat! com-elevator ((obj com-elevator)) + "Does any necessary initial platform setup. +For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." + (dotimes (s5-0 (-> obj path curve num-cverts)) + (let ((a1-1 (res-lump-struct (-> obj entity) 'string-startup-vector structure :time (the float s5-0)))) + (cond + (a1-1 + (vector-normalize-copy! (-> obj camera-startup s5-0) (the-as vector a1-1) 1.0) + (set! (-> obj use-camera-startup? s5-0) #t) + ) + (else + (set! (-> obj use-camera-startup? s5-0) #f) + ) + ) + ) + ) + (set! (-> obj sound-id) (new-sound-id)) + (none) + ) + +;; definition for method 31 of type com-elevator +(defmethod init-plat-collision! com-elevator ((obj com-elevator)) + "TODO - collision stuff for setting up the platform" + (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) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 22937.6 37683.2) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 22937.6 37683.2) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 3) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 22937.6 39321.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-20 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (com-elevator-method-49 obj #f) + (none) + ) + +;; definition of type tomb-trans-elevator +(deftype tomb-trans-elevator (com-elevator) + ((unknown-gijh1bn2i3hb1 int32 :offset-assert 412) + ) + :heap-base #x120 + :method-count-assert 50 + :size-assert #x1a0 + :flag-assert #x32012001a0 + ) + +;; definition for method 3 of type tomb-trans-elevator +(defmethod inspect tomb-trans-elevator ((obj tomb-trans-elevator)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-elevator inspect))) + (t9-0 obj) + ) + (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defstate running (tomb-trans-elevator) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type com-elevator running) enter))) + (if t9-0 + (t9-0) + ) + ) + (if (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) + (set-setting! 'jump #f 0 0) + ) + (none) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type com-elevator running) exit))) + (if t9-0 + (t9-0) + ) + ) + (sound-stop (-> self sound-id)) + (sound-play "tmb-elev-stop") + (if (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) + (remove-setting! 'jump) + ) + (none) + ) + :code (behavior () + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 1)) + (suspend) + ) + ) + (logior! (-> self elevator-status) (elevator-status waiting-to-ascend)) + (until #f + (sound-play "tmb-elevator-lp" :id (-> self sound-id)) + (suspend) + (when (= (-> self path-pos) 1.0) + (let ((v1-10 (the int (-> self move-pos 1)))) + (if (-> self use-camera-startup? v1-10) + (persist-with-delay + *setting-control* + 'string-startup-vector + (seconds 0.05) + 'string-startup-vector + 'abs + (the-as float (-> self camera-startup v1-10)) + 0 + ) + ) + ) + (logclear! (-> self elevator-status) (elevator-status waiting-to-ascend)) + ) + ) + #f + (none) + ) + ) + +;; definition for method 10 of type tomb-trans-elevator +(defmethod deactivate tomb-trans-elevator ((obj tomb-trans-elevator)) + (sound-stop (-> obj sound-id)) + ((the-as (function com-elevator none) (find-parent-method tomb-trans-elevator 10)) obj) + (none) + ) + +;; definition for method 33 of type tomb-trans-elevator +;; WARN: Return type mismatch sound-id vs none. +(defmethod init-plat! tomb-trans-elevator ((obj tomb-trans-elevator)) + "Does any necessary initial platform setup. +For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." + ((the-as (function com-elevator none) (find-parent-method tomb-trans-elevator 33)) obj) + (set! (-> obj sound-id) (new-sound-id)) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc index 369472778..71014d6d6 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc @@ -87,15 +87,15 @@ ;; definition for symbol *dig-sinking-platform-constants*, type rigid-body-object-constants (define *dig-sinking-platform-constants* (new 'static 'rigid-body-object-constants - :mass 4.0 - :inv-mass 0.25 - :cm-joint (new 'static 'vector :y -8192.0 :w 1.0) - :linear-damping 0.9 - :angular-damping 0.48 - :friction-factor 0.1 - :inertial-tensor-x (meters 6) - :inertial-tensor-y (meters 4) - :inertial-tensor-z (meters 6) + :info (new 'static 'rigid-body-info + :mass 4.0 + :inv-mass 0.25 + :linear-damping 0.9 + :angular-damping 0.48 + :friction-factor 0.1 + :cm-offset-joint (new 'static 'vector :y -8192.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 6) (meters 4) (meters 6)) + ) :max-time-step 0.02 :gravity (meters 80) :idle-distance (meters 200) diff --git a/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc index 010d346dd..dea7d644e 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc @@ -436,24 +436,25 @@ ) ;; definition for symbol *dig-bomb-crate-cylinder-constants*, type rigid-body-object-constants -(define *dig-bomb-crate-cylinder-constants* (new 'static 'rigid-body-object-constants - :mass 1.0 - :inv-mass 1.0 - :cm-joint (new 'static 'vector :w 1.0) - :linear-damping 0.99 - :angular-damping 0.9 - :bounce-factor 0.5 - :friction-factor 0.1 - :inertial-tensor-x (meters 1) - :inertial-tensor-y (meters 3) - :inertial-tensor-z (meters 1) - :max-time-step 0.02 - :gravity (meters 80) - :idle-distance (meters 200) - :attack-force-scale 2.0 - :name '*dig-bomb-crate-cylinder-constants* - ) - ) +(define *dig-bomb-crate-cylinder-constants* + (new 'static 'rigid-body-object-constants + :info (new 'static 'rigid-body-info + :mass 1.0 + :inv-mass 1.0 + :linear-damping 0.99 + :angular-damping 0.9 + :bounce-factor 0.5 + :friction-factor 0.1 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 1) (meters 3) (meters 1)) + ) + :max-time-step 0.02 + :gravity (meters 80) + :idle-distance (meters 200) + :attack-force-scale 2.0 + :name '*dig-bomb-crate-cylinder-constants* + ) + ) ;; failed to figure out what this is: (defstate idle (dig-bomb-crate-cylinder) @@ -725,9 +726,9 @@ (defmethod rigid-body-object-method-45 dig-bomb-crate-cylinder ((obj dig-bomb-crate-cylinder) (arg0 rigid-body-impact)) (let* ((f0-0 (-> arg0 impulse)) (f1-0 28672.0) - (f30-0 (* f0-0 (/ 1.0 f1-0) (-> obj info inv-mass))) + (f30-0 (* f0-0 (/ 1.0 f1-0) (-> obj info info inv-mass))) ) - (if (< (* 28672.0 (-> obj info mass)) (-> arg0 impulse)) + (if (< (* 28672.0 (-> obj info info mass)) (-> arg0 impulse)) (sound-play-by-name (static-sound-name "barrel-bomb-hit") (new-sound-id) @@ -859,8 +860,8 @@ (quaternion-copy! (-> self root-override-2 quat) (-> arg0 quat)) (rigid-body-object-method-33 self) (set! (-> self mask) (logior (process-mask platform) (-> self mask))) - (vector-float*! (-> self rbody state lin-momentum) (-> arg0 vel) (-> self info mass)) - (vector-float*! (-> self rbody state ang-momentum) (-> arg0 avel) (-> self info mass)) + (vector-float*! (-> self rbody state lin-momentum) (-> arg0 vel) (-> self info info mass)) + (vector-float*! (-> self rbody state ang-momentum) (-> arg0 avel) (-> self info info mass)) (go-virtual idle) (none) ) diff --git a/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc index a2e9116e3..1dfaf239d 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc @@ -1502,15 +1502,15 @@ This commonly includes things such as: ;; definition for symbol *dig-tipping-rock-constants*, type rigid-body-platform-constants (define *dig-tipping-rock-constants* (new 'static 'rigid-body-platform-constants - :mass 4.0 - :inv-mass 0.25 - :cm-joint (new 'static 'vector :z -24576.0 :w 1.0) - :linear-damping 0.9 - :angular-damping 0.48 - :friction-factor 0.1 - :inertial-tensor-x (meters 4) - :inertial-tensor-y (meters 3) - :inertial-tensor-z (meters 21) + :info (new 'static 'rigid-body-info + :mass 4.0 + :inv-mass 0.25 + :linear-damping 0.9 + :angular-damping 0.48 + :friction-factor 0.1 + :cm-offset-joint (new 'static 'vector :z -24576.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 4) (meters 3) (meters 21)) + ) :max-time-step 0.02 :gravity (meters 80) :idle-distance (meters 50) @@ -1823,16 +1823,16 @@ This commonly includes things such as: ;; definition for symbol *dig-stomp-block-constants*, type rigid-body-object-constants (define *dig-stomp-block-constants* (new 'static 'rigid-body-object-constants - :mass 1.0 - :inv-mass 1.0 - :cm-joint (new 'static 'vector :w 1.0) - :linear-damping 0.99 - :angular-damping 0.9 - :bounce-factor 0.5 - :friction-factor 0.1 - :inertial-tensor-x (meters 1) - :inertial-tensor-y (meters 3) - :inertial-tensor-z (meters 1) + :info (new 'static 'rigid-body-info + :mass 1.0 + :inv-mass 1.0 + :linear-damping 0.99 + :angular-damping 0.9 + :bounce-factor 0.5 + :friction-factor 0.1 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 1) (meters 3) (meters 1)) + ) :max-time-step 0.02 :gravity (meters 80) :idle-distance (meters 200) @@ -1919,11 +1919,11 @@ This commonly includes things such as: (set! (-> s5-0 x) (rand-vu-float-range -40960.0 40960.0)) (set! (-> s5-0 y) (rand-vu-float-range -40960.0 0.0)) (set! (-> s5-0 z) (rand-vu-float-range -40960.0 40960.0)) - (vector-float*! (-> self rbody state lin-momentum) s5-0 (-> self info mass)) + (vector-float*! (-> self rbody state lin-momentum) s5-0 (-> self info info mass)) (set! (-> gp-0 x) (rand-vu-float-range -10000.0 10000.0)) (set! (-> gp-0 y) (rand-vu-float-range -10000.0 10000.0)) (set! (-> gp-0 z) (rand-vu-float-range -10000.0 10000.0)) - (vector-float*! (-> self rbody state ang-momentum) gp-0 (-> self info mass)) + (vector-float*! (-> self rbody state ang-momentum) gp-0 (-> self info info mass)) ) (none) ) diff --git a/test/decompiler/reference/jak2/levels/outro/outro-scenes_REF.gc b/test/decompiler/reference/jak2/levels/outro/outro-scenes_REF.gc new file mode 100644 index 000000000..4a9db24a2 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/outro/outro-scenes_REF.gc @@ -0,0 +1,1809 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol death-precursor, type death-info +(define death-precursor + (new 'static 'death-info :vertex-skip #x8 :timer #xe0 :overlap #xff :effect #x1539 :sound 'temp-enemy-die) + ) + +;; definition for function start-precursor-effect +;; WARN: Return type mismatch int vs none. +(defun start-precursor-effect ((arg0 manipy)) + (let ((v1-0 (-> arg0 draw)) + (a1-0 death-precursor) + ) + (set! (-> v1-0 death-vertex-skip) (-> a1-0 vertex-skip)) + (set! (-> v1-0 death-effect) (-> a1-0 effect)) + (set! (-> v1-0 death-timer) (+ (-> a1-0 timer) 1)) + (set! (-> v1-0 death-timer-org) (-> v1-0 death-timer)) + (set! (-> v1-0 death-draw-overlap) (-> a1-0 overlap)) + ) + (send-event + arg0 + 'trans-hook + (lambda :behavior scene-player + () + (set! (-> self draw death-timer) (the-as uint 200)) + (set! (-> self draw death-vertex-skip) (the-as uint (the int (rand-vu-float-range 8.0 24.0)))) + (none) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 5433 + :init-specs ((sp-flt spt-scale-x (meters 0.08)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 196.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 64.0) + (sp-rnd-flt spt-accel-y 0.0 2.7306666 1.0) + (sp-int-plain-rnd spt-timer 5 99 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-texture-glow-soft) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 5434) + ) + ) + +;; failed to figure out what this is: +(defpart 5434 + :init-specs ((sp-flt spt-r 64.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 64.0) + (sp-flt spt-scalevel-x (meters -0.0008)) + (sp-rnd-flt spt-scalevel-y (meters 0) (meters 0.0026666666) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-precursor-entity + :id 1276 + :duration (seconds 0.017) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 5435 :flags (bit6))) + ) + +;; failed to figure out what this is: +(defpart 5435 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2)) + (sp-flt spt-rot-x 819.2) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 8.0 2.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-crocadog crocadog 0 -1 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-brutter-balloon-norift brutter-balloon-norift brutter-balloon-norift-lod0-jg -1 + ((brutter-balloon-norift-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 23) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-metalkor-chopped metalkor-chopped metalkor-chopped-lod0-jg metalkor-chopped-idle-ja + ((metalkor-chopped-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 2 8) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-rift-break-ring rift-break-ring rift-break-ring-lod0-jg -1 + ((rift-break-ring-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100) + :origin-joint-index 4 + ) + +;; failed to figure out what this is: +(defskelgroup skel-kid-medallion kid-medallion kid-medallion-lod0-jg kid-medallion-idle-ja + ((kid-medallion-lod0-mg (meters 200))) + :bounds (static-spherem 0 0 0 1) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-precursor precursor precursor-lod0-jg -1 + ((precursor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.2) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-rift-ring + :id 1277 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :flags (unk-6) + :bounds (static-bspherem 0 0 0 128) + :rotate ((degrees 4) (degrees 0) (degrees 0)) + :parts ((sp-item 5436 :flags (is-3d bit6 bit7)) + (sp-item 5437 :flags (bit7)) + (sp-item 5438 :flags (bit6)) + (sp-item 5439 :flags (bit6)) + (sp-item 5440 :flags (bit7)) + ) + ) + +;; failed to figure out what this is: +(defpart 5440 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-flt spt-x (meters 30)) + (sp-flt spt-y (meters 10)) + (sp-rnd-flt spt-scale-x (meters 0.25) (meters 0.25) 1.0) + (sp-int spt-rot-x 4) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 64.0) + (sp-rnd-flt spt-omega 4.096 4.096 1.0) + (sp-flt spt-vel-x (meters -0.36666667)) + (sp-flt spt-vel-y (meters -0.123333335)) + (sp-flt spt-fade-r 0.32) + (sp-flt spt-fade-g 0.64) + (sp-flt spt-fade-b 0.0) + (sp-flt spt-fade-a 0.32) + (sp-flt spt-friction 0.95) + (sp-int spt-timer 200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5438 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 5)) + (sp-flt spt-rot-x 8192.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 48.0 32.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 5439 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 48)) + (sp-flt spt-rot-x 8192.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 48.0 4.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 65536.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5436 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.0 0.1 1.0) + (sp-flt spt-z (meters 0.2)) + (sp-rnd-flt spt-scale-x (meters 2) (meters 24) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 196.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 196.0) + (sp-flt spt-a 0.0) + (sp-rnd-flt spt-fade-a 0.4 0.4 1.0) + (sp-int spt-timer 320) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat) + (sp-int spt-next-time 80) + (sp-launcher-by-id spt-next-launcher 5441) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5441 + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 160) (sp-launcher-by-id spt-next-launcher 5442)) + ) + +;; failed to figure out what this is: +(defpart 5442 + :init-specs ((sp-flt spt-fade-a -0.8)) + ) + +;; failed to figure out what this is: +(defpart 5437 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 16.0) + (sp-flt spt-x (meters 12)) + (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 196.0 1.0) + (sp-flt spt-g 0.0) + (sp-rnd-flt spt-b 128.0 128.0 1.0) + (sp-rnd-flt spt-a 16.0 16.0 1.0) + (sp-rnd-flt spt-omega 8.192 8.192 1.0) + (sp-flt spt-vel-x (meters -0.10666667)) + (sp-rnd-flt spt-fade-r -0.42666668 0.6533333 1.0) + (sp-flt spt-fade-g 0.42666668) + (sp-rnd-flt spt-fade-b 0.0 -0.21333334 1.0) + (sp-flt spt-friction 0.96) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-magic-birth + :id 1278 + :linger-duration (seconds 0.5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 5443 :flags (launch-asap bit6))) + ) + +;; failed to figure out what this is: +(defpart 5443 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0)) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 196.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 196.0) + (sp-flt spt-a 96.0) + (sp-flt spt-omega 821248.0) + (sp-flt spt-scalevel-x (meters 0.004)) + (sp-flt spt-rotvel-z (degrees -0.5625)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-timer 80) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 8192.0) + (sp-func spt-func 'sparticle-track-root) + (sp-int spt-next-time 25) + (sp-launcher-by-id spt-next-launcher 5444) + ) + ) + +;; failed to figure out what this is: +(defpart 5444 + :init-specs ((sp-flt spt-scalevel-x (meters -0.0009090909)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -1.7454545) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-magic-birth2 + :id 1279 + :linger-duration (seconds 0.5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 5445 :flags (launch-asap bit6))) + ) + +;; failed to figure out what this is: +(defpart 5445 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0)) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 196.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 196.0) + (sp-flt spt-a 96.0) + (sp-flt spt-omega 821248.0) + (sp-flt spt-scalevel-x (meters 0.005)) + (sp-flt spt-rotvel-z (degrees -0.75000006)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-timer 60) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 8192.0) + (sp-func spt-func 'sparticle-track-root) + (sp-int spt-next-time 20) + (sp-launcher-by-id spt-next-launcher 5446) + ) + ) + +;; failed to figure out what this is: +(defpart 5446 + :init-specs ((sp-flt spt-scalevel-x (meters -0.00125)) (sp-copy-from-other spt-scalevel-y -4) (sp-flt spt-fade-a -2.4)) + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-onin-finger-blast + :id 1280 + :duration (seconds 0.167) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5447) (sp-item 5448) (sp-item 5449 :flags (launch-asap bit6))) + ) + +;; failed to figure out what this is: +(defpart 5449 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-flt spt-rot-x 204.8) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-r -12.75) + (sp-flt spt-fade-g -3.1875) + (sp-flt spt-fade-a -1.25) + (sp-int spt-timer 80) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5447 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 64.0) + (sp-rnd-flt spt-scale-x (meters 0.03) (meters 0.01) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 64.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.06666667) 1.0) + (sp-flt spt-scalevel-x (meters -0.0002)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.85333335) + (sp-flt spt-fade-g -0.85333335) + (sp-rnd-flt spt-accel-y 0.0 -0.34133333 1.0) + (sp-rnd-flt spt-friction 0.9 0.01 1.0) + (sp-int-plain-rnd spt-timer 300 599 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int-plain-rnd spt-next-time 0 149 1) + (sp-launcher-by-id spt-next-launcher 5450) + (sp-rnd-flt spt-conerot-x (degrees 82.0) (degrees 10.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees -10.0) (degrees 10.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5448 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x66 :page #x3e6)) + (sp-flt spt-num 16.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.05) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 8.0 4.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.06666667) 1.0) + (sp-flt spt-scalevel-x (meters 0.00016666666)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.008888889 -0.008888889 1.0) + (sp-rnd-flt spt-accel-y 0.0 -0.06826667 1.0) + (sp-rnd-flt spt-friction 0.9 0.01 1.0) + (sp-int spt-timer 900) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-rnd-flt spt-conerot-x (degrees 82.0) (degrees 10.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees -10.0) (degrees 10.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-onin-finger-effect + :id 1281 + :duration (seconds 0.15) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5451 :falloff-to (meters 20)) (sp-item 5452 :falloff-to (meters 20))) + ) + +;; failed to figure out what this is: +(defpart 5451 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-rnd-flt spt-num 0.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.03) (meters 0.02) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 64.0) + (sp-flt spt-scalevel-x (meters -0.00013333333)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.85333335) + (sp-flt spt-fade-g -0.85333335) + (sp-rnd-flt spt-accel-y 0.0 -0.06826667 1.0) + (sp-int-plain-rnd spt-timer 300 899 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int-plain-rnd spt-next-time 0 149 1) + (sp-launcher-by-id spt-next-launcher 5450) + ) + ) + +;; failed to figure out what this is: +(defpart 5450 + :init-specs ((sp-rnd-flt spt-scale-x (meters 0.01) (meters 0.02) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 255.0) + (sp-flt spt-scalevel-x (meters 0)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g 0.0) + (sp-int spt-next-time 5) + (sp-launcher-by-id spt-next-launcher 5453) + ) + ) + +;; failed to figure out what this is: +(defpart 5453 + :init-specs ((sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 64.0) + (sp-int-plain-rnd spt-next-time 0 449 1) + (sp-launcher-by-id spt-next-launcher 5450) + ) + ) + +;; failed to figure out what this is: +(defpart 5452 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x66 :page #x3e6)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 8.0 8.0 1.0) + (sp-flt spt-scalevel-x (meters 0.00033333333)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.026666667 -0.026666667 1.0) + (sp-int-plain-rnd spt-timer 150 449 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-precursor-stone-glow + :id 1282 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 5454 :flags (bit6))) + ) + +;; failed to figure out what this is: +(defpart 5454 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 3.5)) + (sp-flt spt-rot-x 8192.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 16.0) + (sp-flt spt-g 192.0) + (sp-flt spt-b 16.0) + (sp-flt spt-a 24.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags glow) + (sp-flt spt-userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-port-feathers-n-fur-impact + :id 1283 + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 5455 :flags (bit7)) (sp-item 5456 :flags (bit7))) + ) + +;; failed to figure out what this is: +(defpart 5455 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xdd8)) + (sp-func spt-birth-func 'birth-func-pecker-feather-color) + (sp-flt spt-num 3.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.125) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 86.0) + (sp-rnd-flt spt-vel-x (meters -0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-vel-y (meters 0.05) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-vel-z (meters 0.05) (meters 0.01) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -2.4) (degrees 4.8) 1.0) + (sp-rnd-flt spt-accel-y -1.3653333 -1.3653333 1.0) + (sp-rnd-flt spt-friction 0.82 0.07 1.0) + (sp-int spt-timer 800) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-conerot-x (degrees -25.000002) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-z (degrees -25.000002) (degrees 50.000004) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5456 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 25.0) + (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.015) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.0025) (meters 0.015) 1.0) + (sp-flt spt-r 242.0) + (sp-rnd-flt spt-g 64.0 32.0 1.0) + (sp-flt spt-b 20.0) + (sp-flt spt-a 255.0) + (sp-rnd-flt spt-vel-x (meters -0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.008333334) 1.0) + (sp-rnd-flt spt-vel-z (meters 0.05) (meters 0.01) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -2.4) (degrees 4.8) 1.0) + (sp-rnd-flt spt-accel-y -1.3653333 -1.3653333 1.0) + (sp-rnd-flt spt-friction 0.82 0.07 1.0) + (sp-int spt-timer 800) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-conerot-x (degrees -25.000002) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-z (degrees -25.000002) (degrees 50.000004) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-port-feathers-n-fur + :id 1284 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 5457) (sp-item 5458)) + ) + +;; failed to figure out what this is: +(defpart 5457 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xdd8)) + (sp-func spt-birth-func 'birth-func-pecker-feather-color) + (sp-flt spt-num 0.15) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.125) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 86.0) + (sp-rnd-flt spt-vel-x (meters -0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.006666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -2.4) (degrees 4.8) 1.0) + (sp-rnd-flt spt-accel-y -1.3653333 -1.3653333 1.0) + (sp-rnd-flt spt-friction 0.82 0.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-conerot-x (degrees -25.000002) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-z (degrees -25.000002) (degrees 50.000004) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5458 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 2.5) + (sp-rnd-flt spt-scale-x (meters 0.15) (meters 0.015) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.0025) (meters 0.015) 1.0) + (sp-flt spt-r 242.0) + (sp-rnd-flt spt-g 64.0 32.0 1.0) + (sp-flt spt-b 20.0) + (sp-flt spt-a 255.0) + (sp-rnd-flt spt-vel-x (meters -0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-vel-y (meters 0.05) (meters 0.016666668) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -2.4) (degrees 4.8) 1.0) + (sp-rnd-flt spt-accel-y -1.3653333 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.82 0.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-int spt-next-time 150) + (sp-launcher-by-id spt-next-launcher 5459) + (sp-rnd-flt spt-conerot-x (degrees -25.000002) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-z (degrees -25.000002) (degrees 50.000004) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5459 + :init-specs ((sp-flt spt-vel-y (meters 0)) (sp-flt spt-friction 1.0)) + ) + +;; definition for function birth-func-pecker-feather-color +;; WARN: Return type mismatch int vs none. +(defun birth-func-pecker-feather-color ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((v1-0 (rand-vu-int-count 3))) + (cond + ((zero? v1-0) + (set! (-> arg2 rotate-x) 179.0) + (set! (-> arg2 rotate-y) 49.0) + (set! (-> arg2 rotate-z) 41.0) + ) + ((= v1-0 1) + (set! (-> arg2 rotate-x) 252.0) + (set! (-> arg2 rotate-y) 161.0) + (set! (-> arg2 rotate-z) 12.0) + ) + ((= v1-0 2) + (set! (-> arg2 rotate-x) 29.0) + (set! (-> arg2 rotate-y) 60.0) + (set! (-> arg2 rotate-z) 108.0) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(scene-method-16 + (new 'static 'scene + :name "outro-nest" + :extra #f + :info #f + :mask-to-clear #x1282000 + :entity "scene-stage-91" + :art-group "scenecamera" + :anim "outro-nest" + :parts 50 + :command-list '((0 + (task-close! "nest-boss-resolution") + (task-close! "city-win-introduction") + (kill "rift-ring-ingame-1") + (kill "crate-942") + (kill "crate-943") + (kill "crate-944") + (kill "crate-945") + (kill "crate-946") + (kill "crate-947") + (kill "crate-948") + (kill "crate-949") + (fadein (frame-time-30 (new 'static 'bfloat :data 10.0))) + (apply + ,(lambda () + (set! (-> palout memory-mode) (load-buffer-mode borrow)) + (set! (-> hiphog memory-mode) (load-buffer-mode small-center)) + (none) + ) + ) + (send-event "darkjak-highres" 'trans-hook ,(lambda () (set-darkjak-highres-nest-texture-morph! 0.0) (none))) + (part-tracker + "group-outro-rift-ring" + entity + "rift-break-ring" + joint + "gate" + track + #t + duration + (frame-range 0 2795) + ) + (part-tracker + "group-outro-precursor-stone-glow" + entity + "precursor-stone" + joint + "main" + track + #t + duration + (frame-range 0 275) + ) + ) + (206 + (part-tracker + "group-outro-magic-birth" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 206 222) + ) + (part-tracker + "group-outro-magic-birth" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 206 222) + ) + ) + (207 + (joint-eval start-precursor-effect entity "precursor") + (send-event + "precursor" + 'eval + ,(lambda :behavior scene-player + () + (let* ((v1-3 (-> self draw lod-set lod (-> self draw cur-lod) geo num-joints)) + (gp-0 3) + (s5-0 (+ v1-3 1)) + ) + (while (>= s5-0 gp-0) + (if (not (or (and (>= gp-0 13) (>= 21 gp-0)) (and (>= gp-0 26) (>= 34 gp-0)))) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1276) + 5140 + #f + #f + self + gp-0 + :to *entity-pool* + ) + ) + (+! gp-0 1) + ) + ) + #f + ) + ) + ) + (223 + (part-tracker + "group-outro-magic-birth2" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 223 235) + ) + (part-tracker + "group-outro-magic-birth2" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 223 235) + ) + ) + (236 + (part-tracker + "group-outro-magic-birth2" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 236 242) + ) + (part-tracker + "group-outro-magic-birth2" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 236 242) + ) + ) + (2795 + (apply + ,(lambda :behavior scene-player + () + (send-event (process-by-name "metalkor-1" *active-pool*) 'occlude-off) + (none) + ) + ) + ) + (2990 (fadeout (frame-time-30 10))) + (10000 + (task-close! "nest-boss-introduction") + (apply ,(lambda :behavior scene-player + () + (when (-> self aborted?) + (set! (-> palout memory-mode) (load-buffer-mode small-edge)) + (set! (-> hiphog memory-mode) (load-buffer-mode small-edge)) + 0 + ) + (none) + ) + ) + ) + ) + :cut-list '(0 + 81 + 167 + 237 + 332 + 542 + 721 + 811 + 891 + 1011 + 1131 + 1293 + 1416 + 1467 + 1568 + 1701 + 1896 + 1957 + 2071 + 2177 + 2261 + 2358 + 2481 + 2601 + 2846 + 2921 + 3000 + ) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'nestb + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "darkjak-highres" + :level 'nestb + :art-group "skel-darkjak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "kid-highres" + :level 'loutcstb + :art-group "skel-kid-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "keira-highres" + :level 'outrocst + :art-group "skel-keira-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((2261 2358)) + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'outrocst + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min 1568) (1701 max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "youngsamos-highres" + :level 'loutcstb + :art-group "skel-youngsamos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "brutter-highres" + :level 'loutcstb + :art-group "skel-brutter-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "brutter-balloon-norift" + :level 'loutcstb + :art-group "skel-brutter-balloon-norift" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((721 811) (1131 1416) (1467 1800) (1957 2358) (2601 2846) (2921 3000)) + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "rift-rider" + :level 'loutcstb + :art-group "skel-rift-rider" + :prefix "" + :draw-frames '((min 2627)) + :scissor-frames '((2071 2177)) + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "precursor-stone" + :level 'loutcstb + :art-group "skel-precursor-stone" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-chopped" + :level 'loutcstb + :art-group "skel-metalkor-chopped" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'loutcstb + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "rift-break-ring" + :level 'outrocst + :art-group "skel-rift-break-ring" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "precursor" + :level 'outrocst + :art-group "skel-precursor" + :prefix "" + :draw-frames '((200 721)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "nestb-outro" + :end-point-obj "ctyport-hiphog" + :borrow '((outrocst 0 loutcstb special)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :music-delay 1500.0 + :save #t + :scene-task #xf5 + ) + ) + +;; failed to figure out what this is: +(scene-method-16 (new 'static 'scene + :name "outro-palace" + :extra #f + :info #f + :mask-to-clear #x1282000 + :entity "scene-stage-54" + :art-group "scenecamera" + :anim "outro-palace" + :parts 9 + :command-list '((0 + (fadein (frame-time-30 10)) + (want-load 'outrocst 'throne 'hiphog) + (kill "throne-part-132") + (kill "throne-part-133") + (kill "throne-part-134") + (kill "throne-part-135") + (kill "throne-part-136") + (kill "throne-part-137") + (kill "throne-part-138") + (kill "throne-part-139") + (kill "throne-part-140") + (kill "throne-part-141") + (kill "throne-part-158") + (kill "throne-part-155") + (kill "throne-part-152") + (kill "throne-part-149") + (kill "throne-part-143") + (kill "throne-part-144") + (kill "throne-part-142") + (kill "throne-part-147") + (kill "throne-part-145") + (kill "throne-part-148") + (kill "throne-part-150") + (kill "throne-part-151") + (kill "throne-part-153") + (kill "throne-part-154") + (kill "throne-part-156") + (kill "throne-part-157") + (kill "throne-part-159") + (kill "throne-part-160") + ) + (1000 (fadeout (frame-time-30 5))) + (10000 (apply ,(lambda :behavior scene-player + () + (when (-> self aborted?) + (set! (-> palout memory-mode) (load-buffer-mode small-edge)) + (set! (-> hiphog memory-mode) (load-buffer-mode small-edge)) + 0 + ) + (none) + ) + ) + ) + ) + :cut-list '(96 241 838 951) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "torn-highres" + :level 'lthrnout + :art-group "skel-torn-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'lthrnout + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "palmpilot" + :level 'lthrnout + :art-group "skel-palmpilot" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "throne-outro" + :end-point-obj "ctyport-hiphog" + :borrow '((outrocst 0 palout display) (throne 0 lthrnout display) (hiphog 0 lhipout special)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :music-delay 1500.0 + :save #t + ) + ) + +;; failed to figure out what this is: +(scene-method-16 + (new 'static 'scene + :name "outro-hiphog" + :extra #f + :info #f + :mask-to-clear #x1282000 + :entity "scene-stage-24" + :art-group "scenecamera" + :anim "outro-hiphog" + :parts 33 + :command-list '((0 + (fadein (frame-time-30 2)) + (apply + ,(lambda () + (let ((gp-0 (level-get *level* 'outrocst))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 mood-func) (the-as (function mood-context float int none) update-mood-copy-hiphog)) + (set! (-> gp-0 info sky) #f) + #f + ) + ) + ) + ) + (apply ,(lambda () (set! (-> palout memory-mode) (load-buffer-mode small-edge)) 0 (none))) + (want-load 'outrocst 'hiphog 'ctyport) + (kill "hip-door-b-1") + (send-event "sidekick-highres" 'draw-mirror #f) + (send-event "jak-highres" 'draw-mirror #f) + (send-event "keira-highres" 'draw-mirror #f) + (send-event "tess-highres" 'draw-mirror #f) + (send-event "pecker-highres" 'draw-mirror #f) + (send-event "onin-highres" 'draw-mirror #f) + ) + (141 (send-event "onin-highres" 'draw-mirror #t) (send-event "pecker-highres" 'draw-mirror #t)) + (180 (want-display 'ctyport 'display) (kill "hip-door-a-6") (kill "hip-door-b-1")) + (186 (send-event "onin-highres" 'draw-mirror #f) (send-event "pecker-highres" 'draw-mirror #f)) + (476 (send-event "onin-highres" 'draw-mirror #t) (send-event "pecker-highres" 'draw-mirror #t)) + (560 (send-event "onin-highres" 'draw-mirror #f) (send-event "pecker-highres" 'draw-mirror #f)) + (1156 (send-event "onin-highres" 'draw-mirror #t)) + (1160 + (part-tracker + "group-outro-onin-finger-effect" + entity + "onin-highres" + joint + "RindexC" + track + #t + duration + (frame-range 1160 1250) + ) + ) + (1226 + (part-tracker + "group-outro-onin-finger-blast" + entity + "onin-highres" + joint + "RindexC" + track + #t + duration + (frame-range 1226 1236) + ) + ) + (1246 (send-event "onin-highres" 'draw-mirror #f)) + (1436 (send-event "onin-highres" 'draw-mirror #t)) + (1491 (send-event "onin-highres" 'draw-mirror #f)) + (1955 (fadeout (frame-time-30 5))) + (10000 (apply ,(lambda :behavior scene-player + () + (when (-> self aborted?) + (set! (-> hiphog memory-mode) (load-buffer-mode small-edge)) + 0 + ) + (none) + ) + ) + ) + ) + :cut-list '(91 + 141 + 186 + 259 + 401 + 476 + 596 + 691 + 781 + 846 + 971 + 1081 + 1156 + 1246 + 1291 + 1342 + 1436 + 1491 + 1536 + 1581 + 1631 + 1666 + 1701 + 1776 + 1841 + 1891 + ) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'hiphog + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x3 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'hiphog + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min 1840) (1891 max)) + :scissor-frames '((741 846)) + :flags #x3 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "keira-highres" + :level 'outrocst + :art-group "skel-keira-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x3 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'outrocst + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tess-highres" + :level 'outrocst + :art-group "skel-tess-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x3 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'lhipout + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x3 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "onin-highres" + :level 'outrocst + :art-group "skel-onin-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x3 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sig-highres" + :level 'lhipout + :art-group "skel-sig-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "hip-mug" + :level 'lhipout + :art-group "skel-hip-mug" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "hip-mug" + :level 'lhipout + :art-group "skel-hip-mug" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "hip-mug" + :level 'lhipout + :art-group "skel-hip-mug" + :prefix "c-" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "hip-bottle-c" + :level 'lhipout + :art-group "skel-hip-bottle-c" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "kid-medallion" + :level 'lhipout + :art-group "skel-kid-medallion" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'lhipout + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "metalkor-chopped" + :level 'lhipout + :art-group "skel-metalkor-chopped" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "hiphog-outro" + :end-point-obj "ctyport-hiphog" + :borrow '((outrocst 0 portwall special) (hiphog 0 lhipout special)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :music-delay 1500.0 + :save #t + ) + ) + +;; failed to figure out what this is: +(scene-method-16 + (new 'static 'scene + :name "outro-port" + :extra #f + :info #f + :mask-to-clear #x1282000 + :entity "scene-stage-93" + :art-group "scenecamera" + :anim "outro-port" + :parts 28 + :command-list '((0 + (want-sound 'outro1 #f #f) + (setting-unset sound-bank-load) + (time-of-day 23) + (fadein (frame-time-30 10)) + (apply ,(lambda () + (let ((gp-0 (level-get *level* 'hiphog))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 mood-func) update-mood-default) + (set! (-> gp-0 info sky) #f) + ) + ) + (let ((gp-1 (level-get *level* 'lhipout))) + (when gp-1 + (clear-mood-context (-> gp-1 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-1 mood-context)) + ) + (set! (-> gp-1 mood-func) update-mood-default) + (set! (-> gp-1 info sky) #f) + ) + ) + (let ((gp-2 (level-get *level* 'outrocst))) + (when gp-2 + (clear-mood-context (-> gp-2 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-2 mood-context)) + ) + (set! (-> gp-2 mood-func) update-mood-default) + (set! (-> gp-2 info sky) #f) + ) + ) + (let ((gp-3 (level-get *level* 'portwall))) + (when gp-3 + (clear-mood-context (-> gp-3 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-3 mood-context)) + ) + (set! (-> gp-3 mood-func) update-mood-default) + (set! (-> gp-3 info sky) #f) + #f + ) + ) + ) + ) + (want-display 'outrocst 'display) + (apply + ,(lambda () + (with-pp + (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-0 + (let ((t9-1 (method-of-type part-tracker activate))) + (t9-1 (the-as part-tracker gp-0) pp (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-2 run-function-in-process) + (a0-2 gp-0) + (a1-2 part-tracker-init) + (a2-4 (-> *part-group-id-table* 1272)) + (a3-1 #x2d96) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> (new 'static 'vector :x 180224.0 :y 81920.0 :z 5660672.0 :w 1.0) quad)) + ((the-as (function object object object object object object object object none) t9-2) + a0-2 + a1-2 + a2-4 + a3-1 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> gp-0 ppointer) + ) + ) + ) + ) + ) + ) + (200 (setting-reset sfx-volume mode 'rel value (new 'static 'bfloat :data 0.3))) + (300 (setting-reset sfx-volume mode 'rel value (new 'static 'bfloat :data 0.2))) + (514 (setting-reset sfx-volume mode 'rel value (new 'static 'bfloat :data 0.3))) + (610 (setting-reset sfx-volume mode 'rel value (new 'static 'bfloat :data 0.2))) + (2042 + (part-tracker + "group-outro-port-feathers-n-fur-impact" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 2042 2043) + ) + ) + (2105 + (part-tracker + "group-outro-port-feathers-n-fur" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 2105 2300) + ) + ) + (2334 + (setting-reset sfx-volume mode 'rel value (new 'static 'bfloat :data 0.4)) + (apply + ,(lambda () + (with-pp + (set-setting! 'process-mask 'set 0 (process-mask enemy platform projectile)) + (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-0 + (let ((t9-2 (method-of-type part-tracker activate))) + (t9-2 (the-as part-tracker gp-0) pp (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-3 run-function-in-process) + (a0-3 gp-0) + (a1-3 part-tracker-init) + (a2-5 (-> *part-group-id-table* 1272)) + (a3-2 #x2dc6c0) + (t0-1 #f) + (t1-1 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> (new 'static 'vector :x 860160.0 :y 122880.0 :z 6062080.0 :w 1.0) quad)) + ((the-as (function object object object object object object object object none) t9-3) + a0-3 + a1-3 + a2-5 + a3-2 + t0-1 + t1-1 + t2-0 + t3-0 + ) + ) + (-> gp-0 ppointer) + ) + ) + ) + ) + ) + ) + (2490 + (setting-reset sfx-volume mode 'rel value (new 'static 'bfloat :data 0.5)) + (apply ,(lambda () (with-pp + (start-credits pp) + (none) + ) + ) + ) + ) + (10000 (apply ,(lambda () (set! (-> hiphog memory-mode) (load-buffer-mode small-edge)) 0 (none)))) + ) + :cut-list '(245 + 299 + 358 + 401 + 437 + 493 + 611 + 784 + 881 + 969 + 1003 + 1047 + 1159 + 1212 + 1238 + 1290 + 1394 + 1529 + 1629 + 1725 + 1817 + 1871 + 2032 + 2105 + 2256 + 2334 + ) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'hiphog + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'hiphog + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'outrocst + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sig-highres" + :level 'lhipout + :art-group "skel-sig-highres" + :prefix "" + :draw-frames '((min 881) (969 max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'lhipout + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min 611) (784 max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "crocadog-highres" + :level 'lhipout + :art-group "skel-crocadog-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sew-gold-key" + :level 'lhipout + :art-group "skel-sew-gold-key" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'lhipout + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "ctyport-outro" + :end-point-obj "ctyport-start" + :borrow '((outrocst 0 portwall display) (hiphog 0 lhipout display)) + :sfx-volume 0.2 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :music-delay 1500.0 + :save #t + ) + ) diff --git a/test/decompiler/reference/jak2/levels/power_station/power_switches/ctypower_REF.gc b/test/decompiler/reference/jak2/levels/power_station/power_switches/ctypower_REF.gc new file mode 100644 index 000000000..1e32eec46 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/power_station/power_switches/ctypower_REF.gc @@ -0,0 +1,301 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 15 of type hud-turret +;; WARN: Return type mismatch int vs none. +(defmethod draw hud-turret ((obj hud-turret)) + (set-hud-piece-position! + (the-as hud-sprite (-> obj sprites)) + (the int (+ 457.0 (* 130.0 (-> obj offset)))) + 205 + ) + (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -19 22) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +;; definition for method 16 of type hud-turret +;; WARN: Return type mismatch int vs none. +(defmethod update-values hud-turret ((obj hud-turret)) + (set! (-> obj values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +;; definition for method 17 of type hud-turret +;; WARN: Return type mismatch int vs none. +(defmethod init-callback hud-turret ((obj hud-turret)) + (set! (-> obj level) (level-get *level* 'ctywide)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x8 :page #x679))) + (set! (-> obj sprites 0 flags) (the-as uint 4)) + (set! (-> obj sprites 0 scale-x) 1.2) + (set! (-> obj sprites 0 scale-y) 1.2) + (alloc-string-if-needed obj 0) + (set! (-> obj strings 0 scale) 0.6) + (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + 0 + (none) + ) + +;; definition for symbol *city-power-switch-on-position*, type (array vector) +(define *city-power-switch-on-position* (new 'static 'boxed-array :type vector + (new 'static 'vector :x 2336358.5 :y 32768.0 :z -935526.4 :w 1.0) + (new 'static 'vector :x 4273357.0 :y 32645.12 :z 4159078.5 :w 1.0) + (new 'static 'vector :x 4059136.0 :y 32768.0 :z 2203648.0 :w 1.0) + (new 'static 'vector :x 3387392.0 :y 32768.0 :z 2748416.0 :w 1.0) + (new 'static 'vector :x 3854336.0 :y 32768.0 :z 745472.0 :w 1.0) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 87 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (when (not (task-node-closed? (game-task-node city-power-resolution))) + (set-setting! 'exclusive-task #f 0 (-> self node-info task)) + (set! (-> self begin-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) + (set-setting! 'minimap 'clear 0 32) + (set! (-> self max-count) 5) + (set! (-> self count) 0) + (set! (-> *game-info* counter) 5.0) + (dotimes (v1-9 5) + (set! (-> self data-int32 v1-9) 0) + ) + (set! (-> self slave 10) (the-as handle #f)) + (dotimes (gp-0 (-> self max-count)) + (set! (-> self data-vector gp-0 quad) (-> *city-power-switch-on-position* gp-0 quad)) + (set! (-> self minimap gp-0) + (add-icon! *minimap* self (the-as uint 15) (the-as int #f) (-> *city-power-switch-on-position* gp-0) 0) + ) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 87 + 1 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *traffic-manager* 'restore-default-settings) + (dotimes (v1-3 (-> self max-count)) + (when (-> self minimap v1-3) + (logior! (-> self minimap v1-3 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-3) #f) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 87 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (when (not (task-node-closed? (game-task-node city-power-resolution))) + (check-time self) + (set! (-> self count) 0) + (dotimes (v1-3 (-> self max-count)) + (if (>= 1 (-> self data-int32 v1-3)) + (+! (-> self count) 1) + ) + ) + (if (= (-> self count) (-> self max-count)) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (set! (-> *game-info* counter) (the float (-> self count))) + ) + (when (or (zero? (-> self count)) (task-node-closed? (game-task-node city-power-resolution))) + (when (zero? (-> self count)) + (talker-spawn-func (-> *talker-speech* 92) *entity-pool* (target-pos 0) (the-as region #f)) + (task-node-close! (game-task-node city-power-resolution)) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + (send-event (handle->process (-> self hud-counter)) 'hide-and-die) + (set! (-> self fail-on-death?) #f) + ) + (cond + ((handle->process (-> self slave 10)) + (let ((gp-1 (handle->process (-> self slave 10)))) + (when (and gp-1 + (< 40960.0 (vector-vector-xz-distance (-> (the-as process-drawable gp-1) root trans) (target-pos 0))) + ) + (send-event gp-1 'close) + (go-virtual complete) + ) + ) + ) + (else + (go-virtual complete) + ) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 87 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-turret :init hud-init-by-other :to self))) + (send-event *traffic-manager* 'set-target-level #x3f800000) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) + (suspend) + ) + (send-event *traffic-manager* 'set-alert-level 1) + (send-event *traffic-manager* 'set-alert-duration #xa4cb80) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 87 + 5 + (the-as (function object) (lambda :behavior task-manager + () + (dotimes (v1-0 (-> self max-count)) + (when (-> self minimap v1-0) + (logior! (-> self minimap v1-0 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-0) #f) + ) + ) + (kill-all-children self) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 87 + 4 + (the-as (function object) (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (suspend) + ) + (task-node-close! (game-task-node city-power-post-win)) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 87 + 6 + (the-as + (function object) + (lambda :behavior task-manager + ((arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((gp-0 (-> (level-get *level* 'lpower) entity data 0 entity))) + (cond + ((= arg2 'guard-turret-status) + (let ((v1-5 (-> arg3 param 0))) + (let ((a0-2 (the-as object (-> arg3 param 1)))) + (set! (-> *city-power-switch-on-position* v1-5 quad) (-> (the-as vector a0-2) quad)) + ) + (-> self data-int32 v1-5) + ) + ) + ((= arg2 'guard-turret-killed) + (let ((s4-1 (-> arg3 param 0))) + (set! (-> self data-int32 s4-1) 1) + (let ((v1-12 (process-spawn + cty-guard-turret-button + :init basebutton-init-by-other + gp-0 + (-> arg0 root trans) + (-> arg0 root quat) + (-> arg0 entity) + #f + 0 + :to self + ) + ) + ) + (set! (-> self slave (-> self data-int32 s4-1)) (ppointer->handle v1-12)) + (set! (-> (the-as basebutton (-> v1-12 0)) event-down) 'button-down) + ) + ) + #t + ) + ((= arg2 'guard-turret-button-pushed) + (let ((v1-21 (-> arg3 param 0))) + (set! (-> self data-int32 v1-21) 2) + (set! (-> self slave 10) (process->handle arg0)) + (logior! (-> self minimap v1-21 flags) (minimap-flag fade-out)) + (set! (-> self minimap v1-21) #f) + ) + #t + ) + ((= arg2 'spawn-button) + (let ((s4-2 (-> arg3 param 0)) + (s3-2 (-> arg3 param 1)) + ) + (when (not (handle->process (-> self slave (-> self data-int32 s4-2)))) + (let ((v0-1 (the-as object (ppointer->handle (process-spawn + cty-guard-turret-button + :init basebutton-init-by-other + gp-0 + (-> arg0 root trans) + (-> arg0 root quat) + (-> arg0 entity) + s3-2 + 0 + :to self + ) + ) + ) + ) + ) + (set! (-> self slave (-> self data-int32 s4-2)) (the-as handle v0-1)) + v0-1 + ) + ) + ) + ) + ) + ) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/power_station/vinroom-obs_REF.gc b/test/decompiler/reference/jak2/levels/power_station/vinroom-obs_REF.gc new file mode 100644 index 000000000..194a7bf28 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/power_station/vinroom-obs_REF.gc @@ -0,0 +1,345 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type vin-turbine +(deftype vin-turbine (process-drawable) + ((dont-draw-outside? symbol :offset-assert 200) + (lightning-timer uint64 :offset-assert 208) + (outside-plane plane :inline :offset-assert 224) + (lightning-plane plane :inline :offset-assert 240) + ) + :heap-base #x80 + :method-count-assert 22 + :size-assert #x100 + :flag-assert #x1600800100 + (:methods + (idle () _type_ :state 20) + (dormant () _type_ :state 21) + ) + ) + +;; definition for method 3 of type vin-turbine +(defmethod inspect vin-turbine ((obj vin-turbine)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tdont-draw-outside?: ~A~%" (-> obj dont-draw-outside?)) + (format #t "~2Tlightning-timer: ~D~%" (-> obj lightning-timer)) + (format #t "~2Toutside-plane: #~%" (-> obj outside-plane)) + (format #t "~2Tlightning-plane: #~%" (-> obj lightning-plane)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defpart 1245 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 60)) + (sp-flt spt-rot-x 2048.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 64.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 64.0 1.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 32.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 1638.4) + (sp-int spt-next-time 5) + (sp-launcher-by-id spt-next-launcher 167) + ) + ) + +;; failed to figure out what this is: +(defpart 1246 + :init-specs ((sp-flt spt-scale-x (meters 60)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 64.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 64.0 1.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 24.0 32.0 1.0) + (sp-int spt-next-time 5) + (sp-launcher-by-id spt-next-launcher 167) + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 17) (new 'static 'lightning-spec + :name "lightning-turbine" + :flags (lightning-spec-flags lsf2) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x83 :page #xc) + :reduction 0.42 + :num-points 16 + :box-size 12288.0 + :merge-factor 0.5 + :merge-count 4 + :radius 2048.0 + :duration 300.0 + :sound #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-vin-turbine vin-turbine vin-turbine-lod0-jg vin-turbine-idle-ja + ((vin-turbine-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + ) + +;; failed to figure out what this is: +(defstate dormant (vin-turbine) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + (none) + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + (none) + ) + :trans (behavior () + (if (>= (vector4-dot (the-as vector (-> self outside-plane)) (math-camera-pos)) 0.0) + (go-virtual idle) + ) + (none) + ) + :code (the-as (function none :behavior vin-turbine) sleep-code) + ) + +;; failed to figure out what this is: +(defstate idle (vin-turbine) + :virtual #t + :trans (behavior () + (if (and (-> self dont-draw-outside?) + (< (vector4-dot (the-as vector (-> self outside-plane)) (math-camera-pos)) 0.0) + ) + (go-virtual dormant) + ) + (none) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) + :num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (behavior () + (when (and (or (not (-> self dont-draw-outside?)) + (>= (vector4-dot (the-as vector (-> self lightning-plane)) (math-camera-pos)) 0.0) + ) + (< (the-as time-frame (-> self lightning-timer)) (-> self clock frame-counter)) + ) + (let ((s4-0 (new 'stack-no-clear 'matrix)) + (s3-1 + (vector-rotate-x! (new 'stack-no-clear 'vector) *y-vector* (* 182.04445 (rand-vu-float-range 10.0 40.0))) + ) + (gp-2 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'collide-query)) + ) + (if (rand-vu-percent? 0.5) + (vector-negate! s3-1 s3-1) + ) + (vector-rotate-y! s3-1 s3-1 (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (vector+float*! gp-2 (-> self root trans) s3-1 15564.8) + (set! (-> s5-1 start-pos quad) (-> gp-2 quad)) + (set-vector! + (-> s5-1 move-dist) + (rand-vu-float-range -4551.1113 4551.1113) + 0.0 + (rand-vu-float-range -910.2222 910.2222) + 1.0 + ) + (matrix-rotate-zyx! s4-0 (-> s5-1 move-dist)) + (let ((s4-1 (vector-rotate*! (new 'stack-no-clear 'vector) s3-1 s4-0))) + (vector-normalize! s4-1 6144.0) + (vector+! (-> s5-1 start-pos) (-> s5-1 start-pos) s4-1) + (vector-normalize-copy! (-> s5-1 move-dist) s4-1 81920.0) + ) + (let ((v1-17 s5-1)) + (set! (-> v1-17 radius) 409.6) + (set! (-> v1-17 collide-with) (collide-spec backgnd)) + (set! (-> v1-17 ignore-process0) self) + (set! (-> v1-17 ignore-process1) #f) + (set! (-> v1-17 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-17 action-mask) (collide-action solid)) + ) + (when (>= (fill-and-probe-using-line-sphere *collide-cache* s5-1) 0.0) + (set! (-> self lightning-timer) + (the-as uint (+ (-> self clock frame-counter) (the int (* 300.0 (rand-vu-float-range 0.1 0.4))))) + ) + (let ((s4-3 (new 'stack-no-clear 'vector))) + (set! (-> s4-3 quad) (-> s5-1 best-other-tri intersect quad)) + (when (< 8192.0 (vector-vector-distance gp-2 s4-3)) + (let ((s3-2 (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> *lightning-spec-id-table* 17) + 0 + #f + self + gp-2 + s4-3 + :to self + ) + ) + (v1-36 (get-field-spec-by-id (-> *part-id-table* 1245) (sp-field-id spt-timer))) + ) + (if v1-36 + (set! (-> v1-36 initial-valuef) (the-as float (-> (the-as lightning-tracker (-> s3-2 0)) duration))) + ) + ) + (let ((t9-20 sp-launch-particles-var) + (a0-33 *sp-particle-system-2d*) + (a1-21 (-> *part-id-table* 1245)) + (a2-10 *launch-matrix*) + ) + (set! (-> a2-10 trans quad) (-> s4-3 quad)) + (t9-20 a0-33 a1-21 a2-10 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + ) + ) + (ja-post) + (none) + ) + ) + +;; definition for method 11 of type vin-turbine +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! vin-turbine ((obj vin-turbine) (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" + (set! (-> obj root) (new 'process 'trsqv)) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-vin-turbine" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set-vector! (-> obj outside-plane) 0.707 0.0 0.707 -6377922.5) + (set! (-> obj lightning-plane quad) (-> obj outside-plane quad)) + (set! (-> obj lightning-plane w) -6419865.5) + (set! (-> obj dont-draw-outside?) + (nonzero? (res-lump-value (-> obj entity) 'extra-id uint128 :time -1000000000.0)) + ) + (set! (-> obj lightning-timer) (the-as uint 0)) + (if (and (-> obj dont-draw-outside?) + (< (vector4-dot (the-as vector (-> obj outside-plane)) (math-camera-pos)) 0.0) + ) + (go (method-of-object obj dormant)) + (go (method-of-object obj idle)) + ) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-vin-door vin-door vin-door-lod0-jg vin-door-idle-ja + ((vin-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3 0 6) + ) + +;; definition of type vin-door +(deftype vin-door (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + +;; definition for method 3 of type vin-door +(defmethod inspect vin-door ((obj vin-door)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type vin-door +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! vin-door ((obj vin-door) (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" + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 12288.0 0.0 24576.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 8192.0 16384.0 0.0 20480.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) -8192.0 16384.0 0.0 20480.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-vin-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (static-sound-spec "wood-door-open")) + (set! (-> obj sound-open-stop) (static-sound-spec "wood-open-hit")) + (set! (-> obj sound-close-loop) (static-sound-spec "wood-door-close")) + (set! (-> obj sound-close-stop) (static-sound-spec "wood-close-hit")) + (set! (-> obj door-radius) 12288.0) + (go (method-of-object obj close) #t) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc b/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc index d81d84e69..2e6b3417f 100644 --- a/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc @@ -72,15 +72,15 @@ ;; definition for symbol *ruins-sinking-platform-constants*, type rigid-body-platform-constants (define *ruins-sinking-platform-constants* (new 'static 'rigid-body-platform-constants - :mass 1.48 - :inv-mass 0.6756757 - :cm-joint (new 'static 'vector :w 1.0) - :linear-damping 0.8 - :angular-damping 1.0 - :friction-factor 0.1 - :inertial-tensor-x (meters 2) - :inertial-tensor-y (meters 1) - :inertial-tensor-z (meters 2) + :info (new 'static 'rigid-body-info + :mass 1.48 + :inv-mass 0.6756757 + :linear-damping 0.8 + :angular-damping 1.0 + :friction-factor 0.1 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 2) (meters 1) (meters 2)) + ) :max-time-step 0.02 :gravity (meters 80) :idle-distance (meters 50) @@ -153,7 +153,7 @@ ) :post (behavior () (set! (-> self info-override) *ruins-sinking-platform-constants*) - (set! (-> self rbody state info) (the-as rigid-body-info (&-> (-> self info-override) mass))) + (set! (-> self rbody state info) (-> self info-override info)) (rigid-body-object-method-37 self) (none) ) diff --git a/test/decompiler/reference/jak2/levels/stadium/stadium-scenes_REF.gc b/test/decompiler/reference/jak2/levels/stadium/stadium-scenes_REF.gc index e41a948ec..197669a21 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadium-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadium-scenes_REF.gc @@ -1999,7 +1999,7 @@ (set! (-> gp-0 info sky) #f) ) ) - (race-start 2 #f #t) + (the-as object (race-start 2 #f #t)) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/underport/under-obs_REF.gc b/test/decompiler/reference/jak2/levels/underport/under-obs_REF.gc index 5eedbec5e..76c3acc12 100644 --- a/test/decompiler/reference/jak2/levels/underport/under-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/underport/under-obs_REF.gc @@ -1043,36 +1043,37 @@ This commonly includes things such as: ) ;; definition for symbol *under-buoy-plat-platform-constants*, type rigid-body-platform-constants -(define *under-buoy-plat-platform-constants* (new 'static 'rigid-body-platform-constants - :mass 1.48 - :inv-mass 0.6756757 - :cm-joint (new 'static 'vector :w 1.0) - :linear-damping 0.8 - :angular-damping 0.5 - :friction-factor 0.1 - :inertial-tensor-x (meters 5) - :inertial-tensor-y (meters 1) - :inertial-tensor-z (meters 5) - :max-time-step 0.02 - :gravity (meters 80) - :idle-distance (meters 50) - :attack-force-scale 1.0 - :name '*under-buoy-plat-platform-constants* - :drag-factor 2.0 - :buoyancy-factor 2.3 - :max-buoyancy-depth (meters 1.5) - :player-weight (meters 150) - :player-bonk-factor 0.5 - :player-dive-factor 1.0 - :player-force-distance (meters 2) - :player-force-clamp (meters 1000000) - :player-force-timeout #x1e - :explosion-force (meters 1000) - :control-point-count 5 - :platform #t - :sound-name "ruins-plat" - ) - ) +(define *under-buoy-plat-platform-constants* + (new 'static 'rigid-body-platform-constants + :info (new 'static 'rigid-body-info + :mass 1.48 + :inv-mass 0.6756757 + :linear-damping 0.8 + :angular-damping 0.5 + :friction-factor 0.1 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 5) (meters 1) (meters 5)) + ) + :max-time-step 0.02 + :gravity (meters 80) + :idle-distance (meters 50) + :attack-force-scale 1.0 + :name '*under-buoy-plat-platform-constants* + :drag-factor 2.0 + :buoyancy-factor 2.3 + :max-buoyancy-depth (meters 1.5) + :player-weight (meters 150) + :player-bonk-factor 0.5 + :player-dive-factor 1.0 + :player-force-distance (meters 2) + :player-force-clamp (meters 1000000) + :player-force-timeout #x1e + :explosion-force (meters 1000) + :control-point-count 5 + :platform #t + :sound-name "ruins-plat" + ) + ) ;; definition for method 53 of type under-buoy-plat (defmethod rigid-body-platform-method-53 under-buoy-plat ((obj under-buoy-plat) (arg0 vector)) @@ -1111,7 +1112,7 @@ This commonly includes things such as: (set! (-> obj orig-trans quad) (-> obj root-override-2 trans quad)) (set! (-> obj anchor-point quad) (-> obj root-override-2 trans quad)) (set! (-> obj surface-height) (-> obj root-override-2 trans y)) - (set! (-> obj info-override cm-joint y) 6144.0) + (set! (-> obj info-override info cm-offset-joint y) 6144.0) (let ((s5-1 (-> obj info-override control-point-count))) (dotimes (s4-1 s5-1) (let ((s3-0 (-> obj control-point-array data s4-1))) diff --git a/test/offline/config/jak2/config.jsonc b/test/offline/config/jak2/config.jsonc index 9acadecde..4e004cf25 100644 --- a/test/offline/config/jak2/config.jsonc +++ b/test/offline/config/jak2/config.jsonc @@ -21,6 +21,7 @@ "DGO/CTA.DGO", "DGO/CTB.DGO", "DGO/CTC.DGO", + "DGO/CTYASHA.DGO", "DGO/CTYKORA.DGO", "DGO/CWI.DGO", "DGO/DG1.DGO", @@ -44,6 +45,7 @@ "DGO/LBOMBBOT.DGO", "DGO/LERLCHAL.DGO", "DGO/LKIDDOGE.DGO", + "DGO/LPORTRUN.DGO", "DGO/LSACK.DGO", "DGO/MCN.DGO", "DGO/MTN.DGO", @@ -51,6 +53,8 @@ "DGO/NES.DGO", "DGO/ONINTENT.DGO", "DGO/ORACLE.DGO", + "DGO/OUTROCST.DGO", + "DGO/LPOWER.DGO", "DGO/PAC.DGO", "DGO/PAE.DGO", "DGO/PALOUT.DGO",