From b72383964febcc31fcc29020cd4de51847899605 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Tue, 31 Jan 2023 18:32:50 -0500 Subject: [PATCH] d/jak2: cleaning up the remainder of unblocked / unclaimed files (#2171) Co-authored-by: water --- decompiler/IR2/Env.cpp | 4 +- decompiler/config/jak2/all-types.gc | 1344 +++---- .../jak2/anonymous_function_types.jsonc | 69 + decompiler/config/jak2/hacks.jsonc | 23 +- decompiler/config/jak2/inputs.jsonc | 6 + decompiler/config/jak2/label_types.jsonc | 85 +- decompiler/config/jak2/stack_structures.jsonc | 78 +- decompiler/config/jak2/type_casts.jsonc | 268 +- decompiler/util/data_decompile.cpp | 16 +- .../opengl_renderer/OpenGLRenderer.cpp | 3 + game/graphics/opengl_renderer/buckets.h | 2 + goal_src/jak2/engine/ai/enemy-h.gc | 2 +- goal_src/jak2/engine/ai/enemy.gc | 7 +- goal_src/jak2/engine/anim/mspace-h.gc | 14 +- .../jak2/engine/debug/nav/mysql-nav-graph.gc | 69 +- .../jak2/engine/gfx/texture/texture-anim-h.gc | 2 +- goal_src/jak2/engine/physics/rigid-body-h.gc | 32 +- .../jak2/engine/physics/rigid-body-queue.gc | 285 ++ goal_src/jak2/engine/physics/rigid-body.gc | 25 +- goal_src/jak2/engine/ui/text-id-h.gc | 4 + .../jak2/levels/city/common/ctywide-part.gc | 1187 ++++++ .../jak2/levels/city/common/nav-graph-h.gc | 2 +- goal_src/jak2/levels/city/common/vehicle.gc | 12 +- goal_src/jak2/levels/city/farm/ctyfarm-obs.gc | 2475 ++++++++++++ .../city/misc/delivery/delivery-task.gc | 533 +++ .../levels/city/oracle/oracle-training.gc | 420 ++ .../levels/common/enemy/bombots/bombbot-h.gc | 4 +- .../common/enemy/bombots/bombbot-path.gc | 809 ++++ .../levels/common/enemy/bombots/bombbot.gc | 3344 ++++++++++++++++ goal_src/jak2/levels/common/enemy/hopper.gc | 68 +- goal_src/jak2/levels/demo/demo-obs.gc | 1580 ++++++++ .../levels/fortress/rescue/forresca-obs.gc | 409 ++ .../levels/fortress/rescue/forrescb-obs.gc | 805 ++++ goal_src/jak2/levels/hiphog/hiphog-obs.gc | 375 ++ goal_src/jak2/levels/intro/intro-obs.gc | 451 +++ .../jak2/levels/landing_pad/castle-obs.gc | 2752 +++++++++++++ .../jak2/levels/landing_pad/castle-part.gc | 1218 ++++++ .../jak2/levels/landing_pad/castle-texture.gc | 481 +++ .../levels/landing_pad/roboguard-level.gc | 1357 +++++++ goal_src/jak2/levels/palace/pal-obs.gc | 1094 +++++ .../jak2/levels/palace/roof/palroof-obs.gc | 232 ++ .../reference/jak2/engine/ai/enemy-h_REF.gc | 2 +- .../reference/jak2/engine/ai/enemy_REF.gc | 5 +- .../engine/debug/nav/mysql-nav-graph_REF.gc | 72 +- .../engine/gfx/texture/texture-anim-h_REF.gc | 2 +- .../jak2/engine/physics/rigid-body-h_REF.gc | 32 +- .../engine/physics/rigid-body-queue_REF.gc | 320 ++ .../jak2/engine/physics/rigid-body_REF.gc | 25 +- .../levels/city/common/ctywide-part_REF.gc | 1294 ++++++ .../levels/city/common/nav-graph-h_REF.gc | 2 +- .../jak2/levels/city/common/vehicle_REF.gc | 12 +- .../jak2/levels/city/farm/ctyfarm-obs_REF.gc | 2694 +++++++++++++ .../city/misc/delivery/delivery-task_REF.gc | 573 +++ .../levels/city/oracle/oracle-training_REF.gc | 438 ++ .../common/enemy/bombots/bombbot-h_REF.gc | 8 +- .../common/enemy/bombots/bombbot-path_REF.gc | 822 ++++ .../common/enemy/bombots/bombbot_REF.gc | 3559 +++++++++++++++++ .../jak2/levels/common/enemy/hopper_REF.gc | 1 - .../jak2/levels/demo/demo-obs_REF.gc | 1643 ++++++++ .../jak2/levels/forest/pegasus_REF.gc | 64 +- .../fortress/rescue/forresca-obs_REF.gc | 482 +++ .../fortress/rescue/forrescb-obs_REF.gc | 898 +++++ .../jak2/levels/hiphog/hiphog-obs_REF.gc | 510 +++ .../jak2/levels/intro/intro-obs_REF.gc | 527 +++ .../jak2/levels/landing_pad/castle-obs_REF.gc | 3079 ++++++++++++++ .../levels/landing_pad/castle-texture_REF.gc | 496 +++ .../levels/landing_pad/roboguard-level_REF.gc | 1424 +++++++ .../jak2/levels/palace/pal-obs_REF.gc | 1287 ++++++ .../levels/palace/roof/palroof-obs_REF.gc | 279 ++ test/offline/config/jak2/config.jsonc | 6 +- 70 files changed, 41672 insertions(+), 830 deletions(-) create mode 100644 test/decompiler/reference/jak2/engine/physics/rigid-body-queue_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/city/common/ctywide-part_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/city/farm/ctyfarm-obs_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/city/misc/delivery/delivery-task_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot-path_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/fortress/rescue/forresca-obs_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/hiphog/hiphog-obs_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/landing_pad/castle-obs_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/landing_pad/castle-texture_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/landing_pad/roboguard-level_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/palace/pal-obs_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/palace/roof/palroof-obs_REF.gc diff --git a/decompiler/IR2/Env.cpp b/decompiler/IR2/Env.cpp index 382c81d12f..59497fd517 100644 --- a/decompiler/IR2/Env.cpp +++ b/decompiler/IR2/Env.cpp @@ -541,8 +541,8 @@ void Env::add_stack_structure_hint(const StackStructureHint& hint) { if (!type_info->is_reference()) { throw std::runtime_error( fmt::format("Stack variable type {} is not a reference and cannot be stored directly " - "on the stack. Use an array instead.", - base_typespec.print())); + "on the stack at offset {}. Use an array instead.", + base_typespec.print(), hint.stack_offset)); } entry.ref_type = base_typespec; entry.size = type_info->get_size_in_memory(); diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index 8c254888e6..65393d46ef 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -5165,7 +5165,7 @@ ((num-layers uint32 :offset-assert 0) (func symbol :offset-assert 4) (func-id basic :offset 4) - (init-func basic :offset-assert 8) + (init-func symbol :offset-assert 8) (init-func-id basic :offset 8) (tex texture :offset-assert 12) (tex-name string :offset-assert 16) @@ -6999,6 +6999,10 @@ (text-x24d #x024d) (text-x24e #x024e) (text-x24f #x024f) + (oracle-tutorial-dark-bomb #x0273) + (oracle-tutorial-dark-blast #x0274) + (oracle-tutorial-dark-invincible #x0275) + (oracle-tutorial-dark-giant #x0276) (text-x277 #x0277) (text-x278 #x0278) (text-x27a #x027a) @@ -8629,7 +8633,7 @@ (bone bone :offset-assert 16) (param0 (function cspace transformq none) :offset-assert 20) ;; guessed by decompiler (param1 basic :offset-assert 24) - (param2 basic :offset-assert 28) + (param2 basic :offset-assert 28) ;; this isn't always a basic, but that has issues in relocate ) :method-count-assert 10 :size-assert #x20 @@ -31817,7 +31821,7 @@ ) (deftype mysql-nav-graph-level-info (structure) - ((level basic :offset-assert 0) + ((level string :offset-assert 0) (level-id uint32 :offset-assert 4) (node-count int32 :offset-assert 8) (branch-count int32 :offset-assert 12) @@ -32826,7 +32830,7 @@ (_type_) none 72) (kill-prefer-falling "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" - (_type_) none 73) + (_type_) object 73) (general-event-handler "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" @@ -33161,12 +33165,13 @@ ;; ---rigid-body-h:rigid-body-flag (declare-type rigid-body-work structure) +(declare-type rigid-body-object process-focusable) (deftype rigid-body (structure) ((work rigid-body-work :offset-assert 0) (info rigid-body-info :offset-assert 4) (flags rigid-body-flag :offset-assert 8) (force-callback (function object float none) :offset-assert 12) ;; TODO - type! - (blocked-by basic :offset-assert 16) + (blocked-by rigid-body-object :offset-assert 16) (time-remaining float :offset-assert 20) (step-count int16 :offset-assert 24) (position vector :inline :offset-assert 32) @@ -33211,28 +33216,9 @@ ) ) -(declare-type rigid-body-object process-focusable) (deftype rigid-body-control (basic) ((process process :offset-assert 4) (state rigid-body :inline :offset-assert 16) - (work basic :offset 16) - (info rigid-body-info :offset 20) - (flags rigid-body-flag :offset 24) - (force-callback basic :offset 28) - (blocked-by basic :offset 32) - (time-remaining float :offset 36) - (step-count int16 :offset 40) - (position vector :inline :offset 48) - (rot vector :inline :offset 64) - (rotation quaternion :inline :offset 64) - (lin-momentum vector :inline :offset 80) - (ang-momentum vector :inline :offset 96) - (force vector :inline :offset 112) - (torque vector :inline :offset 128) - (lin-velocity vector :inline :offset 144) - (ang-velocity vector :inline :offset 160) - (matrix matrix :inline :offset 176) - (inv-i-world matrix :inline :offset 240) ) :method-count-assert 26 :size-assert #x130 @@ -33356,7 +33342,7 @@ (deftype rigid-body-queue (structure) ((count int8 :offset-assert 0) - (array uint64 128 :offset 8) ;; TODO: unsure about type + (array handle 128 :offset 8) ;; TODO: unsure about type ) :method-count-assert 17 :size-assert #x408 @@ -33364,11 +33350,11 @@ (:methods (rigid-body-queue-method-9 (_type_) none 9) (rigid-body-queue-method-10 (_type_) none 10) - (rigid-body-queue-method-11 (_type_) none 11) + (rigid-body-queue-method-11 (_type_ rigid-body-object) none 11) (rigid-body-queue-method-12 (_type_ int int) none 12) - (rigid-body-queue-method-13 (_type_) none 13) + (rigid-body-queue-method-13 (_type_ int rigid-body-object) none 13) (rigid-body-queue-method-14 (_type_ int) none 14) - (rigid-body-queue-method-15 (_type_) none 15) + (rigid-body-queue-method-15 (_type_ rigid-body-object) none 15) (validate (_type_) symbol 16) ) ) @@ -38131,9 +38117,8 @@ ;; forresca-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype fort-elec-button (cty-guard-turret-button) - ((start-up? basic :offset-assert 284) + ((start-up? symbol :offset-assert 288) ) :method-count-assert 41 :size-assert #x124 @@ -38142,11 +38127,9 @@ (waiting () _type_ :state 40) ) ) -|# -#| (deftype fort-led (process-drawable) - ((button-actor basic :offset-assert 196) + ((button-actor entity-actor :offset-assert 200) ) :method-count-assert 22 :size-assert #xcc @@ -38156,25 +38139,25 @@ (green () _type_ :state 21) ) ) -|# -#| (deftype elec-lock-gate (fort-elec-gate) - () + ( + (actor-group (pointer actor-group) :offset-assert 516) + (actor-group-count int32 :offset-assert 520) + (all-gone? symbol :offset-assert 524) + ) :method-count-assert 32 :size-assert #x210 :flag-assert #x2001900210 - ;; Failed to read fields. (:methods (pre-shutdown () _type_ :state 30) - (elec-lock-gate-method-31 () none 31) + (elec-lock-gate-method-31 (_type_ symbol) symbol 31) ) ) -|# -;; (define-extern fortress-login function) -;; (define-extern fortress-deactivate function) -;; (define-extern fortress-activate function) +(define-extern fortress-login (function none)) +(define-extern fortress-deactivate (function none)) +(define-extern fortress-activate (function level none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; rhino ;; @@ -38683,19 +38666,18 @@ ;; intro-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype intro-flamer (process-drawable) - ((up-dir vector :inline :offset-assert 204) - (average-dir vector :inline :offset-assert 220) - (id int32 :offset-assert 236) - (path-u float :offset-assert 240) - (path-du float :offset-assert 244) - (z-rot float :offset-assert 248) - (flit-prev-offset vector :inline :offset-assert 252) - (flit-next-offset vector :inline :offset-assert 268) - (flit-factor float :offset-assert 284) - (flit-timer uint64 :offset-assert 292) - (flit-interval uint64 :offset-assert 300) + ((up-dir vector :inline :offset-assert 208) + (average-dir vector :inline :offset-assert 224) + (id int32 :offset-assert 240) + (path-u float :offset-assert 244) + (path-du float :offset-assert 248) + (z-rot float :offset-assert 252) + (flit-prev-offset vector :inline :offset-assert 256) + (flit-next-offset vector :inline :offset-assert 272) + (flit-factor float :offset-assert 288) + (flit-timer uint64 :offset-assert 296) + (flit-interval uint64 :offset-assert 304) ) :method-count-assert 23 :size-assert #x138 @@ -38703,34 +38685,25 @@ (:methods (idle () _type_ :state 20) (die () _type_ :state 21) - (intro-flamer-method-22 () none 22) + (intro-flamer-method-22 (_type_) path-control 22) ) ) -|# -#| (deftype metalhead-spawner (process) - ((path-tbl UNKNOWN 19 :offset-assert 124) - (init-pos vector :inline :offset-assert 204) - (average-dir vector :inline :offset-assert 220) + ((path-tbl path-control 19 :offset-assert 128) + (init-pos vector :inline :offset-assert 208) + (average-dir vector :inline :offset-assert 224) ) :method-count-assert 17 :size-assert #xf0 :flag-assert #x11007000f0 (:methods - (metalhead-spawner-method-9 () none 9) - (metalhead-spawner-method-10 () none 10) - (metalhead-spawner-method-11 () none 11) - (metalhead-spawner-method-12 () none 12) - (metalhead-spawner-method-13 () none 13) (idle () _type_ :state 14) (active () _type_ :state 15) (die () _type_ :state 16) ) ) -|# -#| (deftype vil-windmill-sail (process-drawable) () :method-count-assert 21 @@ -38740,15 +38713,13 @@ (idle () _type_ :state 20) ) ) -|# -;; (define-extern intro-flamer-init-by-other function) +(define-extern intro-flamer-init-by-other (function int path-control vector none :behavior intro-flamer)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; vortex-data ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype vortex-vertex (structure) ((pos vector :inline :offset-assert 0) (stq vector :inline :offset-assert 16) @@ -38757,19 +38728,15 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype vortex-vert-array (structure) - ((data UNKNOWN 306 :offset-assert 0) + ((data vortex-vertex 306 :inline :offset-assert 0) ) :method-count-assert 9 :size-assert #x2640 :flag-assert #x900002640 ) -|# -#| (deftype vortex-work (basic) ((giftag dma-gif :inline :offset-assert 16) (off-s-0 uint16 :offset-assert 32) @@ -38785,13 +38752,12 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# -;; (define-extern *vortex-work* vortex-work) -;; (define-extern *vortex-vert-array* object) -;; (define-extern *vortex-poly* object) -;; (define-extern *vortex-tvals* object) -;; (define-extern init-vortex-polys function) +(define-extern *vortex-work* vortex-work) +(define-extern *vortex-vert-array* vortex-vert-array) +(define-extern *vortex-poly* "TODO - this is a guess based on similarly named fields, it's a MASSIVE empty array" (inline-array vortex-vertex)) +(define-extern *vortex-tvals* "TODO - also a guess, just a bunch of floats" (pointer float)) +(define-extern init-vortex-polys (function none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; vortex ;; @@ -39846,7 +39812,6 @@ ;; ctyfarm-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype shaker (structure) ((axis vector :inline :offset-assert 0) (start-time time-frame :offset-assert 16) @@ -39863,15 +39828,13 @@ :size-assert #x38 :flag-assert #xa00000038 (:methods - (shaker-method-9 () none 9) + (shaker-method-9 (_type_) none 9) ) ) -|# -#| (deftype farm-marrow (process-focusable) - ((shakers UNKNOWN 5 :offset-assert 204) - (incoming-attack-id uint32 :offset-assert 524) + ((shakers shaker 5 :inline :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 528) ) :method-count-assert 31 :size-assert #x214 @@ -39879,16 +39842,14 @@ (:methods (idle () _type_ :state 27) (die () _type_ :state 28) - (farm-marrow-method-29 () none 29) - (farm-marrow-method-30 () none 30) + (farm-marrow-method-29 (_type_) none 29) + (farm-marrow-method-30 (_type_) none 30) ) ) -|# -#| (deftype farm-beetree (process-focusable) - ((shakers UNKNOWN 2 :offset-assert 204) - (incoming-attack-id uint32 :offset-assert 332) + ((shakers shaker 2 :inline :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 336) ) :method-count-assert 31 :size-assert #x154 @@ -39896,16 +39857,14 @@ (:methods (idle () _type_ :state 27) (die () _type_ :state 28) - (farm-beetree-method-29 () none 29) - (farm-beetree-method-30 () none 30) + (farm-beetree-method-29 (_type_) none 29) + (farm-beetree-method-30 (_type_) none 30) ) ) -|# -#| (deftype farm-cabbage (process-focusable) - ((shakers UNKNOWN 2 :offset-assert 204) - (incoming-attack-id uint32 :offset-assert 332) + ((shakers shaker 2 :inline :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 336) ) :method-count-assert 31 :size-assert #x154 @@ -39913,16 +39872,14 @@ (:methods (idle () _type_ :state 27) (die () _type_ :state 28) - (farm-cabbage-method-29 () none 29) - (farm-cabbage-method-30 () none 30) + (farm-cabbage-method-29 (_type_) none 29) + (farm-cabbage-method-30 (_type_) none 30) ) ) -|# -#| (deftype farm-small-cabbage (process-focusable) - ((shakers UNKNOWN 1 :offset-assert 204) - (incoming-attack-id uint32 :offset-assert 268) + ((shakers shaker 1 :inline :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 272) ) :method-count-assert 31 :size-assert #x114 @@ -39930,16 +39887,14 @@ (:methods (idle () _type_ :state 27) (die () _type_ :state 28) - (farm-small-cabbage-method-29 () none 29) - (farm-small-cabbage-method-30 () none 30) + (farm-small-cabbage-method-29 (_type_) none 29) + (farm-small-cabbage-method-30 (_type_) none 30) ) ) -|# -#| (deftype farm-chilirots (process-focusable) - ((shakers UNKNOWN 4 :offset-assert 204) - (incoming-attack-id uint32 :offset-assert 460) + ((shakers shaker 4 :inline :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 464) ) :method-count-assert 31 :size-assert #x1d4 @@ -39947,13 +39902,11 @@ (:methods (idle () _type_ :state 27) (die () _type_ :state 28) - (farm-chilirots-method-29 () none 29) - (farm-chilirots-method-30 () none 30) + (farm-chilirots-method-29 (_type_) none 29) + (farm-chilirots-method-30 (_type_) none 30) ) ) -|# -#| (deftype farm-sprinkler-barrels (process-focusable) () :method-count-assert 30 @@ -39961,25 +39914,24 @@ :flag-assert #x1e005000cc (:methods (idle () _type_ :state 27) - (farm-sprinkler-barrels-method-28 () none 28) - (farm-sprinkler-barrels-method-29 () none 29) + (farm-sprinkler-barrels-method-28 (_type_) none 28) + (farm-sprinkler-barrels-method-29 (_type_) none 29) ) ) -|# -;; (define-extern check-farm-piece-ground function) -;; (define-extern pu->knocked-type function) -;; (define-extern *farm-marrow-exploder-params* joint-exploder-static-params) -;; (define-extern farm-marrow-callback function) -;; (define-extern *farm-beetree-exploder-params* joint-exploder-static-params) -;; (define-extern farm-beetree-callback function) -;; (define-extern *farm-cabbage-exploder-params* joint-exploder-static-params) -;; (define-extern farm-cabbage-callback function) -;; (define-extern *farm-small-cabbage-exploder-params* joint-exploder-static-params) -;; (define-extern farm-small-cabbage-callback function) -;; (define-extern *farm-chilirots-exploder-params* joint-exploder-static-params) -;; (define-extern farm-chilirots-callback function) -;; (define-extern farm-activate function) +(define-extern check-farm-piece-ground (function sparticle-system sparticle-cpuinfo matrix none)) +(define-extern pu->knocked-type (function penetrate knocked-type)) +(define-extern *farm-marrow-exploder-params* joint-exploder-static-params) +(define-extern farm-marrow-callback (function cspace transformq none)) +(define-extern *farm-beetree-exploder-params* joint-exploder-static-params) +(define-extern farm-beetree-callback (function cspace transformq none)) +(define-extern *farm-cabbage-exploder-params* joint-exploder-static-params) +(define-extern farm-cabbage-callback (function cspace transformq none)) +(define-extern *farm-small-cabbage-exploder-params* joint-exploder-static-params) +(define-extern farm-small-cabbage-callback (function cspace transformq none)) +(define-extern *farm-chilirots-exploder-params* joint-exploder-static-params) +(define-extern farm-chilirots-callback (function cspace transformq none)) +(define-extern farm-activate (function level none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctyfarma-part ;; @@ -41747,43 +41699,41 @@ ;; shuttle ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype citizen-rebel (citizen-norm) - ((nav-mesh-aid uint32 :offset-assert 1056) - (done? basic :offset-assert 1060) - (task-node uint16 :offset-assert 1064) - (end-pos vector :inline :offset-assert 1068) - (index uint32 :offset-assert 1084) - (gui-id uint32 :offset-assert 1088) - ) - :method-count-assert 219 - :size-assert #x448 - :flag-assert #xdb03d00448 - (:methods - ) - ) -|# +;; (declare-type citizen nav-enemy) +;; (declare-type citizen-norm citizen) +;; (deftype citizen-rebel (citizen-norm) +;; ((nav-mesh-aid uint32 :offset-assert 1056) +;; (done? basic :offset-assert 1060) +;; (task-node uint16 :offset-assert 1064) +;; (end-pos vector :inline :offset-assert 1068) +;; (index uint32 :offset-assert 1084) +;; (gui-id uint32 :offset-assert 1088) +;; ) +;; :method-count-assert 219 +;; :size-assert #x448 +;; :flag-assert #xdb03d00448 +;; (:methods +;; ) +;; ) -#| -(deftype city-shuttle-info (structure) - ((pos vector :inline :offset-assert 0) - (level basic :offset-assert 16) - (nav-mesh-id uint32 :offset-assert 20) - (time time-frame :offset-assert 24) - ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 - ) -|# +;; (deftype city-shuttle-info (structure) +;; ((pos vector :inline :offset-assert 0) +;; (level basic :offset-assert 16) +;; (nav-mesh-id uint32 :offset-assert 20) +;; (time time-frame :offset-assert 24) +;; ) +;; :method-count-assert 9 +;; :size-assert #x20 +;; :flag-assert #x900000020 +;; ) ;; (define-extern *citizen-rebel-global-info* civilian-global-info) ;; (define-extern *citizen-rebel-nav-enemy-info* nav-enemy-info) -;; (define-extern shuttle-init function) -;; (define-extern shuttle-cleanup function) -;; (define-extern shuttle-update function) -;; (define-extern *city-shuttle-info* array) -;; (define-extern *city-burning-bush-shuttle-1-info* array) +;; ;; (define-extern shuttle-init function) +;; ;; (define-extern shuttle-cleanup function) +;; ;; (define-extern shuttle-update function) +;; ;; (define-extern *city-shuttle-info* array) +;; ;; (define-extern *city-burning-bush-shuttle-1-info* array) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; fordumpa-texture ;; @@ -43252,7 +43202,7 @@ (deftype bombbot-path (structure) ((node-count uint16 :offset-assert 0) - (node uint32 :offset-assert 4) + (node (inline-array bombbot-node) :offset-assert 4) ) :method-count-assert 9 :size-assert #x8 @@ -43264,18 +43214,17 @@ ;; bombbot-path ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *bombbot-path-1* object) -;; (define-extern *bombbot-path-2* object) -;; (define-extern *bombbot-path-3* object) -;; (define-extern *bombbot-path-4* object) -;; (define-extern *bombbot-path-5* object) -;; (define-extern *bombbot-path-6* object) +(define-extern *bombbot-path-1* bombbot-path) +(define-extern *bombbot-path-2* bombbot-path) +(define-extern *bombbot-path-3* bombbot-path) +(define-extern *bombbot-path-4* bombbot-path) +(define-extern *bombbot-path-5* bombbot-path) +(define-extern *bombbot-path-6* bombbot-path) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; bombbot ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype bombbot-foot (structure) ((pos-offset vector :inline :offset-assert 0) (joint-index uint32 :offset-assert 16) @@ -43284,76 +43233,74 @@ (next-position vector :inline :offset-assert 48) (real-position vector :inline :offset-assert 64) (speed vector :inline :offset-assert 80) - (moving basic :offset-assert 96) + (moving symbol :offset-assert 96) (main-y float :offset-assert 100) (delta-y float :offset-assert 104) ) + :pack-me :method-count-assert 9 :size-assert #x6c :flag-assert #x90000006c ) -|# -#| (deftype bombbot (nav-enemy) - ((joint-ik UNKNOWN 4 :offset-assert 600) - (feet UNKNOWN 4 :offset-assert 620) - (legs-strength UNKNOWN 4 :offset-assert 1068) - (last-trans vector :inline :offset-assert 1084) - (linear-speed vector :inline :offset-assert 1100) - (last-quat quaternion :inline :offset-assert 1116) - (y-angular-velocity float :offset-assert 1132) - (main-quat quaternion :inline :offset-assert 1148) - (main-spd-y float :offset-assert 1164) - (main-pos-y float :offset-assert 1168) - (main-pos vector :inline :offset-assert 1180) - (city-path bombbot-path :offset-assert 1196) - (current-node uint32 :offset-assert 1200) - (shot-count uint32 :offset-assert 1204) - (next-shoot uint64 :offset-assert 1212) - (stop-shoot uint64 :offset-assert 1220) - (next-target uint64 :offset-assert 1228) - (start-target uint64 :offset-assert 1236) - (beep-time time-frame :offset-assert 1244) - (target-pos vector :inline :offset-assert 1260) - (start-target-pos vector :inline :offset-assert 1276) - (start-target-vel vector :inline :offset-assert 1292) - (top-quat quaternion :inline :offset-assert 1308) - (gun-swivel-quat quaternion :inline :offset-assert 1324) - (gun-quat quaternion :inline :offset-assert 1340) - (angle-turret float :offset-assert 1356) - (angle-gun float :offset-assert 1360) - (high float :offset-assert 1364) - (shield-hit-points float :offset-assert 1368) - (hit-axis vector :inline :offset-assert 1372) - (rigidbody basic :offset-assert 1388) - (info rigid-body-object-constants :offset-assert 1392) - (explosing basic :offset-assert 1396) - (minimap connection-minimap :offset-assert 1400) - (lazer-sound uint32 :offset-assert 1404) - (head-sound uint32 :offset-assert 1408) - (cannon-sound uint32 :offset-assert 1412) - (last-head-roty-speed float :offset-assert 1416) - (head-roty-speed float :offset-assert 1420) - (last-cannon-roty-speed float :offset-assert 1424) - (cannon-roty-speed float :offset-assert 1428) + ((joint-ik joint-mod-ik 4 :offset-assert 604) + (feet bombbot-foot 4 :inline :offset-assert 624) + (legs-strength float 4 :offset-assert 1072) + (last-trans vector :inline :offset-assert 1088) + (linear-speed vector :inline :offset-assert 1104) + (last-quat quaternion :inline :offset-assert 1120) + (y-angular-velocity float :offset-assert 1136) + (main-quat quaternion :inline :offset-assert 1152) + (main-spd-y float :offset-assert 1168) + (main-pos-y float :offset-assert 1172) + (main-pos vector :inline :offset-assert 1184) + (city-path bombbot-path :offset-assert 1200) + (current-node uint32 :offset-assert 1204) + (shot-count uint32 :offset-assert 1208) + (next-shoot uint64 :offset-assert 1216) + (stop-shoot uint64 :offset-assert 1224) + (next-target uint64 :offset-assert 1232) + (start-target uint64 :offset-assert 1240) + (beep-time time-frame :offset-assert 1248) + (target-pos vector :inline :offset-assert 1264) + (start-target-pos vector :inline :offset-assert 1280) + (start-target-vel vector :inline :offset-assert 1296) + (top-quat quaternion :inline :offset-assert 1312) + (gun-swivel-quat quaternion :inline :offset-assert 1328) + (gun-quat quaternion :inline :offset-assert 1344) + (angle-turret float :offset-assert 1360) + (angle-gun float :offset-assert 1364) + (high float :offset-assert 1368) + (shield-hit-points float :offset-assert 1372) + (hit-axis vector :inline :offset-assert 1376) + (rigidbody rigid-body-control :offset-assert 1392) + (info rigid-body-object-constants :offset-assert 1396) + (explosing symbol :offset-assert 1400) + (minimap connection-minimap :offset-assert 1404) + (lazer-sound uint32 :offset-assert 1408) + (head-sound uint32 :offset-assert 1412) + (cannon-sound uint32 :offset-assert 1416) + (last-head-roty-speed float :offset-assert 1420) + (head-roty-speed float :offset-assert 1424) + (last-cannon-roty-speed float :offset-assert 1428) + (cannon-roty-speed float :offset-assert 1432) ) :method-count-assert 185 :size-assert #x59c :flag-assert #xb90520059c (:methods + (kill-prefer-falling () symbol :replace 73) (explode () _type_ :state 178) - (bombbot-method-179 () none 179) - (bombbot-method-180 () none 180) - (bombbot-method-181 () none 181) - (bombbot-method-182 () none 182) - (bombbot-method-183 () none 183) - (bombbot-method-184 () none 184) + (bombbot-method-179 (_type_) none 179) + (bombbot-method-180 (_type_) none 180) + (bombbot-method-181 (_type_ vector) none 181) + (bombbot-method-182 (_type_) none 182) + (bombbot-method-183 (_type_) none 183) + (bombbot-method-184 (_type_) none 184) ) ) -|# -#| (deftype ik-setup (structure) ((elbow-index int32 :offset-assert 0) (hand-dist float :offset-assert 4) @@ -43362,9 +43309,7 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype spring-setup (structure) ((bpos1 vector :offset-assert 0) (wpos2 vector :offset-assert 4) @@ -43373,9 +43318,7 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype bombbot-spawn-params (structure) ((position vector :inline :offset-assert 0) (quat quaternion :inline :offset-assert 16) @@ -43386,48 +43329,53 @@ :size-assert #x28 :flag-assert #x900000028 ) -|# -;; (define-extern *bombbot-body-constants* object) -;; (define-extern *bombbot-exploder-params* joint-exploder-static-params) -;; (define-extern *bombbot-nav-enemy-info* nav-enemy-info) -;; (define-extern *bombbot-ik-setup* array) -;; (define-extern bombbot-do-spline function) -;; (define-extern bombbot-spread-lightning-lazer function) -;; (define-extern bombbot-callback function) -;; (define-extern bombbot-head-callback function) -;; (define-extern bombbot-gun-swivel-callback function) -;; (define-extern bombbot-gun-callback function) -;; (define-extern *bombbot-spring-setup* array) -;; (define-extern bombbot-init-by-other function) +(define-extern *bombbot-body-constants* rigid-body-object-constants) +(define-extern *bombbot-exploder-params* joint-exploder-static-params) +(define-extern *bombbot-nav-enemy-info* nav-enemy-info) +(define-extern *bombbot-ik-setup* (array ik-setup)) +(define-extern bombbot-do-spline (function vector vector vector vector vector float vector)) +(define-extern bombbot-spread-lightning-lazer (function lightning-control vector vector vector none)) +(define-extern bombbot-callback (function cspace transformq none)) +(define-extern bombbot-head-callback (function cspace transformq none)) +(define-extern bombbot-gun-swivel-callback (function cspace transformq none)) +(define-extern bombbot-gun-callback (function cspace transformq none)) +(define-extern *bombbot-spring-setup* (array spring-setup)) +(define-extern bombbot-init-by-other (function bombbot-spawn-params none :behavior bombbot)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; demo-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype demo-control (process) - () + ( + (selected int32 :offset-assert 128) + (sprites hud-sprite 2 :inline :offset-assert 144) ;; elt size: 64 + (sprite-pos vector :inline :offset-assert 272) + (sprite-draw uint32 :offset-assert 288) + (buffer external-art-buffer 2 :offset-assert 292) ;; elt size: 4 + (want int32 2 :offset-assert 300) ;; elt size: 4 + (have int32 2 :offset-assert 308) ;; elt size: 4 + (draw int32 :offset-assert 316) + (active symbol :offset-assert 320) + (spark-time time-frame :offset-assert 328) + (gui-id uint32 :offset-assert 336) + ) :method-count-assert 15 :size-assert #x154 :flag-assert #xf00e00154 - ;; Failed to read fields. (:methods - (demo-control-method-9 () none 9) - (demo-control-method-10 () none 10) - (demo-control-method-11 () none 11) - (demo-control-method-12 () none 12) - (demo-control-method-13 () none 13) (idle () _type_ :state 14) ) ) -|# -;; (define-extern demo-plug-lightning function) -;; (define-extern demo-screen-change function) -;; (define-extern demo-wait-for-press function) -;; (define-extern demo-menu function) -;; (define-extern demo-control-init function) +;; TODO - defined in the kernel +(define-extern *demo-control* (pointer demo-control)) +(define-extern demo-plug-lightning (function process-drawable vector cspace none)) +(define-extern demo-screen-change (function symbol int symbol int none :behavior demo-control)) +(define-extern demo-wait-for-press (function time-frame time-frame symbol symbol)) +(define-extern demo-menu (function object :behavior demo-control)) +(define-extern demo-control-init (function none :behavior demo-control)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; credits ;; @@ -43471,7 +43419,6 @@ ;; palroof-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype pal-lowrez-throne (med-res-level) () :method-count-assert 21 @@ -43480,11 +43427,11 @@ (:methods ) ) -|# -#| (deftype pal-prong (process-drawable) - () + ( + (root-override collide-shape :offset 128 :score 100) + ) :method-count-assert 23 :size-assert #xc8 :flag-assert #x17005000c8 @@ -43494,10 +43441,9 @@ (broken () _type_ :state 22) ) ) -|# -;; (define-extern *pal-prong-exploder-params* joint-exploder-static-params) -;; (define-extern pal-prong-small-collision function) +(define-extern *pal-prong-exploder-params* joint-exploder-static-params) +(define-extern pal-prong-small-collision (function none :behavior pal-prong)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; palboss-texture ;; @@ -43697,182 +43643,257 @@ ;; roboguard-level ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype roboguard-level (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. +(deftype roboguard-level (nav-enemy) + ( + (unknown-n12kjh3n123 int32 5 :offset-assert 604) + (flags uint16 :offset-assert 624) + (roll-timer time-frame :offset-assert 632) + (roll-dir vector :inline :offset-assert 640) + (incoming-attack-id uint32 :offset-assert 656) + (turning-acc float :offset-assert 660) + (speed float :offset-assert 664) + (roll-attack-count uint32 :offset-assert 668) + (roll-sound uint32 :offset-assert 672) + ) + :method-count-assert 189 + :size-assert #x2a4 ;; 676 + :flag-assert #xbd023002a4 + (:methods + (roboguard-level-method-178 (_type_) none 178) + (roboguard-level-method-179 (_type_) none 179) + (roll-enter () _type_ :state 180) + (roll-hostile () _type_ :state 181) + (roll-to-walk () _type_ :state 182) + (idle-dizzy () _type_ :state 183) + (explode () _type_ :state 184) + (roboguard-level-method-185 (_type_ symbol) none 185) + (roboguard-level-method-186 (_type_) none 186) + (roboguard-level-method-187 (_type_) none 187) + (roboguard-level-method-188 (_type_) none 188)) ) -|# -;; (define-extern *roboguard-level-exploder-params* joint-exploder-static-params) -;; (define-extern *roboguard-level-nav-enemy-info* nav-enemy-info) -;; (define-extern roboguard-roll-travel-post function) +(define-extern *roboguard-level-exploder-params* joint-exploder-static-params) +(define-extern *roboguard-level-nav-enemy-info* nav-enemy-info) +(define-extern roboguard-roll-travel-post (function none :behavior roboguard-level)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; castle-texture ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *slime-clut* object) -;; (define-extern *toxic-slime-texture-anim-array* (texture-anim-array texture-anim)) -;; (define-extern set-slime-alphas function) -;; (define-extern get-slime-alphas function) -;; (define-extern set-slime-speed function) -;; (define-extern *cas-conveyor-texture-anim-array* (texture-anim-array texture-anim)) -;; (define-extern set-conveyor-speed! function) +(define-extern *slime-clut* clut16x16) +(define-extern *toxic-slime-texture-anim-array* (texture-anim-array texture-anim)) +(define-extern set-slime-alphas (function float float float float float)) +(define-extern get-slime-alphas (function none)) +(define-extern set-slime-speed (function float symbol)) +(define-extern *cas-conveyor-texture-anim-array* (texture-anim-array texture-anim)) +(define-extern set-conveyor-speed! (function int float none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; castle-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype cas-conveyor (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. +(deftype cas-conveyor (conveyor) + ( + (actor-group (pointer actor-group) :offset-assert 256) + (actor-group-count int32 :offset-assert 260) + (texture-anim-index uint32 :offset-assert 264) + (my-id int32 :offset-assert 268) + (sound-id uint32 :offset-assert 272) + (target-speed float :offset-assert 276) ) -|# - -#| -(deftype cas-conveyor-switch (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 28 + :size-assert #x118 ;; 280 + :flag-assert #x1c00a00118 ) -|# -#| -(deftype cas-electric-fence (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. +(deftype cas-conveyor-switch (process-focusable) + ( + (actor-group (pointer actor-group) :offset-assert 204) + (actor-group-count int32 :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 212) + (quat0 quaternion :inline :offset-assert 224) + (quat180 quaternion :inline :offset-assert 240) + (red-pos vector :inline :offset-assert 256) + (blue-pos vector :inline :offset-assert 272) + (track-flag symbol :offset-assert 288) + (lightning-timer time-frame :offset-assert 296) + (speed float :offset-assert 304) + (target-speed float :offset-assert 308) ) -|# - -#| -(deftype cas-button (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 28 + :size-assert #x138 ;; 312 + :flag-assert #x1c00c00138 + (:methods + (idle () _type_ :state 27)) ) -|# -#| -(deftype cas-elevator (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. +(deftype cas-electric-fence (process-focusable) + ( + (next-spawn-time time-frame :offset-assert 208) + (stop symbol :offset-assert 216) ) -|# - -#| -(deftype cas-rot-bridge (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 29 + :size-assert #xdc ;; 220 + :flag-assert #x1d006000dc + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28)) ) -|# -#| -(deftype cas-switch (UNKNOWN) +(deftype cas-button (basebutton) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 40 + :size-assert #x120 ;; 288 + :flag-assert #x2800a00120 + (:methods + (cas-button-method-39 (_type_) none 39)) ) -|# -#| -(deftype cas-trapdoor (UNKNOWN) +(deftype cas-elevator (elevator) + ( + (sound-id uint32 :offset-assert 368) + ) + :method-count-assert 50 + :size-assert #x174 ;; 372 + :flag-assert #x3201000174 + (:methods + (cas-elevator-method-49 (_type_) none 49)) + ) + +(deftype cas-rot-bridge (process-drawable) + ( + (index uint32 :offset-assert 200) + (anim-index uint32 :offset-assert 204) + (test-index uint32 :offset-assert 208) + (pos float :offset-assert 212) + (pos-old float :offset-assert 216) + (sound-id uint32 :offset-assert 220) + (sound-flag symbol :offset-assert 224) + ) + :method-count-assert 21 + :size-assert #xe4 ;; 228 + :flag-assert #x15007000e4 + (:methods + (idle () _type_ :state 20)) + ) + +(deftype cas-switch (process-drawable) + ( + (actor-group (pointer actor-group) :offset-assert 200) + (actor-group-count int32 :offset-assert 204) + (incoming-attack-id uint32 :offset-assert 208) + (anim-index uint32 :offset-assert 212) + (direction uint32 :offset-assert 216) + (pos-old float :offset-assert 220) + (y-start float :offset-assert 224) + (y-delta float :offset-assert 228) + (sound-id uint32 :offset-assert 232) + (sound-flag symbol :offset-assert 236) + ) + :method-count-assert 21 + :size-assert #xf0 ;; 240 + :flag-assert #x15007000f0 + (:methods + (idle () _type_ :state 20)) + ) + +(deftype cas-trapdoor (process-drawable) + ( + (root-override collide-shape :offset 128 :score 100) + ) + :method-count-assert 22 + :size-assert #xc8 ;; 200 + :flag-assert #x16005000c8 + (:methods + (idle () _type_ :state 20) + (die () _type_ :state 21)) + ) + +(deftype cas-chain-plat (process-focusable) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 30 + :size-assert #xcc ;; 204 + :flag-assert #x1e005000cc + (:methods + (idle () _type_ :state 27) + (drop () _type_ :state 28) + (down () _type_ :state 29)) ) -|# -#| -(deftype cas-chain-plat (UNKNOWN) +(deftype cas-rot-blade (process-drawable) + ( + (sync sync-eased :inline :offset-assert 200) + (rot float :offset-assert 244) + (attack-id uint32 :offset-assert 248) + (sound-id uint32 :offset-assert 252) + ) + :method-count-assert 21 + :size-assert #x100 ;; 256 + :flag-assert #x1500800100 + (:methods + (idle () _type_ :state 20)) + ) + +(deftype cas-flag-a (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 cas-rot-blade (UNKNOWN) +(deftype cas-flag-b (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 cas-flag-a (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. +(deftype cas-robot-door (process-drawable) + ( + (spawner-actor symbol :offset-assert 200) + (door-actor entity-actor 2 :offset-assert 204) ;; elt size: 4 + (spawn-count int32 :offset-assert 212) + (spawn-count-total int32 :offset-assert 216) + (spawn-max int32 :offset-assert 220) + (spawn-total int32 :offset-assert 224) + (notice-dist float :offset-assert 228) + (player-dist float :offset-assert 232) + (anim-index int32 :offset-assert 236) + (last-guard handle :offset-assert 240) + (actor-group (pointer actor-group) :offset-assert 248) + (actor-group-count int32 :offset-assert 252) ) -|# - -#| -(deftype cas-flag-b (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 23 + :size-assert #x100 ;; 256 + :flag-assert #x1700800100 + (:methods + (idle () _type_ :state 20) + (spawning () _type_ :state 21) + (castle-wait-end () _type_ :state 22)) ) -|# -#| -(deftype cas-robot-door (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. +(deftype lightning-ball (process-drawable) + ( + (root-override collide-shape :offset 128 :score 100) + (timer time-frame :offset-assert 200) ) -|# - -#| -(deftype lightning-ball (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 21 + :size-assert #xd0 ;; 208 + :flag-assert #x15005000d0 + (:methods + (idle () _type_ :state 20)) ) -|# -;; (define-extern *cas-conveyor-room-id* object) -;; (define-extern sound-update function) -;; (define-extern *cas-electric-fence-exploder-params* joint-exploder-static-params) -;; (define-extern *cas-trapdoor-exploder-params* joint-exploder-static-params) -;; (define-extern *cas-rot-blade-shadow-control* shadow-control) -;; (define-extern cas-rot-blade-callback function) +(define-extern *cas-conveyor-room-id* int) +(define-extern sound-update (function none :behavior cas-conveyor)) +(define-extern *cas-electric-fence-exploder-params* joint-exploder-static-params) +(define-extern *cas-trapdoor-exploder-params* joint-exploder-static-params) +(define-extern *cas-rot-blade-shadow-control* shadow-control) +(define-extern cas-rot-blade-callback (function cspace transformq none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; castle-part ;; @@ -44435,10 +44456,9 @@ ;; forrescb-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype fort-twist-rail (process-drawable) - ((sync sync-eased :inline :offset-assert 196) - (init-quat quaternion :inline :offset-assert 252) + ((sync sync-eased :inline :offset-assert 200) + (init-quat quaternion :inline :offset-assert 256) ) :method-count-assert 21 :size-assert #x110 @@ -44447,17 +44467,15 @@ (idle () _type_ :state 20) ) ) -|# -#| (deftype fort-elec-belt-inst (process-drawable) - ((l-spec basic :offset-assert 196) - (l-bolt basic :offset-assert 200) - (points UNKNOWN 17 :offset-assert 204) - (path-u float :offset-assert 476) - (path-du float :offset-assert 480) - (attack-id uint32 :offset-assert 484) - (sound-id uint32 :offset-assert 488) + ((l-spec lightning-spec :offset-assert 200) + (l-bolt lightning-control :offset-assert 204) + (points vector 17 :inline :offset-assert 208) + (path-u float :offset-assert 480) + (path-du float :offset-assert 484) + (attack-id uint32 :offset-assert 488) + (sound-id uint32 :offset-assert 492) ) :method-count-assert 23 :size-assert #x1f0 @@ -44468,34 +44486,25 @@ (die () _type_ :state 22) ) ) -|# -#| (deftype fort-elec-belt (process) - ((l-spec basic :offset-assert 124) - (next-spawn-time time-frame :offset-assert 132) - (path basic :offset-assert 140) - (init-quat quaternion :inline :offset-assert 156) - (sync sync-linear :inline :offset-assert 172) - (attack-id uint32 :offset-assert 188) - (path-du float :offset-assert 192) + ((l-spec lightning-spec :offset-assert 128) + (next-spawn-time time-frame :offset-assert 136) + (path path-control :offset-assert 144) + (init-quat quaternion :inline :offset-assert 160) + (sync sync-linear :inline :offset-assert 176) + (attack-id uint32 :offset-assert 192) + (path-du float :offset-assert 196) ) :method-count-assert 16 :size-assert #xc8 :flag-assert #x10005000c8 (:methods - (fort-elec-belt-method-9 () none 9) - (fort-elec-belt-method-10 () none 10) - (fort-elec-belt-method-11 () none 11) - (fort-elec-belt-method-12 () none 12) - (fort-elec-belt-method-13 () none 13) (idle () _type_ :state 14) - (fort-elec-belt-method-15 () none 15) + (fort-elec-belt-method-15 (_type_) none 15) ) ) -|# -#| (deftype fort-conveyor (conveyor) () :method-count-assert 28 @@ -44504,9 +44513,8 @@ (:methods ) ) -|# -;; (define-extern fort-elec-belt-inst-init-by-other function) +(define-extern fort-elec-belt-inst-init-by-other (function quaternion float float lightning-spec uint none :behavior fort-elec-belt-inst)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; spydroid ;; @@ -44552,9 +44560,10 @@ ;; pal-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype pal-falling-plat (process-drawable) - () + ( + (root-override collide-shape-moving :offset 128 :score 100) + ) :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 @@ -44563,9 +44572,7 @@ (fall () _type_ :state 21) ) ) -|# -#| (deftype pal-ent-door (com-airlock) () :method-count-assert 28 @@ -44574,12 +44581,10 @@ (:methods ) ) -|# -#| (deftype pal-grind-ring-center (process-focusable) - ((speed-y float :offset-assert 200) - (hit-sound-played? basic :offset-assert 204) + ((speed-y float :offset-assert 204) + (hit-sound-played? basic :offset-assert 208) ) :method-count-assert 30 :size-assert #xd4 @@ -44587,15 +44592,13 @@ (:methods (idle () _type_ :state 27) (die () _type_ :state 28) - (pal-grind-ring-center-method-29 () none 29) + (pal-grind-ring-center-method-29 (_type_) none 29) ) ) -|# -#| (deftype pal-grind-ring (process-focusable) - ((speed-y float :offset-assert 200) - (hit-sound-played? basic :offset-assert 204) + ((speed-y float :offset-assert 204) + (hit-sound-played? basic :offset-assert 208) ) :method-count-assert 30 :size-assert #xd4 @@ -44603,12 +44606,10 @@ (:methods (idle () _type_ :state 27) (fall () _type_ :state 28) - (pal-grind-ring-method-29 () none 29) + (pal-grind-ring-method-29 (_type_) none 29) ) ) -|# -#| (deftype pal-ent-glass (process-focusable) () :method-count-assert 31 @@ -44617,13 +44618,11 @@ (:methods (idle () _type_ :state 27) (die () _type_ :state 28) - (pal-ent-glass-method-29 () none 29) - (pal-ent-glass-method-30 () none 30) + (pal-ent-glass-method-29 (_type_) none 29) + (pal-ent-glass-method-30 (_type_) none 30) ) ) -|# -#| (deftype palent-turret-shot (guard-shot) () :method-count-assert 40 @@ -44632,23 +44631,19 @@ (:methods ) ) -|# -#| (deftype palent-turret (process-focusable) - ((next-shoot uint64 :offset-assert 204) + ((next-shoot uint64 :offset-assert 208) ) :method-count-assert 29 :size-assert #xd8 :flag-assert #x1d006000d8 (:methods (idle () _type_ :state 27) - (palent-turret-method-28 () none 28) + (palent-turret-method-28 (_type_) none 28) ) ) -|# -#| (deftype pal-breakable-window (process-focusable) () :method-count-assert 31 @@ -44657,17 +44652,16 @@ (:methods (idle () _type_ :state 27) (die () _type_ :state 28) - (pal-breakable-window-method-29 () none 29) - (pal-breakable-window-method-30 () none 30) + (pal-breakable-window-method-29 (_type_) none 29) + (pal-breakable-window-method-30 (_type_) none 30) ) ) -|# -;; (define-extern *pal-grind-ring-center-exploder-params* joint-exploder-static-params) -;; (define-extern pal-grind-ring-center-init-by-other function) -;; (define-extern *pal-ent-glass-exploder-params* joint-exploder-static-params) -;; (define-extern palent-turret-callback function) -;; (define-extern *pal-breakable-window-exploder-params* joint-exploder-static-params) +(define-extern *pal-grind-ring-center-exploder-params* joint-exploder-static-params) +(define-extern pal-grind-ring-center-init-by-other (function entity-actor none :behavior pal-grind-ring-center)) +(define-extern *pal-ent-glass-exploder-params* joint-exploder-static-params) +(define-extern palent-turret-callback (function cspace transformq none)) +(define-extern *pal-breakable-window-exploder-params* joint-exploder-static-params) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; title-obs ;; @@ -45253,185 +45247,230 @@ ;; stadium-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype water-anim-stadium (UNKNOWN) +(deftype water-anim-stadium (water-anim) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 29 + :size-assert #x100 ;; 256 + :flag-assert #x1d00800100 ) -|# -#| -(deftype dummy-vehicle (UNKNOWN) +(deftype dummy-vehicle (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 gar-curtain (UNKNOWN) +(deftype gar-curtain (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 rift-rider (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. +(deftype rift-rider (rigid-body-object) + ( + (escort-actor actor-reference 2 :inline :offset-assert 272) ;; elt size: 8 + (escort-force vector 2 :inline :offset-assert 288) ;; elt size: 16 + (brutter-balloon-actor entity-actor :offset-assert 320) + (path-pos float :offset-assert 324) + (dest-pos vector :inline :offset-assert 336) + (speed float :offset-assert 352) + (height float :offset-assert 356) + (init-height float :offset-assert 360) + (battle-entity-triggered int32 :offset-assert 364) + (battle-info-index int32 :offset-assert 368) + (sound-id uint32 :offset-assert 372) + (hover-volume float :offset-assert 376) + ) + :method-count-assert 58 + :size-assert #x17c ;; 380 + :flag-assert #x3a0100017c + (:methods + (defend-stadium-move () _type_ :state 53) + (defend-stadium-die () _type_ :state 54) + (defend-stadium-explode () _type_ :state 55) + (defend-stadium-land () _type_ :state 56) + (defend-stadium-complete () _type_ :state 57)) + (:states + defend-stadium-wait) ) -|# -#| -(deftype rift-rider-battle-info (UNKNOWN) +(deftype rift-rider-battle-info (structure) ((path-pos float :offset-assert 0) (entity-index int32 :offset-assert 4) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x8 ;; 8 + :flag-assert #x900000008 ) -|# -#| -(deftype spotlight (UNKNOWN) +(deftype spotlight (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 gar-door (UNKNOWN) +(deftype gar-door (com-airlock) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 28 + :size-assert #x174 ;; 372 + :flag-assert #x1c01000174 ) -|# -#| -(deftype stad-samos (UNKNOWN) +(deftype stad-samos (process-focusable) + ( + (root-override2 collide-shape-moving :offset 128 :score 101) + (rift-rider-actor entity-actor :offset-assert 204) + (lightning handle 4 :offset-assert 208) ;; elt size: 8 + (speed float :offset-assert 240) + (observed-speed float :offset-assert 244) + (cquery-timer time-frame :offset-assert 248) + (hit-dir vector :inline :offset-assert 256) + (hit-points float :offset-assert 272) + (max-hit-points float :offset-assert 276) + (incoming-attack-id uint32 :offset-assert 280) + (falling? symbol :offset-assert 284) + (lightning-on? symbol :offset-assert 288) + (enable-move? symbol :offset-assert 292) + (focus-disable-timer time-frame :offset-assert 296) + (stand-anim int32 :offset-assert 304) + (walk-anim int32 :offset-assert 308) + (raise-ship-anim int32 :offset-assert 312) + (knocked-back-anim int32 :offset-assert 316) + (knocked-back-land-anim int32 :offset-assert 320) + (knocked-forward-anim int32 :offset-assert 324) + (knocked-forward-land-anim int32 :offset-assert 328) + (death-anim int32 :offset-assert 332) + (death-end-anim int32 :offset-assert 336) + (knocked-anim int32 :offset-assert 340) + (knocked-land-anim int32 :offset-assert 344) + (hud handle :offset-assert 352) + (hud-bot-index int32 :offset-assert 360) + (rift-rider-joint-offset int32 :offset-assert 364) + (hand-joint int32 :offset-assert 368) + ) + :method-count-assert 36 + :size-assert #x174 ;; 372 + :flag-assert #x2401000174 + (:methods + (idle () _type_ :state 27) + (raise-rift-rider () _type_ :state 28) + (move-rift-rider () _type_ :state 29) + (hit () _type_ :state 30) + (die () _type_ :state 31) + (stad-samos-method-32 (_type_) none 32) + (stad-samos-method-33 (_type_) none 33) + (stad-samos-method-34 (_type_) none 34) + (stad-samos-method-35 (_type_) none 35)) + ) + +(deftype stad-youngsamos (stad-samos) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 36 + :size-assert #x174 ;; 372 + :flag-assert #x2401000174 ) -|# -#| -(deftype stad-youngsamos (UNKNOWN) +(deftype stadium-barrier (process-drawable) + ( + (color vector :inline :offset-assert 208) + (flash vector :inline :offset-assert 224) + (flashf float :offset-assert 240) + (colorf float :offset-assert 244) + ) + :method-count-assert 24 + :size-assert #xf8 ;; 248 + :flag-assert #x18008000f8 + (:methods + (idle () _type_ :state 20) + (die () _type_ :state 21) + (stadium-barrier-method-22 (_type_) none 22) + (stadium-barrier-method-23 (_type_) none 23)) + ) + +(deftype stad-force-field (process-focusable) + ( + (incoming-attack-id uint32 :offset-assert 204) + (plane plane :inline :offset-assert 208) + (field handle :offset-assert 224) + (ripple handle :offset-assert 232) + (next-message-time time-frame :offset-assert 240) + ) + :method-count-assert 30 + :size-assert #xf8 ;; 248 + :flag-assert #x1e008000f8 + (:methods + (idle () _type_ :state 27) + (stad-force-field-method-28 (_type_) none 28) + (stad-force-field-method-29 (_type_ vector) none 29)) + ) + +(deftype stad-c-force-field (stad-force-field) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 30 + :size-assert #xf8 ;; 248 + :flag-assert #x1e008000f8 ) -|# -#| -(deftype stadium-barrier (UNKNOWN) +(deftype stad-d-force-field (stad-force-field) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 30 + :size-assert #xf8 ;; 248 + :flag-assert #x1e008000f8 ) -|# -#| -(deftype stad-force-field (UNKNOWN) +(deftype stad-keira (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 stad-c-force-field (UNKNOWN) +(deftype stad-brutter (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 stad-d-force-field (UNKNOWN) +(deftype brutter-balloon (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 stad-keira (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. - ) -|# - -#| -(deftype stad-brutter (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. - ) -|# - -#| -(deftype brutter-balloon (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. - ) -|# - -;; (define-extern ripple-for-water-anim-stadium ripple-wave-set) -;; (define-extern *rift-rider-physics-constants* object) -;; (define-extern *rift-rider-force-points* array) -;; (define-extern *rift-rider-battle-table* array) -;; (define-extern defend-stadium-rift-rider-handler function) -;; (define-extern rift-rider-travel-post function) +(define-extern ripple-for-water-anim-stadium ripple-wave-set) +(define-extern *rift-rider-physics-constants* rigid-body-object-constants) +(define-extern *rift-rider-force-points* (array vector)) +(define-extern *rift-rider-battle-table* (array rift-rider-battle-info)) +(define-extern defend-stadium-rift-rider-handler (function process int symbol event-message-block object :behavior rift-rider)) +(define-extern rift-rider-travel-post (function none :behavior rift-rider)) ;; (define-extern rift-rider-bounce-reaction function) -;; (define-extern defend-stadium-wait state) -;; (define-extern *stad-nav-callback-info* object) -;; (define-extern *stad-samos-lightning-joint-tbl* array) -;; (define-extern stad-samos-post function) -;; (define-extern spawn-energy function) -;; (define-extern stad-samos-handler function) -;; (define-extern stadium-barrier-init-by-other function) -;; (define-extern stadium-barrier-spawn function) -;; (define-extern stad-keira-init-by-other function) -;; (define-extern stad-brutter-init-by-other function) -;; (define-extern *suppress-stadium* object) +(define-extern *stad-nav-callback-info* nav-callback-info) +(define-extern *stad-samos-lightning-joint-tbl* (array int32)) +(define-extern stad-samos-post (function none :behavior stad-samos)) +(define-extern spawn-energy (function none :behavior stad-samos)) +(define-extern stad-samos-handler (function process int symbol event-message-block object :behavior stad-samos)) +(define-extern stadium-barrier-init-by-other (function vector quaternion vector none :behavior stadium-barrier)) +(define-extern stadium-barrier-spawn (function stad-force-field vector quaternion vector (pointer process))) +(define-extern stad-keira-init-by-other (function none :behavior stad-keira)) +(define-extern stad-brutter-init-by-other (function none :behavior stad-keira)) +(define-extern *suppress-stadium* traffic-suppression-params) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; stadium-scenes ;; @@ -46752,10 +46791,9 @@ ;; delivery-task ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype krew-package (process-drawable) - ((attach-object uint64 :offset-assert 196) - (scale float :offset-assert 204) + ((attach-object handle :offset-assert 200) + (scale float :offset-assert 208) ) :method-count-assert 24 :size-assert #xd4 @@ -46763,16 +46801,15 @@ (:methods (idle () _type_ :state 20) (die () _type_ :state 21) - (krew-package-method-22 () none 22) - (krew-package-method-23 () none 23) + (krew-package-method-22 (_type_) none 22) + (krew-package-method-23 (_type_) none 23) ) ) -|# -;; (define-extern krew-package-init-by-other function) -;; (define-extern krew-package-spawn function) -;; (define-extern delivery-task-setup-ambush-1 function) -;; (define-extern delivery-task-setup-ambush-2 function) +(define-extern krew-package-init-by-other (function process-drawable none :behavior krew-package)) +(define-extern krew-package-spawn (function process process (pointer krew-package))) +(define-extern delivery-task-setup-ambush-1 (function none)) +(define-extern delivery-task-setup-ambush-2 (function none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; portrun ;; @@ -48278,9 +48315,8 @@ ;; sig-recorder ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype sig-path-info (basic) - ((name basic :offset-assert 4) + ((name string :offset-assert 4) (finish-center-p0 vector :inline :offset-assert 16) (finish-center-p1 vector :inline :offset-assert 32) ) @@ -48288,9 +48324,7 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype sigrec-sample (structure) ((sample-time time-frame :offset-assert 0) (pos vector :inline :offset-assert 16) @@ -48301,62 +48335,52 @@ :size-assert #x31 :flag-assert #x900000031 ) -|# -#| (deftype sig-recorder-samples (basic) - ((samples uint32 :offset-assert 4) + ((samples sigrec-sample :offset-assert 4) ) :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype sig-recorder (process) - ((path-num int32 :offset-assert 124) - (info basic :offset-assert 128) - (sample-count int32 :offset-assert 132) - (samples uint32 :offset-assert 136) - (state-time time-frame :offset-assert 140) - (start-time time-frame :offset-assert 148) - (finish-record-plane plane :inline :offset-assert 156) - (finish-record-center vector :inline :offset-assert 172) - (prev-pos vector :inline :offset-assert 188) + ((path-num int32 :offset-assert 128) + (info sig-path-info :offset-assert 132) + (sample-count int32 :offset-assert 136) + (samples sig-recorder-samples :offset-assert 140) + (state-time time-frame :offset-assert 144) + (start-time time-frame :offset-assert 152) + (finish-record-plane plane :inline :offset-assert 160) + (finish-record-center vector :inline :offset-assert 176) + (prev-pos vector :inline :offset-assert 192) ) :method-count-assert 29 :size-assert #xd0 :flag-assert #x1d005000d0 (:methods - (sig-recorder-method-9 () none 9) - (sig-recorder-method-10 () none 10) - (sig-recorder-method-11 () none 11) - (sig-recorder-method-12 () none 12) - (sig-recorder-method-13 () none 13) (idle () _type_ :state 14) (recording () _type_ :state 15) (fail-full () _type_ :state 16) (finished () _type_ :state 17) (save () _type_ :state 18) (fail-save () _type_ :state 19) - (sig-recorder-method-20 () none 20) - (sig-recorder-method-21 () none 21) - (sig-recorder-method-22 () none 22) - (sig-recorder-method-23 () none 23) - (sig-recorder-method-24 () none 24) - (sig-recorder-method-25 () none 25) - (sig-recorder-method-26 () none 26) - (sig-recorder-method-27 () none 27) - (sig-recorder-method-28 () none 28) + (sig-recorder-method-20 (_type_ int) none 20) + (sig-recorder-method-21 (_type_ vector vector) symbol 21) + (sig-recorder-method-22 (_type_) none 22) + (sig-recorder-method-23 (_type_) none 23) + (sig-recorder-method-24 (_type_) none 24) + (sig-recorder-method-25 (_type_ sigrec-sample) none 25) + (sig-recorder-method-26 (_type_ sigrec-sample sigrec-sample sigrec-sample float time-frame) none 26) + (sig-recorder-method-27 (_type_) symbol 27) + (sig-recorder-method-28 (_type_) none 28) ) ) -|# -;; (define-extern *sig-paths* array) -;; (define-extern *sig-recorder-samples* object) -;; (define-extern *sig-recorder* object) -;; (define-extern *sigrec-out* object) +(define-extern *sig-paths* (array sig-path-info)) +(define-extern *sig-recorder-samples* int) +(define-extern *sig-recorder* sig-recorder) +(define-extern *sigrec-out* string) ;; (define-extern sig-recorder-init-by-other function) (define-extern start-sig-recorder (function none)) @@ -48617,7 +48641,7 @@ (_type_ int) nav-node 41) (nav-graph-method-42 (_type_) none 42) (nav-graph-method-43 (_type_ nav-graph-link string) none 43) - (from-editor () none 44) + (from-editor (_type_ nav-node symbol) none 44) ) ) @@ -51658,8 +51682,8 @@ :flag-assert #x10003000b0 ) -;; (define-extern birth-func-race-poster (function int sparticle-cpuinfo sparticle-launchinfo none)) -;; (define-extern birth-func-ctywide-baron-propoganda-ticker-rotate (function int sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern birth-func-race-poster (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none)) +(define-extern birth-func-ctywide-baron-propoganda-ticker-rotate (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctywide-obs ;; @@ -52552,7 +52576,6 @@ ;; hiphog-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype hip-trophy-a (process-drawable) () :method-count-assert 21 @@ -52562,9 +52585,7 @@ (idle () _type_ :state 20) ) ) -|# -#| (deftype hip-trophy-d (process-drawable) () :method-count-assert 21 @@ -52574,9 +52595,7 @@ (idle () _type_ :state 20) ) ) -|# -#| (deftype hip-trophy-f (process-drawable) () :method-count-assert 21 @@ -52586,9 +52605,7 @@ (idle () _type_ :state 20) ) ) -|# -#| (deftype hip-trophy-g (process-drawable) () :method-count-assert 21 @@ -52598,9 +52615,7 @@ (idle () _type_ :state 20) ) ) -|# -#| (deftype hip-trophy-i (process-drawable) () :method-count-assert 21 @@ -52610,9 +52625,7 @@ (idle () _type_ :state 20) ) ) -|# -#| (deftype hip-trophy-j (process-drawable) () :method-count-assert 21 @@ -52622,9 +52635,7 @@ (idle () _type_ :state 20) ) ) -|# -#| (deftype hip-trophy-n (process-drawable) () :method-count-assert 21 @@ -52634,9 +52645,7 @@ (idle () _type_ :state 20) ) ) -|# -#| (deftype hip-trophy-m (process-drawable) () :method-count-assert 21 @@ -52646,7 +52655,6 @@ (idle () _type_ :state 20) ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/decompiler/config/jak2/anonymous_function_types.jsonc b/decompiler/config/jak2/anonymous_function_types.jsonc index 9c5e972883..45db832480 100644 --- a/decompiler/config/jak2/anonymous_function_types.jsonc +++ b/decompiler/config/jak2/anonymous_function_types.jsonc @@ -1095,5 +1095,74 @@ [4, "(function none :behavior task-manager)"], [5, "(function none :behavior task-manager)"], [6, "(function none :behavior task-manager)"] + ], + "oracle-training": [ + [0, "(function none :behavior task-manager)"], + [ + 1, + "(function process int symbol event-message-block object :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 process int symbol event-message-block object :behavior task-manager)" + ], + [9, "(function none :behavior task-manager)"], + [10, "(function none :behavior task-manager)"], + [11, "(function none :behavior task-manager)"], + [ + 12, + "(function process int symbol event-message-block object :behavior task-manager)" + ], + [13, "(function none :behavior task-manager)"], + [14, "(function none :behavior task-manager)"] + ], + "demo-obs": [ + [3, "(function external-art-buffer none)"], + [10, "(function process-drawable vector cspace object)"], + [11, "(function process-drawable none)"], + [12, "(function none)"] + ], + "delivery-task": [ + [0, "(function none :behavior task-manager)"], + [1, "(function none :behavior task-manager)"], + [2, "(function none :behavior task-manager)"], + [5, "(function none :behavior task-manager)"], + [6, "(function none :behavior task-manager)"] + ], + "stadium-obs": [ + [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)"], + [24, "(function none)"], + [61, "(function object nav-control none)"], + [62, "(function object nav-control none)"], + [63, "(function object nav-control none)"], + [64, "(function object nav-control none)"], + [65, "(function object nav-control none)"] + ], + "forrescb-obs": [ + [0, "(function none :behavior task-manager)"], + [1, "(function none :behavior task-manager)"] + ], + "bombbot": [ + [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)"] ] } diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index 0dc2b365f5..3c81298e23 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -210,7 +210,8 @@ "(method 22 fort-floor-spike-b)", "(method 22 fort-floor-spike-c)", "(method 11 sew-catwalk)", - "(method 11 mtn-aval-rocks)" + "(method 11 mtn-aval-rocks)", + "(method 11 gar-curtain)" ], // If format is used with the wrong number of arguments, @@ -328,7 +329,10 @@ 45 // goto 6 ], "(method 27 conveyor)": [5, 14, 22], - "(method 44 nav-graph)": [1, 3, 6, 13, 17], + "(method 44 nav-graph)": [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 14, 15, 16, 17, 18, 22, 24, 25, 26, 27, 30, 31, + 32, 33, 34, 35, 36 + ], "(method 11 sparticle-launch-control)": [ 18, 24, 25, 28, 29, 32, 33, 34, 36, 41, 55, 58, 93, 95 ], @@ -517,7 +521,13 @@ "(anon-function 16 kid-states)": [4, 5], "(anon-function 23 kid-states)": [4, 5], "(anon-function 16 kor-states)": [4, 5], - "(anon-function 23 kor-states)": [4, 5] + "(anon-function 23 kor-states)": [4, 5], + "(method 18 mysql-nav-graph)": [0, 1, 2, 3, 4, 7, 8, 9, 14, 16], + "(anon-function 2 rigid-body-queue)": [0, 1, 2, 3], + "(method 15 rigid-body-queue)": [5, 6, 7, 8, 9, 10, 11], + "(method 13 rigid-body-queue)": [5, 6, 7, 8, 9, 10, 11], + "(method 11 rigid-body-queue)": [0, 5, 6, 7, 8, 9, 10, 11, 17, 18, 25], + "(method 10 rigid-body-queue)": [0, 9, 10, 16, 24, 25, 26, 35, 36, 48] }, // Sometimes the game might use format strings that are fetched dynamically, @@ -593,7 +603,12 @@ [518, 0], [350, 0] ], - "(trans idle burning-bush)": [[171, 0]] + "(trans idle burning-bush)": [[171, 0]], + "(anon-function 11 oracle-training)": [[79, 0]], + "(anon-function 4 oracle-training)": [[79, 0]], + "(anon-function 0 oracle-training)": [[79, 0]], + "(anon-function 7 oracle-training)": [[79, 0]], + "(method 27 sig-recorder)": [[93, 0]] }, "mips2c_functions_by_name": [ diff --git a/decompiler/config/jak2/inputs.jsonc b/decompiler/config/jak2/inputs.jsonc index 8c5b4c670b..74c1e89bac 100644 --- a/decompiler/config/jak2/inputs.jsonc +++ b/decompiler/config/jak2/inputs.jsonc @@ -187,7 +187,9 @@ "levels_to_extract": [ "ATE.DGO", "ATO.DGO", + "CAB.DGO", "CAP.DGO", + "CAS.DGO", "CFA.DGO", "CFB.DGO", "CGA.DGO", @@ -208,6 +210,7 @@ "CWI.DGO", "D3A.DGO", "D3B.DGO", + "DEMO.DGO", "DG1.DGO", "DMI.DGO", "DRB.DGO", @@ -223,6 +226,7 @@ "FORDUMPD.DGO", "FRA.DGO", "FRB.DGO", + "LBOMBBOT.DGO", "GGA.DGO", "HIDEOUT.DGO", "HIPHOG.DGO", @@ -237,6 +241,7 @@ "LHIPOUT.DGO", "LINTCSTB.DGO", "LOUTCSTB.DGO", + "LPACKAGE.DGO", "LPORTRUN.DGO", "LPOWER.DGO", "LPROTECT.DGO", @@ -249,6 +254,7 @@ "LWIDEC.DGO", "MTN.DGO", "MTX.DGO", + "LYSAMSAM.DGO", "NEB.DGO", "NES.DGO", "ONINTENT.DGO", diff --git a/decompiler/config/jak2/label_types.jsonc b/decompiler/config/jak2/label_types.jsonc index 44050800d9..08a6425925 100644 --- a/decompiler/config/jak2/label_types.jsonc +++ b/decompiler/config/jak2/label_types.jsonc @@ -1297,5 +1297,88 @@ ["L274", "attack-info"], ["L220", "vector"] ], - "ctypower": [["L71", "vector"]] + "ctypower": [["L71", "vector"]], + "delivery-task": [ + ["L141", "vector"], + ["L140", "vector"] + ], + "stadium-obs": [ + ["L683", "uint64", true], + ["L677", "uint64", true], + ["L678", "uint64", true], + ["L681", "uint64", true], + ["L682", "uint64", true], + ["L684", "uint64", true], + ["L679", "uint64", true], + ["L680", "uint64", true], + ["L575", "uint64", true], + ["L574", "uint64", true], + ["L573", "uint64", true], + ["L572", "uint64", true], + ["L576", "uint64", true], + ["L571", "uint64", true], + ["L459", "attack-info"], + ["L457", "attack-info"] + ], + "forrescb-obs": [["L146", "attack-info"]], + "castle-obs": [ + ["L589", "uint64", true], + ["L582", "uint64", true], + ["L587", "uint64", true], + ["L588", "uint64", true], + ["L586", "uint64", true], + ["L590", "uint64", true], + ["L592", "uint64", true], + ["L593", "uint64", true], + ["L591", "uint64", true], + ["L584", "uint64", true], + ["L581", "uint64", true], + ["L585", "uint64", true], + ["L583", "uint64", true], + ["L478", "uint64", true], + ["L476", "uint64", true], + ["L481", "uint64", true], + ["L466", "uint64", true], + ["L430", "attack-info"], + ["L487", "uint64", true], + ["L477", "uint64", true], + ["L483", "uint64", true], + ["L470", "uint64", true], + ["L475", "uint64", true], + ["L479", "uint64", true], + ["L473", "uint64", true], + ["L485", "uint64", true], + ["L469", "uint64", true], + ["L472", "uint64", true], + ["L467", "uint64", true], + ["L484", "uint64", true], + ["L474", "uint64", true], + ["L366", "attack-info"], + ["L488", "uint64", true], + ["L486", "uint64", true], + ["L489", "uint64", true], + ["L468", "uint64", true], + ["L480", "uint64", true], + ["L482", "uint64", true], + ["L471", "uint64", true] + ], + "roboguard-level": [ + ["L196", "uint64", true], + ["L177", "uint64", true], + ["L179", "uint64", true], + ["L176", "uint64", true], + ["L175", "uint64", true], + ["L178", "uint64", true], + ["L180", "uint64", true], + ["L181", "uint64", true] + ], + "bombbot": [ + ["L289", "attack-info"], + ["L266", "quaternion"], + ["L260", "quaternion"] + ], + "vortex-data": [ + ["L25", "(inline-array vortex-vertex)", 1216], + ["L24", "(pointer float)", 20] + ] } diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index ea1f3e1fb4..447c2ed0c1 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -1766,7 +1766,6 @@ "(trans drill-laser-idle drill-laser)": [[16, "vector"]], "(code die drill-metalhead-eggs)": [[16, "vector"]], "drill-falling-door-handler": [[16, "attack-info"]], - "(method 12 city-level-info)": [[16, ["inline-array", "vector", 7]]], "(method 25 under-shoot-block)": [[16, "matrix"]], "(code victory under-block)": [[16, "matrix"]], "(code sink-partially under-block)": [[16, "matrix"]], @@ -1817,7 +1816,6 @@ [560, "bounding-box"] ], "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"], @@ -1841,5 +1839,79 @@ "(method 23 ctyport-mine)": [ [32, "vector"], [48, "vector"] - ] + ], + "(post idle intro-flamer)": [ + [160, "vector"], + [176, "vector"] + ], + "demo-plug-lightning": [[16, "vector"]], + "(code idle demo-control)": [ + [16, ["array", "symbol", 6]], + [48, ["array", "symbol", 6]] + ], + "(anon-function 2 delivery-task)": [[96, ["inline-array", "vector", 1]]], + "(post move-rift-rider stad-samos)": [ + [96, "vector"], + [128, "vector"] + ], + "(trans idle palent-turret)": [[32, "vector"]], + "(post idle fort-elec-belt-inst)": [[96, "event-message-block"]], + "(post running fort-elec-belt-inst)": [ + [1120, "collide-query"], + [144, "vector"], + [1680, "vector"], + [96, "event-message-block"], + [816, "bounding-box"], + [848, ["inline-array", "sphere", 17]] + ], + "(post idle cas-conveyor-switch)": [[592, "vector"]], + "(post idle cas-electric-fence)": [[688, "vector"]], + "(method 11 cas-switch)": [[32, "vector"]], + "(trans roll-hostile roboguard-level)": [[80, "vector"]], + "(code roll-hostile roboguard-level)": [[16, "vector"]], + "(method 74 roboguard-level)": [ + [16, "vector"], + [32, "vector"] + ], + "(method 76 roboguard-level)": [[32, "vector"]], + "(code spawning cas-robot-door)": [[16, "enemy-init-by-other-params"]], + "(method 179 bombbot)": [ + [592, "vector"], + [624, "vector"], + [672, "vector"], + [720, "vector"] + ], + "(method 182 bombbot)": [ + [144, "collide-query"], + [16, "matrix"], + [80, "matrix"], + [752, "quaternion"] + ], + "(trans hostile bombbot)": [[48, "vector"]], + "(enter explode bombbot)": [ + [112, "vector"], + [128, "vector"], + [144, "vector"], + [224, "vector"], + [240, "vector"] + ], + "(method 183 bombbot)": [ + [48, "vector"], + [64, "vector"], + [144, "vector"] + ], + "bombbot-spread-lightning-lazer": [ + [96, "vector"], + [64, "vector"] + ], + "bombbot-callback": [[64, "vector"]], + "bombbot-gun-swivel-callback": [ + [16, "vector"], + [80, "vector"] + ], + "bombbot-gun-callback": [ + [32, "vector"], + [80, "vector"] + ], + "(method 181 bombbot)": [[16, ["array", "collide-shape", 64]]] } diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index 8382e88156..216edafcd8 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -8690,5 +8690,271 @@ "(anon-function 0 ctypower)": [ [19, "a0", "vector"], [81, "v1", "basebutton"] - ] + ], + "(anon-function 3 oracle-training)": [[15, "v1", "float"]], + "(anon-function 6 oracle-training)": [[15, "v1", "float"]], + "(anon-function 10 oracle-training)": [[15, "v1", "float"]], + "(anon-function 14 oracle-training)": [[15, "v1", "float"]], + "(method 33 fort-elec-button)": [[31, "v1", "art-joint-anim"]], + "(enter shutdown elec-lock-gate)": [ + [4, "v0", "state"], + [6, "t9", "(function none)"] + ], + "(code idle intro-flamer)": [[18, "v1", "art-joint-anim"]], + "(method 7 metalhead-spawner)": [ + [26, "t9", "(function process int process)"] + ], + "(event idle farm-marrow)": [[[8, 11], "a1", "attack-info"]], + "(event idle farm-beetree)": [[[8, 11], "a1", "attack-info"]], + "(event idle farm-cabbage)": [[[8, 11], "a1", "attack-info"]], + "(event idle farm-small-cabbage)": [[[8, 11], "a1", "attack-info"]], + "(event idle farm-chilirots)": [[[8, 11], "a1", "attack-info"]], + "(code idle farm-sprinkler-barrels)": [[10, "v1", "art-joint-anim"]], + "farm-chilirots-callback": [ + [[2, 39], "s4", "farm-chilirots"], + [[3, 38], "s3", "int"] + ], + "farm-small-cabbage-callback": [ + [[2, 39], "s4", "farm-small-cabbage"], + [[3, 38], "s3", "int"] + ], + "farm-cabbage-callback": [ + [[2, 39], "s4", "farm-cabbage"], + [[3, 38], "s3", "int"] + ], + "farm-beetree-callback": [ + [[2, 39], "s4", "farm-beetree"], + [[3, 38], "s3", "int"] + ], + "farm-marrow-callback": [ + [[2, 39], "s4", "farm-marrow"], + [[3, 38], "s3", "int"] + ], + "demo-plug-lightning": [[95, "v1", "demo-control"]], + "(code idle demo-control)": [ + [[119, 123], "v1", "handle"], + [115, "gp", "handle"], + [[739, 743], "v1", "handle"], + [735, "gp", "handle"], + [[861, 865], "v1", "handle"], + [857, "gp", "handle"] + ], + "(post idle demo-control)": [ + [4, "v0", "process-drawable"], + [206, "v1", "external-art-buffer"], + [210, "v1", "external-art-buffer"], + [[307, 310], "v1", "dma-packet"] + ], + "pal-prong-small-collision": [[2, "v1", "collide-shape-prim-group"]], + "(post idle krew-package)": [[[12, 53], "gp", "process-focusable"]], + "(anon-function 6 delivery-task)": [[88, "v1", "vehicle"]], + "(method 25 elec-lock-gate)": [["_stack_", 16, "res-tag"]], + "birth-func-race-poster": [[27, "s4", "(array int32)"]], + "(anon-function 1 delivery-task)": [ + [178, "v1", "process-drawable"], + [16, "v1", "process-drawable"] + ], + "(anon-function 2 delivery-task)": [ + [14, "gp", "process-focusable"], + [71, "gp", "process-drawable"], + [292, "gp", "process-drawable"], + [187, "gp", "process-drawable"], + [199, "gp", "process-drawable"] + ], + "(code idle gar-curtain)": [[10, "v1", "art-joint-anim"]], + "(method 11 gar-curtain)": [ + [112, "v1", "collide-shape-prim-group"], + [118, "v1", "collide-shape-prim-group"] + ], + "(event defend-stadium-land rift-rider)": [ + [8, "v1", "vector"], + [20, "v1", "vector"] + ], + "(post defend-stadium-land rift-rider)": [[107, "v1", "process-drawable"]], + "(code idle stad-samos)": [[66, "v1", "art-joint-anim"]], + "(code raise-rift-rider stad-samos)": [[42, "v1", "art-joint-anim"]], + "(post move-rift-rider stad-samos)": [[43, "v0", "vector"]], + "spawn-energy": [[77, "gp", "process-drawable"]], + "stad-samos-handler": [ + [[38, 80], "s5", "attack-info"], + [52, "a0", "process-drawable"] + ], + "(code hit stad-samos)": [ + [20, "v1", "art-joint-anim"], + [92, "v1", "art-joint-anim"] + ], + "(code die stad-samos)": [ + [63, "v1", "art-joint-anim"], + [134, "v1", "art-joint-anim"] + ], + "(method 10 stad-samos)": [[42, "t9", "(function process-focusable none)"]], + "(method 29 stad-force-field)": [ + [155, "v1", "process-drawable"], + [418, "v1", "process-drawable"], + [423, "v1", "process-drawable"], + [190, "v1", "process-drawable"], + [272, "v1", "process-drawable"], + [291, "v1", "process-drawable"], + [310, "v1", "process-drawable"], + [328, "v1", "process-drawable"], + [349, "v1", "process-drawable"], + [356, "v1", "process-drawable"], + [365, "v1", "process-drawable"], + [385, "v1", "process-drawable"], + [388, "v1", "process-drawable"] + ], + "(event idle stad-force-field)": [[[9, 12], "v1", "attack-info"]], + "(post idle stad-keira)": [[14, "v0", "vector"]], + "(post idle stad-brutter)": [[14, "v0", "vector"]], + "(method 10 rift-rider)": [[10, "t9", "(function rigid-body-object none)"]], + "(method 45 rift-rider)": [ + [30, "t9", "(function rigid-body-object rigid-body-impact none)"] + ], + "(code fall pal-falling-plat)": [ + [10, "v1", "art-joint-anim"], + [70, "v1", "art-joint-anim"] + ], + "(post idle fort-elec-belt-inst)": [[20, "v0", "vector"]], + "(post running fort-elec-belt-inst)": [ + [20, "v0", "vector"], + [263, "s2", "collide-shape-prim-sphere"] + ], + "(method 10 fort-elec-belt-inst)": [ + [10, "t9", "(function process-drawable none)"] + ], + "(method 11 fort-elec-belt)": [[20, "v0", "(pointer float)"]], + "(method 10 rigid-body-queue)": [ + [[124, 134], "a0", "rigid-body-object"], + [[49, 65], "s4", "rigid-body-object"], + [20, "a0", "rigid-body-object"] + ], + "(method 15 hud)": [[[125, 128], "v1", "dma-packet"]], + "(method 10 cas-conveyor)": [[10, "t9", "(function conveyor none)"]], + "(post idle cas-conveyor)": [ + [58, "t9", "(function none)"], + [45, "v1", "float"] + ], + "(event idle cas-conveyor-switch)": [[[5, 8], "v1", "attack-info"]], + "(event up-idle cas-button)": [[[4, 13], "v1", "attack-info"]], + "(method 33 cas-button)": [[35, "v1", "art-joint-anim"]], + "(post waiting cas-elevator)": [[11, "t9", "(function none)"]], + "(post running cas-elevator)": [ + [9, "t9", "(function none)"], + [15, "v0", "sound-rpc-set-param"] + ], + "(post arrived cas-elevator)": [[11, "t9", "(function none)"]], + "(method 10 cas-elevator)": [[10, "t9", "(function elevator none)"]], + "(code idle cas-rot-bridge)": [ + [40, "v1", "art-joint-anim"], + [98, "v1", "art-joint-anim"], + [178, "v1", "art-joint-anim"], + [236, "v1", "art-joint-anim"], + [310, "v1", "art-joint-anim"], + [368, "v1", "art-joint-anim"], + [417, "v1", "art-joint-anim"], + [475, "v1", "art-joint-anim"] + ], + "(event idle cas-switch)": [ + [[4, 32], "gp", "attack-info"], + [15, "s5", "touching-shapes-entry"] + ], + "(code idle cas-switch)": [[21, "v1", "float"]], + "(event idle cas-trapdoor)": [[10, "gp", "attack-info"]], + "(code drop cas-chain-plat)": [[10, "v1", "art-joint-anim"]], + "(event idle cas-rot-blade)": [[7, "s4", "touching-shapes-entry"]], + "(method 10 cas-rot-blade)": [[10, "t9", "(function process-drawable none)"]], + "(code spawning cas-robot-door)": [ + [27, "v1", "art-joint-anim"], + [417, "v1", "art-joint-anim"] + ], + "(enter ambush roboguard-level)": [ + [4, "v0", "state"], + [6, "t9", "(function none)"], + [[72, 76], "a0", "process-focusable"] + ], + "(enter idle roboguard-level)": [ + [4, "v0", "state"], + [6, "t9", "(function none)"] + ], + "(enter stare roboguard-level)": [ + [4, "v0", "state"], + [6, "t9", "(function none)"] + ], + "(code roll-enter roboguard-level)": [[10, "v1", "art-joint-anim"]], + "(trans roll-hostile roboguard-level)": [ + [120, "gp", "process-focusable"], + [130, "gp", "process-focusable"], + [[157, 161], "gp", "process-focusable"] + ], + "(code roll-to-walk roboguard-level)": [[10, "v1", "art-joint-anim"]], + "(code idle-dizzy roboguard-level)": [[14, "v1", "art-joint-anim"]], + "(enter die roboguard-level)": [ + [4, "v0", "state"], + [6, "t9", "(function none)"] + ], + "(method 185 roboguard-level)": [ + [[5, 28], "v1", "collide-shape-prim-group"], + [[42, 65], "v1", "collide-shape-prim-group"], + [[81, 108], "v1", "collide-shape-prim-group"] + ], + "(method 77 roboguard-level)": [ + [30, "v1", "art-joint-anim"], + [58, "v1", "art-joint-anim"] + ], + "(method 78 roboguard-level)": [ + [24, "a2", "art-joint-anim"], + [53, "a2", "art-joint-anim"] + ], + "(method 74 roboguard-level)": [[[10, 13], "v1", "attack-info"]], + "(method 76 roboguard-level)": [ + [42, "s1", "process-drawable"], + [58, "s1", "process-drawable"] + ], + "(method 10 roboguard-level)": [[10, "t9", "(function nav-enemy none)"]], + "(method 7 roboguard-level)": [ + [9, "t9", "(function nav-enemy int nav-enemy)"] + ], + "(code castle-wait-end cas-robot-door)": [[32, "v1", "art-joint-anim"]], + "(method 11 cas-robot-door)": [ + ["_stack_", 16, "res-tag"], + ["_stack_", 32, "res-tag"], + [105, "v0", "(pointer int32)"] + ], + "(method 181 bombbot)": [ + [26, "a0", "collide-shape"], + [68, "s1", "process-focusable"], + [110, "gp", "process-focusable"] + ], + "(method 182 bombbot)": [ + [137, "v1", "collide-shape-prim"], + [177, "v1", "lightning-tracker"], + [192, "a0", "lightning-tracker"], + [197, "v1", "lightning-tracker"], + [204, "v1", "lightning-tracker"], + [209, "a0", "lightning-tracker"], + [216, "a0", "lightning-tracker"], + [223, "a1", "lightning-tracker"], + [263, "s2", "process-focusable"], + [229, "v1", "collide-shape-prim"], + [233, "v1", "collide-shape-prim"], + [252, "v1", "collide-shape-prim"], + [185, "v1", "lightning-tracker"], + [213, "v1", "lightning-tracker"] + ], + "(code hostile bombbot)": [[11, "v1", "art-joint-anim"]], + "(code die bombbot)": [[11, "v1", "art-joint-anim"]], + "(method 7 bombbot)": [[31, "t9", "(function nav-enemy int nav-enemy)"]], + "(anon-function 8 bombbot)": [[17, "s2", "bombbot"]], + "(anon-function 1 bombbot)": [[15, "s4", "bombbot"]], + "bombbot-callback": [[[2, 190], "s4", "bombbot"]], + "bombbot-head-callback": [[[2, 49], "s4", "bombbot"]], + "bombbot-gun-swivel-callback": [[[4, 87], "s3", "bombbot"]], + "bombbot-gun-callback": [[[6, 76], "s4", "bombbot"]], + "(method 179 bombbot)": [ + ["_stack_", 896, "float"], + ["_stack_", 912, "float"] + ], + "(method 11 cas-switch)": [["_stack_", 16, "res-tag"]], + "(method 11 cas-conveyor)": [["_stack_", 16, "res-tag"]], + "(method 11 cas-conveyor-switch)": [["_stack_", 16, "res-tag"]] } diff --git a/decompiler/util/data_decompile.cpp b/decompiler/util/data_decompile.cpp index 01c3362132..661ff53629 100644 --- a/decompiler/util/data_decompile.cpp +++ b/decompiler/util/data_decompile.cpp @@ -383,7 +383,18 @@ goos::Object decomp_ref_to_integer_array_guess_size( // the input is the location of the data field. // we expect that to be a label: ASSERT((field_location % 4) == 0); - auto pointer_to_data = words.at(field_location / 4); + auto& pointer_to_data = words.at(field_location / 4); + + // pointer-arrays can also be initialized as #f + if (pointer_to_data.kind() == LinkedWord::SYM_PTR) { + ASSERT_MSG( + pointer_to_data.symbol_name() == "#f", + fmt::format( + "attempted to decompile a pointer array of '{}', but encounted a non `#f` symbol", + array_elt_type.base_type())); + return pretty_print::to_symbol("#f"); + } + ASSERT(pointer_to_data.kind() == LinkedWord::PTR); // the data shouldn't have any labels in the middle of it, so we can find the end of the array @@ -467,7 +478,7 @@ goos::Object decomp_ref_to_inline_array_guess_size( // the input is the location of the data field. // we expect that to be a label: ASSERT((field_location % 4) == 0); - auto pointer_to_data = words.at(field_location / 4); + auto& pointer_to_data = words.at(field_location / 4); // inline-arrays can also be initialized as #f if (pointer_to_data.kind() == LinkedWord::SYM_PTR) { @@ -740,6 +751,7 @@ const std::unordered_map< {{"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)}}}, + {"bombbot-path", {{"node", ArrayFieldDecompMeta(TypeSpec("bombbot-node"), 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 08ae1dc8ff..f9559034b7 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.cpp +++ b/game/graphics/opengl_renderer/OpenGLRenderer.cpp @@ -247,6 +247,9 @@ void OpenGLRenderer::init_bucket_renderers_jak2() { init_bucket_renderer("tex-l4-pris2", BucketCategory::TEX, BucketId::TEX_L4_PRIS2); init_bucket_renderer("merc-l4-pris2", BucketCategory::MERC, BucketId::MERC_L4_PRIS2); + init_bucket_renderer("tex-l5-pris2", BucketCategory::TEX, + BucketId::TEX_L5_PRIS2); + init_bucket_renderer("merc-l5-pris2", BucketCategory::MERC, BucketId::MERC_L5_PRIS2); // 250 init_bucket_renderer("tex-l0-water", BucketCategory::TEX, BucketId::TEX_L0_WATER); diff --git a/game/graphics/opengl_renderer/buckets.h b/game/graphics/opengl_renderer/buckets.h index c43d1f1271..5a99f7a038 100644 --- a/game/graphics/opengl_renderer/buckets.h +++ b/game/graphics/opengl_renderer/buckets.h @@ -164,6 +164,8 @@ enum class BucketId { MERC_L3_PRIS2 = 237, TEX_L4_PRIS2 = 240, MERC_L4_PRIS2 = 241, + TEX_L5_PRIS2 = 244, + MERC_L5_PRIS2 = 245, TEX_L0_WATER = 252, MERC_L0_WATER = 253, TFRAG_W_L0_WATER = 255, diff --git a/goal_src/jak2/engine/ai/enemy-h.gc b/goal_src/jak2/engine/ai/enemy-h.gc index c673b919f7..4d0d353485 100644 --- a/goal_src/jak2/engine/ai/enemy-h.gc +++ b/goal_src/jak2/engine/ai/enemy-h.gc @@ -353,7 +353,7 @@ (go-hostile (_type_) none 70) (go-flee (_type_) none 71) (react-to-focus (_type_) none 72) - (kill-prefer-falling (_type_) none 73) + (kill-prefer-falling (_type_) object 73) (general-event-handler (_type_ process int symbol event-message-block) object 74) (enemy-method-75 (_type_ process touching-shapes-entry) none 75) (enemy-method-76 (_type_ process event-message-block) symbol 76) diff --git a/goal_src/jak2/engine/ai/enemy.gc b/goal_src/jak2/engine/ai/enemy.gc index af4cda2db9..cb41011f6f 100644 --- a/goal_src/jak2/engine/ai/enemy.gc +++ b/goal_src/jak2/engine/ai/enemy.gc @@ -567,14 +567,12 @@ (none) ) -;; WARN: Return type mismatch object vs none. (defmethod kill-prefer-falling enemy ((obj enemy)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (if (-> obj enemy-info use-die-falling) (go (method-of-object obj die-falling)) (go (method-of-object obj die)) ) - (none) ) (defmethod enemy-method-135 enemy ((obj enemy) (arg0 int)) @@ -1145,7 +1143,7 @@ ) (set! (-> obj penetrated-flinch) (-> arg0 penetrate-flinch)) (set! (-> obj penetrated-knocked) (-> arg0 penetrate-knocked)) - (set! (-> obj reaction-time) (get-rand-int-range obj 30 180)) + (set! (-> obj reaction-time) (the-as time-frame (get-rand-int-range obj 30 180))) (let* ((v1-79 (-> obj enemy-flags)) (a0-28 (-> obj fact-info-override enemy-options)) (v1-80 (logior (enemy-flag @@ -1624,9 +1622,11 @@ This commonly includes things such as: ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 17] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 28] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 89] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 105] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 202] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 274] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 346] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 407] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 413] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 490] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 493] @@ -1634,6 +1634,7 @@ This commonly includes things such as: ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 560] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 610] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 641] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 720] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 774] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 807] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 814] diff --git a/goal_src/jak2/engine/anim/mspace-h.gc b/goal_src/jak2/engine/anim/mspace-h.gc index 4fd1a4ae6d..18587e73a6 100644 --- a/goal_src/jak2/engine/anim/mspace-h.gc +++ b/goal_src/jak2/engine/anim/mspace-h.gc @@ -60,14 +60,14 @@ (set! (-> skeleton heap-base) (the-as uint 80)) (deftype cspace (structure) - ((parent cspace :offset-assert 0) - (joint joint :offset-assert 4) - (joint-num int16 :offset-assert 8) - (geo drawable :offset-assert 12) - (bone bone :offset-assert 16) + ((parent cspace :offset-assert 0) + (joint joint :offset-assert 4) + (joint-num int16 :offset-assert 8) + (geo drawable :offset-assert 12) + (bone bone :offset-assert 16) (param0 (function cspace transformq none) :offset-assert 20) - (param1 basic :offset-assert 24) - (param2 basic :offset-assert 28) + (param1 basic :offset-assert 24) + (param2 basic :offset-assert 28) ) :method-count-assert 10 :size-assert #x20 diff --git a/goal_src/jak2/engine/debug/nav/mysql-nav-graph.gc b/goal_src/jak2/engine/debug/nav/mysql-nav-graph.gc index ac7dc6fa47..405a5ac5a3 100644 --- a/goal_src/jak2/engine/debug/nav/mysql-nav-graph.gc +++ b/goal_src/jak2/engine/debug/nav/mysql-nav-graph.gc @@ -191,7 +191,7 @@ (set! (-> mysql-nav-visnode-array heap-base) (the-as uint 32)) (deftype mysql-nav-graph-level-info (structure) - ((level basic :offset-assert 0) + ((level string :offset-assert 0) (level-id uint32 :offset-assert 4) (node-count int32 :offset-assert 8) (branch-count int32 :offset-assert 12) @@ -1129,7 +1129,72 @@ returns `-1` if none is found" (none) ) -;; ERROR: function was not converted to expressions. Cannot decompile. +(defmethod lookup-level-info2 mysql-nav-graph ((obj mysql-nav-graph) (arg0 mysql-nav-node) (arg1 symbol)) + "TODO - this was originally called `lookup-level-info` but it clashes with the function defined in `level`" + (let ((s5-0 (the-as mysql-nav-graph-level-info #f))) + (b! (>= (-> obj level-info-last-lookup) (-> obj level-info-array-length)) cfg-3 :delay #f) + (let ((v1-5 (-> obj level-info-array (-> obj level-info-last-lookup)))) + (let ((a0-2 (-> v1-5 level))) + (b! (!= (-> arg0 level_name) a0-2) cfg-3 :delay (empty-form)) + ) + (set! s5-0 v1-5) + ) + (b! #t cfg-18 :delay (nop!)) + (label cfg-3) + (let ((v1-6 0)) + (b! #t cfg-9 :delay (nop!)) + (label cfg-4) + (let ((a0-6 (-> obj level-info-array v1-6))) + (let ((a3-1 (-> a0-6 level))) + (b! (!= (-> arg0 level_name) a3-1) cfg-8 :delay (empty-form)) + ) + (if arg1 + (set! (-> obj level-info-last-lookup) v1-6) + ) + (set! s5-0 a0-6) + ) + (b! #t cfg-18 :delay (nop!)) + (label cfg-8) + (+! v1-6 1) + (label cfg-9) + (b! (< v1-6 (-> obj level-info-array-length)) cfg-4) + ) + (let ((v1-9 (-> obj level-info-array-length))) + (cond + ((< v1-9 32) + (if arg1 + (set! (-> obj level-info-last-lookup) v1-9) + ) + (set! s5-0 (-> obj level-info-array v1-9)) + (set! (-> s5-0 level) (the-as string (-> arg0 level_name))) + (set! (-> s5-0 node-count) 0) + (+! (-> obj level-info-array-length) 1) + ) + (else + (format + 0 + "mysql-nav-graph::lookup-level-info: Error, too many unique level names in nav-graph. May need to increase the max (currently ~d)~%" + 32 + ) + (let ((s4-0 0)) + (b! #t cfg-16 :delay (nop!)) + (label cfg-15) + (let ((v1-17 (-> obj level-info-array s4-0))) + (format 0 "~d ~s~%" s4-0 (-> v1-17 level)) + ) + (+! s4-0 1) + (label cfg-16) + (b! (< s4-0 (-> obj level-info-array-length)) cfg-15) + ) + (break!) + 0 + ) + ) + ) + (label cfg-18) + s5-0 + ) + ) (defmethod mysql-nav-graph-method-20 mysql-nav-graph ((obj mysql-nav-graph)) diff --git a/goal_src/jak2/engine/gfx/texture/texture-anim-h.gc b/goal_src/jak2/engine/gfx/texture/texture-anim-h.gc index 3e04f2df8e..76142d28ef 100644 --- a/goal_src/jak2/engine/gfx/texture/texture-anim-h.gc +++ b/goal_src/jak2/engine/gfx/texture/texture-anim-h.gc @@ -56,7 +56,7 @@ ((num-layers uint32 :offset-assert 0) (func symbol :offset-assert 4) (func-id basic :offset 4) - (init-func basic :offset-assert 8) + (init-func symbol :offset-assert 8) (init-func-id basic :offset 8) (tex texture :offset-assert 12) (tex-name string :offset-assert 16) diff --git a/goal_src/jak2/engine/physics/rigid-body-h.gc b/goal_src/jak2/engine/physics/rigid-body-h.gc index a48dc89f23..cf74d3a7f6 100644 --- a/goal_src/jak2/engine/physics/rigid-body-h.gc +++ b/goal_src/jak2/engine/physics/rigid-body-h.gc @@ -158,7 +158,7 @@ (info rigid-body-info :offset-assert 4) (flags rigid-body-flag :offset-assert 8) (force-callback (function object float none) :offset-assert 12) - (blocked-by basic :offset-assert 16) + (blocked-by rigid-body-object :offset-assert 16) (time-remaining float :offset-assert 20) (step-count int16 :offset-assert 24) (position vector :inline :offset-assert 32) @@ -205,26 +205,8 @@ (deftype rigid-body-control (basic) - ((process process :offset-assert 4) - (state rigid-body :inline :offset-assert 16) - (work basic :offset 16) - (info rigid-body-info :offset 20) - (flags rigid-body-flag :offset 24) - (force-callback basic :offset 28) - (blocked-by basic :offset 32) - (time-remaining float :offset 36) - (step-count int16 :offset 40) - (position vector :inline :offset 48) - (rot vector :inline :offset 64) - (rotation quaternion :inline :offset 64) - (lin-momentum vector :inline :offset 80) - (ang-momentum vector :inline :offset 96) - (force vector :inline :offset 112) - (torque vector :inline :offset 128) - (lin-velocity vector :inline :offset 144) - (ang-velocity vector :inline :offset 160) - (matrix matrix :inline :offset 176) - (inv-i-world matrix :inline :offset 240) + ((process process :offset-assert 4) + (state rigid-body :inline :offset-assert 16) ) :method-count-assert 26 :size-assert #x130 @@ -383,7 +365,7 @@ (deftype rigid-body-queue (structure) ((count int8 :offset-assert 0) - (array uint64 128 :offset 8) + (array handle 128 :offset 8) ) :method-count-assert 17 :size-assert #x408 @@ -391,11 +373,11 @@ (:methods (rigid-body-queue-method-9 (_type_) none 9) (rigid-body-queue-method-10 (_type_) none 10) - (rigid-body-queue-method-11 (_type_) none 11) + (rigid-body-queue-method-11 (_type_ rigid-body-object) none 11) (rigid-body-queue-method-12 (_type_ int int) none 12) - (rigid-body-queue-method-13 (_type_) none 13) + (rigid-body-queue-method-13 (_type_ int rigid-body-object) none 13) (rigid-body-queue-method-14 (_type_ int) none 14) - (rigid-body-queue-method-15 (_type_) none 15) + (rigid-body-queue-method-15 (_type_ rigid-body-object) none 15) (validate (_type_) symbol 16) ) ) diff --git a/goal_src/jak2/engine/physics/rigid-body-queue.gc b/goal_src/jak2/engine/physics/rigid-body-queue.gc index 369f2cb058..19a4bbfd44 100644 --- a/goal_src/jak2/engine/physics/rigid-body-queue.gc +++ b/goal_src/jak2/engine/physics/rigid-body-queue.gc @@ -7,3 +7,288 @@ ;; DECOMP BEGINS +(defmethod rigid-body-queue-method-9 rigid-body-queue ((obj rigid-body-queue)) + (set! (-> obj count) 0) + (dotimes (v1-0 128) + (set! (-> obj array v1-0) (the-as handle #f)) + ) + 0 + (none) + ) + +(defmethod validate rigid-body-queue ((obj rigid-body-queue)) + (let ((gp-0 0)) + (dotimes (v1-0 (-> obj count)) + (let ((a1-2 (-> obj array v1-0)) + (a2-0 (+ v1-0 1)) + ) + (while (< a2-0 (-> obj count)) + (if (= a1-2 (-> obj array a2-0)) + (+! gp-0 1) + ) + (+! a2-0 1) + ) + ) + ) + (if (> gp-0 0) + (format 0 "rigid-body-queue::validate: duplicate count ~d~%" gp-0) + ) + (zero? gp-0) + ) + ) + +(defmethod rigid-body-queue-method-10 rigid-body-queue ((obj rigid-body-queue)) + (local-vars (s4-0 process)) + (with-pp + (let ((f0-0 (-> pp clock seconds-per-frame)) + (v1-1 (-> obj count)) + ) + (b! #t cfg-9 :delay (nop!)) + (label cfg-1) + (+! v1-1 -1) + (let ((a0-4 (handle->process (-> obj array v1-1)))) + (cond + (a0-4 + (let ((a0-6 (-> (the-as rigid-body-object a0-4) rbody))) + (set! (-> a0-6 state time-remaining) f0-0) + (set! (-> a0-6 state blocked-by) #f) + (set! (-> a0-6 state step-count) 0) + (logclear! (-> a0-6 state flags) (rigid-body-flag blocker)) + ) + ) + (else + ) + ) + ) + (label cfg-9) + (b! (nonzero? v1-1) cfg-1 :delay (nop!)) + ) + (let ((s5-0 0)) + (b! #t cfg-35 :delay (nop!)) + (until (= (-> obj array s5-0) (process->handle s4-0)) + (label cfg-11) + (set! s4-0 (handle->process (-> obj array s5-0))) + (b! (not s4-0) cfg-34 :delay (empty-form)) + (let ((s3-0 (-> (the-as rigid-body-object s4-0) rbody))) + (b! + (not (and (logtest? (-> s3-0 state flags) (rigid-body-flag enable-physics)) + (and (< 0.001 (-> s3-0 state time-remaining)) (< (-> s3-0 state step-count) 4)) + ) + ) + cfg-34 + :delay (empty-form) + ) + (rigid-body-object-method-51 (the-as rigid-body-object s4-0)) + (+! (-> s3-0 state step-count) 1) + (let ((a2-2 (-> s3-0 state blocked-by))) + (b! (not a2-2) cfg-34 :delay (empty-form)) + (b! (not #t) cfg-34 :delay (empty-form)) + (logior! (-> a2-2 rbody state flags) (rigid-body-flag blocker)) + (rigid-body-queue-method-13 obj s5-0 a2-2) + ) + ) + ) + (label cfg-34) + (+! s5-0 1) + (label cfg-35) + (b! (< s5-0 (-> obj count)) cfg-11) + ) + (let ((s5-1 0)) + (b! #t cfg-48 :delay (nop!)) + (label cfg-37) + (let ((a0-20 (handle->process (-> obj array s5-1)))) + (when (and a0-20 + (logtest? (-> (the-as rigid-body-object a0-20) rbody state flags) (rigid-body-flag enable-physics)) + ) + (let ((s4-1 pp)) + (set! pp (the-as rigid-body-object a0-20)) + (rigid-body-object-method-52 (the-as rigid-body-object a0-20)) + (set! pp s4-1) + ) + ) + ) + (+! s5-1 1) + (label cfg-48) + (b! (< s5-1 (-> obj count)) cfg-37) + ) + 0 + (none) + ) + ) + +(defmethod rigid-body-queue-method-11 rigid-body-queue ((obj rigid-body-queue) (arg0 rigid-body-object)) + (let ((v1-0 -1)) + (let ((a2-0 0)) + (b! #t cfg-9 :delay (nop!)) + (label cfg-1) + (b! (handle->process (-> obj array a2-0)) cfg-8 :delay (empty-form)) + (set! v1-0 a2-0) + (b! #t cfg-11 :delay (nop!)) + (label cfg-8) + (+! a2-0 1) + (label cfg-9) + (b! (< a2-0 (-> obj count)) cfg-1) + ) + (label cfg-11) + (b! (= v1-0 -1) cfg-18 :delay (nop!)) + (set! (-> obj array v1-0) (process->handle arg0)) + ) + (b! #t cfg-25 :delay (nop!)) + (label cfg-18) + (b! (>= (-> obj count) 128) cfg-25 :delay #f) + (set! (-> obj array (-> obj count)) (process->handle arg0)) + (+! (-> obj count) 1) + (label cfg-25) + 0 + 0 + (none) + ) + +(defmethod rigid-body-queue-method-12 rigid-body-queue ((obj rigid-body-queue) (arg0 int) (arg1 int)) + (when (< arg0 arg1) + (let ((v1-1 arg1) + (a3-0 (+ arg1 -1)) + (a2-3 (-> obj array arg1)) + ) + (while (>= a3-0 arg0) + (set! (-> obj array v1-1) (-> obj array a3-0)) + (+! a3-0 -1) + (+! v1-1 -1) + ) + (set! (-> obj array arg0) a2-3) + ) + ) + 0 + (none) + ) + +(defmethod rigid-body-queue-method-13 rigid-body-queue ((obj rigid-body-queue) (arg0 int) (arg1 rigid-body-object)) + (let ((v1-2 (process->handle arg1)) + (a2-4 (+ arg0 1)) + ) + (b! #t cfg-9 :delay (nop!)) + (label cfg-6) + (b! (!= (-> obj array a2-4) v1-2) cfg-8 :delay (empty-form)) + (rigid-body-queue-method-12 obj arg0 a2-4) + (b! #t cfg-11 :delay (nop!)) + (label cfg-8) + (+! a2-4 1) + (label cfg-9) + (b! (< a2-4 (-> obj count)) cfg-6) + ) + (label cfg-11) + 0 + 0 + (none) + ) + +(defmethod rigid-body-queue-method-14 rigid-body-queue ((obj rigid-body-queue) (arg0 int)) + (let ((v1-0 arg0) + (a1-1 (+ arg0 1)) + ) + (while (< a1-1 (-> obj count)) + (set! (-> obj array v1-0) (-> obj array a1-1)) + (+! a1-1 1) + (+! v1-0 1) + ) + ) + (+! (-> obj count) -1) + 0 + (none) + ) + +(defmethod rigid-body-queue-method-15 rigid-body-queue ((obj rigid-body-queue) (arg0 rigid-body-object)) + (let ((v1-2 (process->handle arg0)) + (a1-4 0) + ) + (b! #t cfg-9 :delay (nop!)) + (label cfg-6) + (b! (!= (-> obj array a1-4) v1-2) cfg-8 :delay (empty-form)) + (rigid-body-queue-method-14 obj a1-4) + (b! #t cfg-11 :delay (nop!)) + (label cfg-8) + (+! a1-4 1) + (label cfg-9) + (b! (< a1-4 (-> obj count)) cfg-6) + ) + (label cfg-11) + 0 + 0 + (none) + ) + +(deftype rigid-body-queue-manager (process) + ((queue rigid-body-queue :offset-assert 128) + ) + :heap-base #x10 + :method-count-assert 15 + :size-assert #x84 + :flag-assert #xf00100084 + (:methods + (idle () _type_ :state 14) + ) + ) + + +(defstate idle (rigid-body-queue-manager) + :virtual #t + :exit (behavior () + (set! (-> self queue count) 0) + 0 + (none) + ) + :code (the-as (function none :behavior rigid-body-queue-manager) sleep-code) + :post (behavior () + (local-vars (a0-3 int) (a0-5 int)) + (let* ((v1-1 (-> *perf-stats* data 17)) + (a0-0 (-> v1-1 ctrl)) + ) + (+! (-> v1-1 count) 1) + (b! (zero? a0-0) cfg-2 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf a0-0) + ) + (.sync.l) + (.sync.p) + (label cfg-2) + 0 + (rigid-body-queue-method-10 (-> self queue)) + (let ((v1-6 (-> *perf-stats* data 17))) + (b! (zero? (-> v1-6 ctrl)) cfg-4 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a0-3 pcr0) + (+! (-> v1-6 accum0) a0-3) + (.mfpc a0-5 pcr1) + (+! (-> v1-6 accum1) a0-5) + ) + (label cfg-4) + 0 + (none) + ) + ) + +(defbehavior rigid-body-queue-manager-init-by-other rigid-body-queue-manager ((arg0 rigid-body-queue)) + (stack-size-set! (-> self main-thread) 128) + (set! (-> self queue) arg0) + (rigid-body-queue-method-9 (-> self queue)) + (go-virtual idle) + ) + +(defun rigid-body-queue-manager-spawn ((arg0 rigid-body-queue) (arg1 process-tree)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn rigid-body-queue-manager arg0 :to arg1))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + gp-0 + ) + ) diff --git a/goal_src/jak2/engine/physics/rigid-body.gc b/goal_src/jak2/engine/physics/rigid-body.gc index c11b57df20..2daf94f81b 100644 --- a/goal_src/jak2/engine/physics/rigid-body.gc +++ b/goal_src/jak2/engine/physics/rigid-body.gc @@ -539,10 +539,11 @@ (vector-rotate*! (-> s5-0 vec-7) (-> s5-0 vec-7) (-> s3-0 inv-i-world)) (vector-cross! (-> s5-0 vec-7) (-> s5-0 vec-7) (-> s5-0 vec-6)) (+! (-> s5-0 float-3) (+ (-> s3-0 info inv-mass) (vector-dot (-> s5-0 vec-5) (-> s5-0 vec-7)))) - (set! f30-1 (fmax - (fmax f30-1 (-> s3-0 info bounce-factor)) - (* (-> arg0 info bounce-mult-factor) (-> s3-0 info bounce-mult-factor)) - ) + (set! f30-1 + (fmax + (fmax f30-1 (-> s3-0 info bounce-factor)) + (* (-> arg0 info bounce-mult-factor) (-> s3-0 info bounce-mult-factor)) + ) ) ) (else @@ -557,12 +558,14 @@ ) (vector+float*! (-> s5-0 vec-9) (-> s5-0 vec-3) (-> s5-0 vec-5) (- (-> s5-0 float-2))) (vector-normalize! (-> s5-0 vec-9) 1.0) - (let ((f0-31 (* -1.0 (fmin - (* (vector-dot (-> s5-0 vec-9) (-> s5-0 vec-3)) f30-2) - (* (-> arg0 info friction-factor) (-> s5-0 float-4)) - ) - ) + (let ((f0-31 + (* -1.0 + (fmin + (* (vector-dot (-> s5-0 vec-9) (-> s5-0 vec-3)) f30-2) + (* (-> arg0 info friction-factor) (-> s5-0 float-4)) ) + ) + ) ) (vector+float*! (-> s5-0 vec-8) (-> s5-0 vec-8) (-> s5-0 vec-9) f0-31) ) @@ -607,7 +610,9 @@ (b! #t cfg-42 :delay (nop!)) (label cfg-39) (b! (not s3-0) cfg-41 :delay (empty-form)) - (set! (-> arg0 blocked-by) (-> (the-as collide-shape-prim-mesh (-> s5-0 cquery num-spheres)) cshape process)) + (set! (-> arg0 blocked-by) + (the-as rigid-body-object (-> (the-as collide-shape-prim-mesh (-> s5-0 cquery num-spheres)) cshape process)) + ) 0 (label cfg-41) (vector+float*! (-> arg0 position) (-> arg0 position) (-> s5-0 vec-5) 40.96) diff --git a/goal_src/jak2/engine/ui/text-id-h.gc b/goal_src/jak2/engine/ui/text-id-h.gc index 88e5841ad6..c131b6c202 100644 --- a/goal_src/jak2/engine/ui/text-id-h.gc +++ b/goal_src/jak2/engine/ui/text-id-h.gc @@ -372,6 +372,10 @@ (text-x24d #x024d) (text-x24e #x024e) (text-x24f #x024f) + (oracle-tutorial-dark-bomb #x0273) + (oracle-tutorial-dark-blast #x0274) + (oracle-tutorial-dark-invincible #x0275) + (oracle-tutorial-dark-giant #x0276) (text-x277 #x0277) (text-x278 #x0278) (text-x27a #x027a) diff --git a/goal_src/jak2/levels/city/common/ctywide-part.gc b/goal_src/jak2/levels/city/common/ctywide-part.gc index bcfcc1b484..9a108fe107 100644 --- a/goal_src/jak2/levels/city/common/ctywide-part.gc +++ b/goal_src/jak2/levels/city/common/ctywide-part.gc @@ -7,3 +7,1190 @@ ;; DECOMP BEGINS +(deftype ctywide-part (part-spawner) + () + :heap-base #x30 + :method-count-assert 16 + :size-assert #xb0 + :flag-assert #x10003000b0 + ) + + +(deftype citywide-part (part-spawner) + () + :heap-base #x30 + :method-count-assert 16 + :size-assert #xb0 + :flag-assert #x10003000b0 + ) + + +(defun birth-func-race-poster ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (let ((s4-0 (the-as object (-> arg1 user-float)))) + (when (nonzero? (the-as float s4-0)) + (let ((s3-0 2)) + (cond + ((task-node-closed? (game-task-node stadium-race-class1-resolution)) + (set! s3-0 3) + ) + ((task-node-closed? (game-task-node stadium-race-class2-resolution)) + (set! s3-0 0) + ) + ((task-node-closed? (game-task-node stadium-race-class3-resolution)) + (set! s3-0 1) + ) + ) + (let ((s4-1 (-> (the-as (array int32) s4-0) (+ s3-0 3)))) + (when (nonzero? s4-1) + (let* ((f30-0 200.0) + (f28-0 (floor f30-0)) + (f1-0 (* 0.00024414062 (vector-vector-distance (-> arg2 x-y-z-sx) (math-camera-pos)))) + (f0-1 (/ f1-0 f28-0)) + ) + (set! (-> arg2 r-g-b-a w) (if (>= f30-0 f1-0) + (* 128.0 (- 1.0 f0-1)) + 0.0 + ) + ) + ) + ) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id s4-1)) + ) + ) + ) + ) + 0 + (none) + ) + +(defpartgroup group-ctywide-race-poster-extra-small + :id 165 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 806 :fade-after (meters 200) :flags (is-3d bit6 bit7))) + ) + +(defpart 806 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7a :page #x45e)) + (sp-func spt-birth-func 'birth-func-race-poster) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 6)) + (sp-flt spt-scale-y (meters 6)) + (sp-flt spt-r 90.0) + (sp-flt spt-g 90.0) + (sp-flt spt-b 90.0) + (sp-flt spt-a 128.0) + (sp-flt spt-omega 50.5) + (sp-int spt-timer 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 left-multiply-quat) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 #x45e07c00 #x45e07900 #x45e07a00 #x45e07d00) + ) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-ctywide-race-poster-small + :id 166 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 807 :fade-after (meters 200) :flags (is-3d bit6 bit7))) + ) + +(defpart 807 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7a :page #x45e)) + (sp-func spt-birth-func 'birth-func-race-poster) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-scale-y (meters 8)) + (sp-flt spt-r 90.0) + (sp-flt spt-g 90.0) + (sp-flt spt-b 90.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 left-multiply-quat) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 #x45e07c00 #x45e07900 #x45e07a00 #x45e07d00) + ) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-ctywide-race-poster-medium + :id 167 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 9) + :parts ((sp-item 808 :fade-after (meters 200) :flags (is-3d bit6 bit7))) + ) + +(defpart 808 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7a :page #x45e)) + (sp-func spt-birth-func 'birth-func-race-poster) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 12)) + (sp-flt spt-scale-y (meters 12)) + (sp-flt spt-r 90.0) + (sp-flt spt-g 90.0) + (sp-flt spt-b 90.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 left-multiply-quat) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 #x45e07c00 #x45e07900 #x45e07a00 #x45e07d00) + ) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-ctywide-race-poster-large + :id 168 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 18) + :parts ((sp-item 809 :fade-after (meters 200) :flags (is-3d bit6 bit7))) + ) + +(defpart 809 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7a :page #x45e)) + (sp-func spt-birth-func 'birth-func-race-poster) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 32)) + (sp-flt spt-scale-y (meters 32)) + (sp-flt spt-r 90.0) + (sp-flt spt-g 90.0) + (sp-flt spt-b 90.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 left-multiply-quat) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 #x45e07c00 #x45e07900 #x45e07a00 #x45e07d00) + ) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-ctywide-stadium-light + :id 169 + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 810 :flags (bit6) :hour-mask #b111111111110000000) + (sp-item 811 :flags (bit6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 810 + :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 48.5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 8192.0) + (sp-flt spt-rot-z (degrees -17.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 32.0) + (sp-flt spt-omega 8195277.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 0.0) + ) + ) + +(defpart 811 + :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 96) (meters 0.1) 1.0) + (sp-flt spt-rot-x 14336.0) + (sp-flt spt-rot-z (degrees -17.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 255.0 255.0 1.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 8.0) + (sp-flt spt-omega 8195277.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 0.0) + ) + ) + +(defpartgroup group-ctywide-baron-propoganda-holo + :id 170 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 818 :flags (is-3d bit6 bit7)) + (sp-item 819 :fade-after (meters 150) :flags (bit6 bit7)) + (sp-item 820 :binding 812) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 813) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 814) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 815) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 816) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 817) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 813) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 814) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 815) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 816) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 817) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 813) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 814) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 815) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 816) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 817) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 813) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 814) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 815) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 816) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 817) + (sp-item 813 :flags (is-3d bit1 start-dead)) + (sp-item 814 :flags (is-3d bit1 start-dead)) + (sp-item 815 :flags (is-3d bit1 start-dead)) + (sp-item 816 :flags (is-3d bit1 start-dead)) + (sp-item 817 :flags (is-3d bit1 start-dead)) + (sp-item 813 :flags (is-3d bit1 start-dead)) + (sp-item 814 :flags (is-3d bit1 start-dead)) + (sp-item 815 :flags (is-3d bit1 start-dead)) + (sp-item 816 :flags (is-3d bit1 start-dead)) + (sp-item 817 :flags (is-3d bit1 start-dead)) + (sp-item 813 :flags (is-3d bit1 start-dead)) + (sp-item 814 :flags (is-3d bit1 start-dead)) + (sp-item 815 :flags (is-3d bit1 start-dead)) + (sp-item 816 :flags (is-3d bit1 start-dead)) + (sp-item 817 :flags (is-3d bit1 start-dead)) + (sp-item 813 :flags (is-3d bit1 start-dead)) + (sp-item 814 :flags (is-3d bit1 start-dead)) + (sp-item 815 :flags (is-3d bit1 start-dead)) + (sp-item 816 :flags (is-3d bit1 start-dead)) + (sp-item 817 :flags (is-3d bit1 start-dead)) + (sp-item 821 :flags (is-3d bit6 bit7)) + (sp-item 822 :fade-after (meters 150) :flags (bit6)) + ) + ) + +(defpart 822 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-rnd-flt spt-num 0.9 0.1 1.0) + (sp-flt spt-y (meters 3.1)) + (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) + (sp-flt spt-rot-x 409.6) + (sp-rnd-flt spt-rot-z (degrees 17.0) (degrees 8.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-int spt-g 1124073472 1 128.0) + (sp-rnd-flt spt-b 0.0 128.0 1.0) + (sp-rnd-flt spt-a 16.0 16.0 1.0) + (sp-flt spt-omega 616448.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 2048.0) + ) + ) + +(defun birth-func-ctywide-baron-propoganda-ticker-rotate ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (local-vars (v1-6 float) (v1-7 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (-> arg4 sprite))) + (let ((s4-0 (new 'stack-no-clear 'quaternion))) + (let* ((v1-0 arg2) + (f0-0 (-> v1-0 qx-qy-qz-sy x)) + (f1-0 (-> v1-0 qx-qy-qz-sy y)) + (f2-0 (-> v1-0 qx-qy-qz-sy z)) + ) + (set! (-> s4-0 x) f0-0) + (set! (-> s4-0 y) f1-0) + (set! (-> s4-0 z) f2-0) + (set! (-> s4-0 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0)))) + ) + (quaternion-rotate-y! s4-0 s4-0 (+ 8192.0 (-> s5-0 sprite flag-rot-sy z))) + (let ((v1-5 arg2)) + (cond + ((< (-> s4-0 w) 0.0) + (.lvf vf1 (&-> v1-5 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s4-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> v1-5 qx-qy-qz-sy quad) vf1) + (.mov v1-6 vf1) + ) + (else + (.lvf vf1 (&-> v1-5 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s4-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> v1-5 qx-qy-qz-sy quad) vf1) + (.mov v1-7 vf1) + ) + ) + ) + ) + (set! (-> arg2 r-g-b-a w) (-> s5-0 sprite r-g-b-a w)) + ) + 0 + (none) + ) + ) + +(defpart 820 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 0.1) + (sp-flt spt-y (meters 5)) + (sp-flt spt-scale-x (meters 0.1)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 812 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 0)) + (sp-flt spt-y (meters 0)) + (sp-flt spt-z (meters 2)) + (sp-flt spt-scale-x (meters 2)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 32.0) + (sp-flt spt-g 32.0) + (sp-flt spt-b 96.0) + (sp-flt spt-a 0.0) + (sp-flt spt-omega 8192.0) + (sp-flt spt-vel-x (meters 0.02)) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-flt spt-rotvel-z (degrees 0.45)) + (sp-flt spt-fade-a 0.8) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-int spt-next-time 80) + (sp-launcher-by-id spt-next-launcher 823) + ) + ) + +(defpart 823 + :init-specs ((sp-flt spt-a 64.0) + (sp-flt spt-fade-a 0.0) + (sp-int spt-next-time 440) + (sp-launcher-by-id spt-next-launcher 824) + ) + ) + +(defpart 824 + :init-specs ((sp-flt spt-fade-a -0.8)) + ) + +(defpart 813 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6f :page #x45e)) + (sp-func spt-birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 0.65)) + (sp-flt spt-rot-x 16384.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 64.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 814 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x70 :page #x45e)) + (sp-func spt-birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 0.65)) + (sp-flt spt-rot-x 16384.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 64.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 815 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x71 :page #x45e)) + (sp-func spt-birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 0.65)) + (sp-flt spt-rot-x 16384.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 64.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 816 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x72 :page #x45e)) + (sp-func spt-birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 0.65)) + (sp-flt spt-rot-x 16384.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 64.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 817 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x73 :page #x45e)) + (sp-func spt-birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 0.65)) + (sp-flt spt-rot-x 16384.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 128.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 819 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-rnd-flt spt-scale-x (meters 10) (meters 0.1) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 96.0 96.0 1.0) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 20.0 4.0 1.0) + (sp-flt spt-omega 616448.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 10240.0) + ) + ) + +(defpart 818 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x74 :page #x45e)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-flt spt-z (meters 0.05)) + (sp-rnd-flt spt-scale-x (meters 4.5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 192.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 96.0 16.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 821 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x74 :page #x45e)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 5.75)) + (sp-flt spt-z (meters 0.05)) + (sp-rnd-flt spt-scale-x (meters 6.5) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-x 14563.556 728.1778 1.0) + (sp-flt spt-rot-y (degrees 90.0)) + (sp-flt spt-rot-z (degrees 90.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 32.0) + (sp-flt spt-b 16.0) + (sp-rnd-flt spt-a 32.0 16.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-14 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-ctywide-burning-bush-holo-off + :id 171 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 825 :flags (is-3d bit6 bit7)) + (sp-item 826 :flags (is-3d bit6 bit7)) + (sp-item 827 :flags (is-3d bit6 bit7)) + (sp-item 828 :flags (is-3d bit6 bit7)) + ) + ) + +(defpart 825 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7b :page #x45e)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-flt spt-z (meters -0.02)) + (sp-rnd-flt spt-scale-x (meters 4.5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.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-rnd-flt spt-a 64.0 32.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 827 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xd3 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 5)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-y (degrees 90.0)) + (sp-flt spt-rot-z (degrees 90.0)) + (sp-flt spt-scale-y (meters 6)) + (sp-rnd-flt spt-r 64.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 128.0 1.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 828 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-flt spt-z (meters -0.05)) + (sp-flt spt-scale-x (meters 5)) + (sp-flt spt-rot-x -16384.0) + (sp-flt spt-rot-y (degrees 90.0)) + (sp-flt spt-rot-z (degrees 90.0)) + (sp-flt spt-scale-y (meters 6)) + (sp-flt spt-r 255.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 0.0 8.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-12 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 826 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7b :page #x45e)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-flt spt-z (meters 0.02)) + (sp-rnd-flt spt-scale-x (meters 5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-y (degrees 90.0)) + (sp-flt spt-rot-z (degrees 90.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 8.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-12 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-ctywide-burning-bush-holo-red + :id 172 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 829 :flags (is-3d bit6 bit7)) (sp-item 830 :fade-after (meters 150) :flags (bit6 bit7))) + ) + +(defpart 829 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xd3 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 5)) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 5)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-y (degrees 90.0)) + (sp-flt spt-rot-z (degrees 90.0)) + (sp-flt spt-scale-y (meters 4)) + (sp-flt spt-r 255.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 830 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x84 :page #xc)) + (sp-rnd-flt spt-num 2.0 4.0 1.0) + (sp-rnd-flt spt-x (meters -2.25) (meters 4.5) 1.0) + (sp-flt spt-y (meters 4.5)) + (sp-flt spt-scale-x (meters 1)) + (sp-rnd-int-flt spt-rot-z (degrees 0.0) 1 32768.0) + (sp-rnd-flt spt-scale-y (meters 3) (meters 1.5) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 0.0) + (sp-flt spt-fade-a 1.6) + (sp-int spt-timer 40) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 20) + (sp-launcher-by-id spt-next-launcher 831) + (sp-rnd-int-flt spt-rotate-y (degrees 0.0) 1 32768.0) + ) + ) + +(defpartgroup group-ctywide-burning-bush-holo-on + :id 173 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 832 :flags (is-3d bit6 bit7)) + (sp-item 833 :flags (is-3d bit6 bit7)) + (sp-item 834 :flags (is-3d bit6 bit7)) + (sp-item 835 :fade-after (meters 150) :flags (bit6 bit7)) + ) + ) + +(defpart 835 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x84 :page #xc)) + (sp-rnd-flt spt-num 2.0 4.0 1.0) + (sp-rnd-flt spt-x (meters -2.25) (meters 4.5) 1.0) + (sp-rnd-flt spt-y (meters 5.5) (meters 0.5) 1.0) + (sp-flt spt-scale-x (meters 1)) + (sp-rnd-int-flt spt-rot-z (degrees 0.0) 1 32768.0) + (sp-flt spt-scale-y (meters 6)) + (sp-rnd-int spt-r 1124073472 1 128.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 0.0) + (sp-flt spt-fade-a 1.6) + (sp-int spt-timer 40) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 20) + (sp-launcher-by-id spt-next-launcher 831) + (sp-rnd-int-flt spt-rotate-y (degrees 0.0) 1 32768.0) + ) + ) + +(defpart 831 + :init-specs ((sp-flt spt-fade-a -1.6)) + ) + +(defpart 832 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x78 :page #x45e)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-flt spt-z (meters -0.02)) + (sp-rnd-flt spt-scale-x (meters 3.5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.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 0.0) + (sp-rnd-flt spt-a 128.0 32.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 834 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xd3 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 5)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-y (degrees 90.0)) + (sp-flt spt-rot-z (degrees 90.0)) + (sp-flt spt-scale-y (meters 6)) + (sp-flt spt-r 255.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 32.0 64.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 833 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x78 :page #x45e)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-flt spt-z (meters 0.02)) + (sp-rnd-flt spt-scale-x (meters 4) (meters 0.1) 1.0) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-y (degrees 90.0)) + (sp-flt spt-rot-z (degrees 90.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 64.0 16.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-12 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-ctywide-palace-high-fire + :id 174 + :flags (unk-8) + :bounds (static-bspherem 0 2 0 5) + :parts ((sp-item 836 :fade-after (meters 500) :falloff-to (meters 600)) + (sp-item 837 :fade-after (meters 500) :flags (bit6)) + ) + ) + +(defpart 836 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x33 :page #xc)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 1.5) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) + (sp-rnd-flt spt-scale-y (meters 4) (meters 2) 1.0) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-rnd-flt spt-b 0.0 32.0 1.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0) (meters -0.0033333334) 1.0) + (sp-flt spt-scalevel-x (meters -0.009375)) + (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-g -0.7111111) + (sp-rnd-flt spt-fade-a -0.1 -0.1 1.0) + (sp-rnd-flt spt-accel-y 3.4133334 2.7306666 1.0) + (sp-int-plain-rnd spt-timer 160 49 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-3) + (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) + ) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.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.05) 1.0) + ) + ) + +(defpart 837 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 0.5) + (sp-flt spt-y (meters 4)) + (sp-rnd-flt spt-scale-x (meters 16) (meters 0.5) 1.0) + (sp-flt spt-rot-x 40.96) + (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 128.0 64.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-rnd-flt spt-b 0.0 32.0 1.0) + (sp-rnd-flt spt-a 16.0 16.0 1.0) + (sp-flt spt-scalevel-x (meters -0.0016666667)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.7111111) + (sp-flt spt-fade-a -1.0666667) + (sp-int spt-timer 25) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.05) 1.0) + ) + ) + +(defpartgroup group-ctywide-misc-citylights-red-1 + :id 175 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 838 :flags (bit6) :period 1200 :length 5 :hour-mask #b111111111110000000)) + ) + +(defpartgroup group-ctywide-misc-citylights-red-2 + :id 176 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 838 :flags (bit6) :period 1200 :length 5 :offset 400 :hour-mask #b111111111110000000)) + ) + +(defpartgroup group-ctywide-misc-citylights-red-3 + :id 177 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 838 :flags (bit6) :period 1200 :length 5 :offset 800 :hour-mask #b111111111110000000)) + ) + +(defpart 838 + :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 7.5)) + (sp-flt spt-rot-x 2048.0) + (sp-flt spt-scale-y (meters 6)) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 0.0 32.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 8.0) + (sp-flt spt-omega 12290867.0) + (sp-flt spt-scalevel-x (meters 0.075)) + (sp-flt spt-scalevel-y (meters 0.06)) + (sp-flt spt-fade-a 0.08) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + (sp-int spt-next-time 100) + (sp-launcher-by-id spt-next-launcher 839) + ) + ) + +(defpart 839 + :init-specs ((sp-flt spt-scale-y (meters 12)) + (sp-flt spt-a 16.0) + (sp-flt spt-scalevel-x (meters 0)) + (sp-flt spt-scalevel-y (meters 0)) + (sp-flt spt-fade-a 0.0) + (sp-int spt-next-time 600) + (sp-launcher-by-id spt-next-launcher 840) + ) + ) + +(defpart 840 + :init-specs ((sp-flt spt-scalevel-x (meters -0.075)) + (sp-flt spt-scalevel-y (meters -0.06)) + (sp-flt spt-fade-a -0.08) + (sp-int spt-next-time 100) + (sp-launcher-by-id spt-next-launcher 841) + ) + ) + +(defpart 841 + :init-specs ((sp-flt spt-scale-y (meters 6)) + (sp-flt spt-a 8.0) + (sp-flt spt-scalevel-x (meters 0)) + (sp-flt spt-scalevel-y (meters 0)) + (sp-flt spt-fade-a 0.0) + ) + ) + +(defpartgroup group-ctywide-misc-citylights-blue-1 + :id 178 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 842 :flags (bit6) :period 1200 :length 5 :hour-mask #b111111111110000000)) + ) + +(defpartgroup group-ctywide-misc-citylights-blue-2 + :id 179 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 842 :flags (bit6) :period 1200 :length 5 :offset 400 :hour-mask #b111111111110000000)) + ) + +(defpartgroup group-ctywide-misc-citylights-blue-3 + :id 180 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 842 :flags (bit6) :period 1200 :length 5 :offset 800 :hour-mask #b111111111110000000)) + ) + +(defpart 842 + :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 7.5)) + (sp-flt spt-rot-x 2048.0) + (sp-flt spt-scale-y (meters 6)) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 128.0 32.0 1.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 8.0) + (sp-flt spt-omega 12290867.0) + (sp-flt spt-scalevel-x (meters 0.075)) + (sp-flt spt-scalevel-y (meters 0.06)) + (sp-flt spt-fade-a 0.08) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + (sp-int spt-next-time 100) + (sp-launcher-by-id spt-next-launcher 839) + ) + ) + +(defpartgroup group-ctywide-cable-lights + :id 181 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 843 :fade-after (meters 3000) :flags (bit6) :hour-mask #b111111111110000000)) + ) + +(defpart 843 + :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)) + (sp-rnd-flt spt-scale-x (meters 12) (meters 4) 1.0) + (sp-flt spt-rot-x 10240.0) + (sp-flt spt-rot-z (degrees 17.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 196.0 64.0 1.0) + (sp-flt spt-b 64.0) + (sp-rnd-flt spt-a 20.0 8.0 1.0) + (sp-flt spt-omega 12290867.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +(defpartgroup group-slums-seal-of-mar-glow + :id 182 + :flags (unk-6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 4) (degrees 0) (degrees 4)) + :parts ((sp-item 844) (sp-item 845) (sp-item 846 :flags (bit7))) + ) + +(defpart 844 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 0.5) + (sp-flt spt-z (meters -0.05)) + (sp-rnd-flt spt-scale-x (meters 0.9) (meters 0.25) 1.0) + (sp-flt spt-rot-x 409.6) + (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 96.0 32.0 1.0) + (sp-rnd-flt spt-g 64.0 16.0 1.0) + (sp-rnd-flt spt-b 12.0 4.0 1.0) + (sp-rnd-flt spt-a 16.0 16.0 1.0) + (sp-flt spt-fade-a -1.1) + (sp-int spt-timer 50) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +(defpart 845 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 0.5) + (sp-flt spt-z (meters 0.05)) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) + (sp-flt spt-rot-x 409.6) + (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 96.0 32.0 1.0) + (sp-rnd-flt spt-g 64.0 16.0 1.0) + (sp-rnd-flt spt-b 12.0 4.0 1.0) + (sp-rnd-flt spt-a 12.0 12.0 1.0) + (sp-flt spt-fade-a -0.48) + (sp-int spt-timer 50) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +(defpart 846 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-rnd-flt spt-num 4.0 2.0 1.0) + (sp-flt spt-x (meters 0.2)) + (sp-rnd-flt spt-scale-x (meters 0.01) (meters 0.0025) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 196.0 32.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 128.0 128.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.02) (meters 0.02) 1.0) + (sp-rnd-flt spt-fade-a -0.42666668 -0.42666668 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +(defpartgroup group-ctywide-chimney + :id 183 + :flags (unk-8) + :bounds (static-bspherem 0 0 -10 64) + :parts ((sp-item 847 :fade-after (meters 600) :falloff-to (meters 600)) + (sp-item 848 :fade-after (meters 600) :flags (bit6)) + ) + ) + +(defpart 848 + :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 1)) + (sp-rnd-flt spt-scale-x (meters 24) (meters 1.1) 1.0) + (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 240.0) + (sp-flt spt-b 100.0) + (sp-rnd-flt spt-a 12.0 4.0 1.0) + (sp-flt spt-omega 2460057.5) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 16384.0) + ) + ) + +(defpart 847 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 0.0 0.3 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 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.03) (meters 0.01) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.053333335) (meters 0.053333335) 1.0) + (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.0) + (sp-flt spt-fade-g -0.36) + (sp-flt spt-fade-b -4.24) + (sp-rnd-flt spt-fade-a -0.053333335 -0.053333335 1.0) + (sp-rnd-flt spt-accel-x -4.096 -1.3653333 1.0) + (sp-rnd-flt spt-accel-y 0.4096 0.4096 1.0) + (sp-flt spt-friction 0.96) + (sp-int spt-timer 2400) + (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 #xc00000 #xc03300) + ) + (sp-int-plain-rnd spt-next-time 25 4 1) + (sp-launcher-by-id spt-next-launcher 849) + ) + ) + +(defpart 849 + :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 10 39 1) + (sp-launcher-by-id spt-next-launcher 850) + ) + ) + +(defpart 850 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.026666667) (meters 0.026666667) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.14666666) + (sp-flt spt-fade-g -0.7866667) + (sp-flt spt-fade-b -0.88) + (sp-int-plain-rnd spt-next-time 105 44 1) + (sp-launcher-by-id spt-next-launcher 851) + ) + ) + +(defpart 851 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.013333334) (meters 0.013333334) 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-int-plain-rnd spt-next-time 150 29 1) + (sp-launcher-by-id spt-next-launcher 852) + ) + ) + +(defpart 852 + :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.024)) + ) + +(defpartgroup group-ctywide-chimney-smoke + :id 184 + :flags (unk-8) + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 853 :fade-after (meters 950) :falloff-to (meters 1200))) + ) + +(defpart 853 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 0.0 0.5 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 128.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 24.0 24.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.03) (meters 0.01) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.026666667) (meters 0.026666667) 1.0) + (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.21333334) + (sp-flt spt-fade-g -0.21333334) + (sp-flt spt-fade-b -0.21333334) + (sp-rnd-flt spt-fade-a -0.026666667 -0.026666667 1.0) + (sp-rnd-flt spt-accel-x -4.096 -1.3653333 1.0) + (sp-rnd-flt spt-accel-y 0.4096 0.4096 1.0) + (sp-flt spt-friction 0.96) + (sp-int spt-timer 1800) + (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 #xc00000 #xc03300) + ) + (sp-int-plain-rnd spt-next-time 75 4 1) + (sp-launcher-by-id spt-next-launcher 854) + ) + ) + +(defpart 854 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.026666667) (meters 0.026666667) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int-plain-rnd spt-next-time 105 44 1) + (sp-launcher-by-id spt-next-launcher 855) + ) + ) + +(defpart 855 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.026666667) (meters 0.026666667) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + ) + ) diff --git a/goal_src/jak2/levels/city/common/nav-graph-h.gc b/goal_src/jak2/levels/city/common/nav-graph-h.gc index 8823a489a6..67de3b8313 100644 --- a/goal_src/jak2/levels/city/common/nav-graph-h.gc +++ b/goal_src/jak2/levels/city/common/nav-graph-h.gc @@ -222,7 +222,7 @@ (node-at-idx (_type_ int) nav-node 41) (nav-graph-method-42 (_type_) none 42) (nav-graph-method-43 (_type_ nav-graph-link string) none 43) - (from-editor () none 44) + (from-editor (_type_ nav-node symbol) none 44) ) ) diff --git a/goal_src/jak2/levels/city/common/vehicle.gc b/goal_src/jak2/levels/city/common/vehicle.gc index b292f9a306..bb14c3106e 100644 --- a/goal_src/jak2/levels/city/common/vehicle.gc +++ b/goal_src/jak2/levels/city/common/vehicle.gc @@ -1482,11 +1482,13 @@ (if (zero? (-> obj draw light-index)) (set! (-> obj draw light-index) (the-as uint 10)) ) - (rigid-body-queue-method-11 (if (logtest? (-> obj info-override flags) 1024) - *race-rigid-body-queue* - *traffic-rigid-body-queue* - ) - ) + (rigid-body-queue-method-11 + (if (logtest? (-> obj info-override flags) 1024) + *race-rigid-body-queue* + *traffic-rigid-body-queue* + ) + obj + ) 0 (none) ) diff --git a/goal_src/jak2/levels/city/farm/ctyfarm-obs.gc b/goal_src/jak2/levels/city/farm/ctyfarm-obs.gc index bd30a31602..be8904a26c 100644 --- a/goal_src/jak2/levels/city/farm/ctyfarm-obs.gc +++ b/goal_src/jak2/levels/city/farm/ctyfarm-obs.gc @@ -7,3 +7,2478 @@ ;; DECOMP BEGINS +(defpartgroup group-farm-marrow-explode + :id 1025 + :duration (seconds 3.335) + :flags (use-local-clock unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 4462 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d bit7) :period 1200 :length 10) + (sp-item 4463 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d bit7) :period 1200 :length 15) + (sp-item 4464 :fade-after (meters 40) :falloff-to (meters 60) :flags (bit7) :period 1200 :length 15) + (sp-item 4465 :fade-after (meters 100) :falloff-to (meters 120) :flags (bit7) :period 1200 :length 30) + (sp-item 4466 :fade-after (meters 90) :falloff-to (meters 110) :flags (bit7) :period 1200 :length 40) + (sp-item 4467 :fade-after (meters 50) :period 1200 :length 5) + ) + ) + +(defpart 4465 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc)) + (sp-flt spt-num 32.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 5) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (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-rnd-flt spt-r 64.0 64.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 92.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-rnd-flt spt-fade-a -0.16 -0.16 1.0) + (sp-rnd-flt spt-accel-y -6.826667 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.95 0.03 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 0.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +(defpart 4464 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-flt spt-num 32.0) + (sp-rnd-flt spt-y (meters 0) (meters 5) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.05) 1.0) + (sp-int spt-rot-x 4) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-rnd-flt spt-b 128.0 32.0 1.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-omega 2.8672 1.6384 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.083333336) 1.0) + (sp-rnd-flt spt-accel-y -12.288 -2.7306666 1.0) + (sp-rnd-flt spt-friction 0.96 0.02 1.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-21) + (sp-flt spt-userdata 36864.0) + (sp-func spt-func 'check-water-level-drop-motion) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 85.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 1) 1.0) + ) + ) + +(defpart 4466 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 12.0 2.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 5) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 2) (meters 2) 1.0) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-rnd-flt spt-g 64.0 128.0 1.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 16.0 8.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-rnd-flt spt-scalevel-y (meters 0) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-fade-a -0.02 -0.02 1.0) + (sp-rnd-flt spt-accel-y -3.4133334 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.82 0.07 1.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-conerot-x (degrees 30.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +(defpart 4467 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 3)) + (sp-flt spt-scale-x (meters 7)) + (sp-flt spt-rot-x 122.88) + (sp-flt spt-scale-y (meters 5)) + (sp-flt spt-r 32.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 64.0) + (sp-flt spt-omega 206848.0) + (sp-flt spt-scalevel-x (meters 0.2)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -2.56) + (sp-int spt-timer 25) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 1024.0) + ) + ) + +(defpart 4463 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #xae7)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 12.0 6.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 5) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 0.00048828125) 8192.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.3) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.3) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.083333336) (meters 0.1) 1.0) + (sp-flt spt-scalevel-x (meters -0.00022222222)) + (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-scalevel-y (meters -0.00022222222)) + (sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) + (sp-rnd-flt spt-accel-y -13.653334 -6.826667 1.0) + (sp-rnd-flt spt-friction 0.92 0.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 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 5 0 0 -1368390400 -1368390656 -1368390912) + ) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 1200) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 4462 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #xae7)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 12.0 3.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 5) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 0.00048828125) 8192.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.5) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.1) (meters 0.13333334) 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.07 1.0) + (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 5 0 0 -1368390400 -1368390656 -1368390912) + ) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 120) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 15.0) (degrees 150.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; WARN: Return type mismatch number vs none. +(defun check-farm-piece-ground ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (if (and (>= 35225.6 (-> arg2 vector 0 y)) (>= 0.0 (-> arg1 vel-sxvel y))) + (set! (-> arg2 vector 0 y) 35225.6) + (set! (-> arg1 next-time) + (the-as uint (* (max 1 (the-as int (-> *display* clock (-> arg1 clock-index) sparticle-data x))) 2)) + ) + ) + (none) + ) + +(defpart 4468 + :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 150 299 1) + (sp-launcher-by-id spt-next-launcher 4469) + ) + ) + +(defpart 4469 + :init-specs ((sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) (sp-cpuinfo-flags sp-cpuinfo-flag-2 left-multiply-quat)) + ) + +(defpartgroup group-farm-beetree-explode + :id 1026 + :duration (seconds 3.335) + :flags (use-local-clock unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 4470 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d bit7) :period 1200 :length 15) + (sp-item 4471 :fade-after (meters 100) :falloff-to (meters 120) :flags (bit7) :period 1200 :length 30) + (sp-item 4472 :fade-after (meters 90) :falloff-to (meters 110) :flags (bit7) :period 1200 :length 40) + (sp-item 4473 :fade-after (meters 50) :period 1200 :length 5) + (sp-item 4474 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d bit7) :period 1200 :length 10) + (sp-item 4475 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d bit7) :period 1200 :length 15) + ) + ) + +(defpart 4475 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xae7)) + (sp-rnd-flt spt-num 12.0 6.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 9) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 0.00048828125) 8192.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.4) (meters 0.3) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.083333336) (meters 0.1) 1.0) + (sp-flt spt-scalevel-x (meters -0.00022222222)) + (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-scalevel-y (meters -0.00022222222)) + (sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) + (sp-rnd-flt spt-accel-y -13.653334 -6.826667 1.0) + (sp-rnd-flt spt-friction 0.92 0.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 1200) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 4474 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xae7)) + (sp-rnd-flt spt-num 12.0 3.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 9) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 0.00048828125) 8192.0) + (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.4) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 1) (meters 0.5) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.1) (meters 0.13333334) 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.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 120) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 15.0) (degrees 150.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-farm-cabbage-explode + :id 1027 + :duration (seconds 3.335) + :flags (use-local-clock unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 4476 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d bit7) :period 1200 :length 10) + (sp-item 4477 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d bit7) :period 1200 :length 15) + (sp-item 4478 :fade-after (meters 40) :falloff-to (meters 60) :flags (bit7) :period 1200 :length 15) + (sp-item 4479 :fade-after (meters 100) :falloff-to (meters 120) :flags (bit7) :period 1200 :length 30) + (sp-item 4480 :fade-after (meters 90) :falloff-to (meters 110) :flags (bit7) :period 1200 :length 40) + (sp-item 4481 :fade-after (meters 50) :period 1200 :length 5) + ) + ) + +(defpart 4479 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc)) + (sp-flt spt-num 32.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 3) 1.0) + (sp-rnd-flt spt-z (meters -4) (meters 8) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (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-rnd-flt spt-r 196.0 64.0 1.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 0.0 64.0 1.0) + (sp-rnd-flt spt-a 92.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-rnd-flt spt-fade-a -0.16 -0.16 1.0) + (sp-rnd-flt spt-accel-y -6.826667 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.95 0.03 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 0.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +(defpart 4478 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-flt spt-num 32.0) + (sp-rnd-flt spt-y (meters 0) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.05) 1.0) + (sp-int spt-rot-x 4) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 0.0 128.0 1.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-omega 2.8672 1.6384 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.083333336) 1.0) + (sp-rnd-flt spt-accel-y -12.288 -2.7306666 1.0) + (sp-rnd-flt spt-friction 0.96 0.02 1.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-21) + (sp-flt spt-userdata 36864.0) + (sp-func spt-func 'check-water-level-drop-motion) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 85.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 1) 1.0) + ) + ) + +(defpart 4480 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 12.0 2.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 3) 1.0) + (sp-rnd-flt spt-z (meters -4) (meters 8) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 2) (meters 2) 1.0) + (sp-rnd-flt spt-r 196.0 64.0 1.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 0.0 64.0 1.0) + (sp-rnd-flt spt-a 16.0 8.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-rnd-flt spt-scalevel-y (meters 0) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-fade-a -0.02 -0.02 1.0) + (sp-rnd-flt spt-accel-y -3.4133334 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.82 0.07 1.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-conerot-x (degrees 30.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +(defpart 4481 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 1.5)) + (sp-flt spt-scale-x (meters 3)) + (sp-flt spt-rot-x 122.88) + (sp-flt spt-scale-y (meters 5)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-omega 206848.0) + (sp-flt spt-scalevel-x (meters 0.2)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -2.56) + (sp-int spt-timer 25) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 1024.0) + ) + ) + +(defpart 4477 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xae7)) + (sp-rnd-flt spt-num 12.0 6.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 2) 1.0) + (sp-rnd-flt spt-z (meters -1.5) (meters 0.00048828125) 12288.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.3) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.3) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.083333336) (meters 0.1) 1.0) + (sp-flt spt-scalevel-x (meters -0.00022222222)) + (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-scalevel-y (meters -0.00022222222)) + (sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) + (sp-rnd-flt spt-accel-y -13.653334 -6.826667 1.0) + (sp-rnd-flt spt-friction 0.92 0.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 1200) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 4476 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xae7)) + (sp-rnd-flt spt-num 12.0 3.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 2) 1.0) + (sp-rnd-flt spt-z (meters -1.5) (meters 0.00048828125) 12288.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 1) (meters 0.5) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.1) (meters 0.13333334) 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.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 120) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 15.0) (degrees 150.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-farm-small-cabbage-explode + :id 1028 + :duration (seconds 3.335) + :flags (use-local-clock unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 4470 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d bit7) :period 1200 :length 15) + (sp-item 4471 :fade-after (meters 100) :falloff-to (meters 120) :flags (bit7) :period 1200 :length 30) + (sp-item 4472 :fade-after (meters 90) :falloff-to (meters 110) :flags (bit7) :period 1200 :length 40) + (sp-item 4473 :fade-after (meters 50) :period 1200 :length 5) + ) + ) + +(defpart 4471 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc)) + (sp-flt spt-num 20.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 2) 1.0) + (sp-rnd-flt spt-z (meters -2) (meters 4) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (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-rnd-flt spt-r 196.0 64.0 1.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 0.0 64.0 1.0) + (sp-rnd-flt spt-a 92.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-rnd-flt spt-fade-a -0.16 -0.16 1.0) + (sp-rnd-flt spt-accel-y -6.826667 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.95 0.03 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 0.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +(defpart 4472 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 8.0 2.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 2) 1.0) + (sp-rnd-flt spt-z (meters -2) (meters 4) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 1) (meters 1) 1.0) + (sp-rnd-flt spt-r 196.0 64.0 1.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 0.0 64.0 1.0) + (sp-rnd-flt spt-a 16.0 8.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-rnd-flt spt-scalevel-y (meters 0) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-fade-a -0.02 -0.02 1.0) + (sp-rnd-flt spt-accel-y -3.4133334 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.82 0.07 1.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-conerot-x (degrees 30.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +(defpart 4473 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 1.5)) + (sp-flt spt-scale-x (meters 2)) + (sp-flt spt-rot-x 122.88) + (sp-flt spt-scale-y (meters 3.5)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-omega 206848.0) + (sp-flt spt-scalevel-x (meters 0.2)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -2.56) + (sp-int spt-timer 25) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 1024.0) + ) + ) + +(defpart 4470 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xae7)) + (sp-rnd-flt spt-num 12.0 6.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) + (sp-rnd-flt spt-z (meters -1.5) (meters 0.00048828125) 12288.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.3) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.3) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.083333336) (meters 0.1) 1.0) + (sp-flt spt-scalevel-x (meters -0.00022222222)) + (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-scalevel-y (meters -0.00022222222)) + (sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) + (sp-rnd-flt spt-accel-y -13.653334 -6.826667 1.0) + (sp-rnd-flt spt-friction 0.92 0.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 1200) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-farm-chilirots-explode + :id 1029 + :duration (seconds 3.335) + :flags (use-local-clock unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 4482 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d bit7) :period 1200 :length 10) + (sp-item 4483 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d bit7) :period 1200 :length 15) + (sp-item 4484 :fade-after (meters 90) :falloff-to (meters 110) :flags (bit7) :period 1200 :length 40) + (sp-item 4485 :fade-after (meters 50) :period 1200 :length 5) + (sp-item 4486 :fade-after (meters 100) :falloff-to (meters 120) :flags (bit7) :period 1200 :length 30) + ) + ) + +(defpart 4486 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc)) + (sp-flt spt-num 32.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 5) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (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-rnd-flt spt-r 64.0 64.0 1.0) + (sp-rnd-flt spt-g 0.0 32.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 92.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-rnd-flt spt-fade-a -0.16 -0.16 1.0) + (sp-rnd-flt spt-accel-y -6.826667 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.95 0.03 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 0.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +(defpart 4484 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 12.0 2.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 5) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 2) (meters 2) 1.0) + (sp-flt spt-r 64.0) + (sp-rnd-flt spt-g 0.0 16.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 16.0 8.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-rnd-flt spt-scalevel-y (meters 0) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-fade-a -0.02 -0.02 1.0) + (sp-rnd-flt spt-accel-y -3.4133334 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.82 0.07 1.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-conerot-x (degrees 30.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +(defpart 4485 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 3)) + (sp-flt spt-scale-x (meters 7)) + (sp-flt spt-rot-x 122.88) + (sp-flt spt-scale-y (meters 5)) + (sp-flt spt-r 255.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-omega 206848.0) + (sp-flt spt-scalevel-x (meters 0.2)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -2.56) + (sp-int spt-timer 25) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 1024.0) + ) + ) + +(defpart 4483 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xae7)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 12.0 6.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 5) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 0.00048828125) 8192.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.3) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.3) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.083333336) (meters 0.1) 1.0) + (sp-flt spt-scalevel-x (meters -0.00022222222)) + (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-scalevel-y (meters -0.00022222222)) + (sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) + (sp-rnd-flt spt-accel-y -13.653334 -6.826667 1.0) + (sp-rnd-flt spt-friction 0.92 0.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 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 5 0 0 -1368391424 -1368391168) + ) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 1200) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 4482 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xae7)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 12.0 3.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 5) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 0.00048828125) 8192.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.5) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.1) (meters 0.13333334) 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.07 1.0) + (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 5 0 0 -1368391424 -1368391168) + ) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 120) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 15.0) (degrees 150.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-farm-sprinkler-barrels-water + :id 1030 + :duration (seconds 0.5) + :linger-duration (seconds 1) + :flags (use-local-clock unk-4) + :bounds (static-bspherem 0 0 0 128) + :parts ((sp-item 4487 :fade-after (meters 300) :falloff-to (meters 300) :flags (bit7) :period 600 :length 50 :offset 80) + (sp-item 4488 :fade-after (meters 200) :falloff-to (meters 300) :flags (bit7) :period 600 :length 50 :offset 80) + (sp-item 4489 :fade-after (meters 180) :falloff-to (meters 180) :flags (bit7) :period 600 :length 100 :offset 30) + (sp-item 4489 :fade-after (meters 180) :falloff-to (meters 180) :flags (bit7) :period 600 :length 75 :offset 55) + (sp-item 4489 :fade-after (meters 180) :falloff-to (meters 180) :flags (bit7) :period 600 :length 100 :offset 80) + (sp-item 4490 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit7) :period 600 :length 50 :offset 80) + ) + ) + +(defpart 4488 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 6.0 1.0 1.0) + (sp-flt spt-z (meters -0.5)) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.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 32.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 32.0 64.0 1.0) + (sp-rnd-flt spt-vel-z (meters 0.2) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.026666667) (meters 0.01) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.6) (degrees 1.2) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.28444445 -0.28444445 1.0) + (sp-rnd-flt spt-accel-y -1.3653333 -1.3653333 1.0) + (sp-rnd-flt spt-friction 0.8 0.08 1.0) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 use-global-acc) + (sp-rnd-flt spt-launchrot-x (degrees -15.0) (degrees 30.0) 1.0) + (sp-rnd-flt spt-launchrot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 4487 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-rnd-flt spt-num 10.0 1.0 1.0) + (sp-flt spt-z (meters -0.5)) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) + (sp-int spt-rot-x 4) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-omega 4.096) + (sp-rnd-flt spt-vel-z (meters 0.2) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-accel-y -13.653334 1.3653333 1.0) + (sp-flt spt-friction 0.99) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 use-global-acc) + (sp-flt spt-userdata 32768.0) + (sp-func spt-func 'check-drop-level-ctyfarma-drop-userdata) + (sp-int-plain-rnd spt-next-time 0 224 1) + (sp-launcher-by-id spt-next-launcher 4491) + (sp-rnd-flt spt-launchrot-x (degrees -5.0) (degrees 10.0) 1.0) + (sp-rnd-flt spt-launchrot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 4489 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-rnd-flt spt-num 2.0 0.5 1.0) + (sp-flt spt-z (meters -0.5)) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) + (sp-int spt-rot-x 4) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-omega 4.096) + (sp-rnd-flt spt-vel-z (meters 0.13333334) (meters 0.13333334) 1.0) + (sp-rnd-flt spt-accel-y -13.653334 1.3653333 1.0) + (sp-flt spt-friction 0.99) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 use-global-acc) + (sp-flt spt-userdata 32768.0) + (sp-func spt-func 'check-drop-level-ctyfarma-drop-userdata) + (sp-int-plain-rnd spt-next-time 0 224 1) + (sp-launcher-by-id spt-next-launcher 4491) + (sp-rnd-flt spt-launchrot-x (degrees -16.0) (degrees 32.0) 1.0) + (sp-rnd-flt spt-launchrot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 4490 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-rnd-flt spt-num 2.0 0.5 1.0) + (sp-flt spt-z (meters -0.5)) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) + (sp-int spt-rot-x 4) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-omega 4.096) + (sp-rnd-flt spt-vel-z (meters 0.1) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-accel-y -13.653334 1.3653333 1.0) + (sp-flt spt-friction 0.99) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 use-global-acc) + (sp-flt spt-userdata 32768.0) + (sp-func spt-func 'check-drop-level-ctyfarma-drop-userdata) + (sp-int-plain-rnd spt-next-time 0 224 1) + (sp-launcher-by-id spt-next-launcher 4491) + (sp-rnd-flt spt-launchrot-x (degrees -70.0) (degrees 140.0) 1.0) + (sp-rnd-flt spt-launchrot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(deftype shaker (structure) + ((axis vector :inline :offset-assert 0) + (start-time time-frame :offset-assert 16) + (decay-time float :offset-assert 24) + (amplitude float :offset-assert 28) + (freq float :offset-assert 32) + (y-decay-time float :offset-assert 36) + (y-amplitude float :offset-assert 40) + (y-freq float :offset-assert 44) + (shake float :offset-assert 48) + (y-shake float :offset-assert 52) + ) + :method-count-assert 10 + :size-assert #x38 + :flag-assert #xa00000038 + (:methods + (shaker-method-9 (_type_) none 9) + ) + ) + + +;; WARN: Return type mismatch float vs none. +(defmethod shaker-method-9 shaker ((obj shaker)) + (with-pp + (let ((s5-0 (- (-> pp clock frame-counter) (-> obj start-time)))) + (set! (-> obj shake) (* (-> obj amplitude) + (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> obj decay-time)) + (cos (* 65536.0 (/ (the float s5-0) (-> obj freq)))) + ) + ) + (set! (-> obj y-shake) (* (-> obj y-amplitude) + (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> obj y-decay-time)) + (cos (* 65536.0 (/ (the float s5-0) (-> obj y-freq)))) + ) + ) + ) + (none) + ) + ) + +;; WARN: Return type mismatch int vs knocked-type. +(defun pu->knocked-type ((arg0 penetrate)) + (the-as knocked-type (cond + ((logtest? arg0 (penetrate vehicle)) + 7 + ) + ((logtest? (penetrate jak-blue-shot) arg0) + 6 + ) + ((logtest? (penetrate jak-yellow-shot enemy-yellow-shot) arg0) + 4 + ) + ((logtest? (penetrate jak-red-shot) arg0) + 5 + ) + ((logtest? (penetrate explode jak-dark-shot enemy-dark-shot) arg0) + 2 + ) + ((logtest? (penetrate dark-bomb dark-giant) arg0) + 3 + ) + ((logtest? arg0 (penetrate mech-punch)) + 1 + ) + (else + 0 + ) + ) + ) + ) + +(defskelgroup skel-farm-marrow farm-marrow farm-marrow-lod0-jg farm-marrow-idle-ja + ((farm-marrow-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2.4 0 4) + ) + +(defskelgroup skel-farm-marrow-explode farm-marrow farm-marrow-explode-lod0-jg farm-marrow-explode-idle-ja + ((farm-marrow-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +(define *farm-marrow-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 3 :parent-joint-index -1) + (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) + ) + :collide-spec #x1 + ) + ) + +(deftype farm-marrow (process-focusable) + ((shakers shaker 5 :inline :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 528) + ) + :heap-base #x1a0 + :method-count-assert 31 + :size-assert #x214 + :flag-assert #x1f01a00214 + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (farm-marrow-method-29 (_type_) none 29) + (farm-marrow-method-30 (_type_) none 30) + ) + ) + + +(defun farm-marrow-callback ((arg0 cspace) (arg1 transformq)) + (with-pp + (let ((s4-0 (the-as farm-marrow (-> arg0 param1))) + (s3-0 (the-as int (-> arg0 param2))) + ) + (quaternion*! (-> arg1 quat) (-> arg1 quat) (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + (the-as vector (-> s4-0 shakers s3-0)) + (-> s4-0 shakers s3-0 shake) + ) + ) + (quaternion-rotate-local-y! (-> arg1 quat) (-> arg1 quat) (-> s4-0 shakers s3-0 y-shake)) + (if (< (the int (-> s4-0 shakers s3-0 decay-time)) + (- (-> pp clock frame-counter) (-> s4-0 shakers s3-0 start-time)) + ) + (set! (-> arg0 param0) #f) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +(defstate die (farm-marrow) + :virtual #t + :enter (the-as (function none :behavior farm-marrow) #f) + :exit (the-as (function none :behavior farm-marrow) #f) + :trans (the-as (function none :behavior farm-marrow) #f) + :code (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior farm-marrow) #f) + ) + +(defstate idle (farm-marrow) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (let ((a1-1 (the-as object (-> event param 1))) + (a0-2 proc) + ) + (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info a1-1) id)) + (when a0-2 + (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) + (when s5-0 + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (cond + ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) + (sound-play "hit-veggies") + (let ((gp-4 (new 'stack-no-clear 'vector))) + (vector-inv-orient-by-quat! + gp-4 + (vector-cross! + (new 'stack-no-clear 'vector) + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (-> s5-0 root-override trans) (-> self root-override trans)) + 1.0 + ) + *up-vector* + ) + (-> self root-override quat) + ) + (let ((v1-10 (-> self shakers))) + (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) + (set! (-> v1-10 0 start-time) (-> self clock frame-counter)) + (set! (-> v1-10 0 decay-time) 300.0) + (set! (-> v1-10 0 freq) 150.0) + (set! (-> v1-10 0 amplitude) 1820.4445) + (set! (-> v1-10 0 y-amplitude) 0.0) + ) + (let ((a0-17 (-> self node-list data 6))) + (set! (-> a0-17 param0) farm-marrow-callback) + (set! (-> a0-17 param1) self) + (set! (-> a0-17 param2) (the-as basic 0)) + ) + (let ((v1-13 (-> self shakers 1))) + (set! (-> v1-13 axis quad) (-> gp-4 quad)) + (set! (-> v1-13 start-time) (+ (-> self clock frame-counter) (seconds -0.06))) + (set! (-> v1-13 decay-time) 450.0) + (set! (-> v1-13 freq) 150.0) + (set! (-> v1-13 amplitude) 1820.4445) + (set! (-> v1-13 y-amplitude) 0.0) + ) + (let ((v1-15 (-> self node-list data 7))) + (set! (-> v1-15 param0) farm-marrow-callback) + (set! (-> v1-15 param1) self) + (set! (-> v1-15 param2) (the-as basic 1)) + ) + (let ((v1-16 (-> self shakers 2))) + (set! (-> v1-16 axis quad) (-> gp-4 quad)) + (set! (-> v1-16 start-time) (+ (-> self clock frame-counter) (seconds -0.12))) + (set! (-> v1-16 decay-time) 600.0) + (set! (-> v1-16 freq) 150.0) + (set! (-> v1-16 amplitude) 1820.4445) + (set! (-> v1-16 y-amplitude) 0.0) + ) + (let ((v1-18 (-> self node-list data 8))) + (set! (-> v1-18 param0) farm-marrow-callback) + (set! (-> v1-18 param1) self) + (set! (-> v1-18 param2) (the-as basic 2)) + ) + (let ((v1-19 (-> self shakers 3))) + (set! (-> v1-19 axis quad) (-> gp-4 quad)) + (set! (-> v1-19 start-time) (+ (-> self clock frame-counter) (seconds -0.06))) + (set! (-> v1-19 decay-time) 300.0) + (set! (-> v1-19 freq) 150.0) + (set! (-> v1-19 amplitude) 910.2222) + (set! (-> v1-19 y-decay-time) 300.0) + (set! (-> v1-19 y-freq) 150.0) + (set! (-> v1-19 y-amplitude) -1820.4445) + ) + (let ((v1-21 (-> self node-list data 4))) + (set! (-> v1-21 param0) farm-marrow-callback) + (set! (-> v1-21 param1) self) + (set! (-> v1-21 param2) (the-as basic 3)) + ) + (let ((v1-22 (-> self shakers 4))) + (set! (-> v1-22 axis quad) (-> gp-4 quad)) + (set! (-> v1-22 start-time) (+ (-> self clock frame-counter) (seconds -0.12))) + (set! (-> v1-22 decay-time) 600.0) + (set! (-> v1-22 freq) 150.0) + (set! (-> v1-22 amplitude) 910.2222) + (set! (-> v1-22 y-amplitude) 0.0) + ) + ) + (let ((v0-0 (the-as object (-> self node-list data 5)))) + (set! (-> (the-as cspace v0-0) param0) farm-marrow-callback) + (set! (-> (the-as cspace v0-0) param1) self) + (set! (-> (the-as cspace v0-0) param2) (the-as basic 4)) + v0-0 + ) + ) + (else + (sound-play "veggie-burst") + (let ((gp-6 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-6 fountain-rand-transv-lo quad) (-> s5-0 root-override trans quad)) + (set! (-> gp-6 fountain-rand-transv-hi x) 4096.0) + (set! (-> gp-6 fountain-rand-transv-hi y) 122880.0) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1025) + 300 + #f + #f + #f + (-> self node-list data 3 bone transform) + :to self + ) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-farm-marrow-explode" (the-as (pointer uint32) #f)) + 5 + gp-6 + *farm-marrow-exploder-params* + :to self + ) + ) + (go-virtual die) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :exit (behavior () + '() + (none) + ) + :code (the-as (function none :behavior farm-marrow) sleep-code) + :post (behavior () + (dotimes (gp-0 5) + (shaker-method-9 (-> self shakers gp-0)) + ) + (transform-post) + (none) + ) + ) + +(defmethod farm-marrow-method-29 farm-marrow ((obj farm-marrow)) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 9830.4 0.0 16384.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +(defmethod farm-marrow-method-30 farm-marrow ((obj farm-marrow)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! farm-marrow ((obj farm-marrow) (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" + (farm-marrow-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-marrow" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (farm-marrow-method-30 obj) + (quaternion-vector-angle! + (-> obj root-override quat) + *up-vector* + (* 182.04445 (rand-vu-float-range 0.0 360.0)) + ) + (let ((f0-2 (rand-vu-float-range 0.9 1.1))) + (set-vector! (-> obj root-override scale) f0-2 f0-2 f0-2 1.0) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +(defskelgroup skel-farm-beetree farm-beetree farm-beetree-lod0-jg farm-beetree-idle-ja + ((farm-beetree-lod0-mg (meters 999999))) + :bounds (static-spherem 0 4 0 7) + ) + +(defskelgroup skel-farm-beetree-explode farm-beetree farm-beetree-explode-lod0-jg farm-beetree-explode-idle-ja + ((farm-beetree-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +(define *farm-beetree-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 3 :parent-joint-index -1) + (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) + ) + :collide-spec #x1 + ) + ) + +(deftype farm-beetree (process-focusable) + ((shakers shaker 2 :inline :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 336) + ) + :heap-base #xe0 + :method-count-assert 31 + :size-assert #x154 + :flag-assert #x1f00e00154 + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (farm-beetree-method-29 (_type_) none 29) + (farm-beetree-method-30 (_type_) none 30) + ) + ) + + +(defun farm-beetree-callback ((arg0 cspace) (arg1 transformq)) + (with-pp + (let ((s4-0 (the-as farm-beetree (-> arg0 param1))) + (s3-0 (the-as int (-> arg0 param2))) + ) + (quaternion*! (-> arg1 quat) (-> arg1 quat) (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + (the-as vector (-> s4-0 shakers s3-0)) + (-> s4-0 shakers s3-0 shake) + ) + ) + (quaternion-rotate-local-y! (-> arg1 quat) (-> arg1 quat) (-> s4-0 shakers s3-0 y-shake)) + (if (< (the int (-> s4-0 shakers s3-0 decay-time)) + (- (-> pp clock frame-counter) (-> s4-0 shakers s3-0 start-time)) + ) + (set! (-> arg0 param0) #f) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +(defstate die (farm-beetree) + :virtual #t + :enter (the-as (function none :behavior farm-beetree) #f) + :exit (the-as (function none :behavior farm-beetree) #f) + :trans (the-as (function none :behavior farm-beetree) #f) + :code (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior farm-beetree) #f) + ) + +(defstate idle (farm-beetree) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (let ((a1-1 (the-as object (-> event param 1))) + (a0-2 proc) + ) + (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info a1-1) id)) + (when a0-2 + (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) + (when s5-0 + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (cond + ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) + (sound-play "hit-veggies") + (let ((gp-4 (new 'stack-no-clear 'vector))) + (vector-inv-orient-by-quat! + gp-4 + (vector-cross! + (new 'stack-no-clear 'vector) + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (-> s5-0 root-override trans) (-> self root-override trans)) + 1.0 + ) + *up-vector* + ) + (-> self root-override quat) + ) + (let ((v1-10 (-> self shakers))) + (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) + (set! (-> v1-10 0 start-time) (-> self clock frame-counter)) + (set! (-> v1-10 0 decay-time) 300.0) + (set! (-> v1-10 0 freq) 150.0) + (set! (-> v1-10 0 amplitude) 1820.4445) + (set! (-> v1-10 0 y-amplitude) 0.0) + ) + (let ((a0-17 (-> self node-list data 4))) + (set! (-> a0-17 param0) farm-beetree-callback) + (set! (-> a0-17 param1) self) + (set! (-> a0-17 param2) (the-as basic 0)) + ) + (let ((v1-13 (-> self shakers 1))) + (set! (-> v1-13 axis quad) (-> gp-4 quad)) + (set! (-> v1-13 start-time) (+ (-> self clock frame-counter) (seconds -0.06))) + (set! (-> v1-13 decay-time) 600.0) + (set! (-> v1-13 freq) 150.0) + (set! (-> v1-13 amplitude) 364.0889) + (set! (-> v1-13 y-decay-time) 450.0) + (set! (-> v1-13 y-freq) 150.0) + (set! (-> v1-13 y-amplitude) 3640.889) + ) + ) + (let ((v0-0 (the-as object (-> self node-list data 5)))) + (set! (-> (the-as cspace v0-0) param0) farm-beetree-callback) + (set! (-> (the-as cspace v0-0) param1) self) + (set! (-> (the-as cspace v0-0) param2) (the-as basic 1)) + v0-0 + ) + ) + (else + (sound-play "veggie-burst") + (let ((gp-6 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-6 fountain-rand-transv-lo quad) (-> s5-0 root-override trans quad)) + (set! (-> gp-6 fountain-rand-transv-hi x) 4096.0) + (set! (-> gp-6 fountain-rand-transv-hi y) 122880.0) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1026) + 300 + #f + #f + #f + (-> self node-list data 3 bone transform) + :to self + ) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-farm-beetree-explode" (the-as (pointer uint32) #f)) + 5 + gp-6 + *farm-beetree-exploder-params* + :to self + ) + ) + (go-virtual die) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :exit (the-as (function none :behavior farm-beetree) #f) + :code (the-as (function none :behavior farm-beetree) sleep-code) + :post (behavior () + (dotimes (gp-0 2) + (shaker-method-9 (-> self shakers gp-0)) + ) + (transform-post) + (none) + ) + ) + +(defmethod farm-beetree-method-29 farm-beetree ((obj farm-beetree)) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 16384.0 0.0 28672.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +(defmethod farm-beetree-method-30 farm-beetree ((obj farm-beetree)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! farm-beetree ((obj farm-beetree) (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" + (farm-beetree-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-beetree" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (farm-beetree-method-30 obj) + (quaternion-vector-angle! + (-> obj root-override quat) + *up-vector* + (* 182.04445 (rand-vu-float-range 0.0 360.0)) + ) + (let ((f0-2 (rand-vu-float-range 0.9 1.1))) + (set-vector! (-> obj root-override scale) f0-2 f0-2 f0-2 1.0) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +(defskelgroup skel-farm-cabbage farm-cabbage farm-cabbage-lod0-jg farm-cabbage-idle-ja + ((farm-cabbage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +(defskelgroup skel-farm-cabbage-explode farm-cabbage farm-cabbage-explode-lod0-jg farm-cabbage-explode-idle-ja + ((farm-cabbage-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +(define *farm-cabbage-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 3 :parent-joint-index -1) + (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) + ) + :collide-spec #x1 + ) + ) + +(deftype farm-cabbage (process-focusable) + ((shakers shaker 2 :inline :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 336) + ) + :heap-base #xe0 + :method-count-assert 31 + :size-assert #x154 + :flag-assert #x1f00e00154 + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (farm-cabbage-method-29 (_type_) none 29) + (farm-cabbage-method-30 (_type_) none 30) + ) + ) + + +(defun farm-cabbage-callback ((arg0 cspace) (arg1 transformq)) + (with-pp + (let ((s4-0 (the-as farm-cabbage (-> arg0 param1))) + (s3-0 (the-as int (-> arg0 param2))) + ) + (quaternion*! (-> arg1 quat) (-> arg1 quat) (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + (the-as vector (-> s4-0 shakers s3-0)) + (-> s4-0 shakers s3-0 shake) + ) + ) + (quaternion-rotate-local-y! (-> arg1 quat) (-> arg1 quat) (-> s4-0 shakers s3-0 y-shake)) + (if (< (the int (-> s4-0 shakers s3-0 decay-time)) + (- (-> pp clock frame-counter) (-> s4-0 shakers s3-0 start-time)) + ) + (set! (-> arg0 param0) #f) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +(defstate die (farm-cabbage) + :virtual #t + :enter (the-as (function none :behavior farm-cabbage) #f) + :exit (the-as (function none :behavior farm-cabbage) #f) + :trans (the-as (function none :behavior farm-cabbage) #f) + :code (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior farm-cabbage) #f) + ) + +(defstate idle (farm-cabbage) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (let ((a1-1 (the-as object (-> event param 1))) + (a0-2 proc) + ) + (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info a1-1) id)) + (when a0-2 + (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) + (when s5-0 + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (cond + ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) + (sound-play "hit-veggies") + (let ((gp-4 (new 'stack-no-clear 'vector))) + (vector-inv-orient-by-quat! + gp-4 + (vector-cross! + (new 'stack-no-clear 'vector) + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (-> s5-0 root-override trans) (-> self root-override trans)) + 1.0 + ) + *up-vector* + ) + (-> self root-override quat) + ) + (let ((v1-10 (-> self shakers))) + (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) + (set! (-> v1-10 0 start-time) (-> self clock frame-counter)) + (set! (-> v1-10 0 decay-time) 300.0) + (set! (-> v1-10 0 freq) 150.0) + (set! (-> v1-10 0 amplitude) 1820.4445) + (set! (-> v1-10 0 y-amplitude) 0.0) + ) + (let ((a0-17 (-> self node-list data 4))) + (set! (-> a0-17 param0) farm-cabbage-callback) + (set! (-> a0-17 param1) self) + (set! (-> a0-17 param2) (the-as basic 0)) + ) + (let ((v1-13 (-> self shakers 1))) + (set! (-> v1-13 axis quad) (-> gp-4 quad)) + (set! (-> v1-13 start-time) (+ (-> self clock frame-counter) (seconds -0.06))) + (set! (-> v1-13 decay-time) 600.0) + (set! (-> v1-13 freq) 150.0) + (set! (-> v1-13 amplitude) 364.0889) + (set! (-> v1-13 y-decay-time) 450.0) + (set! (-> v1-13 y-freq) 150.0) + (set! (-> v1-13 y-amplitude) 910.2222) + ) + ) + (let ((v0-0 (the-as object (-> self node-list data 5)))) + (set! (-> (the-as cspace v0-0) param0) farm-cabbage-callback) + (set! (-> (the-as cspace v0-0) param1) self) + (set! (-> (the-as cspace v0-0) param2) (the-as basic 1)) + v0-0 + ) + ) + (else + (sound-play "veggie-burst") + (let ((gp-6 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-6 fountain-rand-transv-lo quad) (-> s5-0 root-override trans quad)) + (set! (-> gp-6 fountain-rand-transv-hi x) 40960.0) + (set! (-> gp-6 fountain-rand-transv-hi y) 122880.0) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1027) + 300 + #f + #f + #f + (-> self node-list data 3 bone transform) + :to self + ) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-farm-cabbage-explode" (the-as (pointer uint32) #f)) + 5 + gp-6 + *farm-cabbage-exploder-params* + :to self + ) + ) + (go-virtual die) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :exit (the-as (function none :behavior farm-cabbage) #f) + :code (the-as (function none :behavior farm-cabbage) sleep-code) + :post (behavior () + (dotimes (gp-0 2) + (shaker-method-9 (-> self shakers gp-0)) + ) + (transform-post) + (none) + ) + ) + +(defmethod farm-cabbage-method-29 farm-cabbage ((obj farm-cabbage)) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 4) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +(defmethod farm-cabbage-method-30 farm-cabbage ((obj farm-cabbage)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! farm-cabbage ((obj farm-cabbage) (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" + (farm-cabbage-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-cabbage" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (farm-cabbage-method-30 obj) + (quaternion-vector-angle! + (-> obj root-override quat) + *up-vector* + (* 182.04445 (rand-vu-float-range 0.0 360.0)) + ) + (let ((f0-2 (rand-vu-float-range 0.9 1.1))) + (set-vector! (-> obj root-override scale) f0-2 f0-2 f0-2 1.0) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +(defskelgroup skel-farm-small-cabbage farm-small-cabbage farm-small-cabbage-lod0-jg farm-small-cabbage-idle-ja + ((farm-small-cabbage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + ) + +(defskelgroup skel-farm-small-cabbage-explode farm-small-cabbage farm-small-cabbage-explode-lod0-jg farm-small-cabbage-explode-idle-ja + ((farm-small-cabbage-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +(define *farm-small-cabbage-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 3 :parent-joint-index -1) + (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) + ) + :collide-spec #x1 + ) + ) + +(deftype farm-small-cabbage (process-focusable) + ((shakers shaker 1 :inline :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 272) + ) + :heap-base #xa0 + :method-count-assert 31 + :size-assert #x114 + :flag-assert #x1f00a00114 + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (farm-small-cabbage-method-29 (_type_) none 29) + (farm-small-cabbage-method-30 (_type_) none 30) + ) + ) + + +(defun farm-small-cabbage-callback ((arg0 cspace) (arg1 transformq)) + (with-pp + (let ((s4-0 (the-as farm-small-cabbage (-> arg0 param1))) + (s3-0 (the-as int (-> arg0 param2))) + ) + (quaternion*! (-> arg1 quat) (-> arg1 quat) (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + (the-as vector (-> s4-0 shakers s3-0)) + (-> s4-0 shakers s3-0 shake) + ) + ) + (quaternion-rotate-local-y! (-> arg1 quat) (-> arg1 quat) (-> s4-0 shakers s3-0 y-shake)) + (if (< (the int (-> s4-0 shakers s3-0 decay-time)) + (- (-> pp clock frame-counter) (-> s4-0 shakers s3-0 start-time)) + ) + (set! (-> arg0 param0) #f) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +(defstate die (farm-small-cabbage) + :virtual #t + :enter (the-as (function none :behavior farm-small-cabbage) #f) + :exit (the-as (function none :behavior farm-small-cabbage) #f) + :trans (the-as (function none :behavior farm-small-cabbage) #f) + :code (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior farm-small-cabbage) #f) + ) + +(defstate idle (farm-small-cabbage) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (let ((a1-1 (the-as object (-> event param 1))) + (a0-2 proc) + ) + (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info a1-1) id)) + (when a0-2 + (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) + (when s5-0 + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (cond + ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) + (sound-play "hit-veggies") + (let ((gp-4 (new 'stack-no-clear 'vector))) + (vector-inv-orient-by-quat! + gp-4 + (vector-cross! + (new 'stack-no-clear 'vector) + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (-> s5-0 root-override trans) (-> self root-override trans)) + 1.0 + ) + *up-vector* + ) + (-> self root-override quat) + ) + (let ((v1-10 (-> self shakers))) + (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) + (set! (-> v1-10 0 start-time) (-> self clock frame-counter)) + (set! (-> v1-10 0 decay-time) 300.0) + (set! (-> v1-10 0 freq) 150.0) + (set! (-> v1-10 0 amplitude) 910.2222) + (set! (-> v1-10 0 y-amplitude) 0.0) + ) + ) + (let ((v0-0 (the-as object (-> self node-list data 4)))) + (set! (-> (the-as cspace v0-0) param0) farm-small-cabbage-callback) + (set! (-> (the-as cspace v0-0) param1) self) + (set! (-> (the-as cspace v0-0) param2) (the-as basic 0)) + v0-0 + ) + ) + (else + (sound-play "veggie-burst") + (let ((gp-6 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-6 fountain-rand-transv-lo quad) (-> s5-0 root-override trans quad)) + (set! (-> gp-6 fountain-rand-transv-hi x) 4096.0) + (set! (-> gp-6 fountain-rand-transv-hi y) 122880.0) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1028) + 300 + #f + #f + #f + (-> self node-list data 3 bone transform) + :to self + ) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-farm-small-cabbage-explode" (the-as (pointer uint32) #f)) + 5 + gp-6 + *farm-small-cabbage-exploder-params* + :to self + ) + ) + (go-virtual die) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :exit (the-as (function none :behavior farm-small-cabbage) #f) + :code (the-as (function none :behavior farm-small-cabbage) sleep-code) + :post (behavior () + (dotimes (gp-0 1) + (shaker-method-9 (-> self shakers gp-0)) + ) + (transform-post) + (none) + ) + ) + +(defmethod farm-small-cabbage-method-29 farm-small-cabbage ((obj farm-small-cabbage)) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 4) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 10240.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +(defmethod farm-small-cabbage-method-30 farm-small-cabbage ((obj farm-small-cabbage)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! farm-small-cabbage ((obj farm-small-cabbage) (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" + (farm-small-cabbage-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-small-cabbage" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (farm-small-cabbage-method-30 obj) + (quaternion-vector-angle! + (-> obj root-override quat) + *up-vector* + (* 182.04445 (rand-vu-float-range 0.0 360.0)) + ) + (let ((f0-2 (rand-vu-float-range 0.9 1.1))) + (set-vector! (-> obj root-override scale) f0-2 f0-2 f0-2 1.0) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +(defskelgroup skel-farm-chilirots farm-chilirots farm-chilirots-lod0-jg farm-chilirots-idle-ja + ((farm-chilirots-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 4.5) + ) + +(defskelgroup skel-farm-chilirots-explode farm-chilirots farm-chilirots-explode-lod0-jg farm-chilirots-explode-idle-ja + ((farm-chilirots-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +(define *farm-chilirots-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 3 :parent-joint-index -1) + (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) + ) + :collide-spec #x1 + ) + ) + +(deftype farm-chilirots (process-focusable) + ((shakers shaker 4 :inline :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 464) + ) + :heap-base #x160 + :method-count-assert 31 + :size-assert #x1d4 + :flag-assert #x1f016001d4 + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (farm-chilirots-method-29 (_type_) none 29) + (farm-chilirots-method-30 (_type_) none 30) + ) + ) + + +(defun farm-chilirots-callback ((arg0 cspace) (arg1 transformq)) + (with-pp + (let ((s4-0 (the-as farm-chilirots (-> arg0 param1))) + (s3-0 (the-as int (-> arg0 param2))) + ) + (quaternion*! (-> arg1 quat) (-> arg1 quat) (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + (the-as vector (-> s4-0 shakers s3-0)) + (-> s4-0 shakers s3-0 shake) + ) + ) + (quaternion-rotate-local-y! (-> arg1 quat) (-> arg1 quat) (-> s4-0 shakers s3-0 y-shake)) + (if (< (the int (-> s4-0 shakers s3-0 decay-time)) + (- (-> pp clock frame-counter) (-> s4-0 shakers s3-0 start-time)) + ) + (set! (-> arg0 param0) #f) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +(defstate die (farm-chilirots) + :virtual #t + :enter (the-as (function none :behavior farm-chilirots) #f) + :exit (the-as (function none :behavior farm-chilirots) #f) + :trans (the-as (function none :behavior farm-chilirots) #f) + :code (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior farm-chilirots) #f) + ) + +(defstate idle (farm-chilirots) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (let ((a1-1 (the-as object (-> event param 1))) + (a0-2 proc) + ) + (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info a1-1) id)) + (when a0-2 + (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) + (when s5-0 + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (cond + ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) + (sound-play "hit-veggies") + (let ((gp-4 (new 'stack-no-clear 'vector))) + (vector-inv-orient-by-quat! + gp-4 + (vector-cross! + (new 'stack-no-clear 'vector) + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (-> s5-0 root-override trans) (-> self root-override trans)) + 1.0 + ) + *up-vector* + ) + (-> self root-override quat) + ) + (let ((v1-10 (-> self shakers))) + (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) + (set! (-> v1-10 0 start-time) (-> self clock frame-counter)) + (set! (-> v1-10 0 decay-time) 300.0) + (set! (-> v1-10 0 freq) 150.0) + (set! (-> v1-10 0 amplitude) 1820.4445) + (set! (-> v1-10 0 y-amplitude) 0.0) + ) + (let ((a0-17 (-> self node-list data 4))) + (set! (-> a0-17 param0) farm-chilirots-callback) + (set! (-> a0-17 param1) self) + (set! (-> a0-17 param2) (the-as basic 0)) + ) + (let ((v1-13 (-> self shakers 1))) + (set! (-> v1-13 axis quad) (-> gp-4 quad)) + (set! (-> v1-13 start-time) (+ (-> self clock frame-counter) (seconds -0.06))) + (set! (-> v1-13 decay-time) 450.0) + (set! (-> v1-13 freq) 150.0) + (set! (-> v1-13 amplitude) 1820.4445) + (set! (-> v1-13 y-decay-time) 450.0) + (set! (-> v1-13 y-freq) 150.0) + (set! (-> v1-13 y-amplitude) 1820.4445) + ) + (let ((v1-15 (-> self node-list data 5))) + (set! (-> v1-15 param0) farm-chilirots-callback) + (set! (-> v1-15 param1) self) + (set! (-> v1-15 param2) (the-as basic 1)) + ) + (let ((v1-16 (-> self shakers 2))) + (set! (-> v1-16 axis quad) (-> gp-4 quad)) + (set! (-> v1-16 start-time) (+ (-> self clock frame-counter) (seconds -0.12))) + (set! (-> v1-16 decay-time) 600.0) + (set! (-> v1-16 freq) 150.0) + (set! (-> v1-16 amplitude) 1820.4445) + (set! (-> v1-16 y-decay-time) 450.0) + (set! (-> v1-16 y-freq) 150.0) + (set! (-> v1-16 y-amplitude) 1820.4445) + ) + (let ((v1-18 (-> self node-list data 6))) + (set! (-> v1-18 param0) farm-chilirots-callback) + (set! (-> v1-18 param1) self) + (set! (-> v1-18 param2) (the-as basic 2)) + ) + (let ((v1-19 (-> self shakers 3))) + (set! (-> v1-19 axis quad) (-> gp-4 quad)) + (set! (-> v1-19 start-time) (+ (-> self clock frame-counter) (seconds -0.18))) + (set! (-> v1-19 decay-time) 750.0) + (set! (-> v1-19 freq) 150.0) + (set! (-> v1-19 amplitude) 1820.4445) + (set! (-> v1-19 y-decay-time) 450.0) + (set! (-> v1-19 y-freq) 150.0) + (set! (-> v1-19 y-amplitude) 1820.4445) + ) + ) + (let ((v0-0 (the-as object (-> self node-list data 7)))) + (set! (-> (the-as cspace v0-0) param0) farm-chilirots-callback) + (set! (-> (the-as cspace v0-0) param1) self) + (set! (-> (the-as cspace v0-0) param2) (the-as basic 3)) + v0-0 + ) + ) + (else + (sound-play "veggie-burst") + (let ((gp-6 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-6 fountain-rand-transv-lo quad) (-> s5-0 root-override trans quad)) + (set! (-> gp-6 fountain-rand-transv-hi x) 4096.0) + (set! (-> gp-6 fountain-rand-transv-hi y) 122880.0) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1029) + 300 + #f + #f + #f + (-> self node-list data 3 bone transform) + :to self + ) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-farm-chilirots-explode" (the-as (pointer uint32) #f)) + 5 + gp-6 + *farm-chilirots-exploder-params* + :to self + ) + ) + (go-virtual die) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :code (the-as (function none :behavior farm-chilirots) sleep-code) + :post (behavior () + (dotimes (gp-0 4) + (shaker-method-9 (-> self shakers gp-0)) + ) + (transform-post) + (none) + ) + ) + +(defmethod farm-chilirots-method-29 farm-chilirots ((obj farm-chilirots)) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 8192.0 0.0 18432.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +(defmethod farm-chilirots-method-30 farm-chilirots ((obj farm-chilirots)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! farm-chilirots ((obj farm-chilirots) (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" + (farm-chilirots-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-chilirots" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (farm-chilirots-method-30 obj) + (quaternion-vector-angle! + (-> obj root-override quat) + *up-vector* + (* 182.04445 (rand-vu-float-range 0.0 360.0)) + ) + (let ((f0-2 (rand-vu-float-range 0.9 1.1))) + (set-vector! (-> obj root-override scale) f0-2 f0-2 f0-2 1.0) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +(defskelgroup skel-farm-sprinkler-barrels farm-sprinkler-barrels farm-sprinkler-barrels-lod0-jg farm-sprinkler-barrels-idle-ja + ((farm-sprinkler-barrels-lod0-mg (meters 999999))) + :bounds (static-spherem 0 8 3 4) + ) + +(deftype farm-sprinkler-barrels (process-focusable) + () + :heap-base #x50 + :method-count-assert 30 + :size-assert #xcc + :flag-assert #x1e005000cc + (:methods + (idle () _type_ :state 27) + (farm-sprinkler-barrels-method-28 (_type_) none 28) + (farm-sprinkler-barrels-method-29 (_type_) none 29) + ) + ) + + +(defstate idle (farm-sprinkler-barrels) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (-> self draw art-group data 2) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (behavior () + (transform-post) + (none) + ) + ) + +(defmethod farm-sprinkler-barrels-method-28 farm-sprinkler-barrels ((obj farm-sprinkler-barrels)) + (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 crate camera-blocker)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> s4-0 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> s4-0 local-sphere) -12288.0 32768.0 0.0 20480.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-12 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-12 transform-index) 5) + (set-vector! (-> v1-12 local-sphere) 0.0 6144.0 4096.0 12288.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 6144.0 4096.0 12288.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +(defmethod farm-sprinkler-barrels-method-29 farm-sprinkler-barrels ((obj farm-sprinkler-barrels)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! farm-sprinkler-barrels ((obj farm-sprinkler-barrels) (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" + (farm-sprinkler-barrels-method-28 obj) + (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-farm-sprinkler-barrels" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (farm-sprinkler-barrels-method-29 obj) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +(defun farm-activate ((arg0 level)) + (let* ((v1-0 (-> arg0 name)) + (s5-0 (cond + ((= v1-0 'ctyfarma) + (new 'static 'boxed-array :type int32 5 0 0 -1368390400 -1368390656 -1368390912) + ) + ((= v1-0 'ctyfarmb) + (new 'static 'boxed-array :type int32 5 0 0 -1145043712 -1145043968 -1145044224) + ) + ) + ) + (v1-1 (-> arg0 name)) + (gp-0 (cond + ((= v1-1 'ctyfarma) + (new 'static 'boxed-array :type int32 5 0 0 -1368391424 -1368391168) + ) + ((= v1-1 'ctyfarmb) + (new 'static 'boxed-array :type int32 5 0 0 -1145044736 -1145044480) + ) + ) + ) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 4463) (sp-field-id spt-userdata)) initial-valuef) + (the-as float s5-0) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 4462) (sp-field-id spt-userdata)) initial-valuef) + (the-as float s5-0) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 4483) (sp-field-id spt-userdata)) initial-valuef) + (the-as float gp-0) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 4482) (sp-field-id spt-userdata)) initial-valuef) + (the-as float gp-0) + ) + ) + (setup-user-array (-> *part-id-table* 4463) "ctyfarm-eggplant-body") + (setup-user-array (-> *part-id-table* 4462) "ctyfarm-eggplant-body") + (setup-user-array (-> *part-id-table* 4475) "ctyfarm-chili-stem") + (setup-user-array (-> *part-id-table* 4474) "ctyfarm-chili-stem") + (setup-user-array (-> *part-id-table* 4477) "ctyfarm-cab-body") + (setup-user-array (-> *part-id-table* 4476) "ctyfarm-cab-body") + (setup-user-array (-> *part-id-table* 4470) "ctyfarm-cab-body") + (setup-user-array (-> *part-id-table* 4483) "ctyfarm-chili-stem") + (setup-user-array (-> *part-id-table* 4482) "ctyfarm-chili-stem") + 0 + (none) + ) diff --git a/goal_src/jak2/levels/city/misc/delivery/delivery-task.gc b/goal_src/jak2/levels/city/misc/delivery/delivery-task.gc index d9bd68dfd1..6a3cb31797 100644 --- a/goal_src/jak2/levels/city/misc/delivery/delivery-task.gc +++ b/goal_src/jak2/levels/city/misc/delivery/delivery-task.gc @@ -7,3 +7,536 @@ ;; DECOMP BEGINS +(defskelgroup skel-krew-package krew-package krew-package-lod0-jg krew-package-idle-ja + ((krew-package-lod0-mg (meters 20)) (krew-package-lod1-mg (meters 40)) (krew-package-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.6) + ) + +(deftype krew-package (process-drawable) + ((attach-object handle :offset-assert 200) + (scale float :offset-assert 208) + ) + :heap-base #x60 + :method-count-assert 24 + :size-assert #xd4 + :flag-assert #x18006000d4 + (:methods + (idle () _type_ :state 20) + (die () _type_ :state 21) + (krew-package-method-22 (_type_) none 22) + (krew-package-method-23 (_type_) none 23) + ) + ) + + +(defmethod krew-package-method-22 krew-package ((obj krew-package)) + (set! (-> obj root) (new 'process 'trsqv)) + 0 + (none) + ) + +(defmethod krew-package-method-23 krew-package ((obj krew-package)) + (with-pp + (set! (-> pp level) (level-get *level* 'lpackage)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-krew-package" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj scale) 1.0) + (set! (-> obj draw lod-set lod 0 dist) 81920.0) + (set! (-> obj draw lod-set lod 1 dist) 204800.0) + (set! (-> obj draw lod-set lod 1 dist) 327680.0) + (logior! (-> obj skel status) (joint-control-status sync-math)) + 0 + (none) + ) + ) + +(defstate idle (krew-package) + :virtual #t + :code (the-as (function none :behavior krew-package) sleep-code) + :post (behavior () + (let ((gp-0 (handle->process (-> self attach-object)))) + (cond + (gp-0 + (when (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status dead)) + (seek! (-> self scale) 0.0 (* 0.5 (-> self clock seconds-per-frame))) + (if (= (-> self scale) 0.0) + (go-virtual die) + ) + ) + (set! (-> self draw color-mult quad) (-> (the-as process-focusable gp-0) draw color-mult quad)) + (set! (-> self root trans quad) (-> (the-as process-focusable gp-0) root-override trans quad)) + (quaternion-copy! (-> self root quat) (-> (the-as process-focusable gp-0) root-override quat)) + ) + (else + ) + ) + ) + (let ((f0-5 (-> self scale))) + (set-vector! (-> self root scale) f0-5 f0-5 f0-5 1.0) + ) + (ja-post) + (none) + ) + ) + +(defstate die (krew-package) + :virtual #t + :code (behavior () + (cleanup-for-death self) + (none) + ) + ) + +;; WARN: Return type mismatch entity-perm-status vs none. +(defmethod init-from-entity! krew-package ((obj krew-package) (arg0 entity-actor)) + "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. +This commonly includes things such as: +- stack size +- collision information +- loading the skeleton group / bones +- sounds" + (process-entity-status! obj (entity-perm-status dead) #t) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior krew-package-init-by-other krew-package ((arg0 process-drawable)) + (stack-size-set! (-> self main-thread) 16) + (set! (-> self mask) (logior (process-mask platform) (-> self mask))) + (logclear! (-> self mask) (process-mask actor-pause movie)) + (krew-package-method-22 self) + (set! (-> self attach-object) (process->handle arg0)) + (set! (-> self root trans quad) (-> arg0 root trans quad)) + (quaternion-copy! (-> self root quat) (-> arg0 root quat)) + (krew-package-method-23 self) + (go-virtual idle) + (none) + ) + +(defun krew-package-spawn ((arg0 process) (arg1 process)) + (process-spawn krew-package arg1 :to arg0) + ) + +(set-subtask-hook! + *game-info* + 24 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (while (!= (level-status *level* 'ctysluma) 'active) + (suspend) + ) + (let ((v1-3 (entity-by-name "parking-spot-8"))) + (if v1-3 + (logior! (-> v1-3 extra perm status) (entity-perm-status bit-9)) + ) + ) + (set! (-> self end-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) + (set-setting! 'minimap 'clear 0 32) + (let ((gp-1 *traffic-manager*)) + (let ((s5-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s5-0 position quad) (-> (new 'static 'vector :x 4698112.0 :y 45875.2 :z 81920.0 :w 1.0) quad)) + (quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 32768.0) + (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 gp-1 'spawn-object s5-0) + (when (-> s5-0 proc) + (set! (-> self slave 0) (process->handle (-> s5-0 proc))) + (let ((v1-20 (-> s5-0 proc))) + (set! (-> (the-as vehicle v1-20) damage-factor) 2.0) + ) + (let ((v1-22 (krew-package-spawn (-> s5-0 proc) (-> s5-0 proc)))) + (if v1-22 + (set! (-> self slave 1) (process->handle (-> v1-22 0))) + ) + ) + ) + (let ((s4-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> s4-0 pos quad) (-> s5-0 position quad)) + (quaternion-identity! (-> s4-0 quat)) + (set! (-> s4-0 flags) (task-arrow-flags task-arrow-flag-03)) + (set! (-> s4-0 map-icon) (the-as uint 15)) + (label cfg-21) + (let ((a0-30 (task-arrow-spawn s4-0 (the-as task-arrow self)))) + (when (not a0-30) + (format #t "waiting for task-arrow~%") + (suspend) + (goto cfg-21) + ) + (set! (-> self arrow) (process->handle a0-30)) + ) + ) + ) + (send-event gp-1 'set-target-level #x3f800000) + (send-event gp-1 'set-guard-target-count-range 4 0 1) + (send-event gp-1 'set-guard-target-count-range 5 0 0) + ) + (set! (-> self sub-state) (the-as uint -1)) + (set! (-> self data-int8 0) 0) + (set! (-> self data-int8 1) 0) + 0 + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 24 + 1 + (the-as + (function object) + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + ) + +(defun delivery-task-setup-ambush-1 () + (format #t "delivery-task-setup-ambush-1~%") + (let ((gp-0 + (new 'static 'city-ambush-info + :count 10 + :array (new 'static 'inline-array city-ambush-spot 10 + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4501504.0 :y 32768.0 :z 2297856.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4501504.0 :y 32768.0 :z 2322432.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4501504.0 :y 32768.0 :z 2347008.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4501504.0 :y 32768.0 :z 2371584.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4501504.0 :y 32768.0 :z 2396160.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4513792.0 :y 69632.0 :z 2306048.0 :w 1.0) + :obj-type #x13 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4513792.0 :y 69632.0 :z 2387968.0 :w 1.0) + :obj-type #x13 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4464640.0 :y 69632.0 :z 2285568.0 :w 1.0) + :obj-type #x12 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4464640.0 :y 69632.0 :z 2347008.0 :w 1.0) + :obj-type #x12 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4464640.0 :y 69632.0 :z 2408448.0 :w 1.0) + :obj-type #x12 + ) + ) + ) + ) + (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 2)) + (set! (-> s5-0 guard-type) (the-as uint 1)) + (vector-reset! (-> s5-0 velocity)) + (forward-up-nopitch->quaternion + (-> s5-0 rotation) + (new 'static 'vector :x -1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + ) + (city-ambush-info-method-9 gp-0 s5-0) + ) + (none) + ) + +(defun delivery-task-setup-ambush-2 () + (format #t "delivery-task-setup-ambush-2~%") + (let ((gp-0 + (new 'static 'city-ambush-info + :count 10 + :array (new 'static 'inline-array city-ambush-spot 10 + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3325952.0 :y 32768.0 :z 4689920.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3342336.0 :y 32768.0 :z 4689920.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3358720.0 :y 32768.0 :z 4689920.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3375104.0 :y 32768.0 :z 4689920.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3391488.0 :y 32768.0 :z 4689920.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3338240.0 :y 69632.0 :z 4689920.0 :w 1.0) + :obj-type #x13 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3383296.0 :y 69632.0 :z 4689920.0 :w 1.0) + :obj-type #x13 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3338240.0 :y 45056.0 :z 4722688.0 :w 1.0) + :obj-type #x12 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3358720.0 :y 45056.0 :z 4722688.0 :w 1.0) + :obj-type #x12 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3379200.0 :y 45056.0 :z 4722688.0 :w 1.0) + :obj-type #x12 + ) + ) + ) + ) + (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 2)) + (set! (-> s5-0 guard-type) (the-as uint 1)) + (vector-reset! (-> s5-0 velocity)) + (forward-up-nopitch->quaternion + (-> s5-0 rotation) + (new 'static 'vector :x -1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + ) + (city-ambush-info-method-9 gp-0 s5-0) + ) + (none) + ) + +(set-subtask-hook! + *game-info* + 24 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (local-vars (a0-32 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (handle->process (-> self slave 0)))) + (cond + ((and gp-0 (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status dead)))) + (cond + ((zero? (-> self data-int8 0)) + (when (= (level-status *level* 'ctyindb) 'active) + (set! (-> self data-int8 0) 1) + (delivery-task-setup-ambush-1) + ) + ) + (else + (when (!= (level-status *level* 'ctyindb) 'active) + (set! (-> self data-int8 0) 0) + 0 + ) + ) + ) + (cond + ((zero? (-> self data-int8 1)) + (when (= (level-status *level* 'ctyinda) 'active) + (set! (-> self data-int8 1) 1) + (delivery-task-setup-ambush-2) + ) + ) + (else + (when (!= (level-status *level* 'ctyinda) 'active) + (set! (-> self data-int8 1) 0) + 0 + ) + ) + ) + (let ((f0-0 (vector-vector-distance-squared (-> (the-as process-drawable gp-0) root trans) (target-pos 0))) + (f1-0 12288.0) + ) + (cond + ((and (< f0-0 (* f1-0 f1-0)) *target* (logtest? (focus-status pilot) (-> *target* focus-status))) + (when (nonzero? (-> self sub-state)) + (send-event (handle->process (-> self arrow)) 'set-position (-> self end-pos)) + (send-event (handle->process (-> self arrow)) 'modify-flags 1 0) + (send-event (handle->process (-> self arrow)) 'map-icon 8) + (set! (-> self sub-state) (the-as uint 0)) + 0 + ) + ) + (else + (let* ((v1-59 (new 'stack-no-clear 'inline-array 'vector 1)) + (f0-1 409.6) + (f0-3 (* f0-1 f0-1)) + ) + (.lvf vf1 (&-> (-> (the-as process-drawable gp-0) root transv) 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 a0-32 vf1) + (when (>= f0-3 a0-32) + (set! (-> v1-59 0 quad) (-> (the-as process-drawable gp-0) root trans quad)) + (set! (-> v1-59 0 y) (+ -14336.0 (-> v1-59 0 y))) + (send-event (handle->process (-> self arrow)) 'set-position (-> v1-59 0)) + ) + ) + (when (!= (-> self sub-state) 1) + (send-event (handle->process (-> self arrow)) 'modify-flags 0 1) + (send-event (handle->process (-> self arrow)) 'map-icon 15) + (set! (-> self sub-state) (the-as uint 1)) + ) + ) + ) + ) + (let ((f30-0 49152.0) + (f0-6 (vector-vector-distance-squared (-> (the-as process-drawable gp-0) root trans) (-> self end-pos))) + ) + (if (>= (* f30-0 f30-0) f0-6) + (go-virtual complete) + ) + ) + ) + (else + (go-virtual fail) + ) + ) + ) + (none) + ) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 24 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (let ((gp-0 (new 'static 'vector :x 4501504.0 :y 73728.0 :z 2338816.0 :w 204800.0)) + (s5-0 #f) + ) + (while (not s5-0) + (let ((v1-1 (handle->process (-> self slave 0)))) + (when v1-1 + (let ((f0-0 (vector-vector-distance-squared (-> (the-as process-drawable v1-1) root trans) gp-0)) + (f1-0 (-> gp-0 w)) + ) + (set! s5-0 (< f0-0 (* f1-0 f1-0))) + ) + ) + ) + (suspend) + ) + ) + (send-event *traffic-manager* 'set-guard-target-count-range 0 0 0) + (send-event *traffic-manager* 'set-guard-target-count-range 1 4 4) + (send-event *traffic-manager* 'set-guard-target-count-range 2 0 0) + (send-event *traffic-manager* 'set-guard-target-count-range 4 0 10) + (send-event *traffic-manager* 'set-guard-target-count-range 5 0 10) + (send-event *traffic-manager* 'set-alert-level 3) + (send-event *traffic-manager* 'set-alert-duration #xa4cb80) + (speech-control-method-10 *speech-control* 7 (new 'static 'speech-type-info + :channel #x1 + :priority -2 + :min-delay #x258 + :max-delay #x4b0 + :list (new 'static 'boxed-array :type string + "kg243a" + "kg241a" + "kg242a" + "kg244a" + "kg245a" + "kg246a" + "kg247a" + "kg248a" + "kg249a" + "kg250a" + "kg251a" + "kg252a" + ) + ) + ) + (talker-spawn-func (-> *talker-speech* 49) *entity-pool* (target-pos 0) (the-as region #f)) + (let ((gp-2 (new 'static 'vector :x 3358720.0 :y 32768.0 :z 4689920.0 :w 204800.0)) + (s5-2 #f) + ) + (while (not s5-2) + (let ((v1-48 (handle->process (-> self slave 0)))) + (when v1-48 + (let ((f0-1 (vector-vector-distance-squared (-> (the-as process-drawable v1-48) root trans) gp-2)) + (f1-3 (-> gp-2 w)) + ) + (set! s5-2 (< f0-1 (* f1-3 f1-3))) + ) + ) + ) + (suspend) + ) + ) + (talker-spawn-func (-> *talker-speech* 50) *entity-pool* (target-pos 0) (the-as region #f)) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 24 + 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) + (if (and *target* (logtest? (focus-status pilot) (-> *target* focus-status))) + (send-event *target* 'change-mode 'normal) + ) + (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) + ) + (none) + ) + ) + ) diff --git a/goal_src/jak2/levels/city/oracle/oracle-training.gc b/goal_src/jak2/levels/city/oracle/oracle-training.gc index c6e53bb97a..a6ea881be5 100644 --- a/goal_src/jak2/levels/city/oracle/oracle-training.gc +++ b/goal_src/jak2/levels/city/oracle/oracle-training.gc @@ -7,3 +7,423 @@ ;; DECOMP BEGINS +(set-subtask-hook! + *game-info* + 251 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) + (send-event *target* 'change-mode 'darkjak #f 65) + (set! (-> self sound-id 0) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (send-event *target* 'get-notify self) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 251 + 1 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *target* 'get-pickup 7 (-> self data-float 0)) + (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'get-notify #f) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id 0) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (close! (-> self node-info) 'event) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 251 + 6 + (the-as (function object) (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('attack) + (if (= (-> arg3 param 1) 16) + (go-virtual complete) + ) + ) + ) + ) + ) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 251 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (if (and *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (send-event *target* 'change-mode 'darkjak #f 65) + ) + (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) + (let ((gp-1 (new + 'stack + 'font-context + *font-default-matrix* + 32 + 280 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + ) + (set! (-> gp-1 flags) (font-flags shadow kerning large)) + (let ((v1-14 gp-1)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-1)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-1)) + (set! (-> v1-16 scale) 0.7) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id oracle-tutorial-dark-bomb) #f)) + (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) + ) + ) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 253 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) + (send-event *target* 'change-mode 'darkjak #f 65) + (set! (-> self sound-id 0) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (send-event *target* 'get-notify self) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 253 + 1 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *target* 'get-pickup 7 (-> self data-float 0)) + (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'get-notify #f) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id 0) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (close! (-> self node-info) 'event) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 253 + 6 + (the-as (function object) (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('attack) + (if (= (-> arg3 param 1) 17) + (go-virtual complete) + ) + ) + ) + ) + ) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 253 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (if (and *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (send-event *target* 'change-mode 'darkjak #f 65) + ) + (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) + (let ((gp-1 (new + 'stack + 'font-context + *font-default-matrix* + 32 + 280 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + ) + (set! (-> gp-1 flags) (font-flags shadow kerning large)) + (let ((v1-14 gp-1)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-1)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-1)) + (set! (-> v1-16 scale) 0.7) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id oracle-tutorial-dark-blast) #f)) + (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) + ) + ) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 255 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) + (send-event *target* 'change-mode 'darkjak #f 65) + (set! (-> self sound-id 0) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (send-event *target* 'get-notify self) + (set! (-> self start-time) (-> self clock frame-counter)) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 255 + 1 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *target* 'get-pickup 7 (-> self data-float 0)) + (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'get-notify #f) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id 0) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (close! (-> self node-info) 'event) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 255 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (if (and *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (send-event *target* 'change-mode 'darkjak #f 65) + ) + (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) + (let ((gp-1 (new + 'stack + 'font-context + *font-default-matrix* + 32 + 280 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + ) + (set! (-> gp-1 flags) (font-flags shadow kerning large)) + (let ((v1-14 gp-1)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-1)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-1)) + (set! (-> v1-16 scale) 0.7) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id oracle-tutorial-dark-invincible) #f)) + (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) + ) + ) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 257 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) + (send-event *target* 'change-mode 'darkjak #f 65) + (set! (-> self sound-id 0) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (send-event *target* 'get-notify self) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 257 + 1 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *target* 'get-pickup 7 (-> self data-float 0)) + (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'get-notify #f) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id 0) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (close! (-> self node-info) 'event) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 257 + 6 + (the-as (function object) (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (the-as object (case arg2 + (('notify) + (case (-> arg3 param 0) + (('attack) + (if (= (-> arg3 param 1) 18) + #f + ) + ) + ) + ) + ) + ) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 257 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (if (and *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (send-event *target* 'change-mode 'darkjak #f 65) + ) + (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) + (let ((gp-1 (new + 'stack + 'font-context + *font-default-matrix* + 32 + 280 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + ) + (set! (-> gp-1 flags) (font-flags shadow kerning large)) + (let ((v1-14 gp-1)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-1)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-1)) + (set! (-> v1-16 scale) 0.7) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id oracle-tutorial-dark-giant) #f)) + (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) + ) + ) + ) + (none) + ) + ) + ) diff --git a/goal_src/jak2/levels/common/enemy/bombots/bombbot-h.gc b/goal_src/jak2/levels/common/enemy/bombots/bombbot-h.gc index c97d45d506..327feb169a 100644 --- a/goal_src/jak2/levels/common/enemy/bombots/bombbot-h.gc +++ b/goal_src/jak2/levels/common/enemy/bombots/bombbot-h.gc @@ -21,8 +21,8 @@ (deftype bombbot-path (structure) - ((node-count uint16 :offset-assert 0) - (node uint32 :offset-assert 4) + ((node-count uint16 :offset-assert 0) + (node (inline-array bombbot-node) :offset-assert 4) ) :method-count-assert 9 :size-assert #x8 diff --git a/goal_src/jak2/levels/common/enemy/bombots/bombbot-path.gc b/goal_src/jak2/levels/common/enemy/bombots/bombbot-path.gc index 40f7014901..7673a71606 100644 --- a/goal_src/jak2/levels/common/enemy/bombots/bombbot-path.gc +++ b/goal_src/jak2/levels/common/enemy/bombots/bombbot-path.gc @@ -7,3 +7,812 @@ ;; DECOMP BEGINS +(define *bombbot-path-1* (new 'static 'bombbot-path + :node-count #x1c + :node (new 'static 'inline-array bombbot-node 28 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3258277.5 :y 36837.375 :z 2919952.0) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3527335.0 :y 36837.375 :z 2643463.2) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3614297.8 :y 36837.375 :z 2580864.5) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4291214.0 :y 38298.008 :z 2591629.0) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4390092.0 :y 36837.375 :z 2643881.2) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4455013.0 :y 36837.375 :z 2753605.2) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4538736.0 :y 36837.375 :z 2739244.8) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4589772.0 :y 36837.375 :z 2653011.2) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4602265.0 :y 38390.58 :z 2465177.2) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4529397.0 :y 36837.375 :z 2365566.2) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4405943.0 :y 36837.375 :z 2328894.8) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4000464.5 :y 36837.375 :z 2104958.2) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4013141.5 :y 36837.375 :z 1832038.0) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4521655.0 :y 36837.375 :z 1745903.2) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4506131.5 :y 33105.92 :z 1321582.1) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4644699.5 :y 37455.055 :z 1207492.2) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4667923.5 :y 37455.055 :z 1168281.2) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4659813.0 :y 41026.766 :z 977706.6) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4733418.5 :y 37455.055 :z 871554.7) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4753079.0 :y 37459.56 :z 775511.6) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4692417.5 :y 37457.51 :z 759676.5) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4495687.0 :y 37457.51 :z 765365.9) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4472339.5 :y 37457.51 :z 496651.88) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4383906.5 :y 37457.51 :z 276074.1) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4582235.5 :y 37446.043 :z 83403.57) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4677671.5 :y 37446.043 :z 70415.56) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4685986.5 :y 37446.043 :z 217373.9) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4718386.5 :y 37446.043 :z 233280.72) + :nav-mesh-id #x2578 + ) + ) + ) + ) + +(define *bombbot-path-2* (new 'static 'bombbot-path + :node-count #x21 + :node (new 'static 'inline-array bombbot-node 33 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1677880.9 :y 32856.473 :z -190588.11) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1826967.1 :y 36825.906 :z -179154.53) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1879178.9 :y 36858.266 :z -70936.164) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2041179.8 :y 36852.12 :z -62959.617) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2200935.8 :y 37035.62 :z -327732.44) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2238988.0 :y 36855.81 :z -502779.5) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2280828.0 :y 36862.363 :z -594517.6) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2382253.8 :y 36858.266 :z -654388.8) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2463849.8 :y 36852.53 :z -811904.6) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2693455.5 :y 32287.129 :z -782532.2) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2787884.8 :y 36854.168 :z -1143430.8) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2870263.5 :y 36964.76 :z -1137082.0) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3010809.5 :y 35717.53 :z -1025650.25) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3058421.2 :y 36852.53 :z -689659.5) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3038600.5 :y 37395.66 :z -597171.8) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2939293.0 :y 45748.223 :z -549240.44) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2885557.8 :y 43587.586 :z -452988.53) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3289734.2 :y 37456.28 :z -52194.508) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3266022.5 :y 37448.09 :z 309003.88) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3520949.8 :y 38775.6 :z 423140.97) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3753070.2 :y 37448.09 :z 611843.7) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3987242.5 :y 37458.74 :z 642600.56) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4035505.2 :y 37454.234 :z 575893.1) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4232519.0 :y 37457.51 :z 589045.4) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4315381.0 :y 37457.51 :z 524410.5) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4324351.0 :y 37457.51 :z 385351.7) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4224859.5 :y 37457.51 :z 381204.47) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4227849.5 :y 37457.51 :z 289628.56) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4357856.5 :y 37457.51 :z 260807.06) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4588256.5 :y 37446.043 :z 68193.89) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4668702.0 :y 37446.043 :z 85842.74) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4679515.5 :y 37446.043 :z 238454.38) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4716789.0 :y 37446.043 :z 252433.2) + :nav-mesh-id #x2578 + ) + ) + ) + ) + +(define *bombbot-path-3* (new 'static 'bombbot-path + :node-count #x1b + :node (new 'static 'inline-array bombbot-node 27 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3349143.2 :y 36837.375 :z 1716903.5) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3350859.2 :y 36837.375 :z 2284261.0) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3585396.0 :y 38390.58 :z 2270354.8) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3678752.2 :y 36837.375 :z 2124566.0) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3780005.5 :y 37188.402 :z 1886043.8) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3988593.8 :y 38456.523 :z 1788928.0) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4476435.5 :y 36837.375 :z 1664429.6) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4459273.5 :y 30950.605 :z 1375608.4) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4297235.5 :y 37457.92 :z 1336405.6) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4267007.0 :y 37444.402 :z 1361804.9) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4239564.0 :y 37457.92 :z 1410236.0) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4136713.5 :y 42312.09 :z 1466470.0) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3730288.2 :y 37457.92 :z 1464053.4) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3679088.2 :y 37457.51 :z 1307471.5) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3718180.5 :y 37457.51 :z 1220591.2) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3999309.5 :y 40812.543 :z 1229811.2) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4089249.5 :y 37457.51 :z 1150664.2) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4044267.0 :y 37457.51 :z 856497.75) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4036837.0 :y 37457.51 :z 757390.94) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4235918.0 :y 37457.51 :z 741895.8) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4270160.5 :y 37457.51 :z 614477.44) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4392795.5 :y 37457.51 :z 371413.8) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4414668.0 :y 41926.246 :z 210297.23) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4583751.0 :y 37446.043 :z 98254.85) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4685045.0 :y 37446.043 :z 85629.336) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4691557.0 :y 37446.043 :z 193381.17) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4719328.5 :y 37446.043 :z 209884.78) + :nav-mesh-id #x2578 + ) + ) + ) + ) + +(define *bombbot-path-4* (new 'static 'bombbot-path + :node-count #x1b + :node (new 'static 'inline-array bombbot-node 27 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 882802.25 :y 36859.902 :z 3621834.2) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 872205.94 :y 36854.168 :z 3192081.5) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1050914.4 :y 69632.0 :z 3175034.5) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1498271.4 :y 69626.266 :z 3185827.5) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1481735.8 :y 69642.24 :z 2830061.2) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1456881.2 :y 69642.24 :z 2057588.4) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1502514.8 :y 69642.24 :z 1884434.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1484082.8 :y 69632.0 :z 1743306.4) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1115516.5 :y 69642.24 :z 1752252.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 639340.1 :y 69639.78 :z 1770094.1) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 128253.54 :y 69642.24 :z 1734078.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 73947.95 :y 69642.24 :z 1844170.4) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 109042.07 :y 69642.24 :z 2066944.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 122852.555 :y 69642.24 :z 2758323.5) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 79918.28 :y 69626.266 :z 3150474.8) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 517484.12 :y 69632.0 :z 3181182.2) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 602791.5 :y 36854.168 :z 3181075.8) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 699465.3 :y 36854.168 :z 3194715.2) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 674786.94 :y 36864.0 :z 3605937.2) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 421895.78 :y 36864.0 :z 3631988.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 369729.12 :y 36859.902 :z 3813134.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 397331.66 :y 36861.953 :z 4427570.5) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 731725.44 :y 36864.0 :z 4451286.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1126035.0 :y 36864.0 :z 4429454.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1190809.2 :y 36859.902 :z 4295065.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1190031.0 :y 36861.953 :z 3726978.8) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1073888.9 :y 36859.902 :z 3629100.8) + :nav-mesh-id #x5881 + ) + ) + ) + ) + +(define *bombbot-path-5* (new 'static 'bombbot-path + :node-count #x33 + :node (new 'static 'inline-array bombbot-node 51 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 388330.7 :y 35735.55 :z 5592473.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 235137.44 :y 35738.418 :z 5335571.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 74786.0 :y 35725.312 :z 5357485.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -245602.72 :y 35892.43 :z 5523168.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -478199.4 :y 35809.28 :z 5729811.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -633699.94 :y 39457.586 :z 5876857.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -667004.5 :y 59325.234 :z 5924289.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -696929.9 :y 58614.58 :z 5964103.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -732503.6 :y 22183.527 :z 6010224.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -856731.25 :y 21815.297 :z 6198476.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -870399.56 :y 35786.344 :z 6224935.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -976211.56 :y 35637.656 :z 6564699.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -719711.9 :y 38689.176 :z 6634986.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -531132.0 :y 38689.176 :z 6696467.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -354006.62 :y 38696.14 :z 6784162.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -180439.86 :y 38695.32 :z 6879559.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 20982.58 :y 35575.81 :z 7042620.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 195429.98 :y 35792.895 :z 6968032.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 312721.8 :y 35971.89 :z 6998506.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 453852.78 :y 37415.73 :z 7159356.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 678702.7 :y 75903.38 :z 7154687.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 891694.7 :y 75898.06 :z 7155056.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1123581.5 :y 37389.105 :z 7159807.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1262735.0 :y 36363.06 :z 7003381.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1435963.0 :y 35584.82 :z 6967623.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1585966.8 :y 37874.895 :z 7002643.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1763491.4 :y 38840.32 :z 6884228.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1928056.4 :y 38840.32 :z 6786702.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2107686.0 :y 38849.332 :z 6696098.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2293435.5 :y 38841.547 :z 6626262.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2510294.8 :y 35697.46 :z 6572563.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2539388.0 :y 36340.53 :z 6489415.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2446294.8 :y 35794.535 :z 6219815.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2430483.8 :y 23202.611 :z 6190160.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2307473.0 :y 22759.834 :z 5994905.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2275430.0 :y 56630.066 :z 5951815.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2247085.8 :y 59249.05 :z 5913271.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2208775.2 :y 40428.34 :z 5866126.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2049703.5 :y 35709.746 :z 5719040.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1805794.9 :y 35787.98 :z 5533326.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1550716.5 :y 35767.91 :z 5390949.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1386327.6 :y 35697.05 :z 5346631.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1270820.5 :y 35735.14 :z 5479013.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1179094.6 :y 35735.55 :z 5589237.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1153597.0 :y 23880.09 :z 5588172.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1028533.9 :y 21655.96 :z 5589810.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1001635.44 :y 37785.19 :z 5586247.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 782425.7 :y 35723.67 :z 5569207.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 574987.9 :y 35949.363 :z 5584567.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 546176.6 :y 21655.553 :z 5588704.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 417185.38 :y 24605.082 :z 5599353.5) + :nav-mesh-id #x48cc + ) + ) + ) + ) + +(define *bombbot-path-6* (new 'static 'bombbot-path + :node-count #x1a + :node (new 'static 'inline-array bombbot-node 26 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4673330.5 :y 103528.04 :z 4155801.2) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4680252.0 :y 103531.31 :z 3704430.2) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4259757.5 :y 103531.31 :z 3700010.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3996306.8 :y 103531.31 :z 3698474.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3866263.2 :y 103531.31 :z 3698322.8) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3350626.0 :y 103528.04 :z 3702615.8) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3346918.5 :y 103528.04 :z 4084702.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3694755.5 :y 103528.04 :z 4096572.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3703221.8 :y 103528.04 :z 4352286.0) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3958894.2 :y 103528.04 :z 4364409.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3958861.5 :y 103528.04 :z 4683570.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3573743.2 :y 103528.04 :z 4682791.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3563831.0 :y 103528.04 :z 4222893.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3185090.2 :y 103528.04 :z 4217609.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3184090.8 :y 103443.25 :z 3811204.8) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3179494.5 :y 36837.375 :z 3575176.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3264048.8 :y 36837.375 :z 3525590.8) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3247177.0 :y 36837.375 :z 4148510.0) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3650235.5 :y 36837.375 :z 4178902.8) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3655273.8 :y 36837.375 :z 4465417.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3942530.8 :y 36837.375 :z 4631551.0) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4158422.8 :y 36837.375 :z 4682956.0) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4413520.5 :y 103528.04 :z 4686642.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4432117.0 :y 103528.04 :z 4430192.0) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4616723.5 :y 103528.04 :z 4419378.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4627783.0 :y 103531.31 :z 4174642.5) + :nav-mesh-id #x34ad + ) + ) + ) + ) diff --git a/goal_src/jak2/levels/common/enemy/bombots/bombbot.gc b/goal_src/jak2/levels/common/enemy/bombots/bombbot.gc index 0b78029d51..4758ed292a 100644 --- a/goal_src/jak2/levels/common/enemy/bombots/bombbot.gc +++ b/goal_src/jak2/levels/common/enemy/bombots/bombbot.gc @@ -7,3 +7,3347 @@ ;; DECOMP BEGINS +(define *bombbot-body-constants* (new 'static 'rigid-body-object-constants + :info (new 'static 'rigid-body-info + :mass 1.0 + :inv-mass 1.0 + :linear-damping 0.8 + :angular-damping 0.8 + :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 2) (meters 2) (meters 2)) + ) + :max-time-step 0.02 + :gravity (meters 10) + :idle-distance (meters 200) + :attack-force-scale 2.0 + :name '*bombbot-body-constants* + ) + ) + +(defpartgroup group-bombbot-explode0 + :id 1060 + :duration (seconds 3) + :linger-duration (seconds 2) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4608 :fade-after (meters 200) :falloff-to (meters 200) :period 9600 :length 25) + (sp-item 4609 :period 9600 :length 10 :offset 10) + (sp-item 4610 :fade-after (meters 120) :falloff-to (meters 120) :period 9600 :length 100 :offset 25) + (sp-item 4611 :fade-after (meters 60) :period 9600 :length 35 :offset 10) + (sp-item 4612 :period 9600 :length 50 :offset 15) + (sp-item 4613 :period 9600 :length 5) + (sp-item 4614 :period 9600 :length 50 :offset 15) + (sp-item 4615 :period 9600 :length 5) + ) + ) + +(defpart 4613 + :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 4616) + ) + ) + +(defpart 4616 + :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 4615 + :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 4617) + ) + ) + +(defpart 4617 + :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 4611 + :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 4618) + (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 90.0)) + ) + ) + +(defpart 4618 + :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 4619) + ) + ) + +(defpart 4619 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0)) + ) + +(defpart 4614 + :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 4620) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-conerot-x) + :flags (sp-flag from-pointer) + :func '*sp-temp* + ) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 90.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 2) 1.0) + ) + ) + +(defpart 4620 + :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 4621) + ) + ) + +(defpart 4621 + :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 4612 + :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 4622) + (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-flt spt-rotate-y (degrees 90.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 8) 1.0) + ) + ) + +(defpart 4622 + :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 4623) + ) + ) + +(defpart 4623 + :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 4624) + ) + ) + +(defpart 4624 + :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 4625) + ) + ) + +(defpart 4625 + :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 4610 + :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 4626) + (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-flt spt-rotate-y (degrees 90.0)) + (sp-rnd-flt spt-conerot-radius (meters 3) (meters 5) 1.0) + ) + ) + +(defpart 4626 + :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 4627) + ) + ) + +(defpart 4627 + :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 4608 + :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 4628) + (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-flt spt-rotate-y (degrees 90.0)) + ) + ) + +(defpart 4628 + :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 4629) + ) + ) + +(defpart 4629 + :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 4609 + :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 3600.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) + ) + ) + +(defpart 4630 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x83 :page #xc)) + (sp-func spt-birth-func 'birth-func-set-quat) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2)) + (sp-flt spt-scale-y (meters 40)) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 64.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat) + ) + ) + +(defpart 4631 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbc :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 64.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-flt spt-fade-g -1.0666667) + (sp-flt spt-fade-b -1.0666667) + (sp-flt spt-fade-a -8.533334) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 4632 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbc :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 64.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-flt spt-fade-g -1.0666667) + (sp-flt spt-fade-b -1.0666667) + (sp-flt spt-fade-a -8.533334) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defskelgroup skel-bombbot bombbot bombbot-lod0-jg bombbot-idle-ja + ((bombbot-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12) + :shadow bombbot-shadow-mg + ) + +(defskelgroup skel-bombbot-exploding bombbot bombbot-exploding-lod0-jg bombbot-exploding-idle-ja + ((bombbot-exploding-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12) + ) + +(define *bombbot-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 3 :parent-joint-index -1) + (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) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + ) + :collide-spec #x241 + ) + ) + +(deftype bombbot-foot (structure) + ((pos-offset vector :inline :offset-assert 0) + (joint-index uint32 :offset-assert 16) + (offset float :offset-assert 20) + (position vector :inline :offset-assert 32) + (next-position vector :inline :offset-assert 48) + (real-position vector :inline :offset-assert 64) + (speed vector :inline :offset-assert 80) + (moving symbol :offset-assert 96) + (main-y float :offset-assert 100) + (delta-y float :offset-assert 104) + ) + :pack-me + :method-count-assert 9 + :size-assert #x6c + :flag-assert #x90000006c + ) + + +(deftype bombbot (nav-enemy) + ((joint-ik joint-mod-ik 4 :offset-assert 604) + (feet bombbot-foot 4 :inline :offset-assert 624) + (legs-strength float 4 :offset-assert 1072) + (last-trans vector :inline :offset-assert 1088) + (linear-speed vector :inline :offset-assert 1104) + (last-quat quaternion :inline :offset-assert 1120) + (y-angular-velocity float :offset-assert 1136) + (main-quat quaternion :inline :offset-assert 1152) + (main-spd-y float :offset-assert 1168) + (main-pos-y float :offset-assert 1172) + (main-pos vector :inline :offset-assert 1184) + (city-path bombbot-path :offset-assert 1200) + (current-node uint32 :offset-assert 1204) + (shot-count uint32 :offset-assert 1208) + (next-shoot uint64 :offset-assert 1216) + (stop-shoot uint64 :offset-assert 1224) + (next-target uint64 :offset-assert 1232) + (start-target uint64 :offset-assert 1240) + (beep-time time-frame :offset-assert 1248) + (target-pos vector :inline :offset-assert 1264) + (start-target-pos vector :inline :offset-assert 1280) + (start-target-vel vector :inline :offset-assert 1296) + (top-quat quaternion :inline :offset-assert 1312) + (gun-swivel-quat quaternion :inline :offset-assert 1328) + (gun-quat quaternion :inline :offset-assert 1344) + (angle-turret float :offset-assert 1360) + (angle-gun float :offset-assert 1364) + (high float :offset-assert 1368) + (shield-hit-points float :offset-assert 1372) + (hit-axis vector :inline :offset-assert 1376) + (rigidbody rigid-body-control :offset-assert 1392) + (info rigid-body-object-constants :offset-assert 1396) + (explosing symbol :offset-assert 1400) + (minimap connection-minimap :offset-assert 1404) + (lazer-sound uint32 :offset-assert 1408) + (head-sound uint32 :offset-assert 1412) + (cannon-sound uint32 :offset-assert 1416) + (last-head-roty-speed float :offset-assert 1420) + (head-roty-speed float :offset-assert 1424) + (last-cannon-roty-speed float :offset-assert 1428) + (cannon-roty-speed float :offset-assert 1432) + ) + :heap-base #x520 + :method-count-assert 185 + :size-assert #x59c + :flag-assert #xb90520059c + (:methods + (kill-prefer-falling () symbol :replace 73) + (explode () _type_ :state 178) + (bombbot-method-179 (_type_) none 179) + (bombbot-method-180 (_type_) none 180) + (bombbot-method-181 (_type_ vector) none 181) + (bombbot-method-182 (_type_) none 182) + (bombbot-method-183 (_type_) none 183) + (bombbot-method-184 (_type_) none 184) + ) + ) + + +(define *bombbot-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x3 :param0 #x64 :param1 #x64) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim 3 + :hit-anim 3 + :knocked-anim 3 + :knocked-land-anim 3 + :die-anim 3 + :die-falling-anim 3 + :victory-anim -1 + :jump-wind-up-anim 3 + :jump-in-air-anim 3 + :jump-land-anim 3 + :neck-joint -1 + :look-at-joint 4 + :bullseye-joint 4 + :sound-hit (static-sound-name "bombbot-hit") + :sound-die (static-sound-name "bombbot-die") + :notice-distance (meters 20) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 90 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :attack-shove-up (meters 2) + :attack-mode 'shock + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #f + :walk-anim 3 + :turn-anim -1 + :run-anim 3 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 8) + :run-turning-acceleration (meters 10) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 16) + :walk-turning-acceleration (meters 40) + :maximum-rotation-rate (degrees 60.0) + :notice-nav-radius (meters 2) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +(set! (-> *bombbot-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(deftype ik-setup (structure) + ((elbow-index int32 :offset-assert 0) + (hand-dist float :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + + +(define *bombbot-ik-setup* (new 'static 'boxed-array :type ik-setup + (new 'static 'ik-setup :elbow-index 19 :hand-dist 14880.768) + (new 'static 'ik-setup :elbow-index 13 :hand-dist -14880.768) + (new 'static 'ik-setup :elbow-index 15 :hand-dist 14880.768) + (new 'static 'ik-setup :elbow-index 17 :hand-dist -14880.768) + ) + ) + +(defun bombbot-do-spline ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((f1-1 (* arg5 arg5)) + (f0-2 (* arg5 f1-1)) + ) + (let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2)) + (f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5))) + (f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1))) + ) + (vector-float*! arg0 arg1 f2-3) + (let ((t2-0 arg0)) + (let ((v1-10 arg0)) + (let ((t1-3 (vector+! (new 'stack-no-clear 'vector) arg1 arg2))) + (let ((a1-1 f3-7)) + (.mov vf7 a1-1) + ) + (.lvf vf5 (&-> t1-3 quad)) + ) + (.lvf vf4 (&-> v1-10 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 (&-> t2-0 quad) vf6) + ) + (let ((a2-1 arg0)) + (let ((v1-11 arg0)) + (let ((a1-3 (vector+! (new 'stack-no-clear 'vector) arg3 arg4))) + (let ((t0-1 f1-3)) + (.mov vf7 t0-1) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> v1-11 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 (&-> a2-1 quad) vf6) + ) + ) + (let ((v0-0 arg0)) + (let ((v1-12 arg0)) + (let ((a0-1 arg3)) + (let ((a1-4 f0-2)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-12 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 (&-> v0-0 quad) vf6) + v0-0 + ) + ) + ) + ) + +(defmethod bombbot-method-180 bombbot ((obj bombbot)) + (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> a1-0 sphere quad) (-> obj root-override2 trans quad)) + (set! (-> a1-0 sphere r) 40960.0) + (set! (-> a1-0 velocity quad) (-> obj root-override2 transv quad)) + (vector-reset! (-> a1-0 velocity)) + (set! (-> a1-0 notify-radius) 122880.0) + (set! (-> a1-0 danger-level) 1.0) + (set! (-> a1-0 decay-rate) 0.0) + (set! (-> a1-0 flags) (traffic-danger-flags tdf0)) + (set! (-> a1-0 danger-type) (traffic-danger-type tdt0)) + ;; TODO - traffic + ;; (add-danger-sphere *traffic-engine* a1-0) + ) + (none) + ) + +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +(defmethod bombbot-method-179 bombbot ((obj bombbot)) + (local-vars + (at-0 int) + (sv-864 vector) + (sv-880 vector) + (sv-896 float) + (sv-912 float) + (sv-928 (function vector vector float)) + (sv-944 uint) + ) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-0 (-> s5-0 bbox)) + (a0-2 (-> obj root-override2 trans)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-0 x) 24576.0) + (set! (-> a1-0 y) 22528.0) + (set! (-> a1-0 z) 24576.0) + (set! (-> a1-0 w) 1.0) + (vector-! (the-as vector v1-0) a0-2 a1-0) + ) + (let ((v1-2 (-> s5-0 bbox max)) + (a0-4 (-> obj root-override2 trans)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 x) 24576.0) + (set! (-> a1-1 y) 22528.0) + (set! (-> a1-1 z) 24576.0) + (set! (-> a1-1 w) 1.0) + (vector+! v1-2 a0-4 a1-1) + ) + (set! (-> s5-0 collide-with) (collide-spec backgnd)) + (set! (-> s5-0 ignore-process0) #f) + (set! (-> s5-0 ignore-process1) #f) + (set! (-> s5-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (fill-using-bounding-box *collide-cache* s5-0) + (dotimes (s4-0 4) + (-> obj joint-ik s4-0 shoulder-matrix-no-ik) + (-> obj joint-ik s4-0 elbow-matrix-no-ik) + (new 'stack-no-clear 'vector) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s2-0 quad) (-> obj node-list data 3 bone transform vector 1 quad)) + (new 'stack-no-clear 'vector) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let ((f30-0 0.4)) + (vector-normalize! s2-0 1.0) + (let ((s1-0 (-> obj feet s4-0))) + (let* ((f0-10 (+ (* 0.0033333334 (the float (mod (-> pp clock frame-counter) 300))) (-> s1-0 offset))) + (f28-0 (- f0-10 (* (the float (the int (/ f0-10 1.0))) 1.0))) + (s0-0 (new 'stack-no-clear 'vector)) + ) + (cond + ((>= f30-0 f28-0) + (vector-orient-by-quat! s3-0 (-> s1-0 pos-offset) (-> obj root-override2 quat)) + (let ((f26-0 (- f30-0 f28-0))) + (set! sv-880 s0-0) + (set! sv-864 (new 'stack-no-clear 'vector)) + (set! (-> sv-864 x) 0.0) + (set! (-> sv-864 y) (sin (* (-> obj y-angular-velocity) (-> pp clock frames-per-second)))) + (set! (-> sv-864 z) 0.0) + (set! (-> sv-864 w) 1.0) + (let ((v1-39 s3-0)) + (.lvf vf1 (&-> sv-864 quad)) + (.lvf vf2 (&-> v1-39 quad)) + ) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> sv-880 quad) vf3) + (let ((a1-5 s0-0) + (v1-41 s0-0) + (a0-11 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> (-> obj linear-speed) quad)) + (let ((f0-17 (-> pp clock frames-per-second))) + (.mov at-0 f0-17) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> a0-11 quad) vf1) + (vector+! a1-5 v1-41 a0-11) + ) + (let ((a1-7 (-> s1-0 speed))) + (let ((v1-42 (-> s1-0 speed))) + (let ((a0-13 (vector-! (new 'stack-no-clear 'vector) s0-0 (-> s1-0 speed)))) + (let ((a2-14 (* 4.0 (-> pp clock seconds-per-frame)))) + (.mov vf7 a2-14) + ) + (.lvf vf5 (&-> a0-13 quad)) + ) + (.lvf vf4 (&-> v1-42 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-7 quad) vf6) + ) + (let ((a1-8 s3-0)) + (let ((v1-43 s3-0)) + (let ((a0-14 (-> s1-0 speed))) + (let ((a2-16 (+ 0.2 f26-0))) + (.mov vf7 a2-16) + ) + (.lvf vf5 (&-> a0-14 quad)) + ) + (.lvf vf4 (&-> v1-43 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-8 quad) vf6) + ) + ) + (vector+! s3-0 s3-0 (-> obj root-override2 trans)) + (let ((a1-11 (-> s5-0 start-pos))) + (let ((v1-45 s3-0)) + (let ((a0-17 s2-0)) + (let ((a2-18 24576.0)) + (.mov vf7 a2-18) + ) + (.lvf vf5 (&-> a0-17 quad)) + ) + (.lvf vf4 (&-> v1-45 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-11 quad) vf6) + ) + (vector-float*! (-> s5-0 move-dist) s2-0 -49152.0) + (let ((v1-48 s5-0)) + (set! (-> v1-48 radius) 40.96) + (set! (-> v1-48 collide-with) (collide-spec backgnd)) + (set! (-> v1-48 ignore-process0) #f) + (set! (-> v1-48 ignore-process1) #f) + (set! (-> v1-48 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-48 action-mask) (collide-action solid)) + ) + (let ((f0-25 (probe-using-line-sphere *collide-cache* s5-0))) + (when (>= f0-25 0.0) + (let ((v1-50 (new 'stack-no-clear 'vector))) + (let ((a0-25 (-> s5-0 start-pos))) + (let ((a1-14 (-> s5-0 move-dist))) + (let ((a2-19 f0-25)) + (.mov vf7 a2-19) + ) + (.lvf vf5 (&-> a1-14 quad)) + ) + (.lvf vf4 (&-> a0-25 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-50 quad) vf6) + (- (-> s3-0 y) (-> v1-50 y)) + (set! (-> s3-0 quad) (-> v1-50 quad)) + ) + ) + ) + (set! (-> s1-0 next-position quad) (-> s3-0 quad)) + (set! (-> s1-0 moving) #t) + (let ((a1-15 s3-0)) + (let ((v1-54 (-> s1-0 position))) + (let ((a0-30 (vector-! (new 'stack-no-clear 'vector) (-> s1-0 next-position) (-> s1-0 position)))) + (let ((a2-21 (/ f28-0 f30-0))) + (.mov vf7 a2-21) + ) + (.lvf vf5 (&-> a0-30 quad)) + ) + (.lvf vf4 (&-> v1-54 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-15 quad) vf6) + ) + (let ((t9-5 bombbot-do-spline) + (a0-31 (new 'stack-no-clear 'vector)) + (a1-16 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-16 x) 0.0) + (set! (-> a1-16 y) 0.0) + (set! (-> a1-16 z) 0.0) + (set! (-> a1-16 w) 1.0) + (let ((a2-22 (new 'stack-no-clear 'vector))) + (set! (-> a2-22 x) 0.0) + (set! (-> a2-22 y) 0.0) + (set! (-> a2-22 z) 0.5) + (set! (-> a2-22 w) 1.0) + (let ((a3-1 (new 'stack-no-clear 'vector))) + (set! (-> a3-1 x) 0.0) + (set! (-> a3-1 y) 0.0) + (set! (-> a3-1 z) 1.0) + (set! (-> a3-1 w) 1.0) + (let ((t0-0 (new 'stack-no-clear 'vector))) + (set! (-> t0-0 x) 0.0) + (set! (-> t0-0 y) 4.0) + (set! (-> t0-0 z) 0.0) + (set! (-> t0-0 w) 1.0) + (let ((v0-5 (t9-5 a0-31 a1-16 a2-22 a3-1 t0-0 (/ f28-0 f30-0)))) + (set! (-> s1-0 delta-y) (* 0.05 (-> v0-5 y) (vector-length (-> s1-0 speed)))) + ) + ) + ) + ) + ) + (+! (-> s3-0 y) (-> s1-0 delta-y)) + ) + (else + (when (-> s1-0 moving) + (set! (-> s1-0 position quad) (-> s1-0 next-position quad)) + (set! (-> s1-0 moving) #f) + (let ((s0-1 lerp-scale)) + (set! sv-896 (the-as float 819.2)) + (set! sv-912 (the-as float 0.0)) + (set! sv-928 vector-vector-distance) + (let* ((a0-34 (camera-pos)) + (a1-17 (-> s1-0 position)) + (a2-23 (sv-928 a0-34 a1-17)) + (a3-2 40960.0) + (t0-1 409600.0) + (f30-1 (s0-1 sv-896 sv-912 a2-23 a3-2 t0-1)) + ) + (when (and (!= f30-1 0.0) (< 16384.0 (vector-length (-> s1-0 speed)))) + (activate! *camera-smush-control* f30-1 37 600 1.0 0.1 (-> pp clock)) + (let ((s0-2 (get-process *default-dead-pool* part-tracker #x4000))) + (when s0-2 + (let ((t9-11 (method-of-type part-tracker activate))) + (t9-11 (the-as part-tracker s0-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-12 run-function-in-process) + (a0-39 s0-2) + (a1-22 part-tracker-init) + (a2-29 (-> *part-group-id-table* 21)) + (a3-5 0) + (t0-3 #f) + (t1-2 #f) + (t2-1 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> s1-0 position quad)) + ((the-as (function object object object object object object object object none) t9-12) + a0-39 + a1-22 + a2-29 + a3-5 + t0-3 + t1-2 + t2-1 + t3-0 + ) + ) + (-> s0-2 ppointer) + ) + ) + (when (or (zero? s4-0) (= s4-0 1)) + (let ((s0-3 sound-play-by-name)) + (set! sv-944 (make-u128 0 (the-as uint #x6b6c61772d6262))) + (let ((a1-23 (new-sound-id)) + (a2-30 1024) + (a3-6 0) + (t0-4 0) + (t1-3 1) + (t2-2 (-> s1-0 position)) + ) + (s0-3 (the-as sound-name sv-944) a1-23 a2-30 a3-6 t0-4 (the-as sound-group t1-3) t2-2) + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 (* 0.0012207031 f30-1))) (seconds 0.2)) + ) + ) + ) + ) + ) + (set! (-> s1-0 delta-y) 0.0) + (set! (-> s3-0 quad) (-> s1-0 position quad)) + ) + ) + ) + (let ((a1-25 (-> s5-0 start-pos))) + (let ((v1-96 s3-0)) + (let ((a0-45 s2-0)) + (let ((a2-33 12288.0)) + (.mov vf7 a2-33) + ) + (.lvf vf5 (&-> a0-45 quad)) + ) + (.lvf vf4 (&-> v1-96 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-25 quad) vf6) + ) + (vector-float*! (-> s5-0 move-dist) s2-0 -24576.0) + (let ((v1-99 s5-0)) + (set! (-> v1-99 radius) 40.96) + (set! (-> v1-99 collide-with) (collide-spec backgnd)) + (set! (-> v1-99 ignore-process0) #f) + (set! (-> v1-99 ignore-process1) #f) + (set! (-> v1-99 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-99 action-mask) (collide-action solid)) + ) + (let ((f0-62 (probe-using-line-sphere *collide-cache* s5-0))) + (when (>= f0-62 0.0) + (let ((s0-4 (new 'stack-no-clear 'vector))) + (let ((v1-102 (-> s5-0 start-pos))) + (let ((a0-52 (-> s5-0 move-dist))) + (let ((a1-28 f0-62)) + (.mov vf7 a1-28) + ) + (.lvf vf5 (&-> a0-52 quad)) + ) + (.lvf vf4 (&-> v1-102 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-4 quad) vf6) + (let ((f0-64 (- (-> s3-0 y) (-> s0-4 y)))) + (lerp-scale 1.0 0.0 f0-64 0.0 8192.0) + ) + (- (-> s0-4 y) (-> obj root-override2 trans y)) + (vector-dot s2-0 (vector-! (new 'stack-no-clear 'vector) s0-4 (-> obj root-override2 trans))) + ) + ) + ) + (set! (-> s1-0 real-position quad) (-> s3-0 quad)) + ) + ) + (handle-copy! (-> obj joint-ik s4-0) s3-0) + ) + ) + ) + ) + 0 + (none) + ) + ) + ) + +(defmethod track-target! bombbot ((obj bombbot)) + "Does a lot of various things relating to interacting with the target +- tracks when the enemy was last drawn +- looks at the target and handles attacking +@TODO Not extremely well understood yet" + (local-vars (sv-16 sparticle-launcher) (sv-20 sparticle-launcher)) + (let ((t9-0 (method-of-type nav-enemy track-target!))) + (t9-0 obj) + ) + (cond + ((= (-> obj nav state mesh) *default-nav-mesh*) + (dotimes (s5-0 4) + (enable-set! (-> obj joint-ik s5-0) #f) + ) + ) + (else + (bombbot-method-179 obj) + (dotimes (s5-1 4) + (enable-set! (-> obj joint-ik s5-1) #t) + ) + ) + ) + (vector-! (-> obj linear-speed) (-> obj root-override2 trans) (-> obj last-trans)) + (set! (-> obj last-trans quad) (-> obj root-override2 trans quad)) + (set! (-> obj y-angular-velocity) + (deg- (quaternion-y-angle (-> obj root-override2 quat)) (quaternion-y-angle (-> obj last-quat))) + ) + (quaternion-copy! (-> obj last-quat) (-> obj root-override2 quat)) + (set! (-> obj rigidbody state force-callback) + (the-as (function object float none) (method-of-object obj bombbot-method-183)) + ) + (bombbot-method-184 obj) + (set! sv-16 (the-as sparticle-launcher #f)) + (set! sv-20 (the-as sparticle-launcher #f)) + (cond + ((< (-> obj hit-points) 30) + (set! sv-16 (-> *part-id-table* 778)) + (set! sv-20 (-> *part-id-table* 774)) + ) + ((< (-> obj hit-points) 60) + (set! sv-16 (-> *part-id-table* 781)) + ) + (else + (if (< (rand-vu) 0.05) + (set! sv-16 (-> *part-id-table* 783)) + ) + ) + ) + (when sv-16 + (let ((gp-1 (-> obj node-list data 4 bone transform)) + (s5-3 (new 'stack-no-clear 'vector)) + ) + (dotimes (s4-1 2) + (vector-matrix*! + s5-3 + (vector-rotate-around-y! (new 'stack-no-clear 'vector) (new 'static 'vector :z 6144.0 :w 1.0) (if (< s4-1 1) + 5461.3335 + 38229.332 + ) + ) + gp-1 + ) + (vector-! *particle-vel* s5-3 (matrix->trans gp-1 (new 'stack-no-clear 'vector))) + (set! (-> *particle-vel* y) (+ 4096.0 (-> *particle-vel* y))) + (vector-float*! *particle-vel* *particle-vel* 0.0033333334) + (when (and sv-20 (< (rand-vu) 0.005)) + (let ((t9-14 sp-launch-particles-var) + (a0-22 *sp-particle-system-2d*) + (a1-9 sv-16) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> s5-3 quad)) + (t9-14 a0-22 a1-9 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + (let ((t9-15 sp-launch-particles-var) + (a0-23 *sp-particle-system-2d*) + (a1-10 sv-16) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> s5-3 quad)) + (t9-15 a0-23 a1-10 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod run-logic? bombbot ((obj bombbot)) + #t + ) + +(defmethod enemy-method-58 bombbot ((obj bombbot) (arg0 process) (arg1 event-message-block)) + ((method-of-type nav-enemy enemy-method-58) obj arg0 arg1) + 'hit-flinch + ) + +(defmethod damage-amount-from-attack bombbot ((obj bombbot) (arg0 process) (arg1 event-message-block)) + "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" + (-> arg1 param 1) + (let ((f0-1 (the float (penetrate-using->damage (the-as penetrate (-> obj incoming penetrate-using)))))) + (cond + ((logtest? #xc0000 (-> obj incoming penetrate-using)) + (if (and (logtest? #x40000 (-> obj incoming penetrate-using)) + (logtest? #x80000 (-> obj incoming penetrate-using)) + ) + #x42c80000 + (the int (* 1.8 f0-1)) + ) + ) + ((logtest? #x20000 (-> obj incoming penetrate-using)) + (the int (* 2.0 f0-1)) + ) + (else + (the int f0-1) + ) + ) + ) + ) + +(defmethod general-event-handler bombbot ((obj bombbot) (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" + (with-pp + (case arg2 + (('nav-mesh-kill) + (change-to *default-nav-mesh* obj) + #t + ) + (('hit-flinch) + (send-event *traffic-manager* 'set-alert-level 1) + (cond + ((zero? (-> obj hit-points)) + (if (not (and (-> obj next-state) (= (-> obj next-state name) 'die))) + ((method-of-object obj kill-prefer-falling)) + ) + ) + (else + (let ((a1-3 (-> arg3 param 1))) + (when arg0 + (let ((v1-14 (find-offending-process-focusable arg0 (the-as attack-info a1-3)))) + (when v1-14 + (let ((s5-1 (new 'stack-no-clear 'vector))) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (set! (-> s4-1 quad) (-> v1-14 root-override trans quad)) + (let ((s3-1 (matrix->trans (-> obj node-list data 3 bone transform) (new 'stack-no-clear 'vector)))) + (+! (-> s4-1 x) (* 4096.0 (rand-vu-float-range -20.0 20.0))) + (+! (-> s4-1 y) (* 4096.0 (rand-vu-float-range -20.0 20.0))) + (+! (-> s4-1 z) (* 4096.0 (rand-vu-float-range -20.0 20.0))) + (vector-! s5-1 s3-1 s4-1) + ) + ) + (vector-normalize! s5-1 4096000.0) + (vector-inv-orient-by-quat! s5-1 s5-1 (-> obj root-override2 quat)) + (let* ((s4-2 (-> obj rigidbody)) + (v1-26 (-> obj rigidbody)) + (a1-10 (new 'stack-no-clear 'vector)) + (a1-11 (rigid-body-method-23 (-> v1-26 state) a1-10)) + ) + (rigid-body-method-18 (-> s4-2 state) a1-11 s5-1) + ) + ) + ) + ) + ) + ) + 'back + ) + ) + ) + (('explode) + (if (not (and (-> obj next-state) (= (-> obj next-state name) 'explode))) + (go (method-of-object obj explode)) + ) + ) + (('touched 'touch 'attack) + (when (logtest? (process-mask vehicle) (-> arg0 mask)) + (let ((a1-14 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-14 from) (process->ppointer pp)) + (set! (-> a1-14 num-params) 2) + (set! (-> a1-14 message) 'attack) + (set! (-> a1-14 param 0) (-> arg3 param 0)) + (let ((v1-43 (new 'static 'attack-info :mask (attack-info-mask mode id)))) + (let* ((a0-27 *game-info*) + (a2-4 (+ (-> a0-27 attack-id) 1)) + ) + (set! (-> a0-27 attack-id) a2-4) + (set! (-> v1-43 id) a2-4) + ) + (set! (-> v1-43 mode) 'mine) + (set! (-> a1-14 param 1) (the-as uint v1-43)) + ) + (send-event-function arg0 a1-14) + ) + ) + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) + ) + ) + ) + +(defstate notice (bombbot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy notice) enter))) + (if t9-0 + (t9-0) + ) + ) + (react-to-focus self) + (none) + ) + ) + +(defmethod bombbot-method-181 bombbot ((obj bombbot) (arg0 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (the-as process-drawable #f))) + (let ((f30-0 (the-as float #x7f800000)) + (s3-0 (new 'stack-no-clear 'array 'collide-shape 64)) + ) + (countdown (s2-0 (fill-actor-list-for-sphere *actor-hash* (the-as sphere arg0) s3-0 64)) + (let* ((s1-0 (-> s3-0 s2-0)) + (a0-3 (if (type? s1-0 collide-shape) + s1-0 + ) + ) + ) + (when a0-3 + (let* ((s0-0 (-> a0-3 process)) + (s1-1 (if (type? s0-0 process-focusable) + s0-0 + ) + ) + ) + (when (and s1-1 + (!= obj s1-1) + (not (logtest? (-> obj focus-status) (focus-status inactive))) + (not (logtest? (-> obj focus-status) (focus-status disable))) + (not (logtest? (-> obj focus-status) (focus-status dead))) + (not (logtest? (process-mask guard) (-> s1-1 mask))) + (not (logtest? (process-mask crate) (-> s1-1 mask))) + (logtest? (process-mask vehicle) (-> s1-1 mask)) + s1-1 + (zero? (logand (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) + ) + (let ((f0-0 (vector-vector-xz-distance (-> obj root-override2 trans) (-> s1-1 root trans)))) + (when (or (not gp-0) (< f0-0 f30-0)) + (set! gp-0 s1-1) + (set! f30-0 f0-0) + ) + ) + ) + ) + ) + ) + ) + ) + (if (and *target* (< (vector-vector-distance (target-pos 0) arg0) (-> arg0 w))) + (set! gp-0 *target*) + ) + (cond + (gp-0 + (set! (-> obj target-pos quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) + (let ((v1-34 (-> obj target-pos))) + (let ((a0-16 (-> gp-0 root trans))) + (let ((a1-8 (-> gp-0 root transv))) + (let ((a2-1 0.0)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a1-8 quad)) + ) + (.lvf vf4 (&-> a0-16 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-34 quad) vf6) + ) + (set! (-> obj start-target-pos quad) (-> gp-0 root trans quad)) + (set! (-> obj start-target-vel quad) (-> gp-0 root transv quad)) + (try-update-focus (-> obj focus) (the-as process-focusable gp-0) obj) + ) + (else + (clear-focused (-> obj focus)) + ) + ) + ) + 0 + (none) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun bombbot-spread-lightning-lazer ((arg0 lightning-control) (arg1 vector) (arg2 vector) (arg3 vector)) + (local-vars (sv-656 vector) (sv-672 vector) (sv-688 int) (sv-704 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (set! sv-656 arg1) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> sv-656 quad)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> arg2 quad)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! sv-672 (new 'stack-no-clear 'vector)) + (let ((s2-0 (new 'stack-no-clear 'quaternion))) + (vector-length arg2) + (let ((s1-0 (new 'stack-no-clear 'vector))) + (set! (-> s1-0 quad) (-> arg3 quad)) + (let ((s0-0 (new 'stack-no-clear 'collide-query)) + (f30-0 6144.0) + ) + (vector-normalize! s4-0 f30-0) + (let ((v1-9 (-> sv-656 quad))) + (set! (-> sv-672 quad) v1-9) + ) + (set! sv-688 0) + (while (< sv-688 15) + (let ((v1-11 s0-0)) + (set! (-> v1-11 radius) 6144.0) + (set! (-> v1-11 collide-with) (collide-spec vehicle-sphere hit-by-others-list)) + (set! (-> v1-11 ignore-process0) #f) + (set! (-> v1-11 ignore-process1) #f) + (set! (-> v1-11 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-11 action-mask) (collide-action solid)) + ) + (set! (-> s0-0 start-pos quad) (-> s5-0 quad)) + (set! (-> s0-0 move-dist quad) (-> s4-0 quad)) + (set-from-point-offset-pad! (-> s0-0 bbox) (-> s0-0 start-pos) (-> s0-0 move-dist) (-> s0-0 radius)) + (fill-using-bounding-box *collide-cache* s0-0) + (set! (-> s0-0 radius) 819.2) + (let ((f0-4 (probe-using-line-sphere *collide-cache* s0-0))) + (cond + ((>= f0-4 0.0) + (let ((a1-5 s3-0)) + (let ((v1-18 (-> s0-0 start-pos))) + (let ((a0-14 (-> s0-0 move-dist))) + (let ((a2-2 f0-4)) + (.mov vf7 a2-2) + ) + (.lvf vf5 (&-> a0-14 quad)) + ) + (.lvf vf4 (&-> v1-18 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-5 quad) vf6) + ) + (set! (-> s5-0 quad) (-> s3-0 quad)) + ) + (else + (vector+! (-> s0-0 start-pos) s5-0 s4-0) + (let ((a1-8 (-> s0-0 start-pos))) + (let ((v1-21 (-> s0-0 start-pos))) + (let ((a0-18 s1-0)) + (let ((a2-4 -4096.0)) + (.mov vf7 a2-4) + ) + (.lvf vf5 (&-> a0-18 quad)) + ) + (.lvf vf4 (&-> v1-21 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-8 quad) vf6) + ) + (vector-negate! (-> s0-0 move-dist) s4-0) + (set! f0-4 (probe-using-line-sphere *collide-cache* s0-0)) + (when (>= f0-4 0.0) + (let ((a1-11 s3-0)) + (let ((v1-24 (-> s0-0 start-pos))) + (let ((a0-21 (-> s0-0 move-dist))) + (let ((a2-5 f0-4)) + (.mov vf7 a2-5) + ) + (.lvf vf5 (&-> a0-21 quad)) + ) + (.lvf vf4 (&-> v1-24 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-11 quad) vf6) + ) + (let ((a1-12 s3-0)) + (let ((v1-25 s3-0)) + (let ((a0-22 s1-0)) + (let ((a2-7 4096.0)) + (.mov vf7 a2-7) + ) + (.lvf vf5 (&-> a0-22 quad)) + ) + (.lvf vf4 (&-> v1-25 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-12 quad) vf6) + ) + (set! (-> s5-0 quad) (-> s3-0 quad)) + ) + ) + ) + (cond + ((>= f0-4 0.0) + (+! (-> s3-0 x) (rand-vu-float-range -409.6 409.6)) + (+! (-> s3-0 y) (rand-vu-float-range -409.6 409.6)) + (+! (-> s3-0 z) (rand-vu-float-range -409.6 409.6)) + (set-point! arg0 (-> arg0 state points-to-draw) s3-0) + (+! (-> arg0 state points-to-draw) 1) + (set! sv-704 (-> s0-0 best-other-tri normal)) + (quaternion-from-two-vectors! s2-0 s1-0 sv-704) + (vector-orient-by-quat! s4-0 s4-0 s2-0) + (set! (-> s1-0 quad) (-> sv-704 quad)) + (vector-flatten! s4-0 s4-0 sv-704) + (vector-normalize! s4-0 f30-0) + ) + (else + (vector+! s5-0 s5-0 s4-0) + (when (< sv-688 14) + (set-point! arg0 (-> arg0 state points-to-draw) s5-0) + (+! (-> arg0 state points-to-draw) 1) + ) + ) + ) + ) + (set! sv-688 (+ sv-688 1)) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +(defmethod bombbot-method-182 bombbot ((obj bombbot)) + (local-vars + (v1-28 symbol) + (sv-880 matrix) + (sv-896 (function vector vector quaternion vector)) + (sv-912 vector) + (sv-928 vector) + (sv-944 (function quaternion vector float quaternion)) + (sv-960 quaternion) + (sv-976 vector) + (sv-992 basic) + (sv-1008 process) + (sv-1024 (pointer process)) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s2-0 (handle->process (-> obj focus handle)))) + (set! sv-880 (new 'stack-no-clear 'matrix)) + (let* ((a0-4 (-> obj node-list data 6 bone transform)) + (a2-0 (-> a0-4 quad 0)) + (a1-1 (-> a0-4 quad 1)) + (v1-7 (-> a0-4 quad 2)) + (a0-5 (-> a0-4 trans quad)) + ) + (set! (-> sv-880 quad 0) a2-0) + (set! (-> sv-880 quad 1) a1-1) + (set! (-> sv-880 quad 2) v1-7) + (set! (-> sv-880 trans quad) a0-5) + ) + (new 'stack-no-clear 'matrix) + (let ((s3-0 (new 'stack-no-clear 'collide-query)) + (s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s0-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (matrix->trans sv-880 s4-0) + (let ((a0-7 s4-0)) + (let ((v1-10 s4-0)) + (let ((a1-5 (-> sv-880 vector 2))) + (let ((a2-3 8192.0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a1-5 quad)) + ) + (.lvf vf4 (&-> v1-10 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 (&-> a0-7 quad) vf6) + ) + (vector-normalize-copy! s5-0 (-> sv-880 vector 2) 327680.0) + (set! (-> s3-0 start-pos quad) (-> s4-0 quad)) + (set! (-> s3-0 move-dist quad) (-> s5-0 quad)) + (let ((v1-14 s3-0)) + (set! (-> v1-14 radius) 40.96) + (set! (-> v1-14 collide-with) (collide-spec + backgnd + jak + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + ) + ) + (set! (-> v1-14 ignore-process0) obj) + (set! (-> v1-14 ignore-process1) #f) + (set! (-> v1-14 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-14 action-mask) (collide-action solid)) + ) + (let ((f0-2 (fill-and-probe-using-line-sphere *collide-cache* s3-0))) + (when (>= f0-2 0.0) + (vector-float*! s5-0 s5-0 f0-2) + (vector+! s1-0 (-> s3-0 start-pos) s5-0) + (point-in-plane-<-point+normal! s0-0 s1-0 (-> s3-0 best-other-tri normal)) + (vector-! s0-0 s0-0 s1-0) + (set! sv-896 vector-orient-by-quat!) + (set! sv-912 s0-0) + (set! sv-928 s0-0) + (set! sv-944 quaternion-vector-angle!) + (set! sv-960 (new 'stack-no-clear 'quaternion)) + (set! sv-976 (-> s3-0 best-other-tri normal)) + (let* ((a2-6 (rand-vu-float-range 0.0 65536.0)) + (a2-7 (sv-944 sv-960 sv-976 a2-6)) + ) + (sv-896 sv-912 sv-928 a2-7) + ) + (set! sv-992 (-> s3-0 best-other-tri collide-ptr)) + (let ((v1-25 (if (type? sv-992 collide-shape-prim) + sv-992 + ) + ) + ) + (when v1-25 + (cond + ((logtest? (-> (the-as collide-shape-prim v1-25) prim-core collide-as) (collide-spec vehicle-sphere)) + (set! sv-1008 (get-process *default-dead-pool* lightning-tracker #x4000)) + (set! v1-28 + (when sv-1008 + (set! sv-1024 (the-as (pointer process) v1-28)) + (let ((t9-9 (method-of-type lightning-tracker activate))) + (t9-9 + (the-as lightning-tracker sv-1008) + *entity-pool* + (symbol->string (-> lightning-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (run-now-in-process sv-1008 lightning-tracker-init (-> *lightning-spec-id-table* 13) 30 #f #f #f #f) + (set! sv-1024 (-> sv-1008 ppointer)) + v1-28 + ) + ) + (set-point! (-> (the-as lightning-tracker (-> sv-1024 0)) lightning) 0 s1-0) + (set! (-> (the-as lightning-tracker (-> sv-1024 0)) offset0 quad) (-> s1-0 quad)) + (set! (-> (the-as lightning-tracker (-> sv-1024 0)) lightning state points-to-draw) 1) + (bombbot-spread-lightning-lazer + (-> (the-as lightning-tracker (-> sv-1024 0)) lightning) + s1-0 + s0-0 + (-> s3-0 best-other-tri normal) + ) + (+! (-> (the-as lightning-tracker (-> sv-1024 0)) lightning state points-to-draw) -1) + (set! (-> (the-as lightning-tracker (-> sv-1024 0)) offset1 quad) + (-> (the-as lightning-tracker (-> sv-1024 0)) + lightning + state + path + data + (+ (-> (the-as lightning-tracker (-> sv-1024 0)) lightning state points-to-draw) -1) + quad + ) + ) + ) + ((logtest? (-> (the-as collide-shape-prim v1-25) prim-core collide-as) (collide-spec civilian)) + (let ((s1-1 process-drawable-shock-skel-effect) + (s0-1 (-> (the-as collide-shape-prim v1-25) cshape process)) + ) + (s1-1 + (if (type? s0-1 process-focusable) + s0-1 + ) + (-> *lightning-spec-id-table* 5) + lightning-probe-callback + (-> *part-id-table* 166) + 2048.0 + -1 + -1 + ) + ) + ) + ((logtest? (-> (the-as collide-shape-prim v1-25) prim-core collide-as) (collide-spec jak)) + ) + (else + ) + ) + (when (and s2-0 + s2-0 + (zero? (logand (-> (the-as process-focusable s2-0) focus-status) (focus-status disable dead ignore grabbed))) + ) + (let ((s2-1 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s2-1 ent) (-> obj entity)) + (set! (-> s2-1 charge) 1.0) + (set! (-> s2-1 options) (projectile-options)) + (set! (-> s2-1 notify-handle) (process->handle obj)) + (set! (-> s2-1 owner-handle) (the-as handle #f)) + (set! (-> s2-1 ignore-handle) (process->handle obj)) + (let* ((v1-69 *game-info*) + (a0-67 (+ (-> v1-69 attack-id) 1)) + ) + (set! (-> v1-69 attack-id) a0-67) + (set! (-> s2-1 attack-id) a0-67) + ) + (set! (-> s2-1 timeout) (new 'static 'handle :process #x4b0 :u64 #x4b0)) + (set! (-> s2-1 pos quad) (-> s3-0 start-pos quad)) + (vector+! (-> s2-1 vel) (-> s3-0 start-pos) s5-0) + (vector-normalize-copy! (-> s2-1 vel) (-> s3-0 move-dist) 40960000.0) + (spawn-projectile guard-lazer-shot s2-1 obj *default-dead-pool*) + ) + ) + ) + ) + (when (zero? (-> obj lazer-sound)) + (let ((s3-1 sound-play-by-spec) + (s2-2 (static-sound-spec "bb-laser-fire" :volume 0.0 :mask (pitch))) + ) + (set! (-> s2-2 volume) 1024) + (set! (-> s2-2 pitch-mod) 0) + (set! (-> obj lazer-sound) (the-as uint (s3-1 s2-2 (new-sound-id) s4-0))) + ) + ) + (set! (-> *part-id-table* 4630 init-specs 4 initial-valuef) (vector-length s5-0)) + (draw-beam (-> *part-id-table* 4630) s4-0 s5-0 #f #t) + (let ((t9-20 sp-launch-particles-var) + (a0-76 *sp-particle-system-2d*) + (a1-34 (-> *part-id-table* 4631)) + (a2-20 *launch-matrix*) + ) + (set! (-> a2-20 trans quad) (-> s4-0 quad)) + (t9-20 a0-76 a1-34 a2-20 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-21 sp-launch-particles-var) + (a0-77 *sp-particle-system-2d*) + (a1-35 (-> *part-id-table* 4632)) + (a2-21 *launch-matrix*) + ) + (set! (-> a2-21 trans quad) (-> (vector+! (new 'stack-no-clear 'vector) s5-0 s4-0) quad)) + (t9-21 a0-77 a1-35 a2-21 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defstate hostile (bombbot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self enemy-flags) (logior (enemy-flag actor-pause-backup) (-> self enemy-flags))) + (set! (-> self shield-hit-points) (+ -1.0 (-> self shield-hit-points))) + (none) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) + (if t9-0 + (t9-0) + ) + ) + (sound-stop (the-as sound-id (-> self lazer-sound))) + (sound-stop (the-as sound-id (-> self head-sound))) + (sound-stop (the-as sound-id (-> self cannon-sound))) + (none) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (>= (the int (* 30.0 (-> self shield-hit-points))) (-> self hit-points)) + ) + (when (< (the-as time-frame (-> self next-target)) (-> self clock frame-counter)) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self root-override2 trans quad)) + (set! (-> a1-0 w) 122880.0) + (bombbot-method-181 self a1-0) + ) + (set! (-> self next-target) (the-as uint (+ (-> self clock frame-counter) (seconds 2)))) + (set! (-> self start-target) (the-as uint (-> self clock frame-counter))) + ) + (let ((gp-0 (handle->process (-> self focus handle)))) + (let ((f30-0 1.0)) + (when (and gp-0 (< (fabs (- (-> self target-pos y) (-> self root-override2 trans y))) 20480.0)) + ) + (seek! (-> self legs-strength 0) f30-0 (* 0.5 (-> self clock seconds-per-frame))) + (seek! (-> self legs-strength 1) f30-0 (* 0.5 (-> self clock seconds-per-frame))) + (seek! (-> self legs-strength 2) f30-0 (* 0.5 (-> self clock seconds-per-frame))) + (seek! (-> self legs-strength 3) f30-0 (* 0.5 (-> self clock seconds-per-frame))) + ) + (cond + (gp-0 + (let ((a1-6 (-> self target-pos))) + (let ((v1-34 (-> self start-target-pos))) + (let ((a0-14 (-> self start-target-vel))) + (let ((a2-8 (* 0.0033333334 (the float (- (-> self clock frame-counter) (the-as int (-> self start-target))))))) + (.mov vf7 a2-8) + ) + (.lvf vf5 (&-> a0-14 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-6 quad) vf6) + ) + (cond + ((< (the-as time-frame (+ (-> self next-target) -300)) (-> self clock frame-counter)) + (bombbot-method-182 self) + ) + (else + (sound-stop (the-as sound-id (-> self lazer-sound))) + (set! (-> self lazer-sound) (the-as uint 0)) + 0 + ) + ) + ) + (else + (sound-stop (the-as sound-id (-> self lazer-sound))) + (set! (-> self lazer-sound) (the-as uint 0)) + 0 + ) + ) + ) + (when (= (-> self nav state mesh) *default-nav-mesh*) + (let ((a0-23 (find-nearest-nav-mesh (-> self root-override2 trans) 0.0))) + (when a0-23 + (change-to a0-23 self) + (dotimes (gp-1 4) + (let ((s5-0 (-> self feet gp-1))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-orient-by-quat! s4-0 (-> s5-0 pos-offset) (-> self root-override2 quat)) + (vector+! s4-0 s4-0 (-> self root-override2 trans)) + (set! (-> s5-0 next-position quad) (-> s4-0 quad)) + (set! (-> s5-0 position quad) (-> s4-0 quad)) + ) + (set! (-> s5-0 delta-y) 0.0) + ) + (set! (-> self legs-strength gp-1) 1.0) + ) + ) + ) + ) + (new 'stack-no-clear 'vector) + (let ((f0-28 (* 0.25 (+ (-> self feet 0 next-position y) + (-> self feet 1 next-position y) + (-> self feet 2 next-position y) + (-> self feet 3 next-position y) + ) + ) + ) + ) + (if (!= (-> self nav state mesh) *default-nav-mesh*) + (+! (-> self root-override2 trans y) + (* 4.0 (-> self clock seconds-per-frame) (- f0-28 (-> self root-override2 trans y))) + ) + ) + ) + (if (= (vector-length (-> self root-override2 transv)) 0.0) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (set! (-> self last-head-roty-speed) (-> self head-roty-speed)) + (set! (-> self head-roty-speed) (vector-y-angle (-> self node-list data 4 bone transform vector 2))) + (set! (-> self last-cannon-roty-speed) (-> self cannon-roty-speed)) + (set! (-> self cannon-roty-speed) (vector-y-angle (-> self node-list data 6 bone transform vector 2))) + (let ((f0-39 (deg- (-> self last-head-roty-speed) (-> self head-roty-speed)))) + (cond + ((< 364.0889 (fabs f0-39)) + (when (zero? (-> self head-sound)) + (let ((gp-2 sound-play-by-spec) + (s5-1 (static-sound-spec "bb-turret-loop" :volume 0.0 :mask (pitch))) + ) + (set! (-> s5-1 volume) 1024) + (set! (-> s5-1 pitch-mod) 0) + (set! (-> self head-sound) (the-as uint (gp-2 s5-1 (new-sound-id) (-> self root-override2 trans)))) + ) + ) + ) + (else + (when (nonzero? (-> self head-sound)) + (sound-play "bb-turret-end") + (sound-stop (the-as sound-id (-> self head-sound))) + (set! (-> self head-sound) (the-as uint 0)) + 0 + ) + ) + ) + ) + (let ((f0-43 (deg- (-> self last-cannon-roty-speed) (-> self cannon-roty-speed)))) + (cond + ((< 364.0889 (fabs f0-43)) + (when (zero? (-> self cannon-sound)) + (let ((gp-4 sound-play-by-spec) + (s5-3 (static-sound-spec "bb-laser-loop" :volume 0.0 :mask (pitch))) + ) + (set! (-> s5-3 volume) 1024) + (set! (-> s5-3 pitch-mod) 0) + (set! (-> self cannon-sound) (the-as uint (gp-4 s5-3 (new-sound-id) (-> self root-override2 trans)))) + ) + ) + ) + (else + (when (nonzero? (-> self cannon-sound)) + (sound-stop (the-as sound-id (-> self cannon-sound))) + (sound-play "bb-laser-end") + (set! (-> self cannon-sound) (the-as uint 0)) + 0 + ) + ) + ) + ) + (bombbot-method-180 self) + (none) + ) + ) + :code (behavior () + (until #f + (suspend) + (ja-no-eval :group! bombbot-idle-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim bombbot-idle-ja) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (behavior () + (-> self current-node) + (let ((gp-1 (min (the-as int (+ (-> self current-node) 1)) (the-as int (+ (-> self city-path node-count) -1))))) + (cond + ((= (-> self nav state mesh) *default-nav-mesh*) + (vector-v+! + (-> self root-override2 trans) + (-> self root-override2 trans) + (vector-normalize! + (vector-! + (new 'stack-no-clear 'vector) + (the-as vector (-> self city-path node gp-1)) + (-> self root-override2 trans) + ) + (-> *bombbot-nav-enemy-info* run-travel-speed) + ) + ) + (seek! + (-> self root-override2 trans y) + (-> self city-path node gp-1 position y) + (* 16384.0 (-> self clock seconds-per-frame)) + ) + (track-target! self) + (update-transforms (-> self root-override2)) + ) + (else + (let ((v1-25 (-> self nav state)) + (a0-10 (-> self city-path node gp-1)) + ) + (logclear! (-> v1-25 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-25 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-25 target-post quad) (-> a0-10 position quad)) + ) + 0 + (nav-enemy-method-176 self) + ) + ) + (if (< (vector-vector-xz-distance (-> self root-override2 trans) (the-as vector (-> self city-path node gp-1))) + 32768.0 + ) + (set! (-> self current-node) + (the-as + uint + (min (the-as int (+ (-> self current-node) 1)) (the-as int (+ (-> self city-path node-count) -1))) + ) + ) + ) + ) + (none) + ) + ) + +(defstate die (bombbot) + :virtual #t + :enter (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (set! (-> self explosing) #f) + (set! (-> self beep-time) 0) + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (let ((v1-0 (-> self nav))) + (set! (-> v1-0 target-speed) + (- (-> self nav target-speed) (* 0.4 (-> self clock seconds-per-frame) (-> self nav target-speed))) + ) + ) + 0 + (if (>= (- (-> self clock frame-counter) (-> self state-time)) 0) + (seek! (-> self legs-strength 0) 0.8 (* 10.0 (-> self clock seconds-per-frame))) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.8)) + (seek! (-> self legs-strength 3) 0.4 (* 10.0 (-> self clock seconds-per-frame))) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 1.6)) + (seek! (-> self legs-strength 1) 0.0 (* 10.0 (-> self clock seconds-per-frame))) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 2.4)) + (seek! (-> self legs-strength 2) 0.5 (* 10.0 (-> self clock seconds-per-frame))) + ) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 2.8)) + (sound-play "bb-explode") + (go-virtual explode) + ) + (when (< (-> self beep-time) (-> self clock frame-counter)) + (sound-play "bb-beep") + (set! (-> self beep-time) + (+ (-> self clock frame-counter) + (the int (* 0.2 (the float (- (seconds 2.8) (- (-> self clock frame-counter) (-> self state-time)))))) + ) + ) + ) + (none) + ) + :code (behavior () + (until #f + (suspend) + (ja-no-eval :group! bombbot-idle-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim bombbot-idle-ja) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (behavior () + (nav-enemy-method-176 self) + (none) + ) + ) + +(defstate explode (bombbot) + :virtual #t + :enter (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (set! (-> self explosing) #f) + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-0 fountain-rand-transv-lo quad) (-> self root-override2 trans quad)) + (set! (-> gp-0 duration) (seconds 3)) + (set! (-> gp-0 gravity) -163840.0) + (set! (-> gp-0 fountain-rand-transv-hi x) 8192.0) + (set! (-> gp-0 fountain-rand-transv-hi y) 32768.0) + (set! (-> gp-0 fountain-rand-transv-hi z) 8192.0) + (set! (-> gp-0 fountain-rand-transv-hi w) 24576.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-bombbot-exploding" (the-as (pointer uint32) #f)) + 6 + gp-0 + *bombbot-exploder-params* + :to self + ) + ) + (let ((v1-23 (new 'stack-no-clear 'vector))) + (set! (-> v1-23 quad) (-> self root-override2 trans quad)) + (set! (-> v1-23 y) (+ 2048.0 (-> v1-23 y))) + ) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (set! (-> gp-1 quad) (-> self node-list data 3 bone transform trans quad)) + (new 'stack-no-clear 'vector) + 4.0 + (activate! *camera-smush-control* 1024.0 37 210 1.0 0.995 (-> self clock)) + (let ((s5-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> s5-1 spawn-point quad) (-> gp-1 quad)) + (quaternion-copy! (-> s5-1 spawn-quat) (-> self root-override2 quat)) + (set! (-> s5-1 radius) 61440.0) + (set! (-> s5-1 group) (-> *part-group-id-table* 1060)) + (set! (-> s5-1 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> s5-1 penetrate-using) (penetrate explode)) + (explosion-spawn self explosion s5-1) + ) + ) + (dotimes (gp-2 4) + (let ((s4-1 (new 'stack-no-clear 'vector)) + (s5-2 (new 'stack-no-clear 'vector)) + ) + (let ((f30-0 (* 16384.0 (the float gp-2)))) + (set-vector! s4-1 (cos f30-0) 0.0 (sin f30-0) 1.0) + ) + (vector-float*! s4-1 s4-1 (* 4096.0 (+ 2.0 (* 2.0 (rand-vu))))) + (set! (-> s5-2 quad) (-> self root-override2 trans quad)) + (vector+! (-> self root-override2 trans) (-> self root-override2 trans) s4-1) + (set! (-> self fact-info-override pickup-type) (pickup-type ammo-random)) + (set! (-> self fact-info-override pickup-amount) 10.0) + (set! (-> self fact-info-override pickup-spawn-amount) 1.0) + (drop-pickup (-> self fact-info-override) #t *entity-pool* (-> self fact-info-override) 0) + (set! (-> self root-override2 trans quad) (-> s5-2 quad)) + ) + ) + (set! (-> self explosing) #t) + (let ((v1-62 (-> self root-override2 root-prim))) + (set! (-> v1-62 prim-core collide-as) (collide-spec)) + (set! (-> v1-62 prim-core collide-with) (collide-spec)) + ) + 0 + (ja-channel-set! 0) + (ja-post) + (none) + ) + :code (behavior () + (while (-> self child) + (suspend) + ) + (none) + ) + ) + +;; WARN: Return type mismatch nav-enemy vs bombbot. +(defmethod relocate bombbot ((obj bombbot) (arg0 int)) + (dotimes (v1-0 4) + (if (nonzero? (-> obj joint-ik v1-0)) + (&+! (-> obj joint-ik v1-0) arg0) + ) + ) + (if (nonzero? (-> obj rigidbody)) + (&+! (-> obj rigidbody) arg0) + ) + (the-as bombbot ((the-as (function nav-enemy int nav-enemy) (find-parent-method bombbot 7)) obj arg0)) + ) + +(defmethod init-enemy-collision! bombbot ((obj bombbot)) + "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" + (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 33) 0))) + (set! (-> s5-0 total-prims) (the-as uint 34)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 12288.0 0.0 24576.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-12 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) 0.0 1638.4 0.0 8192.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-14 transform-index) 19) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-16 transform-index) 19) + (set-vector! (-> v1-16 local-sphere) 0.0 4096.0 0.0 2867.2) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-18 transform-index) 19) + (set-vector! (-> v1-18 local-sphere) 0.0 8192.0 0.0 2867.2) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-20 transform-index) 19) + (set-vector! (-> v1-20 local-sphere) 0.0 12288.0 0.0 2867.2) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-22 transform-index) 18) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-24 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-24 transform-index) 18) + (set-vector! (-> v1-24 local-sphere) 0.0 4096.0 0.0 2867.2) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-26 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-26 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-26 transform-index) 18) + (set-vector! (-> v1-26 local-sphere) 0.0 8192.0 0.0 2867.2) + ) + (let ((v1-28 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-28 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-28 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-28 transform-index) 18) + (set-vector! (-> v1-28 local-sphere) 0.0 12288.0 0.0 2867.2) + ) + (let ((v1-30 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-30 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-30 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-30 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-30 transform-index) 13) + (set-vector! (-> v1-30 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-32 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-32 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-32 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-32 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-32 transform-index) 13) + (set-vector! (-> v1-32 local-sphere) 0.0 -4096.0 0.0 2867.2) + ) + (let ((v1-34 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-34 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-34 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-34 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-34 transform-index) 13) + (set-vector! (-> v1-34 local-sphere) 0.0 -8192.0 0.0 2867.2) + ) + (let ((v1-36 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-36 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-36 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-36 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-36 transform-index) 13) + (set-vector! (-> v1-36 local-sphere) 0.0 -12288.0 0.0 2867.2) + ) + (let ((v1-38 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-38 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-38 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-38 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-38 transform-index) 12) + (set-vector! (-> v1-38 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-40 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-40 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-40 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-40 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-40 transform-index) 12) + (set-vector! (-> v1-40 local-sphere) 0.0 -4096.0 0.0 2867.2) + ) + (let ((v1-42 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-42 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-42 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-42 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-42 transform-index) 12) + (set-vector! (-> v1-42 local-sphere) 0.0 -8192.0 0.0 2867.2) + ) + (let ((v1-44 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-44 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-44 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-44 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-44 transform-index) 12) + (set-vector! (-> v1-44 local-sphere) 0.0 -12288.0 0.0 2867.2) + ) + (let ((v1-46 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-46 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-46 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-46 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-46 transform-index) 17) + (set-vector! (-> v1-46 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-48 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-48 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-48 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-48 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-48 transform-index) 17) + (set-vector! (-> v1-48 local-sphere) 0.0 -4096.0 0.0 2867.2) + ) + (let ((v1-50 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-50 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-50 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-50 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-50 transform-index) 17) + (set-vector! (-> v1-50 local-sphere) 0.0 -8192.0 0.0 2867.2) + ) + (let ((v1-52 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-52 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-52 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-52 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-52 transform-index) 17) + (set-vector! (-> v1-52 local-sphere) 0.0 -12288.0 0.0 2867.2) + ) + (let ((v1-54 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-54 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-54 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-54 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-54 transform-index) 16) + (set-vector! (-> v1-54 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-56 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-56 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-56 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-56 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-56 transform-index) 16) + (set-vector! (-> v1-56 local-sphere) 0.0 -4096.0 0.0 2867.2) + ) + (let ((v1-58 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-58 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-58 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-58 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-58 transform-index) 16) + (set-vector! (-> v1-58 local-sphere) 0.0 -8192.0 0.0 2867.2) + ) + (let ((v1-60 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-60 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-60 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-60 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-60 transform-index) 16) + (set-vector! (-> v1-60 local-sphere) 0.0 -12288.0 0.0 2867.2) + ) + (let ((v1-62 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-62 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-62 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-62 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-62 transform-index) 15) + (set-vector! (-> v1-62 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-64 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-64 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-64 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-64 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-64 transform-index) 15) + (set-vector! (-> v1-64 local-sphere) 0.0 4096.0 0.0 2867.2) + ) + (let ((v1-66 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-66 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-66 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-66 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-66 transform-index) 15) + (set-vector! (-> v1-66 local-sphere) 0.0 8192.0 0.0 2867.2) + ) + (let ((v1-68 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-68 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-68 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-68 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-68 transform-index) 15) + (set-vector! (-> v1-68 local-sphere) 0.0 12288.0 0.0 2867.2) + ) + (let ((v1-70 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-70 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-70 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-70 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-70 transform-index) 14) + (set-vector! (-> v1-70 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-72 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-72 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-72 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-72 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-72 transform-index) 14) + (set-vector! (-> v1-72 local-sphere) 0.0 4096.0 0.0 2867.2) + ) + (let ((v1-74 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-74 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-74 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-74 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-74 transform-index) 14) + (set-vector! (-> v1-74 local-sphere) 0.0 8192.0 0.0 2867.2) + ) + (let ((v1-76 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-76 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-76 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-76 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-76 transform-index) 14) + (set-vector! (-> v1-76 local-sphere) 0.0 12288.0 0.0 2867.2) + ) + (set! (-> s5-0 nav-radius) 16384.0) + (let ((v1-78 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-78 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-78 prim-core collide-with)) + ) + (set! (-> obj root-override2) s5-0) + ) + 0 + (none) + ) + +(defmethod coin-flip? bombbot ((obj bombbot)) + "@returns The result of a 50/50 RNG roll" + #f + ) + +(defun bombbot-callback ((arg0 cspace) (arg1 transformq)) + (local-vars + (sv-176 (function quaternion quaternion quaternion quaternion)) + (sv-192 quaternion) + (sv-208 quaternion) + (sv-224 vector) + (sv-240 vector) + ) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (the-as bombbot (-> arg0 param1)))) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) *unity-quaternion*)) + ) + (let ((f30-0 0.0) + (s2-0 (vector-reset! (new 'stack-no-clear 'vector))) + ) + (dotimes (s0-0 4) + (let ((v1-3 (-> s4-0 feet s0-0))) + (let ((a1-2 s2-0)) + (let ((a0-2 s2-0)) + (let ((a2-1 (+ (the-as uint (-> s4-0 feet 0 real-position)) (* 112 s0-0)))) + (let ((a3-3 0.25)) + (.mov vf7 a3-3) + ) + (.lvf vf5 (&-> (the-as (pointer int128) a2-1))) + ) + (.lvf vf4 (&-> a0-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 (&-> a1-2 quad) vf6) + ) + (set! (-> v1-3 main-y) (- (-> s4-0 feet s0-0 real-position y) (-> s4-0 root-override2 trans y))) + (set! (-> v1-3 main-y) (-> v1-3 delta-y)) + (+! f30-0 (* 0.25 (-> v1-3 main-y))) + (set! (-> s1-0 quad) (-> v1-3 pos-offset quad)) + (set! (-> s1-0 y) (* -2.0 (-> v1-3 main-y))) + (new 'stack-no-clear 'vector) + (set! sv-224 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> v1-3 pos-offset) 1.0)) + ) + (set! sv-240 (vector-normalize-copy! (new 'stack-no-clear 'vector) s1-0 1.0)) + (let ((f0-8 (vector-vector-angle-safe sv-224 sv-240))) + (when (!= f0-8 0.0) + (set! sv-176 quaternion*!) + (set! sv-192 s3-0) + (set! sv-208 s3-0) + (let ((t9-4 quaternion-vector-angle!) + (a0-14 (new 'stack-no-clear 'quaternion)) + (a1-8 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> sv-224 quad)) + (.lvf vf2 (&-> sv-240 quad)) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> a1-8 quad) vf3) + (let ((a2-5 (t9-4 a0-14 a1-8 f0-8))) + (sv-176 sv-192 sv-208 a2-5) + ) + ) + ) + ) + ) + (let* ((f0-9 0.0) + (f0-10 (+ -16384.0 f0-9)) + (f2-0 (- f30-0 (-> s4-0 main-pos-y))) + (f1-7 (- (-> s4-0 main-spd-y))) + (f0-12 (+ f0-10 (* 60.0 f2-0) (* 10.0 f1-7))) + ) + (+! (-> s4-0 main-spd-y) (* f0-12 (-> pp clock seconds-per-frame))) + ) + (+! (-> s4-0 main-pos-y) (* (-> s4-0 main-spd-y) (-> pp clock seconds-per-frame))) + (vector-! s2-0 s2-0 (-> s4-0 root-override2 trans)) + (vector-inv-orient-by-quat! s2-0 s2-0 (-> s4-0 root-override2 quat)) + (let ((a1-13 (-> s4-0 main-pos))) + (let ((v1-19 (-> s4-0 main-pos))) + (let ((a0-20 (vector-! (new 'stack-no-clear 'vector) s2-0 (-> s4-0 main-pos)))) + (let ((a2-10 (* 4.0 (-> pp clock seconds-per-frame)))) + (.mov vf7 a2-10) + ) + (.lvf vf5 (&-> a0-20 quad)) + ) + (.lvf vf4 (&-> v1-19 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-13 quad) vf6) + ) + ) + (quaternion-slerp! (-> s4-0 main-quat) (-> s4-0 main-quat) s3-0 0.8) + ) + (quaternion-copy! (-> arg1 quat) (-> s4-0 main-quat)) + (set! (-> arg1 trans quad) (-> s4-0 main-pos quad)) + (set! (-> arg1 trans y) (+ 16384.0 (-> s4-0 main-pos-y))) + (quaternion-copy! (-> arg1 quat) (-> s4-0 rigidbody state rotation)) + (let ((s3-1 (-> arg1 trans)) + (v1-23 (-> s4-0 rigidbody)) + (a1-17 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 quad) (-> (rigid-body-method-23 (-> v1-23 state) a1-17) quad)) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + ) + +(defun bombbot-head-callback ((arg0 cspace) (arg1 transformq)) + (with-pp + (let ((s4-0 (the-as bombbot (-> arg0 param1)))) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'quaternion)) + ) + (let ((a1-1 (-> s4-0 nav state))) + (set! (-> s2-0 quad) (-> a1-1 target-post quad)) + ) + (vector-! s2-0 s2-0 (-> s4-0 root-override2 trans)) + (set! (-> s2-0 y) 0.0) + (vector-normalize! s2-0 1.0) + (quaternion-from-two-vectors! + s3-0 + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 root-override2 quat)) + s2-0 + ) + (quaternion-smooth-seek! (-> s4-0 top-quat) (-> s4-0 top-quat) s3-0 (* 4.0 (-> pp clock seconds-per-frame))) + ) + (quaternion-copy! (-> arg1 quat) (-> s4-0 top-quat)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +(defun bombbot-gun-swivel-callback ((arg0 cspace) (arg1 transformq)) + (local-vars (sv-128 vector) (sv-144 vector) (sv-160 vector)) + (with-pp + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (cspace<-parented-transformq-joint! arg0 arg1) + (let ((s3-0 (the-as bombbot (-> arg0 param1)))) + (set! sv-160 (new 'stack-no-clear 'vector)) + (let ((s4-0 (new 'stack-no-clear 'quaternion)) + (s0-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s5-0 (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector))) + ) + (set! sv-144 sv-160) + (set! sv-128 (-> s3-0 target-pos)) + (let ((v0-2 (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector)))) + (.lvf vf4 (&-> sv-128 quad)) + (.lvf vf5 (&-> v0-2 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-144 quad) vf6) + (rot-zxy-from-vector! s0-0 (-> arg0 bone transform vector 2)) + (rot-zxy-from-vector! s0-0 *z-vector*) + (rot-zxy-from-vector! s1-0 sv-160) + (set! (-> s2-0 x) (deg- (-> s1-0 x) (-> s0-0 x))) + (set! (-> s2-0 y) (deg- (-> s1-0 y) (-> s0-0 y))) + (set! (-> s2-0 y) (deg- (-> s1-0 y) 0.0)) + (set! (-> s3-0 angle-turret) + (deg-seek (-> s3-0 angle-turret) (-> s2-0 y) (* 36408.89 (-> pp clock seconds-per-frame))) + ) + (quaternion-vector-angle! s4-0 *up-vector* (-> s3-0 angle-turret)) + (quaternion->matrix (-> arg0 bone transform) s4-0) + (set! (-> arg0 bone transform trans quad) (-> s5-0 quad)) + ) + ) + 0 + (none) + ) + ) + ) + +(defun bombbot-gun-callback ((arg0 cspace) (arg1 transformq)) + (local-vars (sv-112 vector) (sv-128 vector)) + (with-pp + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (cspace<-parented-transformq-joint! arg0 arg1) + (let ((s4-0 (the-as bombbot (-> arg0 param1)))) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! sv-128 s0-0) + (set! sv-112 (-> s4-0 target-pos)) + (let ((v0-1 (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector)))) + (.lvf vf4 (&-> sv-112 quad)) + (.lvf vf5 (&-> v0-1 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-128 quad) vf6) + (rot-zxy-from-vector! s2-0 (-> arg0 bone transform vector 2)) + (rot-zxy-from-vector! s1-0 s0-0) + (set! (-> s3-0 x) (fmax -2730.6667 (fmin 2730.6667 (deg- (-> s1-0 x) (-> s2-0 x))))) + (set! (-> s3-0 y) (deg- (-> s1-0 y) (-> s2-0 y))) + (set! (-> s4-0 angle-gun) + (deg-seek (-> s4-0 angle-gun) (-> s3-0 x) (* 7281.778 (-> pp clock seconds-per-frame))) + ) + ) + ) + (quaternion-vector-angle! (-> arg1 quat) *x-vector* (-> s4-0 angle-gun)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + ) + +(deftype spring-setup (structure) + ((bpos1 vector :offset-assert 0) + (wpos2 vector :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + + +(define *bombbot-spring-setup* (new 'static 'boxed-array :type spring-setup + (new 'static 'spring-setup + :bpos1 (new 'static 'vector :x 4096.0 :y -4096.0 :z 4096.0 :w 1.0) + :wpos2 (new 'static 'vector :x 6144.0 :y 14336.0 :z 6144.0 :w 1.0) + ) + (new 'static 'spring-setup + :bpos1 (new 'static 'vector :x 4096.0 :y -4096.0 :z -4096.0 :w 1.0) + :wpos2 (new 'static 'vector :x 6144.0 :y 14336.0 :z -6144.0 :w 1.0) + ) + (new 'static 'spring-setup + :bpos1 (new 'static 'vector :x -4096.0 :y -4096.0 :z -4096.0 :w 1.0) + :wpos2 (new 'static 'vector :x -6144.0 :y 14336.0 :z -6144.0 :w 1.0) + ) + (new 'static 'spring-setup + :bpos1 (new 'static 'vector :x -4096.0 :y -4096.0 :z 4096.0 :w 1.0) + :wpos2 (new 'static 'vector :x -6144.0 :y 14336.0 :z 6144.0 :w 1.0) + ) + ) + ) + +(defmethod bombbot-method-183 bombbot ((obj bombbot)) + (local-vars (at-0 int) (sv-160 vector) (sv-176 vector)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (vector-reset! a1-0) + (set! (-> a1-0 y) (* -1.0 (-> obj info gravity) (-> obj rigidbody state info mass))) + (rigid-body-method-20 (-> obj rigidbody state) a1-0) + ) + (rigid-body-method-24 (-> obj rigidbody state)) + (logclear! (-> obj rigidbody state flags) (rigid-body-flag active)) + (dotimes (s5-0 4) + (let ((s4-0 (vector-matrix*! + (new 'stack-no-clear 'vector) + (-> *bombbot-spring-setup* s5-0 bpos1) + (-> obj rigidbody state matrix) + ) + ) + ) + (set! sv-160 (new 'stack-no-clear 'vector)) + (let ((v1-22 (-> *bombbot-spring-setup* s5-0 wpos2 quad))) + (set! (-> sv-160 quad) v1-22) + ) + (set! sv-176 (new 'stack-no-clear 'vector)) + (let ((s0-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> sv-160 y) (* (-> obj legs-strength s5-0) (-> sv-160 y))) + (+! (-> sv-160 y) (-> obj feet s5-0 main-y)) + 0.0 + 0.0 + 0.0 + (let ((v1-33 (-> obj rigidbody)) + (a1-3 s4-0) + (a2-1 sv-176) + ) + (rigid-body-method-22 (-> v1-33 state) a1-3 a2-1) + ) + (let ((v1-36 s0-0)) + (.lvf vf4 (&-> s4-0 quad)) + (.lvf vf5 (&-> sv-160 quad)) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-36 quad) vf6) + ) + (let ((a1-4 s1-0) + (v1-37 *null-vector*) + ) + (vector-! a1-4 sv-176 v1-37) + ) + (let ((f0-10 (vector-length s0-0))) + (vector-float*! s2-0 s0-0 (/ 1.0 f0-10)) + (let ((f0-12 (* 60.0 (+ -40.96 f0-10))) + (f1-8 (* 0.8 (vector-dot s1-0 s2-0))) + ) + (vector-float*! s3-0 s2-0 (- (+ f0-12 f1-8))) + ) + ) + (rigid-body-method-18 (-> obj rigidbody state) s4-0 s3-0) + ) + ) + ) + (let ((v1-54 (new 'stack-no-clear 'vector))) + (.lvf vf1 (&-> (-> obj linear-speed) quad)) + (let ((f0-15 (-> pp clock frames-per-second))) + (.mov at-0 f0-15) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-54 quad) vf1) + ) + 0 + (none) + ) + ) + ) + +(defmethod bombbot-method-184 bombbot ((obj bombbot)) + (with-pp + (rigid-body-control-method-10 + (-> obj rigidbody) + (the-as rigid-body-object obj) + (-> pp clock seconds-per-frame) + 0.033333335 + ) + 0 + (none) + ) + ) + +(defmethod init-enemy! bombbot ((obj bombbot)) + "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-bombbot" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-enemy-behaviour-and-stats! obj *bombbot-nav-enemy-info*) + (set-vector! (-> obj root-override2 scale) 1.0 1.0 1.0 1.0) + (let ((v1-7 (-> obj nav))) + (set! (-> v1-7 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> obj root-override2 dynam) 573440.0) + (logior! (-> obj nav flags) (nav-control-flag momentum-ignore-heading)) + (dotimes (s5-1 4) + (set! (-> obj joint-ik s5-1) + (new + 'process + 'joint-mod-ik + obj + (-> *bombbot-ik-setup* s5-1 elbow-index) + (-> *bombbot-ik-setup* s5-1 hand-dist) + ) + ) + (set! (-> obj joint-ik s5-1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> obj joint-ik s5-1 elbow-rotation-axis) (the-as uint 0)) + ) + (logior! (-> obj joint-ik 1 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> obj joint-ik 3 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> obj joint-ik 0 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> obj joint-ik 1 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> obj joint-ik 2 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> obj joint-ik 3 flags) (joint-mod-ik-flags elbow-rot-neg)) + (let ((f1-0 11878.4) + (f0-6 10240.0) + ) + (let ((f2-0 -10240.0)) + (let ((v1-51 (-> obj feet))) + (set! (-> v1-51 0 pos-offset x) f1-0) + (set! (-> v1-51 0 pos-offset y) 0.0) + (set! (-> v1-51 0 pos-offset z) f0-6) + (set! (-> v1-51 0 pos-offset w) 1.0) + ) + (set! (-> obj feet 0 offset) 0.0) + (let ((v1-52 (-> obj feet 1))) + (set! (-> v1-52 pos-offset x) f1-0) + (set! (-> v1-52 pos-offset y) 0.0) + (set! (-> v1-52 pos-offset z) f2-0) + (set! (-> v1-52 pos-offset w) 1.0) + ) + (set! (-> obj feet 1 offset) 0.5) + (let ((v1-54 (-> obj feet 2))) + (set! (-> v1-54 pos-offset x) (- f1-0)) + (set! (-> v1-54 pos-offset y) 0.0) + (set! (-> v1-54 pos-offset z) f2-0) + (set! (-> v1-54 pos-offset w) 1.0) + ) + ) + (set! (-> obj feet 2 offset) 0.1) + (let ((v1-56 (-> obj feet 3))) + (set! (-> v1-56 pos-offset x) (- f1-0)) + (set! (-> v1-56 pos-offset y) 0.0) + (set! (-> v1-56 pos-offset z) f0-6) + (set! (-> v1-56 pos-offset w) 1.0) + ) + ) + (set! (-> obj feet 3 offset) 0.6) + (quaternion-copy! (-> obj last-quat) (-> obj root-override2 quat)) + (quaternion-copy! (-> obj main-quat) *unity-quaternion*) + (let ((v1-60 (-> obj nav))) + (set! (-> v1-60 sphere-mask) (the-as uint 64)) + ) + 0 + (let ((a0-28 (-> obj node-list data 3))) + (set! (-> a0-28 param0) bombbot-callback) + (set! (-> a0-28 param1) obj) + ) + (let ((a0-29 (-> obj node-list data 4))) + (set! (-> a0-29 param0) bombbot-head-callback) + (set! (-> a0-29 param1) obj) + ) + (let ((a0-30 (-> obj node-list data 5))) + (set! (-> a0-30 param0) bombbot-gun-swivel-callback) + (set! (-> a0-30 param1) obj) + ) + (let ((a0-31 (-> obj node-list data 6))) + (set! (-> a0-31 param0) bombbot-gun-callback) + (set! (-> a0-31 param1) obj) + ) + (set! (-> obj rigidbody) (new 'process 'rigid-body-control obj)) + (set! (-> obj info) *bombbot-body-constants*) + (rigid-body-method-25 + (-> obj rigidbody state) + (-> obj info info) + *null-vector* + *unity-quaternion* + (method-of-object obj bombbot-method-183) + ) + (set! (-> obj shield-hit-points) 3.0) + (set! (-> obj lazer-sound) (the-as uint (new-sound-id))) + (set! (-> obj head-sound) (the-as uint 0)) + (set! (-> obj cannon-sound) (the-as uint 0)) + (transform-post) + (dotimes (s5-2 4) + (let ((s4-1 (-> obj feet s5-2))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-orient-by-quat! s3-0 (-> s4-1 pos-offset) (-> obj root-override2 quat)) + (vector+! s3-0 s3-0 (-> obj root-override2 trans)) + (set! (-> s4-1 next-position quad) (-> s3-0 quad)) + (set! (-> s4-1 position quad) (-> s3-0 quad)) + ) + (set! (-> s4-1 delta-y) 0.0) + ) + (set! (-> obj legs-strength s5-2) 1.0) + ) + (set! (-> obj draw light-index) (the-as uint 10)) + 0 + (none) + ) + +(deftype bombbot-spawn-params (structure) + ((position vector :inline :offset-assert 0) + (quat quaternion :inline :offset-assert 16) + (nav-mesh basic :offset-assert 32) + (path bombbot-path :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + + +;; WARN: Return type mismatch object vs none. +(defbehavior bombbot-init-by-other bombbot ((arg0 bombbot-spawn-params)) + (stack-size-set! (-> self main-thread) 512) + (set! (-> self city-path) (-> arg0 path)) + (set! (-> self current-node) (the-as uint 0)) + (init-enemy-collision! self) + (set! (-> self root-override2 trans quad) (-> self city-path node (-> self current-node) position quad)) + (quaternion-copy! (-> self root-override2 quat) (-> arg0 quat)) + (vector-identity! (-> self root-override2 scale)) + (-> arg0 nav-mesh) + (set! (-> *bombbot-nav-enemy-info* nav-mesh) *default-nav-mesh*) + (init-enemy! self) + (set! (-> self shot-count) (the-as uint 5)) + (set! (-> self last-trans quad) (-> self root-override2 trans quad)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 15) (the-as int #f) (the-as vector #t) 0)) + (set! (-> self mask) (logior (process-mask enemy guard) (-> self mask))) + (go-virtual hostile) + (none) + ) + +(set-subtask-hook! + *game-info* + 186 + 0 + (the-as (function object) (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0 32) + (set-setting! 'exclusive-task #f 0 (-> self node-info task)) + (set! (-> self data-int32 0) 0) + 0 + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 186 + 1 + (the-as + (function object) + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + ) + +(set-subtask-hook! + *game-info* + 186 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (when (nonzero? (-> self data-int32 0)) + (let ((gp-0 0)) + (let ((s5-0 10000)) + (dotimes (s4-0 3) + (let* ((s2-0 (-> self slave s4-0 process 0)) + (s3-0 (if (type? s2-0 bombbot) + (the-as bombbot s2-0) + ) + ) + ) + (when s3-0 + (+! gp-0 1) + (let ((v1-14 + (the int (* 0.000030517578 (vector-vector-xz-distance + (-> s3-0 root-override2 trans) + (the-as vector (-> s3-0 city-path node (+ (-> s3-0 city-path node-count) -1))) + ) + ) + ) + ) + ) + (if (< v1-14 s5-0) + (set! s5-0 v1-14) + ) + ) + (when (= (-> s3-0 current-node) (+ (-> s3-0 city-path node-count) -1)) + ) + ) + ) + ) + (set! (-> self data-int32 1) s5-0) + (cond + ((< s5-0 10) + (set! (-> *game-info* timer) (the-as time-frame (the int (* 300.0 (the float s5-0))))) + (let ((v1-25 (handle->process (-> self hud-timer)))) + (if (and *target* (not v1-25)) + (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) + ) + ) + (when (zero? s5-0) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + (go-virtual fail) + ) + ) + (else + (if (handle->process (-> self hud-timer)) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + ) + ) + ) + ) + (if (zero? gp-0) + (go-virtual complete) + ) + ) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 186 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (while (!= (-> (level-get-target-inside *level*) name) 'ctysluma) + (suspend) + ) + (set! (-> self data-int32 0) 1) + (set-setting! 'airlock #f 0 0) + (set-setting! 'sound-mode #f 0 1) + (let ((gp-1 *traffic-manager*)) + (send-event gp-1 'set-guard-target-count-range 4 0 0) + (send-event gp-1 'set-guard-target-count-range 5 0 0) + ) + (let ((gp-2 (new 'stack 'bombbot-spawn-params))) + (set! (-> gp-2 nav-mesh) (get-nav-mesh (the-as actor-id 9592))) + (set! (-> gp-2 position quad) + (-> (new 'static 'quaternion :x 4387619.0 :y 37262.54 :z 230567.11 :w 1.0) quad) + ) + (quaternion-copy! (-> gp-2 quat) (new 'static 'quaternion :x 0.0006 :y -0.8345 :z -0.0013 :w -0.5509)) + (set! (-> gp-2 path) *bombbot-path-1*) + (set! (-> self slave 0) (ppointer->handle (process-spawn bombbot gp-2 :to self))) + (set! (-> gp-2 path) *bombbot-path-2*) + (set! (-> self slave 1) (ppointer->handle (process-spawn bombbot gp-2 :to self))) + (set! (-> gp-2 path) *bombbot-path-3*) + (set! (-> self slave 2) (ppointer->handle (process-spawn bombbot gp-2 :to self))) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 186 + 4 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (talker-spawn-func (-> *talker-speech* 117) *entity-pool* (target-pos 0) (the-as region #f)) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 186 + 5 + (the-as + (function object) + (lambda :behavior task-manager + () + (when (and *target* + (not (logtest? (-> *target* focus-status) (focus-status dead))) + (zero? (-> self data-int32 1)) + (nonzero? (-> self data-int32 0)) + ) + (cond + ((= (level-status *level* 'ctysluma) 'active) + (set-setting! 'entity-name "camera-236" 0 0) + (set-setting! 'minimap 'clear 0 128) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "bbotxplo" -99.0 0) + (dotimes (gp-1 3) + (let* ((s5-0 (-> self slave gp-1 process 0)) + (a0-7 (if (type? s5-0 bombbot) + s5-0 + ) + ) + ) + (if a0-7 + (send-event a0-7 'explode) + ) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.3)) + (suspend) + ) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (-> self clock seconds-per-frame) + (bucket-id tex-all-map) + ) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (suspend) + ) + (set-setting! 'interp-time 'abs 0 0) + (remove-setting! 'entity-name) + ) + (else + ) + ) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 186 + 1 + (the-as (function object) (lambda :behavior task-manager () (disable *screen-filter*) (none))) + ) + +(set-subtask-hook! + *game-info* + 297 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0 32) + (set-setting! 'airlock #f 0 0) + (set-setting! 'exclusive-task #f 0 (-> self node-info task)) + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'set-guard-target-count-range 4 0 0) + (send-event gp-0 'set-guard-target-count-range 5 0 0) + ) + (let ((gp-1 (new 'stack 'bombbot-spawn-params))) + (set! (-> gp-1 nav-mesh) (get-nav-mesh (the-as actor-id 9592))) + (set! (-> gp-1 position quad) + (-> (new 'static 'quaternion :x 4387619.0 :y 37262.54 :z 230567.11 :w 1.0) quad) + ) + (quaternion-copy! (-> gp-1 quat) (new 'static 'quaternion :x 0.0006 :y -0.8345 :z -0.0013 :w -0.5509)) + (set! (-> gp-1 path) *bombbot-path-4*) + (set! (-> self slave 0) (ppointer->handle (process-spawn bombbot gp-1 :to self))) + (set! (-> gp-1 path) *bombbot-path-5*) + (set! (-> self slave 1) (ppointer->handle (process-spawn bombbot gp-1 :to self))) + (set! (-> gp-1 path) *bombbot-path-6*) + (set! (-> self slave 2) (ppointer->handle (process-spawn bombbot gp-1 :to self))) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 297 + 1 + (the-as + (function object) + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + ) + +(set-subtask-hook! + *game-info* + 297 + 2 + (the-as (function object) (lambda :behavior task-manager + () + (let ((gp-0 0)) + 10000 + (dotimes (s5-0 3) + (let* ((s4-0 (-> self slave s5-0 process 0)) + (v1-6 (if (type? s4-0 bombbot) + (the-as bombbot s4-0) + ) + ) + ) + (when v1-6 + (+! gp-0 1) + (when (= (-> v1-6 current-node) (+ (-> v1-6 city-path node-count) -1)) + (set! (-> v1-6 current-node) (the-as uint 0)) + 0 + ) + ) + ) + ) + (if (zero? gp-0) + (go-virtual complete) + ) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 297 + 3 + (the-as (function object) (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (until #f + (suspend) + ) + #f + (none) + ) + ) + ) diff --git a/goal_src/jak2/levels/common/enemy/hopper.gc b/goal_src/jak2/levels/common/enemy/hopper.gc index a96c96e50e..8011f08bd8 100644 --- a/goal_src/jak2/levels/common/enemy/hopper.gc +++ b/goal_src/jak2/levels/common/enemy/hopper.gc @@ -202,7 +202,72 @@ :default-hit-points 1 :gnd-collide-with (collide-spec backgnd) :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #xffffffffffffffff + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-giant + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + penetrate-33 + penetrate-34 + penetrate-35 + penetrate-36 + penetrate-37 + penetrate-38 + penetrate-39 + penetrate-40 + penetrate-41 + penetrate-42 + penetrate-43 + penetrate-44 + penetrate-45 + penetrate-46 + penetrate-47 + penetrate-48 + penetrate-49 + penetrate-50 + penetrate-51 + penetrate-52 + penetrate-53 + penetrate-54 + penetrate-55 + penetrate-56 + penetrate-57 + penetrate-58 + penetrate-59 + penetrate-60 + penetrate-61 + penetrate-62 + penetrate-63 + ) :movement-gravity (meters -100) :friction 0.8 :attack-shove-back (meters 3) @@ -289,7 +354,6 @@ ((method-of-type nav-enemy kill-prefer-falling) obj) ) ) - (none) ) (defmethod enemy-method-90 hopper ((obj hopper) (arg0 int) (arg1 enemy-jump-info)) diff --git a/goal_src/jak2/levels/demo/demo-obs.gc b/goal_src/jak2/levels/demo/demo-obs.gc index 03ca82470d..22b48cc6fb 100644 --- a/goal_src/jak2/levels/demo/demo-obs.gc +++ b/goal_src/jak2/levels/demo/demo-obs.gc @@ -5,5 +5,1585 @@ ;; name in dgo: demo-obs ;; dgos: DEMO +(declare-type demo-control process) +(define-extern *demo-control* (pointer demo-control)) + ;; DECOMP BEGINS +(deftype demo-control (process) + ((selected int32 :offset-assert 128) + (sprites hud-sprite 2 :inline :offset-assert 144) + (sprite-pos vector :inline :offset-assert 272) + (sprite-draw uint32 :offset-assert 288) + (buffer external-art-buffer 2 :offset-assert 292) + (want int32 2 :offset-assert 300) + (have int32 2 :offset-assert 308) + (draw int32 :offset-assert 316) + (active symbol :offset-assert 320) + (spark-time time-frame :offset-assert 328) + (gui-id uint32 :offset-assert 336) + ) + :heap-base #xe0 + :method-count-assert 15 + :size-assert #x154 + :flag-assert #xf00e00154 + (:methods + (idle () _type_ :state 14) + ) + ) + + +;; WARN: Return type mismatch process vs demo-control. +(defmethod relocate demo-control ((obj demo-control) (arg0 int)) + (dotimes (v1-0 2) + (if (nonzero? (-> obj buffer v1-0)) + (&+! (-> obj buffer v1-0) arg0) + ) + ) + (the-as demo-control ((method-of-type process relocate) obj arg0)) + ) + +(defmethod deactivate demo-control ((obj demo-control)) + (dotimes (s5-0 2) + (set-pending-file (-> obj buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) + ) + (dotimes (s5-1 2) + (update (-> obj buffer s5-1)) + ) + ((method-of-type process deactivate) obj) + (none) + ) + +(defskelgroup skel-jak-demo-logo jak-logo jak-logo-lod0-jg -1 + ((jak-logo-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 20) + :origin-joint-index 3 + ) + +(defskelgroup skel-jak-demo-stand jak-stand jak-stand-lod0-jg -1 + ((jak-stand-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 20) + :origin-joint-index 3 + ) + +;; WARN: Return type mismatch time-frame vs none. +(defun demo-plug-lightning ((arg0 process-drawable) (arg1 vector) (arg2 cspace)) + (local-vars (sv-32 cspace) (sv-48 int) (sv-64 symbol) (sv-80 int) (sv-96 vector)) + (set! sv-32 arg2) + (let ((s5-0 (get-process *default-dead-pool* lightning-tracker #x4000))) + (when s5-0 + (let ((t9-1 (method-of-type lightning-tracker activate))) + (t9-1 + (the-as lightning-tracker s5-0) + *entity-pool* + (symbol->string (-> lightning-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((s3-0 run-function-in-process) + (s2-0 s5-0) + (s1-0 lightning-tracker-init) + (s0-0 (-> *lightning-spec-id-table* 1)) + ) + (set! sv-48 30) + (set! sv-64 (the-as symbol #f)) + (set! sv-80 (+ (-> sv-32 joint number) 1)) + (set! sv-96 (new 'stack-no-clear 'vector)) + (set! (-> sv-96 x) (+ (-> arg1 x) (rand-vu-float-range -4096.0 4096.0))) + (set! (-> sv-96 y) (+ (-> arg1 y) (rand-vu-float-range -4096.0 4096.0))) + (set! (-> sv-96 z) (+ (-> arg1 z) (rand-vu-float-range -4096.0 4096.0))) + (set! (-> sv-96 w) 1.0) + ((the-as (function object object object object object object object object none) s3-0) + s2-0 + s1-0 + s0-0 + sv-48 + sv-64 + arg0 + sv-80 + sv-96 + ) + ) + (-> s5-0 ppointer) + ) + ) + (let ((v1-20 (handle->process (-> *game-info* controller 0)))) + (if v1-20 + (set! (-> (the-as demo-control v1-20) spark-time) (-> *display* base-clock frame-counter)) + ) + ) + (none) + ) + +(scene-method-16 + (new 'static 'scene + :name "demo-disk-intro" + :extra #f + :info #f + :mask-to-clear #x1000000 + :entity "scene-stage-47" + :art-group "scenecamera" + :anim "demo-disk-intro" + :parts 10 + :command-list '((0 + (want-force-vis 'ctysluma #t) + (want-force-vis 'ctywide #t) + (kill "ctysluma-part-181") + (kill "ctysluma-part-182") + (kill "ctysluma-part-187") + (kill "ctysluma-part-188") + (send-event "jak-demo-logo" 'color-mult 0 0 0 1) + (apply + ,(lambda () + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 23) + (send-event (ppointer->process *time-of-day*) 'change 'minute 0) + (send-event (ppointer->process *time-of-day*) 'change 'second 0) + (none) + ) + ) + (joint-eval + ,(lambda ((arg0 process-drawable)) + (logior! (-> arg0 draw global-effect) (draw-control-global-effect title-light)) + (case (scf-get-territory) + ((1) + (case (-> *setting-control* user-current language) + (((language-enum spanish)) + (send-event arg0 'segment 32 0) + ) + (((language-enum french)) + (send-event arg0 'segment 64 0) + ) + (else + (send-event arg0 'segment 512 0) + ) + ) + ) + ((2) + (send-event arg0 'segment 256 0) + ) + ) + (none) + ) + entity + "jak-demo-logo" + joint + "plugsparks" + ) + (fadein (seconds (new 'static 'bfloat :data 1.0))) + ) + (10 (want-force-vis 'ctysluma #f) (want-force-vis 'ctywide #f) (send-event *target* 'change-mode 'demo)) + (991 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + (part-tracker + "group-demo-plug" + entity + "jak-demo-logo" + joint + "plugsparks" + track + #t + duration + (frame-range (new 'static 'bfloat :data 991.0) (new 'static 'bfloat :data 1011.0)) + ) + ) + (992 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (998 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (999 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (1004 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (1005 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (1008 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 0.85) + (new 'static 'bfloat :data 0.85) + (new 'static 'bfloat :data 0.85) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (1009 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (1010 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (1011 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (1012 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + ) + ) + (1013 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + ) + (1033 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + ) + ) + (1063 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 1.0) + ) + ) + (1073 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + ) + (send-event "jak-demo-logo" 'segment 2 0) + ) + (1105 + (apply + ,(lambda ((arg0 process-drawable) (arg1 vector) (arg2 cspace)) + (with-pp + (let ((v1-1 + (lookup-gui-connection *gui-control* pp (gui-channel art-load) (the-as string #f) (new 'static 'sound-id)) + ) + ) + (if v1-1 + (sound-pause (-> v1-1 id)) + ) + ) + (send-event (handle->process (-> *game-info* controller 0)) 'pause) + (time-of-day-setup #t) + (the-as object (remove-setting! 'half-speed)) + ) + ) + ) + ) + ) + :cut-list '() + :wait-ground-time (seconds 1) + :draw-target #f + :abort #f + :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 'demo + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :light-index #x1e + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-demo-logo" + :level 'demo + :art-group "skel-jak-demo-logo" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x6e + ) + (new 'static 'scene-actor + :name "jak-demo-stand" + :level 'demo + :art-group "skel-jak-demo-stand" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "demo-movie" + :end-point-obj "demo-movie-end" + :borrow '() + :sfx-volume 1.0 + :ambient-volume 1.0 + :blackout-end #f + :peaceful #t + :music-delay 1500.0 + :save #t + ) + ) + +(defbehavior demo-screen-change demo-control ((arg0 symbol) (arg1 int) (arg2 symbol) (arg3 int)) + (when arg3 + (let ((s3-0 (the-as int (-> *setting-control* user-current language)))) + (if (and (= (the-as language-enum s3-0) (language-enum english)) (= (scf-get-territory) 1)) + (set! s3-0 7) + ) + (if (>= (the-as int arg0) 0) + (set! arg0 (the-as symbol (+ (the-as uint arg0) (* 3 s3-0)))) + ) + (if (>= arg1 0) + (+! arg1 (* 3 s3-0)) + ) + ) + ) + (set! (-> self want 0) (the-as int arg0)) + (set! (-> self want 1) (-> self draw)) + (when arg2 + (set-setting! 'bg-a 'abs #x3f800000 0) + (set! (-> *setting-control* user-current bg-a) 1.0) + (apply-settings *setting-control*) + ) + (when (>= (-> self draw) 0) + (set-setting! 'bg-a 'abs #x3f800000 0) + (apply-settings *setting-control*) + (while (!= (-> *setting-control* user-current bg-a) 1.0) + (suspend) + ) + ) + (set! (-> self draw) (the-as int arg0)) + (set! (-> self active) #f) + (while (and (>= (-> self draw) 0) (not (-> self active))) + (suspend) + ) + (remove-setting! 'bg-a) + (set! (-> self want 1) arg1) + 0 + (none) + ) + +(defun demo-wait-for-press ((arg0 time-frame) (arg1 time-frame) (arg2 symbol)) + (with-pp + (let ((s4-0 (-> pp clock frame-counter)) + (s3-0 #f) + ) + (while (not (or (>= (- (-> pp clock frame-counter) s4-0) arg1) (and (>= (- (-> pp clock frame-counter) s4-0) arg0) s3-0)) + ) + (if (cpad-pressed? 0 triangle) + (set! s3-0 #t) + ) + (suspend) + ) + ) + #f + ) + ) + +;; WARN: Return type mismatch int vs object. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior demo-menu demo-control () + (local-vars (sv-112 font-context)) + (sound-play "dmenu-hit") + (let ((gp-1 (cond + ((= *kernel-boot-message* 'demo-shared) + (new 'static 'boxed-array :type uint32 #x24f #x250 #x123) + ) + ((= (scf-get-territory) 1) + (new 'static 'boxed-array :type uint32 #x24f #x250) + ) + (else + (new 'static 'boxed-array :type uint32 #x24f #x250 #x251) + ) + ) + ) + ) + (until #f + (when (not (paused?)) + (cond + ((and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (> (-> self selected) 0) + ) + (seekl! (-> self selected) 0 1) + (sound-play "dmenu-move") + ) + ((and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (< (-> self selected) (+ (-> gp-1 length) -1)) + ) + (seekl! (-> self selected) (+ (-> gp-1 length) -1) 1) + (sound-play "dmenu-move") + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (sound-play "dmenu-pick") + (return (the-as object (-> self selected))) + ) + ) + (set! sv-112 (new + 'stack + 'font-context + *font-default-matrix* + 64 + 312 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + (let ((v1-25 sv-112)) + (set! (-> v1-25 width) (the float 384)) + ) + (let ((v1-26 sv-112)) + (set! (-> v1-26 height) (the float 50)) + ) + (set! (-> sv-112 flags) (font-flags shadow kerning middle left large)) + (set! (-> sv-112 scale) 0.7) + (dotimes (s5-4 (-> gp-1 length)) + (if (= (-> self selected) s5-4) + (set! (-> sv-112 color) (font-color #f1f104)) + (set! (-> sv-112 color) (font-color #dadada)) + ) + (print-game-text + (lookup-text! *common-text* (the-as game-text-id (-> gp-1 s5-4)) #f) + sv-112 + #f + 44 + (bucket-id progress) + ) + (set! (-> sv-112 origin y) (+ 22.0 (-> sv-112 origin y))) + ) + ) + (suspend) + ) + ) + #f + -1 + ) + +(defstate idle (demo-control) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('pause) + (let ((v0-0 2)) + (set! (-> *game-info* demo-state) (the-as uint v0-0)) + v0-0 + ) + ) + ) + ) + ) + :code (behavior () + (let ((v1-1 (-> *game-info* demo-state))) + (cond + ((or (zero? v1-1) (= v1-1 1)) + (when (zero? (-> *game-info* demo-state)) + (case (scf-get-territory) + ((2) + (let ((t9-1 demo-screen-change) + (a0-3 25) + (a1-1 26) + (a2-0 #t) + ) + (t9-1 (the-as symbol a0-3) a1-1 a2-0 (the-as int #f)) + (let ((a1-2 (new 'stack-no-clear 'array 'symbol 6))) + (set! (-> a1-2 5) #f) + (set! (-> a1-2 4) #f) + (set! (-> a1-2 3) #f) + (set! (-> a1-2 2) 'ctywide) + (set! (-> a1-2 1) 'ctysluma) + (set! (-> a1-2 0) 'demo) + (want-levels *load-state* a1-2) + ) + (demo-wait-for-press (seconds 1) (seconds 5) a2-0) + ) + (let ((t9-4 demo-screen-change) + (a0-6 26) + (a1-4 -1) + (a2-1 #f) + ) + (t9-4 (the-as symbol a0-6) a1-4 a2-1 (the-as int #f)) + (demo-wait-for-press (seconds 1) (seconds 5) a2-1) + ) + (demo-screen-change (the-as symbol -1) -1 #f (the-as int #t)) + ) + ) + ) + (set! (-> *game-info* demo-state) (the-as uint 1)) + (let ((gp-1 + (ppointer->handle (process-spawn scene-player :init scene-player-init "demo-disk-intro" #t "demo-movie")) + ) + ) + (while (and (handle->process (the-as handle gp-1)) (= (-> *game-info* demo-state) 1)) + (if *target* + (set! (-> *target* control trans quad) (-> (math-camera-pos) quad)) + ) + (set! (-> *game-info* kiosk-timeout) (the-as uint (-> *display* game-clock frame-counter))) + (set! (-> *ACTOR-bank* birth-max) 1000) + (suspend) + ) + ) + (set! (-> *game-info* demo-state) (the-as uint 10)) + ) + ((= v1-1 10) + (set! (-> self gui-id) + (the-as uint (add-process *gui-control* self (gui-channel jak) (gui-action queue) "demoend" -99.0 0)) + ) + (if (and (!= (scf-get-territory) 2) (= (-> *setting-control* user-current language) (language-enum japanese))) + (demo-screen-change (the-as symbol 2) -1 #t (the-as int #f)) + (demo-screen-change (the-as symbol 2) -1 #t (the-as int #t)) + ) + (while (!= (get-status *gui-control* (the-as sound-id (-> self gui-id))) (gui-status ready)) + (suspend) + ) + (set-action! + *gui-control* + (gui-action play) + (the-as sound-id (-> self gui-id)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (cond + ((zero? (scf-get-territory)) + (let ((gp-3 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-3) (seconds 0.38)) + (suspend) + ) + ) + (set! (-> self sprite-draw) (the-as uint 3)) + (set-vector! (-> self sprite-pos) -512.0 40.0 0.0 1.0) + (let ((gp-4 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-4) (seconds 0.25)) + (set! (-> self sprite-pos x) + (lerp-scale -512.0 0.0 (sin (* 218.45334 (the float (- (-> self clock frame-counter) gp-4)))) 0.0 1.0) + ) + (suspend) + ) + ) + (let ((gp-5 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-5) (seconds 2)) + (suspend) + ) + ) + (let ((gp-6 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-6) (seconds 0.25)) + (set! (-> self sprite-pos x) + (lerp-scale 0.0 512.0 (sin (* 218.45334 (the float (- (-> self clock frame-counter) gp-6)))) 0.0 1.0) + ) + (suspend) + ) + ) + (set! (-> self sprite-draw) (the-as uint 1)) + (set-vector! (-> self sprite-pos) 30.0 -240.0 0.0 1.0) + (let ((gp-7 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-7) (seconds 0.25)) + (set! (-> self sprite-pos y) + (lerp-scale -240.0 270.0 (sin (* 218.45334 (the float (- (-> self clock frame-counter) gp-7)))) 0.0 1.0) + ) + (suspend) + ) + ) + (let ((gp-8 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-8) (seconds 2)) + (suspend) + ) + ) + (let ((gp-9 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-9) (seconds 0.25)) + (set! (-> self sprite-pos y) + (lerp-scale 270.0 720.0 (sin (* 218.45334 (the float (- (-> self clock frame-counter) gp-9)))) 0.0 1.0) + ) + (suspend) + ) + ) + (set! (-> self sprite-draw) (the-as uint 2)) + (set-vector! (-> self sprite-pos) 20.0 40.0 0.0 1.0) + (let ((gp-10 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-10) (seconds 0.25)) + (set! (-> self sprite-pos y) + (lerp-scale 720.0 20.0 (sin (* 218.45334 (the float (- (-> self clock frame-counter) gp-10)))) 0.0 1.0) + ) + (suspend) + ) + ) + (let ((a1-21 (new 'stack-no-clear 'array 'symbol 6))) + (set! (-> a1-21 5) #f) + (set! (-> a1-21 4) #f) + (set! (-> a1-21 3) #f) + (set! (-> a1-21 2) 'ctysluma) + (set! (-> a1-21 1) 'ctywide) + (set! (-> a1-21 0) 'demo) + (want-levels *load-state* a1-21) + ) + (let ((gp-11 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-11) (seconds 2)) + (suspend) + ) + ) + (let ((gp-12 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-12) (seconds 0.25)) + (set! (-> self sprite-pos y) + (lerp-scale 20.0 -720.0 (sin (* 218.45334 (the float (- (-> self clock frame-counter) gp-12)))) 0.0 1.0) + ) + (suspend) + ) + ) + ) + (else + (let ((gp-13 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-13) (seconds 0.38)) + (suspend) + ) + ) + (let ((gp-14 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-14) (seconds 2)) + (suspend) + ) + ) + (let ((gp-15 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-15) (seconds 0.25)) + (suspend) + ) + ) + (let ((gp-16 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-16) (seconds 0.25)) + (suspend) + ) + ) + (let ((gp-17 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-17) (seconds 2)) + (suspend) + ) + ) + (let ((gp-18 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-18) (seconds 0.25)) + (suspend) + ) + ) + (let ((gp-19 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-19) (seconds 0.25)) + (suspend) + ) + ) + (let ((gp-20 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-20) (seconds 2)) + (suspend) + ) + ) + (let ((gp-21 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-21) (seconds 0.25)) + (suspend) + ) + ) + ) + ) + (let ((gp-22 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-22) (seconds 3)) + (suspend) + ) + ) + (demo-screen-change (the-as symbol -1) -1 #f (the-as int #t)) + (set! (-> *game-info* demo-state) (the-as uint 1)) + (start 'play (get-continue-by-name *game-info* "demo-start")) + (sleep-code) + ) + ) + ) + (set! (-> self want 0) 5) + (set! (-> self want 1) 6) + (remove-setting! 'allow-timeout) + (set! (-> *setting-control* user-default allow-timeout) #t) + (let ((gp-24 (demo-menu))) + (eval! + (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) + '(fadeout (seconds (new 'static 'bfloat :data 0.3))) + ) + (let ((s5-8 (-> self clock frame-counter))) + (while (or (!= (-> *setting-control* user-current bg-a) (-> *setting-control* user-target bg-a)) + (< (- (-> self clock frame-counter) s5-8) (seconds 0.3)) + ) + (suspend) + ) + ) + (set-blackout-frames (seconds 0.5)) + (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) + (while (-> *setting-control* user-current movie) + (suspend) + ) + (cond + ((zero? gp-24) + (let ((gp-25 (-> self mask))) + (logior! (-> self mask) (process-mask no-kill)) + (play-task (game-task atoll-sig) 'debug #f) + (send-event (ppointer->process *time-of-day*) 'change 'hour 8) + (set! (-> self mask) gp-25) + ) + (set-setting! 'allow-pause #t 0 0) + (let ((gp-27 + (ppointer->handle (process-spawn scene-player :init scene-player-init "atoll-2-intro-demo" #t "hiphog-demo")) + ) + ) + (while (handle->process (the-as handle gp-27)) + (suspend) + ) + ) + (set-setting! 'allow-timeout #f 0 0) + (set-setting! 'allow-pause #f 0 0) + (let ((t9-49 demo-screen-change) + (a0-81 0) + (a1-39 -1) + (a2-30 #t) + ) + (t9-49 (the-as symbol a0-81) a1-39 a2-30 (the-as int #t)) + (demo-wait-for-press (seconds 1) (seconds 15) a2-30) + ) + (demo-screen-change (the-as symbol -1) -1 #f (the-as int #t)) + (start 'play (get-continue-by-name *game-info* "atoll-start")) + ) + ((= gp-24 1) + (let ((gp-29 (-> self mask))) + (logior! (-> self mask) (process-mask no-kill)) + (play-task (game-task strip-rescue) 'debug #f) + (set! (-> self mask) gp-29) + ) + (set-setting! 'allow-pause #t 0 0) + (let ((gp-31 + (ppointer->handle (process-spawn scene-player :init scene-player-init "crane-intro-demo" #t "vinroom-demo")) + ) + ) + (while (handle->process (the-as handle gp-31)) + (suspend) + ) + ) + (let ((gp-32 (-> self mask))) + (logior! (-> self mask) (process-mask no-kill)) + (play-task (game-task strip-rescue) 'debug #f) + (set! (-> *game-info* gun-type) 1) + (logior! (-> *game-info* debug-features) (game-feature board)) + (logior! (-> *game-info* features) (game-feature board)) + (send-event (ppointer->process *time-of-day*) 'change 'hour 8) + (set! (-> self mask) gp-32) + ) + (set-setting! 'allow-timeout #f 0 0) + (set-setting! 'allow-pause #f 0 0) + (let ((t9-63 demo-screen-change) + (a0-105 1) + (a1-54 -1) + (a2-42 #t) + ) + (t9-63 (the-as symbol a0-105) a1-54 a2-42 (the-as int #t)) + (demo-wait-for-press (seconds 1) (seconds 15) a2-42) + ) + (demo-screen-change (the-as symbol -1) -1 #f (the-as int #t)) + (start 'play (get-continue-by-name *game-info* "strip-warp")) + ) + ((= gp-24 2) + (set-setting! 'allow-timeout #f 0 0) + (set-setting! 'allow-pause #f 0 0) + (demo-screen-change (the-as symbol -1) -1 #f (the-as int #t)) + (set! (-> *setting-control* user-default music-volume) 0.0) + (case *kernel-boot-message* + (('demo-shared) + (set! *master-exit* 'force) + ) + (else + (set! *master-exit* 'movie) + ) + ) + ) + ) + ) + (sleep-code) + (none) + ) + :post (behavior () + (local-vars (v1-70 external-art-buffer)) + (let ((gp-0 (the-as process-drawable (command-get-process "jak-demo-logo" (the-as process #f))))) + (when (and gp-0 (nonzero? (-> gp-0 draw))) + (let ((s5-0 (lookup-light-sphere-by-name "big-demo1" (-> self level bsp light-hash))) + (v1-6 (lookup-light-sphere-by-name "big-demo2" (-> self level bsp light-hash))) + ) + (if s5-0 + (set! (-> s5-0 brightness) (-> gp-0 draw color-mult x)) + ) + (if v1-6 + (set! (-> v1-6 brightness) (-> gp-0 draw color-mult x)) + ) + ) + ) + ) + (let ((gp-1 (lookup-light-sphere-by-name "small-demo" (-> self level bsp light-hash)))) + (when gp-1 + (if (>= (- (-> *display* base-clock frame-counter) (-> self spark-time)) (seconds 0.125)) + (set! (-> gp-1 brightness) 0.0) + (set! (-> gp-1 brightness) (rand-vu-float-range 0.5 2.0)) + ) + ) + ) + (dotimes (v1-16 2) + (set! (-> self buffer v1-16 frame-lock) #f) + (set! (-> self have v1-16) -1) + ) + (dotimes (gp-2 2) + (let ((s5-1 (-> self want gp-2))) + (when (>= s5-1 0) + (dotimes (s4-0 2) + (case (file-status (-> self buffer s4-0) "demo-screen" s5-1) + (('locked 'active) + (set! (-> self buffer s4-0 frame-lock) #t) + (set! (-> self have gp-2) s4-0) + ) + ) + ) + ) + ) + ) + (dotimes (gp-3 2) + (let ((a2-1 (-> self want gp-3))) + (when (and (>= a2-1 0) (< (-> self have gp-3) 0)) + (dotimes (v1-42 2) + (when (not (-> self buffer v1-42 frame-lock)) + (set-pending-file (-> self buffer v1-42) "demo-screen" a2-1 (process->handle self) -1.0) + (goto cfg-45) + ) + ) + ) + ) + (label cfg-45) + ) + (dotimes (gp-4 2) + (update (-> self buffer gp-4)) + ) + (set! (-> self active) #f) + (when (>= (-> self draw) 0) + (dotimes (gp-5 2) + (when (file-status (-> self buffer gp-5) "demo-screen" (-> self draw)) + (set! v1-70 (-> self buffer gp-5)) + (goto cfg-58) + ) + ) + (set! v1-70 (the-as external-art-buffer #f)) + (label cfg-58) + (when (and v1-70 (-> v1-70 art-group)) + (draw-raw-image (bucket-id debug-no-zbuf1) (-> v1-70 art-group) 512 416 (-> self level) 8) + (set! (-> self active) #t) + ) + ) + (when (nonzero? (-> self sprite-draw)) + (set! (-> self sprites 0 pos x) (the int (-> self sprite-pos x))) + (set! (-> self sprites 0 pos y) (the int (-> self sprite-pos y))) + (set! (-> self sprites 1 pos quad) (-> self sprites 0 pos quad)) + (case (-> self sprite-draw) + ((1) + (set! (-> self sprites 0 scale-y) 1.0) + (set! (-> self sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #x74c))) + (set! (-> self sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #x74c))) + (+! (-> self sprites 0 pos y) -256) + ) + ((2) + (set! (-> self sprites 0 scale-y) 2.0) + (set! (-> self sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x74c))) + (set! (-> self sprites 1 tex) #f) + ) + ((3) + (set! (-> self sprites 0 scale-y) 1.0) + (set! (-> self sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #x74c))) + (set! (-> self sprites 1 tex) #f) + ) + ) + (let* ((s5-2 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-6 (-> s5-2 base)) + ) + (dotimes (s4-1 2) + (if (and (-> self sprites s4-1 tex) (!= (-> self sprites s4-1 scale-x) 0.0)) + (draw (-> self sprites s4-1) s5-2 (-> self level)) + ) + ) + (let ((a3-6 (-> s5-2 base))) + (let ((v1-102 (the-as object (-> s5-2 base)))) + (set! (-> (the-as dma-packet v1-102) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-102) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-102) vif1) (new 'static 'vif-tag)) + (set! (-> s5-2 base) (&+ (the-as pointer v1-102) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id progress) + gp-6 + (the-as (pointer dma-tag) a3-6) + ) + ) + ) + ) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior demo-control-init demo-control () + (stack-size-set! (-> self main-thread) 2048) + (logclear! (-> self mask) (process-mask freeze pause menu progress actor-pause)) + (set! (-> self level) (level-get *level* 'demo)) + (let ((a1-2 (if (and (nonzero? (-> self level entity)) (> (-> self level entity length) 0)) + (-> self level entity data 0 entity) + ) + ) + ) + (process-entity-set! self (the-as entity-actor a1-2)) + ) + (set-setting! 'allow-pause #f 0 0) + (set-setting! 'allow-progress #f 0 0) + (set-setting! 'airlock #f 0 0) + (set-setting! 'music #f 0 0) + (set-setting! 'allow-timeout #f 0 0) + (apply-settings *setting-control*) + (dotimes (gp-0 2) + (set! (-> self buffer gp-0) + (new + 'process + 'external-art-buffer + gp-0 + (lambda ((arg0 external-art-buffer)) + (let ((gp-0 (level-get *level* 'demo))) + (cond + ((not (-> gp-0 user-object (-> arg0 index))) + (let ((s4-0 (-> arg0 heap))) + (set! (-> s4-0 base) (kmalloc (-> gp-0 heap) #xd0000 (kmalloc-flags) "heap")) + (set! (-> s4-0 current) (-> s4-0 base)) + (set! (-> s4-0 top-base) (&+ (-> s4-0 base) #xd0000)) + (set! (-> s4-0 top) (-> s4-0 top-base)) + ) + (set! (-> gp-0 user-object (-> arg0 index)) (the-as basic (-> arg0 heap base))) + ) + (else + (let ((v1-10 (-> arg0 heap))) + (set! (-> v1-10 base) (the-as pointer (-> gp-0 user-object (-> arg0 index)))) + (set! (-> v1-10 current) (-> v1-10 base)) + (set! (-> v1-10 top-base) (&+ (-> v1-10 base) #xd0000)) + (set! (-> v1-10 top) (-> v1-10 top-base)) + ) + ) + ) + ) + 0 + (none) + ) + #f + ) + ) + ) + (set! (-> self selected) 0) + (dotimes (v1-32 2) + (set! (-> self want v1-32) -1) + (set! (-> self have v1-32) -1) + ) + (set! (-> self draw) -1) + (set! (-> self active) #f) + (dotimes (v1-36 2) + (let ((a0-14 (&+ (-> self sprites 0 color2) (* v1-36 64)))) + (set! (-> a0-14 0) 128) + (set! (-> a0-14 1) 128) + (set! (-> a0-14 2) 128) + (set! (-> a0-14 3) 128) + ) + (set! (-> self sprites v1-36 pos z) #xffffff) + (set! (-> self sprites v1-36 pos w) 0) + (set! (-> self sprites v1-36 scale-x) 1.0) + (set! (-> self sprites v1-36 scale-y) 1.0) + (set! (-> self sprites v1-36 angle) 0.0) + (set! (-> self sprites v1-36 flags) (the-as uint 0)) + (set! (-> self sprites v1-36 tex) #f) + ) + (set! (-> self sprite-draw) (the-as uint 0)) + (set! *demo-control* (the-as (pointer demo-control) (process->ppointer self))) + (set! (-> *game-info* controller 0) (process->handle self)) + (go-virtual idle) + (none) + ) + +(defstate target-demo (target) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('change-mode) + (case (-> event param 0) + (('grab) + (if (not (-> event param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + ) + (else + (target-generic-event-handler proc arg1 event-type event) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (let ((a0-1 (-> *hud-engine* alive-list next0))) + *hud-engine* + (let ((s5-0 (-> a0-1 next0))) + (while (!= a0-1 (-> *hud-engine* alive-list-end)) + (deactivate ((method-of-type connection get-process) (the-as connection a0-1))) + (set! a0-1 s5-0) + *hud-engine* + (set! s5-0 (-> s5-0 next0)) + ) + ) + ) + (ja-channel-set! 0) + (when arg0 + (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) + (kill-by-type demo-control *active-pool*) + (set! (-> self game controller 0) + (ppointer->handle (process-spawn demo-control :init demo-control-init :to *entity-pool*)) + ) + ) + (none) + ) + :code (the-as (function symbol none :behavior target) sleep-code) + :post target-no-move-post + ) + +(defpartgroup group-demo-sign-naughtydog + :id 1290 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 5474 :flags (is-3d launch-asap bit7)) + (sp-item 5475 :flags (is-3d launch-asap bit7)) + (sp-item 5476 :fade-after (meters 200) :flags (bit6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 5476 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 32) (meters 0.1) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-rnd-flt spt-scale-y (meters 48) (meters 0.1) 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 10.0 2.0 1.0) + (sp-flt spt-omega 822476.8) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5474 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x754)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters 0.1)) + (sp-flt spt-scale-x (meters 16)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 8)) + (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-int spt-timer -1) + (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 5 0 0 #x75400300 -2139062144 0 1 #x75400300 #x60606060 #x202020 1) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5475 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x754)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters -0.1)) + (sp-flt spt-scale-x (meters 16)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 180.0)) + (sp-flt spt-scale-y (meters 8)) + (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-int spt-timer -1) + (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 5 0 0 #x75400300 -2139062144 0 1 #x75400300 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-demo-sign-big-praxis + :id 1291 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 5477 :flags (is-3d launch-asap bit7)) + (sp-item 5478 :flags (is-3d launch-asap bit7)) + (sp-item 5479 :fade-after (meters 200) :flags (bit6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 5479 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 48) (meters 0.1) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-rnd-flt spt-scale-y (meters 32) (meters 0.1) 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 10.0 2.0 1.0) + (sp-flt spt-omega 822476.8) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +(defpart 5477 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x754)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 16)) + (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-int spt-timer -1) + (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 5 0 0 #x75400000 -2139062144 0 1 #x75400000 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5478 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x754)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters -0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 180.0)) + (sp-flt spt-scale-y (meters 16)) + (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-int spt-timer -1) + (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 5 0 0 #x75400000 -2139062144 0 1 #x75400000 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-demo-sign-wanted + :id 1292 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 5480 :flags (is-3d launch-asap bit7)) + (sp-item 5481 :flags (is-3d launch-asap bit7)) + (sp-item 5482 :fade-after (meters 200) :flags (bit6) :hour-mask #b111111111110000000) + ) + ) + +(defpart 5482 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 32) (meters 0.1) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-rnd-flt spt-scale-y (meters 32) (meters 0.1) 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 10.0 2.0 1.0) + (sp-flt spt-omega 822476.8) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +(defpart 5480 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x754)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 8)) + (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-int spt-timer -1) + (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 5 0 0 #x75400200 -2139062144 0 1 #x75400200 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5481 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x754)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters -0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 180.0)) + (sp-flt spt-scale-y (meters 8)) + (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-int spt-timer -1) + (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 5 0 0 #x75400200 -2139062144 0 1 #x75400200 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-demo-sign-scea + :id 1293 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 5483 :flags (is-3d launch-asap bit7)) (sp-item 5484 :flags (is-3d launch-asap bit7))) + ) + +(defpart 5483 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x754)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 8)) + (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-int spt-timer -1) + (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 5 0 0 #x75400100 -2139062144 0 1 #x75400100 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5484 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x754)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters -0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 180.0)) + (sp-flt spt-scale-y (meters 8)) + (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-int spt-timer -1) + (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 5 0 0 #x75400100 -2139062144 0 1 #x75400100 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(when (= (scf-get-territory) 1) + (let ((v1-40 (get-field-spec-by-id (-> *part-id-table* 5483) (sp-field-id spt-userdata)))) + (if v1-40 + (set! (-> v1-40 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 #x75400400 -2139062144 0 1 #x75400400 -2141167520 #x202020 0) + ) + ) + ) + ) + (let ((v1-43 (get-field-spec-by-id (-> *part-id-table* 5484) (sp-field-id spt-userdata)))) + (if v1-43 + (set! (-> v1-43 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 #x75400400 -2139062144 0 1 #x75400400 -2141167520 #x202020 0) + ) + ) + ) + ) + ) + +(when (= (scf-get-territory) 2) + (let ((v1-47 (get-field-spec-by-id (-> *part-id-table* 5483) (sp-field-id spt-userdata)))) + (if v1-47 + (set! (-> v1-47 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 #x75400500 -2139062144 0 1 #x75400500 -2141167520 #x202020 0) + ) + ) + ) + ) + (let ((v1-50 (get-field-spec-by-id (-> *part-id-table* 5484) (sp-field-id spt-userdata)))) + (if v1-50 + (set! (-> v1-50 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 #x75400500 -2139062144 0 1 #x75400500 -2141167520 #x202020 0) + ) + ) + ) + ) + ) + +(when (= (scf-get-territory) 3) + (let ((v1-54 (get-field-spec-by-id (-> *part-id-table* 5483) (sp-field-id spt-userdata)))) + (if v1-54 + (set! (-> v1-54 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 #x75400600 -2139062144 0 1 #x75400600 -2141167520 #x202020 0) + ) + ) + ) + ) + (let ((v1-57 (get-field-spec-by-id (-> *part-id-table* 5484) (sp-field-id spt-userdata)))) + (if v1-57 + (set! (-> v1-57 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 #x75400600 -2139062144 0 1 #x75400600 -2141167520 #x202020 0) + ) + ) + ) + ) + ) + +(defpartgroup group-demo-plug + :id 1294 + :linger-duration (seconds 2) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5485 :flags (bit6) :period 1500 :length 150) + (sp-item 5486 :flags (bit6) :period 1500 :length 150) + (sp-item 5487 :period 1500 :length 200) + (sp-item 5487 :period 1500 :length 100) + (sp-item 5487 :period 1500 :length 70) + (sp-item 5487 :period 1500 :length 45) + (sp-item 5487 :period 1500 :length 30) + (sp-item 5487 :period 1500 :length 25) + (sp-item 5487 :period 1500 :length 20) + (sp-item 5487 :period 1500 :length 15) + ) + ) + +(defpart 5485 + :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 5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 1638.4) + (sp-rnd-flt spt-rot-z (degrees -5.0) (degrees 10.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 200.0 55.0 1.0) + (sp-rnd-flt spt-a 20.0 4.0 1.0) + (sp-flt spt-omega 411648.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 6144.0) + ) + ) + +(defpart 5486 + :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 32) (meters 0.1) 1.0) + (sp-flt spt-rot-x 1638.4) + (sp-rnd-flt spt-rot-z (degrees -2.0) (degrees 4.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 255.0 255.0 1.0) + (sp-rnd-flt spt-b 200.0 55.0 1.0) + (sp-rnd-flt spt-a 8.0 4.0 1.0) + (sp-flt spt-omega 1231667.2) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 6144.0) + ) + ) + +(defpart 5487 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-flt spt-scale-x (meters 1.5)) + (sp-int spt-rot-x 4) + (sp-flt spt-scale-y (meters 0.05)) + (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 64.0 1.0) + (sp-flt spt-omega 8.192) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-fade-r -0.85 -0.85 1.0) + (sp-rnd-flt spt-fade-g -1.7 -1.7 1.0) + (sp-flt spt-fade-b -8.0) + (sp-rnd-flt spt-accel-y -6.826667 -2.7306666 1.0) + (sp-flt spt-friction 0.96) + (sp-int-plain-rnd spt-timer 300 1199 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (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) + ) + ) diff --git a/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc b/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc index 285c3f8993..081fad35d1 100644 --- a/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc +++ b/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc @@ -7,3 +7,412 @@ ;; DECOMP BEGINS +(defun fortress-login () + (set! *nav-network* (new 'loading-level 'nav-network)) + (nav-network-method-9 *nav-network*) + 0 + (none) + ) + +(defun fortress-deactivate () + (set! *nav-network* (the-as nav-network 0)) + 0 + (none) + ) + +(defun fortress-activate ((arg0 level)) + (nav-network-method-10 *nav-network* arg0 *fortress-adjacency*) + (none) + ) + +(deftype fort-elec-button (cty-guard-turret-button) + ((start-up? symbol :offset-assert 288) + ) + :heap-base #xb0 + :method-count-assert 41 + :size-assert #x124 + :flag-assert #x2900b00124 + (:methods + (waiting () _type_ :state 40) + ) + ) + + +(defskelgroup skel-fort-elec-button cty-guard-turret-button cty-guard-turret-button-lod0-jg cty-guard-turret-button-idle-ja + ((cty-guard-turret-button-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) + +(defstate waiting (fort-elec-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger) + (go-virtual pop-up) + ) + ) + ) + :code (the-as (function none :behavior fort-elec-button) sleep-code) + ) + +(defmethod basebutton-method-33 fort-elec-button ((obj fort-elec-button)) + "TODO - joint stuff" + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-elec-button" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (cond + ((-> obj start-up?) + (let ((a0-4 (-> obj skel root-channel 0))) + (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> a0-4 frame-num) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 3)) frames num-frames) -1)) + ) + (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + ) + ) + (else + (let ((a0-5 (-> obj skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + ) + ) + ) + (transform-post) + (none) + ) + +;; WARN: Return type mismatch process-mask vs none. +(defmethod prepare-trigger-event! fort-elec-button ((obj fort-elec-button)) + "Sets `event-going-down` to `'trigger`" + (set! (-> obj start-up?) (= 1 (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0))) + (set! (-> obj event-going-down) 'trigger) + (process-entity-status! obj (entity-perm-status no-kill) #t) + (logclear! (-> obj mask) (process-mask actor-pause)) + (none) + ) + +(defmethod idle-state-transition fort-elec-button ((obj fort-elec-button)) + "If `button-status` has [[button-status:0]] set, transition to [[basebutton::27]] otherwise, [[basebutton::30]]" + (cond + ((-> obj start-up?) + (let ((s5-0 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-0 + (the-as art-joint-anim (-> obj draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-0 frame-num) 0.0) + ) + (go (method-of-object obj up-idle)) + ) + (else + (go (method-of-object obj waiting)) + ) + ) + ) + +(deftype fort-led (process-drawable) + ((button-actor entity-actor :offset-assert 200) + ) + :heap-base #x50 + :method-count-assert 22 + :size-assert #xcc + :flag-assert #x16005000cc + (:methods + (red () _type_ :state 20) + (green () _type_ :state 21) + ) + ) + + +(defskelgroup skel-fort-led fort-led fort-led-lod0-jg fort-led-idle-ja + ((fort-led-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defstate red (fort-led) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger) + (go-virtual green) + ) + ) + ) + :code (behavior () + (setup-masks (-> self draw) 4 2) + (ja-post) + (sleep-code) + (none) + ) + ) + +(defstate green (fort-led) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('untrigger) + (go-virtual red) + ) + ) + ) + :code (behavior () + (setup-masks (-> self draw) 2 4) + (ja-post) + (sleep-code) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! fort-led ((obj fort-led) (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-fort-led" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj button-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (if (and (-> obj button-actor) + (logtest? (-> obj button-actor extra perm status) (entity-perm-status subtask-complete)) + ) + (go (method-of-object obj green)) + (go (method-of-object obj red)) + ) + (none) + ) + +(deftype elec-lock-gate (fort-elec-gate) + ((actor-group (pointer actor-group) :offset-assert 516) + (actor-group-count int32 :offset-assert 520) + (all-gone? symbol :offset-assert 524) + ) + :heap-base #x190 + :method-count-assert 32 + :size-assert #x210 + :flag-assert #x2001900210 + (:methods + (pre-shutdown () _type_ :state 30) + (elec-lock-gate-method-31 (_type_ symbol) symbol 31) + ) + ) + + +(defstate active (elec-lock-gate) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger) + (if (elec-lock-gate-method-31 self (the-as symbol proc)) + (go-virtual pre-shutdown) + ) + ) + (else + ((-> (method-of-type elec-gate active) event) proc arg1 event-type event) + ) + ) + ) + ) + +(defstate pre-shutdown (elec-lock-gate) + :virtual #t + :trans (-> (method-of-type elec-lock-gate active) trans) + :code (behavior () + (let ((a0-0 *target*)) + (when (and a0-0 (< 81920.0 (vector-vector-distance (get-trans a0-0 0) (-> self root trans)))) + (set! (-> self quality-enabled?) #f) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 0.5)) + (suspend) + ) + ) + (hide-hud-quick #f) + (set-setting! 'entity-name "camera-243" 0 0) + (set-setting! 'process-mask 'set 0 (process-mask movie enemy)) + (process-grab? *target* #f) + (let ((gp-2 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-2) (seconds 2)) + (suspend) + ) + ) + ) + ) + (go-virtual shutdown) + (none) + ) + :post (-> (method-of-type elec-lock-gate active) post) + ) + +(defstate shutdown (elec-lock-gate) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (the-as state (find-parent-method elec-lock-gate 22)) enter))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (set! (-> self all-gone?) #f) + (none) + ) + :trans (behavior () + (let ((gp-0 #t)) + (dotimes (s5-0 5) + (let ((s4-0 (-> self l-bolt s5-0))) + (seek! (-> s4-0 pos) 0.0 (* (- 1.14 (-> s4-0 pos)) (-> self clock seconds-per-frame))) + (set! gp-0 (cond + ((or (< 1.0 (-> s4-0 pos)) (>= 0.0 (-> s4-0 pos))) + (let ((v1-9 (-> self l-bolt s5-0 bolt)) + (a0-1 3) + ) + (let ((a1-2 (!= a0-1 (-> v1-9 state mode)))) + (case a0-1 + ((3) + (if a1-2 + (set! (-> v1-9 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-9 state start-color) (-> v1-9 spec start-color)) + (set! (-> v1-9 state end-color) (-> v1-9 spec end-color)) + ) + ) + ) + (set! (-> v1-9 state mode) (the-as lightning-mode a0-1)) + ) + (let ((v1-12 (-> self l-bolt s5-0 ring 0)) + (a0-2 3) + ) + (let ((a1-12 (!= a0-2 (-> v1-12 state mode)))) + (case a0-2 + ((3) + (if a1-12 + (set! (-> v1-12 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-12 state start-color) (-> v1-12 spec start-color)) + (set! (-> v1-12 state end-color) (-> v1-12 spec end-color)) + ) + ) + ) + (set! (-> v1-12 state mode) (the-as lightning-mode a0-2)) + ) + (let ((v1-15 (-> self l-bolt s5-0 ring 1)) + (a0-3 3) + ) + (let ((a1-22 (!= a0-3 (-> v1-15 state mode)))) + (case a0-3 + ((3) + (if a1-22 + (set! (-> v1-15 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-15 state start-color) (-> v1-15 spec start-color)) + (set! (-> v1-15 state end-color) (-> v1-15 spec end-color)) + ) + ) + ) + (set! (-> v1-15 state mode) (the-as lightning-mode a0-3)) + ) + gp-0 + ) + (else + #f + ) + ) + ) + ) + ) + (set! (-> self all-gone?) gp-0) + ) + (none) + ) + :code (behavior () + (until (-> self all-gone?) + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.5)) + (suspend) + ) + ) + ) + (set-setting! 'interp-time 'abs 0 0) + (remove-setting! 'entity-name) + (remove-setting! 'process-mask) + (dotimes (gp-1 2) + (suspend) + ) + (remove-setting! 'interp-time) + (process-release? *target*) + (go-virtual idle) + (none) + ) + ) + +(defmethod elec-lock-gate-method-31 elec-lock-gate ((obj elec-lock-gate) (arg0 symbol)) + (dotimes (v1-0 (-> obj actor-group-count)) + (dotimes (a2-0 (-> obj actor-group v1-0 length)) + (when (or (not arg0) (let ((a3-5 (-> obj actor-group v1-0 data a2-0 actor))) + (!= (if a3-5 + (-> a3-5 extra process) + ) + arg0 + ) + ) + ) + (if (not (logtest? (-> obj actor-group v1-0 data a2-0 actor extra perm status) (entity-perm-status subtask-complete)) + ) + (return #f) + ) + ) + ) + ) + #t + ) + +(defmethod set-state! elec-lock-gate ((obj elec-lock-gate)) + "If either [[actor-option::17]] is set on the [[elec-gate]] or the related subtask is completed +make the gate `idle`. + +Otherwise, the gate will be `active`." + (if (elec-lock-gate-method-31 obj #f) + (go (method-of-object obj shutdown)) + ((method-of-type fort-elec-gate set-state!) obj) + ) + (none) + ) + +(defmethod set-palette! elec-lock-gate ((obj elec-lock-gate)) + "Sets the [[elec-gate]]'s `palette-id` appropriately" + (local-vars (sv-16 res-tag)) + (let ((t9-0 (method-of-type fort-elec-gate set-palette!))) + (t9-0 obj) + ) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-4 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-4 (nonzero? (-> sv-16 elt-count))) + (set! (-> obj actor-group) (the-as (pointer actor-group) v1-4)) + (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> obj actor-group-count) 0) + 0 + ) + ) + ) + (none) + ) diff --git a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc index 9fc4440339..a119531cc5 100644 --- a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc +++ b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc @@ -7,3 +7,808 @@ ;; DECOMP BEGINS +(deftype fort-twist-rail (process-drawable) + ((sync sync-eased :inline :offset-assert 200) + (init-quat quaternion :inline :offset-assert 256) + ) + :heap-base #x90 + :method-count-assert 21 + :size-assert #x110 + :flag-assert #x1500900110 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-fort-twist-rail fort-twist-rail 0 3 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 10 14) + ) + +(defstate idle (fort-twist-rail) + :virtual #t + :trans (the-as (function none :behavior fort-twist-rail) rider-trans) + :code (the-as (function none :behavior fort-twist-rail) sleep-code) + :post (behavior () + (let ((f0-0 (get-norm! (-> self sync) 0))) + (quaternion-rotate-y! (-> self root quat) (-> self init-quat) (+ -2730.6667 (* 5461.3335 f0-0))) + ) + (rider-post) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! fort-twist-rail ((obj fort-twist-rail) (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-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 40960.0 57344.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec 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 -19660.8 0.0 24576.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid rideable)) + (set! (-> v1-17 transform-index) 3) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 45056.0 45056.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-20 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-20 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-20 prim-core collide-with)) + ) + (set! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-twist-rail" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (quaternion-copy! (-> obj init-quat) (-> obj root quat)) + (let ((a1-14 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-26 0)) + (if #t + (set! v1-26 (logior v1-26 1)) + ) + (set! (-> a1-14 sync-type) 'sync-eased) + (set! (-> a1-14 sync-flags) (the-as sync-flags v1-26)) + ) + (set! (-> a1-14 period) (the-as uint 900)) + (set! (-> a1-14 entity) (-> obj entity)) + (set! (-> a1-14 percent) 0.0) + (set! (-> a1-14 ease-in) 0.15) + (set! (-> a1-14 ease-out) 0.15) + (set! (-> a1-14 pause-in) 0.0) + (set! (-> a1-14 pause-out) 0.0) + (initialize! (-> obj sync) a1-14) + ) + (let ((a0-29 (-> obj skel root-channel 0))) + (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> a0-29 frame-num) 0.0) + (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +(deftype fort-elec-belt-inst (process-drawable) + ((l-spec lightning-spec :offset-assert 200) + (l-bolt lightning-control :offset-assert 204) + (points vector 17 :inline :offset-assert 208) + (path-u float :offset-assert 480) + (path-du float :offset-assert 484) + (attack-id uint32 :offset-assert 488) + (sound-id uint32 :offset-assert 492) + ) + :heap-base #x170 + :method-count-assert 23 + :size-assert #x1f0 + :flag-assert #x17017001f0 + (:methods + (idle () _type_ :state 20) + (running () _type_ :state 21) + (die () _type_ :state 22) + ) + ) + + +(defskelgroup skel-fort-elec-belt-inst fort-elec-belt fort-elec-belt-lod0-jg fort-elec-belt-idle-ja + ((fort-elec-belt-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 -19 20) + ) + +(defstate idle (fort-elec-belt-inst) + :virtual #t + :code (behavior () + (suspend) + (let ((v1-0 (-> self l-bolt)) + (a0-0 1) + ) + (let ((a1-1 (!= a0-0 (-> v1-0 state mode)))) + (case a0-0 + ((3) + (if a1-1 + (set! (-> v1-0 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-0 state start-color) (-> v1-0 spec start-color)) + (set! (-> v1-0 state end-color) (-> v1-0 spec end-color)) + ) + ) + ) + (set! (-> v1-0 state mode) (the-as lightning-mode a0-0)) + ) + (go-virtual running) + (none) + ) + :post (behavior () + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'get-point-norm) + (set! (-> a1-0 param 0) (the-as uint (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 param 1) (the-as uint (-> self path-u))) + (let ((v1-7 (the-as vector (send-event-function (ppointer->process (-> self parent)) a1-0)))) + (set! (-> self root trans quad) (-> v1-7 quad)) + ) + ) + (+! (-> self path-u) (* (-> self path-du) (-> self clock seconds-per-frame))) + (ja-post) + (none) + ) + ) + +(defstate running (fort-elec-belt-inst) + :virtual #t + :exit (behavior () + (sound-stop (the-as sound-id (-> self sound-id))) + (none) + ) + :trans (behavior () + (if (>= (-> self path-u) 1.0) + (go-virtual die) + ) + (none) + ) + :code (the-as (function none :behavior fort-elec-belt-inst) sleep-code) + :post (behavior () + (local-vars + (sv-1696 + (function lightning-spec time-frame symbol process-drawable vector vector none :behavior lightning-tracker) + ) + (sv-1712 lightning-spec) + ) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'get-point-norm) + (set! (-> a1-0 param 0) (the-as uint (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 param 1) (the-as uint (-> self path-u))) + (let ((v1-7 (the-as vector (send-event-function (ppointer->process (-> self parent)) a1-0)))) + (set! (-> self root trans quad) (-> v1-7 quad)) + ) + ) + (+! (-> self path-u) (* (-> self path-du) (-> self clock seconds-per-frame))) + (let ((s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4))) + (s2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 5))) + ) + (let ((t2-0 (new 'stack-no-clear 'vector))) + (vector+! t2-0 s3-0 s2-0) + (vector-float*! t2-0 t2-0 0.5) + (set! (-> t2-0 y) (+ -20480.0 (-> t2-0 y))) + (sound-play "sliding-laser" :id (the-as sound-id (-> self sound-id)) :position t2-0) + ) + (let* ((v0-4 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s2-0 s3-0) 1.0)) + (gp-1 (vector-cross! (new 'stack-no-clear 'vector) v0-4 *up-vector*)) + (s5-0 (-> self l-bolt)) + (f30-0 90112.0) + (f0-6 (* f30-0 f30-0)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) s2-0 s3-0)) + (f1-4 (* 0.5 (vector-length s4-1))) + ) + (let ((f2-2 (* f1-4 f1-4))) + (vector-float*! s4-1 s4-1 0.5) + (vector+! s4-1 s3-0 s4-1) + (+! (-> s4-1 y) (sqrtf (- f0-6 f2-2))) + ) + (let* ((f0-12 (* 2.0 (asin (/ f1-4 f30-0)))) + (f28-1 (* 0.0625 f0-12)) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 x) 0.0) + (set! (-> s3-1 y) (- f30-0)) + (set! (-> s3-1 z) 0.0) + (set! (-> s3-1 w) 0.0) + (let ((a2-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) gp-1 (* -0.5 f0-12)))) + (vector-orient-by-quat! s3-1 s3-1 a2-2) + ) + (dotimes (s2-1 17) + (let ((s1-1 (vector+! (new 'stack-no-clear 'vector) s4-1 s3-1))) + (set-point! s5-0 s2-1 s1-1) + (set! (-> self points s2-1 quad) (-> s1-1 quad)) + ) + (let ((a2-5 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) gp-1 f28-1))) + (vector-orient-by-quat! s3-1 s3-1 a2-5) + ) + ) + ) + ) + ) + (let ((gp-2 (new 'stack-no-clear 'collide-query))) + (let ((s5-1 (new 'stack-no-clear 'bounding-box))) + (let ((a1-15 (new 'stack-no-clear 'inline-array 'sphere 17))) + (dotimes (v1-37 17) + (set! (-> a1-15 v1-37 quad) (-> self points v1-37 quad)) + (set! (-> a1-15 v1-37 r) 4096.0) + ) + (set-from-spheres! s5-1 a1-15 17) + ) + (set! (-> gp-2 collide-with) (collide-spec jak bot player-list)) + (set! (-> gp-2 ignore-process0) self) + (set! (-> gp-2 ignore-process1) #f) + (set! (-> gp-2 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> gp-2 action-mask) (collide-action solid)) + (mem-copy! (the-as pointer (-> gp-2 bbox)) (the-as pointer s5-1) 32) + ) + (fill-using-bounding-box *collide-cache* gp-2) + ) + (let ((gp-3 1)) + (while (< gp-3 17) + (let ((s3-2 (new 'stack-no-clear 'collide-query)) + (s5-2 (-> self points (+ gp-3 -1))) + (s4-2 (-> self points gp-3)) + ) + (let ((v1-52 (vector-! (new 'stack-no-clear 'vector) s4-2 s5-2))) + (set! (-> s3-2 start-pos quad) (-> s5-2 quad)) + (set! (-> s3-2 move-dist quad) (-> v1-52 quad)) + ) + (let ((v1-54 s3-2)) + (set! (-> v1-54 radius) 4096.0) + (set! (-> v1-54 collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-54 ignore-process0) self) + (set! (-> v1-54 ignore-process1) #f) + (set! (-> v1-54 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-54 action-mask) (collide-action solid semi-solid)) + ) + (when (>= (probe-using-line-sphere *collide-cache* s3-2) 0.0) + (let* ((s2-2 (-> s3-2 best-other-tri collide-ptr)) + (s3-3 (if (type? s2-2 collide-shape-prim-sphere) + (the-as collide-shape-prim-sphere s2-2) + ) + ) + ) + (when s3-3 + (sound-play "laser-hit") + (let ((s2-4 (get-process *default-dead-pool* lightning-tracker #x4000))) + (when s2-4 + (let ((t9-19 (method-of-type lightning-tracker activate))) + (t9-19 + (the-as lightning-tracker s2-4) + *entity-pool* + (symbol->string (-> lightning-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((s1-3 run-function-in-process) + (s0-0 s2-4) + ) + (set! sv-1696 lightning-tracker-init) + (set! sv-1712 (-> self l-spec)) + (let ((a3-3 (the int (* 3.0 (rand-vu-float-range 5.0 11.0)))) + (t0-2 #f) + (t1-2 #f) + ) + ((the-as (function object object object object object object object object none) s1-3) + s0-0 + sv-1696 + sv-1712 + a3-3 + t0-2 + t1-2 + s5-2 + s4-2 + ) + ) + ) + (-> s2-4 ppointer) + ) + ) + (let ((v1-68 (vector-reset! (new 'stack-no-clear 'vector))) + (a1-28 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-28 from) (process->ppointer self)) + (set! (-> a1-28 num-params) 2) + (set! (-> a1-28 message) 'attack) + (set! (-> a1-28 param 0) (the-as uint #f)) + (let ((a0-50 (new 'static 'attack-info :mask (attack-info-mask vector invinc-time shove-up id)))) + (set! (-> a0-50 id) (-> self attack-id)) + (set! (-> a0-50 invinc-time) (seconds 3)) + (set! (-> a0-50 vector quad) (-> v1-68 quad)) + (set! (-> a0-50 shove-up) 12288.0) + (set! (-> a1-28 param 1) (the-as uint a0-50)) + ) + (send-event-function (-> s3-3 cshape process) a1-28) + ) + ) + ) + ) + ) + (+! gp-3 1) + ) + ) + (ja-post) + (none) + ) + ) + +(defstate die (fort-elec-belt-inst) + :virtual #t + :code (behavior () + (let ((v1-0 (-> self l-bolt)) + (a0-0 3) + ) + (let ((a1-1 (!= a0-0 (-> v1-0 state mode)))) + (case a0-0 + ((3) + (if a1-1 + (set! (-> v1-0 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-0 state start-color) (-> v1-0 spec start-color)) + (set! (-> v1-0 state end-color) (-> v1-0 spec end-color)) + ) + ) + ) + (set! (-> v1-0 state mode) (the-as lightning-mode a0-0)) + ) + (suspend) + (cleanup-for-death self) + (none) + ) + ) + +;; WARN: Return type mismatch process-drawable vs fort-elec-belt-inst. +(defmethod relocate fort-elec-belt-inst ((obj fort-elec-belt-inst) (arg0 int)) + (if (nonzero? (-> obj l-bolt)) + (&+! (-> obj l-bolt) arg0) + ) + (the-as fort-elec-belt-inst ((method-of-type process-drawable relocate) obj arg0)) + ) + +(defmethod deactivate fort-elec-belt-inst ((obj fort-elec-belt-inst)) + (sound-stop (the-as sound-id (-> obj sound-id))) + ((the-as (function process-drawable none) (find-parent-method fort-elec-belt-inst 10)) obj) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior fort-elec-belt-inst-init-by-other fort-elec-belt-inst ((arg0 quaternion) (arg1 float) (arg2 float) (arg3 lightning-spec) (arg4 uint)) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-fort-elec-belt-inst" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (quaternion-copy! (-> self root quat) arg0) + (set! (-> self path-u) arg1) + (set! (-> self path-du) arg2) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self l-bolt) (new 'process 'lightning-control arg3 self 0.0)) + (let ((v1-8 (-> self l-bolt)) + (a0-7 0) + ) + (let ((a1-7 (!= a0-7 (-> v1-8 state mode)))) + (case a0-7 + ((3) + (if a1-7 + (set! (-> v1-8 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-8 state start-color) (-> v1-8 spec start-color)) + (set! (-> v1-8 state end-color) (-> v1-8 spec end-color)) + ) + ) + ) + (set! (-> v1-8 state mode) (the-as lightning-mode a0-7)) + ) + (set! (-> self l-spec) arg3) + (set! (-> self attack-id) arg4) + (set! (-> self sound-id) (the-as uint (new-sound-id))) + (ja-no-eval :group! (-> self draw art-group data 2) :num! zero) + (ja-post) + (go-virtual idle) + (none) + ) + +(deftype fort-elec-belt (process) + ((l-spec lightning-spec :offset-assert 128) + (next-spawn-time time-frame :offset-assert 136) + (path path-control :offset-assert 144) + (init-quat quaternion :inline :offset-assert 160) + (sync sync-linear :inline :offset-assert 176) + (attack-id uint32 :offset-assert 192) + (path-du float :offset-assert 196) + ) + :heap-base #x50 + :method-count-assert 16 + :size-assert #xc8 + :flag-assert #x10005000c8 + (:methods + (idle () _type_ :state 14) + (fort-elec-belt-method-15 (_type_) none 15) + ) + ) + + +(defstate idle (fort-elec-belt) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('get-point-norm) + (get-point-at-percent-along-path! + (-> self path) + (the-as vector (-> event param 0)) + (the-as float (-> event param 1)) + 'interp + ) + ) + ) + ) + ) + :trans (behavior () + (set-forrescb-electricity-scale! 1.0 0) + (when (>= (-> self clock frame-counter) (-> self next-spawn-time)) + (process-spawn + fort-elec-belt-inst + (-> self init-quat) + 0 + (-> self path-du) + (-> self l-spec) + (-> self attack-id) + :to self + ) + (set! (-> self next-spawn-time) (get-timeframe-offset! (-> self sync) 0)) + ) + (none) + ) + :code (the-as (function none :behavior fort-elec-belt) sleep-code) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod fort-elec-belt-method-15 fort-elec-belt ((obj fort-elec-belt)) + (with-pp + (let* ((f28-0 (total-distance (-> obj path))) + (s5-0 (-> obj sync)) + (f26-0 81.92) + (a0-3 (- (-> pp clock frame-counter) (get-timeframe-offset! s5-0 0))) + (v1-6 (-> s5-0 period)) + (f30-0 (/ (* f26-0 (the float a0-3)) f28-0)) + (f28-1 (/ (* f26-0 (the float v1-6)) f28-0)) + ) + (while (>= 1.0 f30-0) + (if (>= f30-0 0.0) + (process-spawn + fort-elec-belt-inst + (-> obj init-quat) + f30-0 + (-> obj path-du) + (-> obj l-spec) + (-> obj attack-id) + :to obj + ) + ) + (+! f30-0 f28-1) + ) + ) + (none) + ) + ) + +;; WARN: Return type mismatch process vs fort-elec-belt. +(defmethod relocate fort-elec-belt ((obj fort-elec-belt) (arg0 int)) + (if (nonzero? (-> obj path)) + (&+! (-> obj path) arg0) + ) + (the-as fort-elec-belt ((method-of-type process relocate) obj arg0)) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! fort-elec-belt ((obj fort-elec-belt) (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" + (local-vars (sv-64 int)) + (quaternion-copy! (-> obj init-quat) (-> arg0 quat)) + (let ((s5-0 (new 'stack-no-clear 'sync-info-params))) + (let ((s3-0 1200)) + 0.0 + (set! sv-64 0) + (let ((v1-1 (res-lump-data arg0 'sync (pointer float) :tag-ptr (the-as (pointer res-tag) (& sv-64))))) + (when v1-1 + (set! s3-0 (the int (* 300.0 (-> v1-1 0)))) + (-> v1-1 1) + ) + ) + (let ((v1-2 0)) + (if #t + (set! v1-2 (logior v1-2 1)) + ) + (set! (-> s5-0 sync-type) 'sync-linear) + (set! (-> s5-0 sync-flags) (the-as sync-flags v1-2)) + ) + (set! (-> s5-0 entity) arg0) + (set! (-> s5-0 period) (the-as uint s3-0)) + ) + (set! (-> s5-0 percent) 0.0) + (initialize! (-> obj sync) s5-0) + ) + (set! (-> obj l-spec) (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf2) + :rand-func #x2 + :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.72 + :num-points 17 + :box-size 4997.12 + :merge-factor 0.32 + :merge-count 2 + :radius 7372.8 + :duration -1.0 + :sound #f + ) + ) + (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) + (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> obj path-du) (/ 24576.0 (total-distance (-> obj path)))) + (let* ((v1-14 *game-info*) + (a0-15 (+ (-> v1-14 attack-id) 1)) + ) + (set! (-> v1-14 attack-id) a0-15) + (set! (-> obj attack-id) a0-15) + ) + (fort-elec-belt-method-15 obj) + (set! (-> obj next-spawn-time) (get-timeframe-offset! (-> obj sync) 0)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (go (method-of-object obj idle)) + (none) + ) + +(deftype fort-conveyor (conveyor) + () + :heap-base #x80 + :method-count-assert 28 + :size-assert #x100 + :flag-assert #x1c00800100 + ) + + +(defskelgroup skel-fort-conveyor fort-conveyor fort-conveyor-lod0-jg fort-conveyor-idle-ja + ((fort-conveyor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 16 16.5) + ) + +(defmethod get-art-group fort-conveyor ((obj fort-conveyor)) + "@returns The respective [[art-group]] for the [[conveyor]]" + (art-group-get-by-name *level* "skel-fort-conveyor" (the-as (pointer uint32) #f)) + ) + +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod reset-root! fort-conveyor ((obj fort-conveyor)) + "Re-initializes the `root` [[trsqv]]" + (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 65536.0 67584.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-15 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> obj root) s5-0) + ) + (none) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod init! fort-conveyor ((obj fort-conveyor)) + "Initializes defaults for things like the `speed` and `belt-radius`" + (set! (-> obj speed) -47104.0) + (set! (-> obj belt-radius) 24576.0) + (set! (-> obj pull-y-threshold) 4096.0) + (if (name= (-> obj name) "fort-conveyor-4") + (set-vector! (-> obj root scale) 0.8 0.0 0.657 1.0) + ) + (none) + ) + +(defmethod set-and-get-ambient-sound! fort-conveyor ((obj fort-conveyor)) + "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] +and return it as well. Otherwise, set it to `0`" + (let* ((s5-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 0.0 'interp)) + (v1-2 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 1.0 'interp)) + (a3-3 (vector+! (new 'stack-no-clear 'vector) s5-0 v1-2)) + ) + (vector-float*! a3-3 a3-3 0.5) + (let ((v0-2 (new 'process 'ambient-sound (static-sound-spec "fort-conveyor" :fo-max 50) a3-3))) + (set! (-> obj sound) v0-2) + v0-2 + ) + ) + ) + +(set-subtask-hook! + *game-info* + 172 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-excitement 'abs #x3f4ccccd 0) + (speech-control-method-10 + *speech-control* + 6 + (new 'static 'speech-type-info + :min-delay #x4b0 + :max-delay #x960 + :list (new 'static 'boxed-array :type string + "kg001" + "kg002" + "kg004" + "kg006" + "kg001a" + "kg013" + "kg016" + "kg018" + "kg019" + "kg023" + "kg024" + "kg002a" + "kg004a" + "kg078a" + "kg079a" + "kg080a" + "kg081a" + "kg004a" + "kg082a" + "kg083a" + "kg084a" + "kg085a" + "kg086a" + "kg087a" + "kg088a" + "kg091a" + "kg023a" + "kg006a" + "kg092a" + "kg020a" + "kg093a" + "kg094a" + "kg095a" + "kg103a" + "kg104a" + "kg112a" + "kg024a" + "kg134" + "kg136" + "kg137" + "kg138" + "kg139" + "kg140" + "kg141" + ) + ) + ) + (speech-control-method-10 + *speech-control* + 9 + (new 'static 'speech-type-info + :priority 1 + :min-delay #x12c + :max-delay #x258 + :list (new 'static 'boxed-array :type string + "kg133" + "kg142" + "kg144" + "kg145" + "kg146" + "kg147" + "kg148" + "kg149" + "kg150" + "kg138" + "kg151" + "kg152" + "kg153" + "kg154" + "kg155" + "kg159" + "kg163" + "kg164" + ) + ) + ) + (speech-control-method-10 + *speech-control* + 10 + (new 'static 'speech-type-info :priority #xa :max-delay #x12c :list (new 'static 'boxed-array :type string + "kg166" + "kg167" + "kg168" + "kg169" + "kg171" + "kg172" + "kg173" + "kg174" + "kg175" + ) + ) + ) + (none) + ) + ) + ) + +(set-subtask-hook! + *game-info* + 172 + 1 + (the-as + (function object) + (lambda :behavior task-manager () (speech-control-method-9 *speech-control*) (none)) + ) + ) diff --git a/goal_src/jak2/levels/hiphog/hiphog-obs.gc b/goal_src/jak2/levels/hiphog/hiphog-obs.gc index ca4da985b2..01dca5172b 100644 --- a/goal_src/jak2/levels/hiphog/hiphog-obs.gc +++ b/goal_src/jak2/levels/hiphog/hiphog-obs.gc @@ -7,3 +7,378 @@ ;; DECOMP BEGINS +(deftype hip-trophy-a (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-hip-trophy-a hip-trophy-a hip-trophy-a-lod0-jg hip-trophy-a-idle-ja + ((hip-trophy-a-lod0-mg (meters 999999))) + :bounds (static-spherem 1 -1 0 1.6) + ) + +(defstate idle (hip-trophy-a) + :virtual #t + :code (the-as (function none :behavior hip-trophy-a) sleep-code) + :post (the-as (function none :behavior hip-trophy-a) ja-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-trophy-a ((obj hip-trophy-a) (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-hip-trophy-a" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (if (= (the-as uint v1-5) 1) + (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + ) + ) + (go (method-of-object obj idle)) + (none) + ) + +(deftype hip-trophy-d (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-hip-trophy-d hip-trophy-d hip-trophy-d-lod0-jg hip-trophy-d-idle-ja + ((hip-trophy-d-lod0-mg (meters 999999))) + :bounds (static-spherem -0.2 -0.5 0 2) + ) + +(defstate idle (hip-trophy-d) + :virtual #t + :code (the-as (function none :behavior hip-trophy-d) sleep-code) + :post (the-as (function none :behavior hip-trophy-d) ja-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-trophy-d ((obj hip-trophy-d) (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-hip-trophy-d" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (if (= (the-as uint v1-5) 1) + (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + ) + ) + (go (method-of-object obj idle)) + (none) + ) + +(deftype hip-trophy-f (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-hip-trophy-f hip-trophy-f hip-trophy-f-lod0-jg hip-trophy-f-idle-ja + ((hip-trophy-f-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +(defstate idle (hip-trophy-f) + :virtual #t + :code (the-as (function none :behavior hip-trophy-f) sleep-code) + :post (the-as (function none :behavior hip-trophy-f) ja-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-trophy-f ((obj hip-trophy-f) (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-hip-trophy-f" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (if (= (the-as uint v1-5) 1) + (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + ) + ) + (go (method-of-object obj idle)) + (none) + ) + +(deftype hip-trophy-g (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-hip-trophy-g hip-trophy-g hip-trophy-g-lod0-jg hip-trophy-g-idle-ja + ((hip-trophy-g-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defstate idle (hip-trophy-g) + :virtual #t + :code (the-as (function none :behavior hip-trophy-g) sleep-code) + :post (the-as (function none :behavior hip-trophy-g) ja-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-trophy-g ((obj hip-trophy-g) (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-hip-trophy-g" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (if (= (the-as uint v1-5) 1) + (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + ) + ) + (go (method-of-object obj idle)) + (none) + ) + +(deftype hip-trophy-i (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-hip-trophy-i hip-trophy-i hip-trophy-i-lod0-jg hip-trophy-i-idle-ja + ((hip-trophy-i-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defstate idle (hip-trophy-i) + :virtual #t + :code (the-as (function none :behavior hip-trophy-i) sleep-code) + :post (the-as (function none :behavior hip-trophy-i) ja-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-trophy-i ((obj hip-trophy-i) (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-hip-trophy-i" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (if (= (the-as uint v1-5) 1) + (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + ) + ) + (go (method-of-object obj idle)) + (none) + ) + +(deftype hip-trophy-j (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-hip-trophy-j hip-trophy-j hip-trophy-j-lod0-jg hip-trophy-j-idle-ja + ((hip-trophy-j-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defstate idle (hip-trophy-j) + :virtual #t + :code (the-as (function none :behavior hip-trophy-j) sleep-code) + :post (the-as (function none :behavior hip-trophy-j) ja-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-trophy-j ((obj hip-trophy-j) (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-hip-trophy-j" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (if (= (the-as uint v1-5) 1) + (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + ) + ) + (go (method-of-object obj idle)) + (none) + ) + +(deftype hip-trophy-n (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-hip-trophy-n hip-trophy-n hip-trophy-n-lod0-jg hip-trophy-n-idle-ja + ((hip-trophy-n-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defstate idle (hip-trophy-n) + :virtual #t + :code (the-as (function none :behavior hip-trophy-n) sleep-code) + :post (the-as (function none :behavior hip-trophy-n) ja-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-trophy-n ((obj hip-trophy-n) (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-hip-trophy-n" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (if (= (the-as uint v1-5) 1) + (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + ) + ) + (go (method-of-object obj idle)) + (none) + ) + +(deftype hip-trophy-m (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-hip-trophy-m hip-trophy-m hip-trophy-m-lod0-jg hip-trophy-m-idle-ja + ((hip-trophy-m-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defstate idle (hip-trophy-m) + :virtual #t + :code (the-as (function none :behavior hip-trophy-m) sleep-code) + :post (the-as (function none :behavior hip-trophy-m) ja-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-trophy-m ((obj hip-trophy-m) (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-hip-trophy-m" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (if (= (the-as uint v1-5) 1) + (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + ) + ) + (go (method-of-object obj idle)) + (none) + ) diff --git a/goal_src/jak2/levels/intro/intro-obs.gc b/goal_src/jak2/levels/intro/intro-obs.gc index b7f764f9fb..afe5e0d61f 100644 --- a/goal_src/jak2/levels/intro/intro-obs.gc +++ b/goal_src/jak2/levels/intro/intro-obs.gc @@ -7,3 +7,454 @@ ;; DECOMP BEGINS +(deftype intro-flamer (process-drawable) + ((up-dir vector :inline :offset-assert 208) + (average-dir vector :inline :offset-assert 224) + (id int32 :offset-assert 240) + (path-u float :offset-assert 244) + (path-du float :offset-assert 248) + (z-rot float :offset-assert 252) + (flit-prev-offset vector :inline :offset-assert 256) + (flit-next-offset vector :inline :offset-assert 272) + (flit-factor float :offset-assert 288) + (flit-timer uint64 :offset-assert 296) + (flit-interval uint64 :offset-assert 304) + ) + :heap-base #xc0 + :method-count-assert 23 + :size-assert #x138 + :flag-assert #x1700c00138 + (:methods + (idle () _type_ :state 20) + (die () _type_ :state 21) + (intro-flamer-method-22 (_type_) path-control 22) + ) + ) + + +(defskelgroup skel-intro-flamer intro-flamer intro-flamer-lod0-jg intro-flamer-fly-straight-ja + ((intro-flamer-lod0-mg (meters 20)) (intro-flamer-lod1-mg (meters 40)) (intro-flamer-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7.5) + :shadow intro-flamer-shadow-mg + :origin-joint-index 3 + ) + +(defstate idle (intro-flamer) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('die) + (go-virtual die) + ) + ) + ) + :trans (behavior () + (if (= (-> self path-u) 1.0) + (go-virtual die) + ) + (when (>= (- (-> self clock frame-counter) (the-as int (-> self flit-timer))) + (the-as time-frame (-> self flit-interval)) + ) + (let ((f28-0 (rand-vu-float-range -1.0 1.0)) + (f30-0 (rand-vu-float-range -1.0 1.0)) + (f0-1 (rand-vu-float-range 0.2 0.6)) + ) + (set! (-> self flit-prev-offset quad) (-> self flit-next-offset quad)) + (set-vector! (-> self flit-next-offset) (* 4096.0 f28-0) (* 4096.0 f30-0) 0.0 0.0) + (set! (-> self flit-factor) 0.0) + (set! (-> self flit-interval) (the-as uint (the int (* 300.0 f0-1)))) + ) + (set! (-> self flit-timer) (the-as uint (-> self clock frame-counter))) + ) + (none) + ) + :code (behavior () + (ja-channel-set! 1) + (let ((f30-0 (rand-vu-float-range 0.8 1.2))) + (until #f + (ja-no-eval :group! (-> self draw art-group data 5) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1)) + f30-0 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + (none) + ) + :post (behavior () + (seek! (-> self path-u) 1.0 (* (-> self path-du) (-> self clock seconds-per-frame))) + (let ((s3-0 (intro-flamer-method-22 self)) + (s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'quaternion)) + (f30-0 (-> self path-u)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (get-point-at-percent-along-path! s3-0 gp-0 f30-0 'interp) + (displacement-between-points-at-percent-normalized! s3-0 s4-0 (fmin 1.0 (+ 0.05 f30-0))) + (let ((t9-4 vector-normalize!) + (a0-4 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-4 x) (-> s4-0 x)) + (set! (-> a0-4 y) 0.0) + (set! (-> a0-4 z) (-> s4-0 z)) + (set! (-> a0-4 w) 1.0) + (let ((s3-1 (t9-4 a0-4 1.0)) + (t9-5 vector-normalize!) + (a0-5 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-5 x) (-> self average-dir x)) + (set! (-> a0-5 y) 0.0) + (set! (-> a0-5 z) (-> self average-dir z)) + (set! (-> a0-5 w) 1.0) + (let* ((v1-10 (t9-5 a0-5 1.0)) + (f0-15 (vector-dot (vector-cross! (new 'stack-no-clear 'vector) s3-1 v1-10) *up-vector*)) + (f0-16 (* 49152.0 f0-15)) + ) + (set! (-> self z-rot) (deg-seek + (-> self z-rot) + (fmax -15473.777 (fmin 15473.777 f0-16)) + (* 21845.334 (-> self clock seconds-per-frame)) + ) + ) + ) + ) + ) + (let ((a2-5 (vector-rotate-z! (new 'stack-no-clear 'vector) *up-vector* (-> self z-rot)))) + (forward-up->quaternion s5-0 s4-0 a2-5) + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) s5-0 (* 8.0 (-> self clock seconds-per-frame))) + (seek! (-> self flit-factor) 1.0 (* 8.0 (-> self clock seconds-per-frame))) + (let* ((v1-25 (-> self flit-prev-offset)) + (a1-10 (-> self flit-next-offset)) + (a0-14 (vector-! (new 'stack-no-clear 'vector) a1-10 v1-25)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (vector+float*! s5-1 v1-25 a0-14 (-> self flit-factor)) + (vector-orient-by-quat! s5-1 s5-1 (-> self root quat)) + (vector+! (-> self root trans) gp-0 s5-1) + ) + ) + (cond + ((logtest? (-> self draw status) (draw-control-status on-screen)) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (let ((gp-1 (new 'stack-no-clear 'collide-query))) + (set! (-> gp-1 start-pos quad) (-> self root trans quad)) + (set-vector! (-> gp-1 move-dist) 0.0 -81920.0 0.0 1.0) + (let ((v1-37 gp-1)) + (set! (-> v1-37 radius) 2048.0) + (set! (-> v1-37 collide-with) (collide-spec backgnd)) + (set! (-> v1-37 ignore-process0) self) + (set! (-> v1-37 ignore-process1) #f) + (set! (-> v1-37 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-37 action-mask) (collide-action solid)) + ) + (cond + ((>= (fill-and-probe-using-line-sphere *collide-cache* gp-1) 0.0) + (let ((v1-41 (-> self draw shadow-ctrl))) + (logclear! (-> v1-41 settings flags) (shadow-flags disable-draw)) + ) + 0 + (let ((a0-28 (-> gp-1 best-other-tri intersect))) + (let ((f0-36 (-> self root trans y))) + (let ((v1-45 (-> self draw shadow-ctrl))) + (set! (-> v1-45 settings bot-plane w) (- (+ (- -12288.0 f0-36) (-> a0-28 y)))) + ) + 0 + (let ((v1-48 (-> self draw shadow-ctrl))) + (set! (-> v1-48 settings top-plane w) (- (+ (- 12288.0 f0-36) (-> a0-28 y)))) + ) + ) + 0 + (let* ((f2-2 (vector-vector-distance a0-28 (-> self root trans))) + (f0-41 (* 0.000030517578 (fmax 0.0 (fmin 32768.0 (+ -57344.0 f2-2))))) + ) + (set! (-> self draw shadow-ctrl settings shadow-dir w) (lerp 409600.0 40960.0 f0-41)) + ) + ) + ) + (else + (let ((v1-58 (-> self draw shadow-ctrl))) + (logior! (-> v1-58 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + ) + ) + (else + (let ((v1-61 (-> self draw shadow-ctrl))) + (logior! (-> v1-61 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + (ja-post) + (none) + ) + ) + +(defstate die (intro-flamer) + :virtual #t + :code (behavior () + (suspend) + (cleanup-for-death self) + (none) + ) + ) + +;; WARN: Return type mismatch object vs path-control. +(defmethod intro-flamer-method-22 intro-flamer ((obj intro-flamer)) + (the-as path-control (send-event (ppointer->process (-> obj parent)) 'path (-> obj id))) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! intro-flamer ((obj intro-flamer) (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-intro-flamer" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (go (method-of-object obj idle)) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior intro-flamer-init-by-other intro-flamer ((arg0 int) (arg1 path-control) (arg2 vector)) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-intro-flamer" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> self draw force-lod) 2) + (set! (-> self id) arg0) + (set! (-> self path-u) 0.0) + (set! (-> self path-du) (rand-vu-float-range 0.15 0.32)) + (set! (-> self z-rot) 0.0) + (set! (-> self flit-timer) (the-as uint (-> self clock frame-counter))) + (set! (-> self flit-interval) (the-as uint 0)) + (vector-reset! (-> self flit-prev-offset)) + (vector-reset! (-> self flit-next-offset)) + (set! (-> self flit-factor) 0.0) + (get-point-in-path! arg1 (-> self root trans) 0.0 'interp) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (displacement-between-points-at-percent-normalized! arg1 s4-1 0.0) + (forward-up-nopitch->quaternion (-> self root quat) s4-1 *up-vector*) + ) + (set! (-> self draw shadow-ctrl) + (new 'process 'shadow-control 0.0 0.0 614400.0 (shadow-flags shdf03) 491520.0) + ) + (set! (-> self draw light-index) (the-as uint 30)) + (set! (-> self average-dir quad) (-> arg2 quad)) + (go-virtual idle) + (none) + ) + +(deftype metalhead-spawner (process) + ((path-tbl path-control 19 :offset-assert 128) + (init-pos vector :inline :offset-assert 208) + (average-dir vector :inline :offset-assert 224) + ) + :heap-base #x70 + :method-count-assert 17 + :size-assert #xf0 + :flag-assert #x11007000f0 + (:methods + (idle () _type_ :state 14) + (active () _type_ :state 15) + (die () _type_ :state 16) + ) + ) + + +(defstate idle (metalhead-spawner) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger) + (go-virtual active) + ) + (('path) + (-> self path-tbl (-> event param 0)) + ) + ) + ) + :code (the-as (function none :behavior metalhead-spawner) sleep-code) + ) + +(defstate active (metalhead-spawner) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('untrigger) + (go-virtual idle) + ) + (('die) + (go-virtual die) + ) + (('path) + (-> self path-tbl (-> event param 0)) + ) + ) + ) + :code (behavior () + (let ((gp-0 0)) + (until #f + (set! gp-0 (mod (+ gp-0 (rand-vu-int-range 1 6)) 19)) + (let ((s5-0 (get-process *default-dead-pool* intro-flamer #x4000))) + (when s5-0 + (let ((t9-2 (method-of-type process activate))) + (t9-2 s5-0 self (symbol->string (-> intro-flamer symbol)) (the-as pointer #x70004000)) + ) + (run-now-in-process s5-0 intro-flamer-init-by-other gp-0 (-> self path-tbl gp-0) (-> self average-dir)) + (-> s5-0 ppointer) + ) + ) + (let ((s5-1 (the int (* 300.0 (rand-vu-float-range 0.03 0.08)))) + (s4-0 (-> self clock frame-counter)) + ) + (until (>= (- (-> self clock frame-counter) s4-0) s5-1) + (suspend) + ) + ) + ) + ) + #f + (none) + ) + :post (behavior () + (dotimes (gp-0 19) + (debug-draw (-> self path-tbl gp-0)) + ) + (none) + ) + ) + +(defstate die (metalhead-spawner) + :virtual #t + :code (behavior () + (let ((gp-0 (-> self child))) + (while gp-0 + (send-event (ppointer->process gp-0) 'die) + (set! gp-0 (-> gp-0 0 brother)) + ) + ) + (while (-> self child) + (suspend) + ) + (process-entity-status! self (entity-perm-status dead) #t) + (none) + ) + ) + +;; WARN: Return type mismatch process vs metalhead-spawner. +(defmethod relocate metalhead-spawner ((obj metalhead-spawner) (arg0 int)) + (dotimes (v1-0 19) + (if (nonzero? (-> obj path-tbl v1-0)) + (&+! (-> obj path-tbl v1-0) arg0) + ) + ) + (the-as + metalhead-spawner + ((the-as (function process int process) (find-parent-method metalhead-spawner 7)) obj arg0) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! metalhead-spawner ((obj metalhead-spawner) (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 init-pos quad) (-> arg0 extra trans quad)) + (vector-reset! (-> obj average-dir)) + (dotimes (s5-0 19) + (let ((s4-0 (new 'process 'curve-control obj 'path (the float (+ s5-0 1))))) + (set! (-> obj path-tbl s5-0) s4-0) + (logior! (-> s4-0 flags) (path-control-flag display draw-line draw-point draw-text)) + (let* ((s3-0 (get-point-at-percent-along-path! s4-0 (new 'stack-no-clear 'vector) 0.0 'interp)) + (v1-10 (get-point-at-percent-along-path! s4-0 (new 'stack-no-clear 'vector) 1.0 'interp)) + (s4-2 (vector-! (new 'stack-no-clear 'vector) v1-10 s3-0)) + ) + (vector-normalize! s4-2 1.0) + (vector+! (-> obj average-dir) (-> obj average-dir) s4-2) + ) + ) + ) + (vector-normalize! (-> obj average-dir) 1.0) + (go (method-of-object obj idle)) + (none) + ) + +(deftype vil-windmill-sail (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-vil-windmill-sail vil-windmill-sail vil-windmill-sail-lod0-jg vil-windmill-sail-idle-ja + ((vil-windmill-sail-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) + +(defstate idle (vil-windmill-sail) + :virtual #t + :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 vil-windmill-sail) ja-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! vil-windmill-sail ((obj vil-windmill-sail) (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-vil-windmill-sail" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (go (method-of-object obj idle)) + (none) + ) diff --git a/goal_src/jak2/levels/landing_pad/castle-obs.gc b/goal_src/jak2/levels/landing_pad/castle-obs.gc index 855efff77d..21b1e817d0 100644 --- a/goal_src/jak2/levels/landing_pad/castle-obs.gc +++ b/goal_src/jak2/levels/landing_pad/castle-obs.gc @@ -5,5 +5,2757 @@ ;; name in dgo: castle-obs ;; dgos: CAS +;; og:update-with-merge:substr + ;; DECOMP BEGINS +(define *cas-conveyor-room-id* 0) + +(deftype cas-conveyor (conveyor) + ((actor-group (pointer actor-group) :offset-assert 256) + (actor-group-count int32 :offset-assert 260) + (texture-anim-index uint32 :offset-assert 264) + (my-id int32 :offset-assert 268) + (sound-id uint32 :offset-assert 272) + (target-speed float :offset-assert 276) + ) + :heap-base #xa0 + :method-count-assert 28 + :size-assert #x118 + :flag-assert #x1c00a00118 + ) + + +(defmethod init! cas-conveyor ((obj cas-conveyor)) + "Initializes defaults for things like the `speed` and `belt-radius`" + (let ((t9-0 (method-of-type conveyor init!))) + (t9-0 obj) + ) + (set! (-> obj speed) (res-lump-float (-> obj entity) 'speed :default 30720.0)) + (set! (-> obj belt-radius) (res-lump-float (-> obj entity) 'center-radius :default 15974.4)) + (set! (-> obj texture-anim-index) (res-lump-value (-> obj entity) 'index uint :time -1000000000.0)) + (set! (-> obj my-id) + (res-lump-value (-> obj entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) + ) + (set! (-> obj pull-y-threshold) 409.6) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-conveyor ((obj cas-conveyor) (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" + (local-vars (sv-16 res-tag)) + (reset-root! obj) + (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) + (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (< (-> obj path curve num-cverts) 2) + (go process-drawable-art-error "bad path") + ) + (init! obj) + (set! (-> obj sound-id) (the-as uint (new-sound-id))) + (set! (-> obj target-speed) (-> obj speed)) + (conveyor-method-21 obj) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-16 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-16 (nonzero? (-> sv-16 elt-count))) + (set! (-> obj actor-group) (the-as (pointer actor-group) v1-16)) + (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> obj actor-group-count) 0) + 0 + ) + ) + ) + (go (method-of-object obj idle)) + (none) + ) + +(defmethod deactivate cas-conveyor ((obj cas-conveyor)) + (sound-stop (the-as sound-id (-> obj sound-id))) + ((the-as (function conveyor none) (find-parent-method cas-conveyor 10)) obj) + (none) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defbehavior sound-update cas-conveyor () + (when (and *target* + (and (>= 327680.0 (vector-vector-distance (-> self collide-bounds) (-> *target* control trans))) + (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (let ((f0-2 (* 0.000032552085 (+ -30720.0 (fabs (-> self speed)))))) + (sound-play-by-name + (static-sound-name "castle-conveyor") + (the-as sound-id (-> self sound-id)) + 1024 + (the int (* 1524.0 f0-2)) + 0 + (sound-group sfx) + (-> self collide-bounds) + ) + ) + ) + (none) + ) + +(defstate idle (cas-conveyor) + :virtual #t + :trans sound-update + :code (the-as (function none :behavior cas-conveyor) sleep-code) + :post (behavior () + (when (or (= (-> self my-id) -1) (= (-> self my-id) (/ *cas-conveyor-room-id* 8))) + (cond + ((zero? (-> self actor-group-count)) + (set! (-> self speed) (seek-with-smooth (-> self speed) (-> self target-speed) 61440.0 0.1 409.6)) + ) + (else + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'get-speed) + (set! (-> a1-1 param 0) (the-as uint #f)) + (let ((t9-1 send-event-function) + (v1-13 (-> self actor-group 0 data 0 actor)) + ) + (set! (-> self speed) (the-as float (t9-1 + (if v1-13 + (-> v1-13 extra process) + ) + a1-1 + ) + ) + ) + ) + ) + ) + ) + (set-conveyor-speed! (the-as int (-> self texture-anim-index)) (-> self speed)) + ) + (let ((t9-3 (-> (method-of-type conveyor idle) post))) + (if t9-3 + ((the-as (function none) t9-3)) + ) + ) + (none) + ) + ) + +(deftype cas-conveyor-switch (process-focusable) + ((actor-group (pointer actor-group) :offset-assert 204) + (actor-group-count int32 :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 212) + (quat0 quaternion :inline :offset-assert 224) + (quat180 quaternion :inline :offset-assert 240) + (red-pos vector :inline :offset-assert 256) + (blue-pos vector :inline :offset-assert 272) + (track-flag symbol :offset-assert 288) + (lightning-timer time-frame :offset-assert 296) + (speed float :offset-assert 304) + (target-speed float :offset-assert 308) + ) + :heap-base #xc0 + :method-count-assert 28 + :size-assert #x138 + :flag-assert #x1c00c00138 + (:methods + (idle () _type_ :state 27) + ) + ) + + +(set! (-> *lightning-spec-id-table* 27) (new 'static 'lightning-spec + :name "lightning-cas-switch" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x83 :page #xc) + :reduction 0.42 + :num-points 6 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration 30.0 + :sound #f + ) + ) + +(defskelgroup skel-cas-conveyor-switch cas-conveyor-switch cas-conveyor-switch-lod0-jg cas-conveyor-switch-idle-ja + ((cas-conveyor-switch-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0.7 0 3.5) + :origin-joint-index 3 + ) + +(defstate idle (cas-conveyor-switch) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (let ((v1-1 (the-as object (-> event param 1)))) + (when (!= (-> (the-as attack-info v1-1) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-1) id)) + (when (and (-> self track-flag) (= (-> self speed) (-> self target-speed))) + (set! (-> self target-speed) (- (-> self target-speed))) + (sound-play "cas-shot-switch") + ) + ) + ) + ) + (('track) + (-> self track-flag) + ) + (('get-speed) + (-> self speed) + ) + ) + ) + :trans (behavior () + (let ((f30-0 (-> self speed))) + (set! (-> self speed) (seek-with-smooth (-> self speed) (-> self target-speed) 61440.0 0.1 409.6)) + (cond + ((< f30-0 0.0) + (quaternion-smooth-seek! (-> self root-override quat) (-> self root-override quat) (-> self quat180) 0.1) + (let ((t9-2 sp-launch-particles-var) + (a0-2 *sp-particle-system-2d*) + (a1-2 (-> *part-id-table* 5119)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> self blue-pos quad)) + (t9-2 a0-2 a1-2 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + (else + (quaternion-smooth-seek! (-> self root-override quat) (-> self root-override quat) (-> self quat0) 0.1) + (let ((t9-4 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 5120)) + (a2-4 *launch-matrix*) + ) + (set! (-> a2-4 trans quad) (-> self red-pos quad)) + (t9-4 a0-4 a1-4 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + (cond + ((or (zero? (-> self actor-group-count)) + (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) + ) + (set! (-> self track-flag) #t) + ) + (else + (let ((gp-0 0)) + (dotimes (s5-0 (length (-> self actor-group 0))) + (let ((v1-16 (-> self actor-group 0 data s5-0)) + (a1-5 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-5 from) (process->ppointer self)) + (set! (-> a1-5 num-params) 0) + (set! (-> a1-5 message) 'stopped?) + (let ((t9-5 send-event-function) + (v1-17 (-> v1-16 actor)) + ) + (if (not (t9-5 + (if v1-17 + (-> v1-17 extra process) + ) + a1-5 + ) + ) + (+! gp-0 1) + ) + ) + ) + ) + (cond + ((zero? gp-0) + (set-castle-electricity-scale! 0.0) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + ) + (else + (set-castle-electricity-scale! 1.0) + ) + ) + (set! (-> self track-flag) (zero? gp-0)) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior cas-conveyor-switch) sleep-code) + :post (behavior () + (local-vars (sv-608 symbol) (sv-624 symbol) (sv-640 (function vector cspace vector)) (sv-656 vector)) + (when (and (logtest? (actor-option user17) (-> self fact options)) + (not (-> self track-flag)) + (< (-> self lightning-timer) (-> self clock frame-counter)) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> *y-vector* quad)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (vector-rotate-x! s5-0 s5-0 (* 182.04445 (rand-vu-float-range 0.0 5.0))) + (vector-rotate-y! s5-0 s5-0 (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (set! (-> gp-0 start-pos quad) (-> self root-override trans quad)) + (vector-normalize-copy! (-> gp-0 move-dist) s5-0 40960.0) + (let ((v1-11 gp-0)) + (set! (-> v1-11 radius) 409.6) + (set! (-> v1-11 collide-with) (collide-spec backgnd enemy obstacle)) + (set! (-> v1-11 ignore-process0) self) + (set! (-> v1-11 ignore-process1) #f) + (set! (-> v1-11 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-11 action-mask) (collide-action solid)) + ) + (let ((f0-5 (fill-and-probe-using-line-sphere *collide-cache* gp-0))) + (when (< 0.0 f0-5) + (let ((s5-2 (vector+float*! (new 'stack-no-clear 'vector) (-> gp-0 start-pos) (-> gp-0 move-dist) f0-5)) + (gp-1 45) + (s4-2 (get-process *default-dead-pool* lightning-tracker #x4000)) + ) + (when s4-2 + (let ((t9-7 (method-of-type lightning-tracker activate))) + (t9-7 + (the-as lightning-tracker s4-2) + *entity-pool* + (symbol->string (-> lightning-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((s3-2 run-function-in-process) + (s2-2 s4-2) + (s1-0 lightning-tracker-init) + (s0-0 (-> *lightning-spec-id-table* 27)) + ) + (set! sv-608 (the-as symbol #f)) + (set! sv-624 (the-as symbol #f)) + (set! sv-640 vector<-cspace!) + (set! sv-656 (new 'stack-no-clear 'vector)) + (let* ((a1-8 (-> self node-list data (+ (rand-vu-int-count 3) 4))) + (t2-0 (sv-640 sv-656 a1-8)) + ) + ((the-as (function object object object object object object object object none) s3-2) + s2-2 + s1-0 + s0-0 + gp-1 + sv-608 + sv-624 + t2-0 + s5-2 + ) + ) + ) + (-> s4-2 ppointer) + ) + ) + (set! (-> self lightning-timer) + (+ (-> self clock frame-counter) (the int (* 300.0 (rand-vu-float-range 0.04 0.1)))) + ) + ) + ) + ) + ) + ) + (transform-post) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-conveyor-switch ((obj cas-conveyor-switch) (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" + (local-vars (sv-16 res-tag)) + (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 enemy)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list 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 1228.8 0.0 14336.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-cas-conveyor-switch" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj mask) (logior (process-mask enemy) (-> obj mask))) + (set! (-> obj fact) + (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) + (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (!= (-> obj path curve num-cverts) 2) + (go process-drawable-art-error "bad path") + ) + (get-point-in-path! (-> obj path) (-> obj red-pos) 0.0 'exact) + (get-point-in-path! (-> obj path) (-> obj blue-pos) 1.0 'exact) + (set! (-> obj lightning-timer) 0) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-27 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-27 (nonzero? (-> sv-16 elt-count))) + (set! (-> obj actor-group) (the-as (pointer actor-group) v1-27)) + (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> obj actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> obj quat0 quad) (-> obj root-override quat quad)) + (quaternion-rotate-y! (-> obj quat180) (-> obj quat0) 32768.0) + (set! (-> obj speed) (res-lump-float (-> obj entity) 'speed :default 30720.0)) + (set! (-> obj target-speed) (-> obj speed)) + (go (method-of-object obj idle)) + (none) + ) + +(deftype cas-electric-fence (process-focusable) + ((next-spawn-time time-frame :offset-assert 208) + (stop symbol :offset-assert 216) + ) + :heap-base #x60 + :method-count-assert 29 + :size-assert #xdc + :flag-assert #x1d006000dc + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + ) + ) + + +(defskelgroup skel-cas-electric-fence cas-electric-fence cas-electric-fence-lod0-jg cas-electric-fence-idle-ja + ((cas-electric-fence-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1.5 0 2) + ) + +(defskelgroup skel-cas-electric-fence-explode cas-electric-fence cas-electric-fence-explode-lod0-jg cas-electric-fence-explode-idle-ja + ((cas-electric-fence-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4.2) + ) + +(define *cas-electric-fence-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 3 :parent-joint-index -1) + (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 + :art-level #f + ) + ) + +(defstate die (cas-electric-fence) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (none) + ) + :code (behavior () + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-cas-electric-fence-explode" (the-as (pointer uint32) #f)) + 5 + gp-0 + *cas-electric-fence-exploder-params* + :to self + ) + ) + (sound-play "lightning-node") + (suspend) + (logior! (-> self entity extra perm status) (entity-perm-status dead)) + (let ((gp-2 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-2) (seconds 4)) + (suspend) + ) + ) + (cleanup-for-death self) + (none) + ) + ) + +(defstate idle (cas-electric-fence) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('touched) + #f + ) + (('attack) + #f + ) + (('track) + #t + ) + (('stop) + (let ((v0-0 #t)) + (set! (-> self stop) v0-0) + v0-0 + ) + ) + (('stopped?) + (-> self stop) + ) + ) + ) + ) + :code (the-as (function none :behavior cas-electric-fence) sleep-code) + :post (behavior () + (when (not (-> self stop)) + (when (< (-> self next-spawn-time) (-> self clock frame-counter)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> *y-vector* quad)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (vector-rotate-x! s5-0 s5-0 (* 182.04445 (rand-vu-float-range 0.0 140.0))) + (vector-rotate-y! s5-0 s5-0 (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (set! (-> gp-0 start-pos quad) (-> self root-override trans quad)) + (set! (-> gp-0 start-pos y) (+ 15400.96 (-> gp-0 start-pos y))) + (vector-normalize-copy! (-> gp-0 move-dist) s5-0 40960.0) + (let ((v1-9 gp-0)) + (set! (-> v1-9 radius) 409.6) + (set! (-> v1-9 collide-with) (collide-spec backgnd enemy obstacle)) + (set! (-> v1-9 ignore-process0) self) + (set! (-> v1-9 ignore-process1) #f) + (set! (-> v1-9 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-9 action-mask) (collide-action solid)) + ) + (let ((f0-7 (fill-and-probe-using-line-sphere *collide-cache* gp-0))) + (when (< 0.0 f0-7) + (let ((s5-2 (vector+float*! (new 'stack-no-clear 'vector) (-> gp-0 start-pos) (-> gp-0 move-dist) f0-7))) + (let ((s4-2 120)) + (process-spawn + lightning-tracker + :init lightning-tracker-init + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x83 :page #xc) + :reduction 0.42 + :num-points 16 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "shock" :fo-min 10 :fo-max 40) + ) + s4-2 + #f + #f + (-> gp-0 start-pos) + s5-2 + :to *entity-pool* + ) + (let ((v1-22 (get-field-spec-by-id (-> *part-id-table* 166) (sp-field-id spt-timer)))) + (if v1-22 + (set! (-> v1-22 initial-valuef) (the-as float s4-2)) + ) + ) + ) + (let ((t9-10 sp-launch-particles-var) + (a0-21 *sp-particle-system-2d*) + (a1-10 (-> *part-id-table* 166)) + (a2-8 *launch-matrix*) + ) + (set! (-> a2-8 trans quad) (-> s5-2 quad)) + (t9-10 a0-21 a1-10 a2-8 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + (set! (-> self next-spawn-time) + (+ (-> self clock frame-counter) (the int (* 300.0 (rand-vu-float-range 0.07 0.4)))) + ) + ) + ) + ) + ) + ) + (let ((gp-2 *target*)) + (when (and gp-2 (zero? (logand (-> gp-2 focus-status) (focus-status disable dead ignore inactive)))) + (let ((s4-3 (get-trans gp-2 0))) + (when (< (vector-vector-distance s4-3 (-> self root-override trans)) 24576.0) + (let ((s5-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> s5-3 from) (process->ppointer self)) + (set! (-> s5-3 num-params) 2) + (set! (-> s5-3 message) 'attack) + (set! (-> s5-3 param 0) (the-as uint #f)) + (let ((s3-3 (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up control id)))) + (let* ((v1-38 *game-info*) + (a0-29 (+ (-> v1-38 attack-id) 1)) + ) + (set! (-> v1-38 attack-id) a0-29) + (set! (-> s3-3 id) a0-29) + ) + (set! (-> s3-3 vector quad) + (-> (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-3 (-> self root-override trans)) 1.0) quad) + ) + (set! (-> s3-3 shove-back) 24576.0) + (set! (-> s3-3 shove-up) 12288.0) + (set! (-> s3-3 control) (if (logtest? (focus-status board) (-> gp-2 focus-status)) + 1.0 + 0.0 + ) + ) + (set! (-> s5-3 param 1) (the-as uint s3-3)) + ) + (send-event-function gp-2 s5-3) + ) + (let ((s5-4 (new 'stack-no-clear 'vector))) + (set! (-> s5-4 quad) (-> self root-override trans quad)) + (set! (-> s5-4 y) (+ 15400.96 (-> s5-4 y))) + (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> *lightning-spec-id-table* 1) + 225 + #f + #f + s5-4 + 6 + :to gp-2 + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-electric-fence ((obj cas-electric-fence) (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 ((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 hit-by-others-list player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid deadly)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 6144.0 0.0 8192.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! (-> s4-0 event-self) 'touched) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-electric-fence" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj next-spawn-time) 0) + (set! (-> obj stop) #f) + (ja-channel-set! 1) + (let ((a0-14 (-> obj skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> a0-14 frame-num) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +(deftype cas-button (basebutton) + () + :heap-base #xa0 + :method-count-assert 40 + :size-assert #x120 + :flag-assert #x2800a00120 + (:methods + (cas-button-method-39 (_type_) none 39) + ) + ) + + +(defskelgroup skel-cas-button cas-button cas-button-lod0-jg cas-button-idle-ja + ((cas-button-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.25) + ) + +(defmethod basebutton-method-34 cas-button ((obj cas-button)) + "TODO - collision stuff" + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 9216.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-12 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +(defmethod prepare-trigger-event! cas-button ((obj cas-button)) + "Sets `event-going-down` to `'trigger`" + (set! (-> obj event-down) 'shutdown) + 0 + (none) + ) + +(defstate up-idle (cas-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (let ((v1-1 (the-as attack-info (-> event param 1)))) + (case (-> v1-1 mode) + (('flop) + (when (or (not (or (= (-> v1-1 mode) 'spin) (= (-> v1-1 mode) 'punch))) + (logtest? (-> self button-status) (button-status button-status-3)) + ) + (send-event! self (-> self event-going-down)) + (sound-play "big-red-button") + (go-virtual going-down) + ) + ) + ) + ) + ) + ) + ) + ) + +(defmethod basebutton-method-33 cas-button ((obj cas-button)) + "TODO - joint stuff" + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-button" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (cond + ((logtest? (-> obj button-status) (button-status pressed)) + (let ((s5-1 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-1 + (the-as art-joint-anim (-> obj draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-1 frame-num) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) frames num-frames) -1)) + ) + ) + ) + (else + (let ((s5-2 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-2 + (the-as art-joint-anim (-> obj draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-2 frame-num) 0.0) + ) + ) + ) + (set! (-> obj anim-speed) 2.0) + (transform-post) + (none) + ) + +(deftype cas-elevator (elevator) + ((sound-id uint32 :offset-assert 368) + ) + :heap-base #x100 + :method-count-assert 50 + :size-assert #x174 + :flag-assert #x3201000174 + (:methods + (cas-elevator-method-49 (_type_) none 49) + ) + ) + + +(defskelgroup skel-cas-elevator cas-elevator cas-elevator-lod0-jg cas-elevator-up-down-ja + ((cas-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 9) + ) + +(defmethod get-art-group cas-elevator ((obj cas-elevator)) + "@returns The associated [[art-group]]" + (art-group-get-by-name *level* "skel-cas-elevator" (the-as (pointer uint32) #f)) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod cas-elevator-method-49 cas-elevator ((obj cas-elevator)) + (let* ((f0-1 (fmax 0.0 (- (-> obj root-override trans y) (-> obj bottom-top 0)))) + (f0-3 (* 0.001171875 (- f0-1 (* (the float (the int (/ f0-1 30720.0))) 30720.0)))) + (v1-6 (-> obj skel root-channel 0)) + ) + (set! (-> v1-6 num-func) num-func-identity) + (set! (-> v1-6 frame-num) f0-3) + ) + (none) + ) + +(defmethod move-between-points cas-elevator ((obj cas-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 ((s5-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) (-> s5-0 y)) (< (-> arg0 y) (+ -8192.0 (-> v1-3 y)))) + (let ((a0-8 (vector-! (new 'stack-no-clear 'vector) arg0 v1-3))) + (< (sqrtf (+ (* (-> a0-8 x) (-> a0-8 x)) (* (-> a0-8 z) (-> a0-8 z)))) 36864.0) + ) + ) + ) + ) + +(defmethod commited-to-ride? cas-elevator ((obj cas-elevator)) + "@returns if the target is considered within the elevator area enough to begin descending/ascending" + (let* ((s5-0 *target*) + (a0-2 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when a0-2 + (let* ((a0-3 (get-trans a0-2 0)) + (v1-2 (vector-! (new 'stack-no-clear 'vector) a0-3 (-> obj root-override trans))) + ) + (< (sqrtf (+ (* (-> v1-2 x) (-> v1-2 x)) (* (-> v1-2 z) (-> v1-2 z)))) 28672.0) + ) + ) + ) + ) + +(defstate waiting (cas-elevator) + :virtual #t + :post (behavior () + (if (-> self bouncing) + (cas-elevator-method-49 self) + ) + (let ((t9-1 (-> (method-of-type elevator waiting) post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (none) + ) + ) + +(defstate running (cas-elevator) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type elevator running) enter))) + (if t9-0 + (t9-0) + ) + ) + (sound-play "cas-elevate" :id (the-as sound-id (-> self sound-id)) :position (-> self root-override trans)) + (none) + ) + :post (behavior () + (cas-elevator-method-49 self) + (let ((t9-1 (-> (method-of-type elevator running) post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (when *sound-player-enable* + (let ((gp-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> gp-0 command) (sound-command set-param)) + (set! (-> gp-0 id) (the-as sound-id (-> self sound-id))) + (let ((a1-0 (-> self root-override trans))) + (let ((s5-0 self)) + (when (= a1-0 #t) + (if (and s5-0 (type? s5-0 process-drawable) (nonzero? (-> s5-0 root-override))) + (set! a1-0 (-> s5-0 root-override trans)) + (set! a1-0 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (the-as vector3w (-> gp-0 params trans)) a1-0) + ) + (set! (-> gp-0 params mask) (the-as uint 32)) + (-> gp-0 id) + ) + ) + (none) + ) + ) + +(defstate arrived (cas-elevator) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type elevator arrived) enter))) + (if t9-0 + (t9-0) + ) + ) + (sound-stop (the-as sound-id (-> self sound-id))) + (sound-play "cas-elevate-end") + (none) + ) + :post (behavior () + (if (-> self bouncing) + (cas-elevator-method-49 self) + ) + (let ((t9-1 (-> (method-of-type elevator arrived) post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (none) + ) + ) + +(defmethod deactivate cas-elevator ((obj cas-elevator)) + (sound-stop (the-as sound-id (-> obj sound-id))) + ((the-as (function elevator none) (find-parent-method cas-elevator 10)) obj) + (none) + ) + +(defmethod init-plat! cas-elevator ((obj cas-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." + (set! (-> obj sound-id) (the-as uint (new-sound-id))) + (cas-elevator-method-49 obj) + (none) + ) + +(defmethod init-plat-collision! cas-elevator ((obj cas-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-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (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 0.0 36864.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-16 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +(deftype cas-rot-bridge (process-drawable) + ((index uint32 :offset-assert 200) + (anim-index uint32 :offset-assert 204) + (test-index uint32 :offset-assert 208) + (pos float :offset-assert 212) + (pos-old float :offset-assert 216) + (sound-id uint32 :offset-assert 220) + (sound-flag symbol :offset-assert 224) + ) + :heap-base #x70 + :method-count-assert 21 + :size-assert #xe4 + :flag-assert #x15007000e4 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-cas-rot-bridge cas-rot-bridge cas-rot-bridge-lod0-jg cas-rot-bridge-idle-ja + ((cas-rot-bridge-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 -8 14) + :origin-joint-index 3 + ) + +(defstate idle (cas-rot-bridge) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (local-vars (v0-0 number)) + (the-as object (case event-type + (('move) + (set! (-> self anim-index) (/ (the-as int (-> event param 0)) 8)) + (set! v0-0 (logclear (-> self mask) (process-mask sleep-code))) + (set! (-> self mask) (the-as process-mask v0-0)) + v0-0 + ) + (('get-pos) + (set! (-> self test-index) (/ (the-as int (-> event param 0)) 8)) + (let ((f0-0 (ja-aframe-num 0))) + (cond + ((zero? (-> self test-index)) + (if (< f0-0 10.0) + (set! f0-0 10.0) + ) + (if (< 40.0 f0-0) + (set! f0-0 40.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -10.0 f0-0))) + ) + ((= (-> self test-index) 1) + (if (< f0-0 50.0) + (set! f0-0 50.0) + ) + (if (< 80.0 f0-0) + (set! f0-0 80.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -50.0 f0-0))) + ) + ((= (-> self test-index) 2) + (if (< f0-0 90.0) + (set! f0-0 90.0) + ) + (if (< 120.0 f0-0) + (set! f0-0 120.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -90.0 f0-0))) + ) + ((= (-> self test-index) 3) + (if (< f0-0 10.0) + (set! f0-0 10.0) + ) + (if (< 40.0 f0-0) + (set! f0-0 40.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -10.0 f0-0))) + ) + ) + ) + (-> self pos) + ) + (('reset) + (when (nonzero? (-> self anim-index)) + (ja-no-eval :group! (-> self draw art-group data 3) :num! min) + (set! (-> self anim-index) (the-as uint 0)) + (set! v0-0 (logclear (-> self mask) (process-mask sleep-code))) + (set! (-> self mask) (the-as process-mask v0-0)) + v0-0 + ) + ) + ) + ) + ) + :code (behavior () + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + (let ((f0-0 (ja-aframe-num 0))) + (cond + ((zero? (-> self anim-index)) + (when (or (= f0-0 10.0) (= f0-0 40.0) (= f0-0 50.0)) + (cond + ((= f0-0 10.0) + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 7) + :num! (seek! 0.0) + :frame-num (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) frames num-frames) -1)) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + ) + ) + ) + ((= (-> self anim-index) 1) + (when (or (= f0-0 40.0) (= f0-0 50.0) (= f0-0 80.0) (= f0-0 90.0)) + (cond + ((or (= f0-0 40.0) (= f0-0 50.0)) + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 8) + :num! (seek! 0.0) + :frame-num (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) frames num-frames) -1)) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + ) + ) + ) + ((= (-> self anim-index) 2) + (when (or (= f0-0 80.0) (= f0-0 90.0) (= f0-0 120.0)) + (cond + ((or (= f0-0 80.0) (= f0-0 90.0)) + (ja-no-eval :group! (-> self draw art-group data 5) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 9) + :num! (seek! 0.0) + :frame-num (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) frames num-frames) -1)) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + ) + ) + ) + ((= (-> self anim-index) 3) + (cond + ((= f0-0 10.0) + (ja-no-eval :group! (-> self draw art-group data 6) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 10) + :num! (seek! 0.0) + :frame-num (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) frames num-frames) -1)) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + ) + ) + ) + ) + ) + #f + (none) + ) + :post (behavior () + (let ((f0-0 (ja-aframe-num 0))) + (cond + ((zero? (-> self anim-index)) + (if (< f0-0 10.0) + (set! f0-0 10.0) + ) + (if (< 40.0 f0-0) + (set! f0-0 40.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -10.0 f0-0))) + ) + ((= (-> self anim-index) 1) + (if (< f0-0 50.0) + (set! f0-0 50.0) + ) + (if (< 80.0 f0-0) + (set! f0-0 80.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -50.0 f0-0))) + ) + ((= (-> self anim-index) 2) + (if (< f0-0 90.0) + (set! f0-0 90.0) + ) + (if (< 120.0 f0-0) + (set! f0-0 120.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -90.0 f0-0))) + ) + ((= (-> self anim-index) 3) + (if (< f0-0 10.0) + (set! f0-0 10.0) + ) + (if (< 40.0 f0-0) + (set! f0-0 40.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -10.0 f0-0))) + ) + ) + ) + (let* ((f0-9 (-> self pos)) + (f1-13 (- f0-9 (-> self pos-old))) + ) + (set! (-> self pos-old) f0-9) + (when (!= f1-13 0.0) + (cond + ((< 0.0 f1-13) + (cond + ((< f0-9 1.0) + (sound-play + "track-plat-loop" + :id (the-as sound-id (-> self sound-id)) + :position (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 5)) + ) + (set! (-> self sound-flag) #t) + ) + ((-> self sound-flag) + (sound-play + "track-plat-stop" + :position (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 5)) + ) + (sound-stop (the-as sound-id (-> self sound-id))) + (set! (-> self sound-flag) #f) + ) + ) + ) + (else + (cond + ((< 0.0 f0-9) + (sound-play + "track-plat-loop" + :id (the-as sound-id (-> self sound-id)) + :position (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 5)) + ) + (set! (-> self sound-flag) #t) + ) + ((-> self sound-flag) + (sound-play + "track-plat-stop" + :position (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 5)) + ) + (sound-stop (the-as sound-id (-> self sound-id))) + (set! (-> self sound-flag) #f) + ) + ) + ) + ) + ) + ) + (transform-post) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-rot-bridge ((obj cas-rot-bridge) (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 5) 0))) + (set! (-> s4-0 total-prims) (the-as uint 6)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 5) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 57344.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 0.0 0.0 0.0 18432.0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 4) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 5120.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 5) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 18432.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 6) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 5120.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 7) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 18432.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-20 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-20 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-20 prim-core collide-with)) + ) + (set! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-rot-bridge" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) 16384.0) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj index) (res-lump-value (-> obj entity) 'index uint :time -1000000000.0)) + (let ((v1-30 (-> obj index))) + (cond + ((zero? v1-30) + (set! (-> obj root trans x) (+ 5734.4 (-> obj root trans x))) + (let ((s5-2 (-> obj skel root-channel 0))) + (joint-control-channel-group! s5-2 (the-as art-joint-anim (-> obj draw art-group data 6)) num-func-identity) + (set! (-> s5-2 frame-num) 0.0) + ) + ) + ((= v1-30 1) + (let ((s5-3 (-> obj skel root-channel 0))) + (joint-control-channel-group! s5-3 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (set! (-> s5-3 frame-num) 0.0) + ) + ) + ) + ) + (set! (-> obj draw light-index) (the-as uint 1)) + (set! (-> obj sound-id) (the-as uint (new-sound-id))) + (set! (-> obj sound-flag) #f) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +(deftype cas-switch (process-drawable) + ((actor-group (pointer actor-group) :offset-assert 200) + (actor-group-count int32 :offset-assert 204) + (incoming-attack-id uint32 :offset-assert 208) + (anim-index uint32 :offset-assert 212) + (direction uint32 :offset-assert 216) + (pos-old float :offset-assert 220) + (y-start float :offset-assert 224) + (y-delta float :offset-assert 228) + (sound-id uint32 :offset-assert 232) + (sound-flag symbol :offset-assert 236) + ) + :heap-base #x70 + :method-count-assert 21 + :size-assert #xf0 + :flag-assert #x15007000f0 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-cas-switch cas-switch 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 2.7 0 3) + :origin-joint-index 3 + ) + +(defstate idle (cas-switch) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as + object + (case event-type + (('attack) + (let ((gp-0 (the-as attack-info (-> event param 1)))) + (when (or (= (-> gp-0 mode) 'spin) (= (-> gp-0 mode) 'spin-air)) + (let* ((s5-0 (the-as object (-> event param 0))) + (s4-0 (-> (the-as touching-shapes-entry s5-0) head)) + ) + (while s4-0 + (let ((a0-2 (get-touched-prim s4-0 (the-as collide-shape (-> self root)) (the-as touching-shapes-entry s5-0)))) + (when (= (-> a0-2 prim-id) 1) + (when (!= (-> gp-0 id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> gp-0 id)) + (let ((s3-0 (-> self actor-group 0))) + (dotimes (s2-0 (-> s3-0 length)) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 1) + (set! (-> a1-6 message) 'move) + (set! (-> a1-6 param 0) (* (-> self anim-index) 8)) + (let ((t9-1 send-event-function) + (v1-20 (-> s3-0 data s2-0 actor)) + ) + (t9-1 + (if v1-20 + (-> v1-20 extra process) + ) + a1-6 + ) + ) + ) + ) + ) + ) + ) + ) + (set! s4-0 (-> s4-0 next)) + ) + ) + #f + ) + ) + ) + ) + ) + ) + :trans (the-as (function none :behavior cas-switch) rider-trans) + :code (behavior () + (until #f + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'get-pos) + (set! (-> a1-0 param 0) (* (-> self anim-index) 8)) + (let* ((t9-0 send-event-function) + (v1-8 (-> self actor-group 0 data 0 actor)) + (a0-0 (if v1-8 + (-> v1-8 extra process) + ) + ) + (f30-0 (the-as float (t9-0 a0-0 a1-0))) + (f28-0 (- f30-0 (-> self pos-old))) + ) + (set! (-> self pos-old) f30-0) + (when (!= f28-0 0.0) + (set! (-> self root trans y) (+ (-> self y-start) (* f30-0 (-> self y-delta)))) + (if (< (* (-> self y-delta) f28-0) 0.0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) 1820.4445) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) -1820.4445) + ) + (cond + ((< 0.0 f28-0) + (cond + ((< f30-0 1.0) + (sound-play "cas-valve-loop" :id (the-as sound-id (-> self sound-id)) :position (-> self root trans)) + (set! (-> self sound-flag) #t) + ) + ((-> self sound-flag) + (sound-play "cas-valve-stop") + (sound-stop (the-as sound-id (-> self sound-id))) + (set! (-> self sound-flag) #f) + ) + ) + ) + (else + (cond + ((< 0.0 f30-0) + (sound-play "cas-valve-loop" :id (the-as sound-id (-> self sound-id)) :position (-> self root trans)) + (set! (-> self sound-flag) #t) + ) + ((-> self sound-flag) + (sound-play "cas-valve-stop") + (sound-stop (the-as sound-id (-> self sound-id))) + (set! (-> self sound-flag) #f) + ) + ) + ) + ) + ) + ) + ) + (suspend) + ) + #f + (none) + ) + :post (the-as (function none :behavior cas-switch) rider-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-switch ((obj cas-switch) (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" + (local-vars (sv-16 res-tag)) + (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid no-standon)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 11059.2 0.0 12288.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 0.0 11059.2 0.0 12288.0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 1)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid rideable)) + (set! (-> v1-11 transform-index) 3) + (set-vector! (-> v1-11 local-sphere) 0.0 11059.2 0.0 12288.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-switch" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-22 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-22 (nonzero? (-> sv-16 elt-count))) + (set! (-> obj actor-group) (the-as (pointer actor-group) v1-22)) + (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> obj actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> obj anim-index) (res-lump-value (-> obj entity) 'index uint :time -1000000000.0)) + (set! (-> obj direction) (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0)) + (let ((s5-2 (-> obj root trans)) + (s4-2 (-> obj root trans)) + (t9-10 (method-of-type res-lump get-property-struct)) + (a0-27 (-> obj entity)) + (a1-19 'trans-offset) + (a2-9 'interp) + (a3-7 -1000000000.0) + (t0-6 (new 'stack-no-clear 'vector)) + ) + (set! (-> t0-6 x) 0.0) + (set! (-> t0-6 y) 0.0) + (set! (-> t0-6 z) 0.0) + (set! (-> t0-6 w) 1.0) + (vector+! + s5-2 + s4-2 + (the-as vector (t9-10 a0-27 a1-19 a2-9 a3-7 t0-6 (the-as (pointer res-tag) #f) *res-static-buf*)) + ) + ) + (set! (-> obj y-start) (-> obj root trans y)) + (if (zero? (-> obj direction)) + (set! (-> obj y-delta) -12288.0) + (set! (-> obj y-delta) 12288.0) + ) + (set! (-> obj sound-id) (the-as uint (new-sound-id))) + (set! (-> obj sound-flag) #f) + (go (method-of-object obj idle)) + (none) + ) + +(deftype cas-trapdoor (process-drawable) + ((root-override collide-shape :offset 128) + ) + :heap-base #x50 + :method-count-assert 22 + :size-assert #xc8 + :flag-assert #x16005000c8 + (:methods + (idle () _type_ :state 20) + (die () _type_ :state 21) + ) + ) + + +(defskelgroup skel-cas-trapdoor cas-trapdoor cas-trapdoor-lod0-jg cas-trapdoor-idle-ja + ((cas-trapdoor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +(defskelgroup skel-cas-trapdoor-explode cas-trapdoor cas-trapdoor-explode-lod0-jg cas-trapdoor-explode-idle-ja + ((cas-trapdoor-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) + +(define *cas-trapdoor-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) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + ) + :collide-spec #x1 + ) + ) + +(defstate idle (cas-trapdoor) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('attack) + (let ((gp-0 (the-as object (-> event param 1)))) + (when (and (not (task-node-closed? (game-task-node castle-boss-resolution))) + (logtest? (-> (the-as attack-info gp-0) penetrate-using) (penetrate flop)) + ) + (go-virtual die) + #f + ) + ) + ) + ) + ) + ) + :code (the-as (function none :behavior cas-trapdoor) sleep-code) + ) + +(defstate die (cas-trapdoor) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (sound-play "trapdoor") + (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (let* ((s5-1 *target*) + (a0-3 (if (type? s5-1 process-focusable) + s5-1 + ) + ) + ) + (when a0-3 + (set! (-> gp-1 fountain-rand-transv-lo quad) (-> (get-trans a0-3 0) quad)) + (set! (-> gp-1 fountain-rand-transv-lo y) (+ -16384.0 (-> gp-1 fountain-rand-transv-lo y))) + ) + ) + (set! (-> gp-1 fountain-rand-transv-hi x) 24576.0) + (set! (-> gp-1 fountain-rand-transv-hi y) 81920.0) + (set! (-> gp-1 fountain-rand-transv-hi z) 12288.0) + (set! (-> gp-1 fountain-rand-transv-hi w) 32768.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-cas-trapdoor-explode" (the-as (pointer uint32) #f)) + 5 + gp-1 + *cas-trapdoor-exploder-params* + :to self + ) + ) + (none) + ) + :code (behavior () + (sound-play "trapdoor") + (suspend) + (ja-channel-set! 0) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) + (suspend) + ) + ) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior cas-trapdoor) ja-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-trapdoor ((obj cas-trapdoor) (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 ((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 bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 0) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (if (not (task-node-closed? (game-task-node castle-boss-resolution))) + (set! (-> obj root-override penetrated-by) (penetrate flop)) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-trapdoor" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((a0-14 (-> obj skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> a0-14 frame-num) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +(deftype cas-chain-plat (process-focusable) + () + :heap-base #x50 + :method-count-assert 30 + :size-assert #xcc + :flag-assert #x1e005000cc + (:methods + (idle () _type_ :state 27) + (drop () _type_ :state 28) + (down () _type_ :state 29) + ) + ) + + +(defskelgroup skel-cas-chain-plat cas-chain-plat cas-chain-plat-lod0-jg cas-chain-plat-idle-ja + ((cas-chain-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3 0 6) + :origin-joint-index 4 + ) + +(defstate idle (cas-chain-plat) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (sound-play "cas-shelf-plat") + (go-virtual drop) + ) + (('track) + #t + ) + ) + ) + :code (the-as (function none :behavior cas-chain-plat) sleep-code) + :post (the-as (function none :behavior cas-chain-plat) ja-post) + ) + +(defstate drop (cas-chain-plat) + :virtual #t + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual down) + (none) + ) + :post (the-as (function none :behavior cas-chain-plat) transform-post) + ) + +(defstate down (cas-chain-plat) + :virtual #t + :code (the-as (function none :behavior cas-chain-plat) sleep-code) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-chain-plat ((obj cas-chain-plat) (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 ((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 hit-by-others-list player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 4) + (set-vector! (-> v1-2 local-sphere) 0.0 12288.0 0.0 24576.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-chain-plat" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj mask) (logior (process-mask enemy) (-> obj mask))) + (go (method-of-object obj idle)) + (none) + ) + +(deftype cas-rot-blade (process-drawable) + ((sync sync-eased :inline :offset-assert 200) + (rot float :offset-assert 244) + (attack-id uint32 :offset-assert 248) + (sound-id uint32 :offset-assert 252) + ) + :heap-base #x80 + :method-count-assert 21 + :size-assert #x100 + :flag-assert #x1500800100 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-cas-rot-blade cas-rot-blade cas-rot-blade-lod0-jg cas-rot-blade-idle-ja + ((cas-rot-blade-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + :shadow cas-rot-blade-shadow-mg + ) + +(define *cas-rot-blade-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :flags (shadow-flags disable-fade shdf03) + :shadow-dir (new 'static 'vector :y -1.0 :w 163840.0) + :bot-plane (new 'static 'plane :y 1.0 :w 8192.0) + :top-plane (new 'static 'plane :y 1.0 :w 2048.0) + ) + ) + ) + +(defun cas-rot-blade-callback ((arg0 cspace) (arg1 transformq)) + (with-pp + (quaternion-rotate-local-y! + (-> arg1 quat) + (-> arg1 quat) + (* 606.8148 (the float (-> pp clock frame-counter))) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +(defstate idle (cas-rot-blade) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as + object + (case event-type + (('touched) + (let* ((s4-0 (the-as object (-> event param 0))) + (s3-0 (-> (the-as touching-shapes-entry s4-0) head)) + ) + (while s3-0 + (let ((a0-3 (get-touched-prim s3-0 (the-as collide-shape (-> self root)) (the-as touching-shapes-entry s4-0)))) + (when (= (-> a0-3 prim-id) 1) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 2) + (set! (-> a1-2 message) 'attack) + (set! (-> a1-2 param 0) (-> event param 0)) + (let ((a0-6 (new 'static 'attack-info :mask (attack-info-mask id)))) + (let* ((v1-10 *game-info*) + (a2-3 (+ (-> v1-10 attack-id) 1)) + ) + (set! (-> v1-10 attack-id) a2-3) + (set! (-> a0-6 id) a2-3) + ) + (set! (-> a1-2 param 1) (the-as uint a0-6)) + ) + (send-event-function proc a1-2) + ) + ) + ) + (set! s3-0 (-> s3-0 next)) + ) + ) + #f + ) + ) + ) + ) + :trans (behavior () + (set! (-> self rot) (+ 1820.4445 (get-scaled-val! (-> self sync) 29127.111 0))) + (quaternion-vector-angle! (-> self root quat) *y-vector* (-> self rot)) + (sound-play + "cas-arm-blade" + :id (the-as sound-id (-> self sound-id)) + :position (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4)) + ) + (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 cas-rot-blade) transform-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-rot-blade ((obj cas-rot-blade) (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 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 61440.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (set! (-> s4-0 event-self) 'touched) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 0.0 0.0 0.0 49152.0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid deadly)) + (set! (-> v1-11 transform-index) 4) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 14336.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-rot-blade" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj draw light-index) (the-as uint 2)) + (let ((a1-10 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-20 0)) + (if #t + (set! v1-20 (logior v1-20 1)) + ) + (set! (-> a1-10 sync-type) 'sync-eased) + (set! (-> a1-10 sync-flags) (the-as sync-flags v1-20)) + ) + (set! (-> a1-10 period) (the-as uint 1800)) + (set! (-> a1-10 entity) arg0) + (set! (-> a1-10 percent) 0.0) + (set! (-> a1-10 ease-in) 0.15) + (set! (-> a1-10 ease-out) 0.15) + (set! (-> a1-10 pause-in) 0.2) + (set! (-> a1-10 pause-out) 0.0) + (initialize! (-> obj sync) a1-10) + ) + (let ((a0-26 (-> obj node-list data 4))) + (set! (-> a0-26 param0) cas-rot-blade-callback) + (set! (-> a0-26 param1) obj) + ) + (set! (-> obj sound-id) (the-as uint (new-sound-id))) + (set! (-> obj draw shadow-ctrl) *cas-rot-blade-shadow-control*) + (go (method-of-object obj idle)) + (none) + ) + +(defmethod deactivate cas-rot-blade ((obj cas-rot-blade)) + (sound-stop (the-as sound-id (-> obj sound-id))) + ((the-as (function process-drawable none) (find-parent-method cas-rot-blade 10)) obj) + (none) + ) + +(deftype cas-flag-a (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-cas-flag-a cas-flag-a cas-flag-a-lod0-jg cas-flag-a-idle-ja + ((cas-flag-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -8 0 8.5) + ) + +(defstate idle (cas-flag-a) + :virtual #t + :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 cas-flag-a) ja-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-flag-a ((obj cas-flag-a) (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-cas-flag-a" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (go (method-of-object obj idle)) + (none) + ) + +(deftype cas-flag-b (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defskelgroup skel-cas-flag-b cas-flag-b cas-flag-b-lod0-jg cas-flag-b-idle-ja + ((cas-flag-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -8 0 8.5) + ) + +(defstate idle (cas-flag-b) + :virtual #t + :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 cas-flag-b) ja-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-flag-b ((obj cas-flag-b) (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-cas-flag-b" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (go (method-of-object obj idle)) + (none) + ) + +(deftype cas-robot-door (process-drawable) + ((spawner-actor symbol :offset-assert 200) + (door-actor entity-actor 2 :offset-assert 204) + (spawn-count int32 :offset-assert 212) + (spawn-count-total int32 :offset-assert 216) + (spawn-max int32 :offset-assert 220) + (spawn-total int32 :offset-assert 224) + (notice-dist float :offset-assert 228) + (player-dist float :offset-assert 232) + (anim-index int32 :offset-assert 236) + (last-guard handle :offset-assert 240) + (actor-group (pointer actor-group) :offset-assert 248) + (actor-group-count int32 :offset-assert 252) + ) + :heap-base #x80 + :method-count-assert 23 + :size-assert #x100 + :flag-assert #x1700800100 + (:methods + (idle () _type_ :state 20) + (spawning () _type_ :state 21) + (castle-wait-end () _type_ :state 22) + ) + ) + + +(defskelgroup skel-cas-robot-door cas-robot-door cas-robot-door-lod0-jg cas-robot-door-idle-ja + ((cas-robot-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +(defstate idle (cas-robot-door) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger) + (go-virtual spawning) + ) + ) + ) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.6)) + (let ((a0-1 *target*)) + (if (and a0-1 + (not (logtest? (-> a0-1 focus-status) (focus-status disable dead))) + (< (vector-vector-distance (get-trans a0-1 0) (-> self root trans)) (-> self notice-dist)) + ) + (go-virtual spawning) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (none) + ) + :code (the-as (function none :behavior cas-robot-door) sleep-code) + ) + +(defstate spawning (cas-robot-door) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('roboguard-die) + (let ((v0-0 (+ (-> self spawn-count) -1))) + (set! (-> self spawn-count) v0-0) + v0-0 + ) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self spawn-count) 0) + (set! (-> self spawn-count-total) 0) + (set! (-> self player-dist) (-> self notice-dist)) + (none) + ) + :trans (behavior () + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.6)) + (let ((a0-1 *target*)) + (if (and a0-1 (zero? (logand (-> a0-1 focus-status) (focus-status disable dead)))) + (set! (-> self player-dist) (vector-vector-distance (get-trans a0-1 0) (-> self root trans))) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (none) + ) + :code (behavior () + (sound-play "robo-hatch-open") + (ja-no-eval :group! (-> self draw art-group data 2) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 0.5)) + (suspend) + ) + ) + (while (or (= (-> self spawn-total) -1) (< (-> self spawn-count-total) (-> self spawn-total))) + (when (and (< (-> self player-dist) (+ 81920.0 (-> self notice-dist))) + (and (< (-> self spawn-count) (-> self spawn-max)) + (or (not (handle->process (-> self last-guard))) + (not (and (-> (handle->process (-> self last-guard)) next-state) + (= (-> (handle->process (-> self last-guard)) next-state name) ''ambush) + ) + ) + ) + ) + ) + (let ((gp-2 (new 'stack-no-clear 'enemy-init-by-other-params))) + (set! (-> gp-2 trans quad) (-> self root trans quad)) + (quaternion-copy! (-> gp-2 quat) *unity-quaternion*) + (set! (-> gp-2 entity) (the-as entity (-> self spawner-actor))) + (set! (-> gp-2 directed?) #f) + (set! (-> gp-2 no-initial-move-to-ground?) #f) + (let* ((s5-1 (get-process *default-dead-pool* roboguard-level #x4000)) + (v1-52 (when s5-1 + (let ((t9-8 (method-of-type process activate))) + (t9-8 s5-1 self (symbol->string (-> roboguard-level symbol)) (the-as pointer #x70004000)) + ) + (run-now-in-process s5-1 enemy-init-by-other self gp-2) + (-> s5-1 ppointer) + ) + ) + ) + (when v1-52 + (set! (-> self last-guard) (ppointer->handle v1-52)) + (+! (-> self spawn-count) 1) + (+! (-> self spawn-count-total) 1) + ) + ) + ) + ) + (let ((gp-3 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-3) (the int (* 300.0 (rand-vu-float-range 0.5 1.0)))) + (suspend) + ) + ) + ) + (while (> (-> self spawn-count) 0) + (let ((gp-4 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-4) (seconds 0.43)) + (suspend) + ) + ) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (cond + ((= (-> self anim-index) -1) + (cond + ((= (-> self actor-group-count) 1) + (go-virtual castle-wait-end) + ) + ((= (-> self actor-group-count) 2) + (until (process-grab? *target* #f) + (suspend) + ) + (let ((a3-4 (res-lump-struct (-> self entity) 'camera-name structure))) + (if a3-4 + (set-setting! 'entity-name a3-4 0 0) + ) + ) + (let ((gp-5 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-5) (seconds 2)) + (suspend) + ) + ) + (dotimes (gp-6 (-> self actor-group 1 length)) + (let ((a1-17 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-17 from) (process->ppointer self)) + (set! (-> a1-17 num-params) 0) + (set! (-> a1-17 message) 'stop) + (let ((t9-16 send-event-function) + (v1-102 (-> self actor-group 1 data gp-6 actor)) + ) + (t9-16 + (if v1-102 + (-> v1-102 extra process) + ) + a1-17 + ) + ) + ) + ) + ) + ) + ) + (else + (until (process-grab? *target* #f) + (suspend) + ) + (let ((a3-6 (res-lump-struct (-> self entity) 'camera-name structure))) + (if a3-6 + (set-setting! 'entity-name a3-6 0 0) + ) + ) + (let ((gp-7 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-7) (seconds 1)) + (suspend) + ) + ) + (let ((gp-8 (-> self actor-group 0))) + (dotimes (s5-3 (-> gp-8 length)) + (let ((a1-21 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-21 from) (process->ppointer self)) + (set! (-> a1-21 num-params) 1) + (set! (-> a1-21 message) 'move) + (set! (-> a1-21 param 0) (the-as uint (* (-> self anim-index) 8))) + (let ((t9-20 send-event-function) + (v1-128 (-> gp-8 data s5-3 actor)) + ) + (t9-20 + (if v1-128 + (-> v1-128 extra process) + ) + a1-21 + ) + ) + ) + ) + ) + ) + ) + (sound-play "robo-hatch-cls") + (ja-no-eval :group! (-> self draw art-group data 2) + :num! (seek! 0.0) + :frame-num (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) frames num-frames) -1)) + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek! 0.0)) + ) + (let ((gp-10 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-10) (seconds 1)) + (suspend) + ) + ) + (remove-setting! 'entity-name) + (until (process-release? *target*) + (suspend) + ) + (sleep-code) + (none) + ) + :post (behavior () + '() + (none) + ) + ) + +(defstate castle-wait-end (cas-robot-door) + :virtual #t + :code (behavior () + (local-vars (v1-28 symbol)) + (sound-play "robo-hatch-cls") + (ja-no-eval :group! (-> self draw art-group data 2) + :num! (seek! 0.0) + :frame-num (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) frames num-frames) -1)) + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek! 0.0)) + ) + (while (begin + (dotimes (v1-27 (-> self actor-group 0 length)) + (when (not (logtest? (-> self actor-group 0 data v1-27 actor extra perm status) (entity-perm-status subtask-complete)) + ) + (set! v1-28 #f) + (goto cfg-14) + ) + ) + (set! v1-28 #t) + (goto cfg-14) + (label cfg-14) + (not v1-28) + ) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 0.51)) + (suspend) + ) + ) + ) + (until (process-grab? *target* #f) + (suspend) + ) + (let ((a3-2 (res-lump-struct (-> self entity) 'camera-name structure))) + (if a3-2 + (set-setting! 'entity-name a3-2 0 0) + ) + ) + (let ((gp-2 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-2) (seconds 1)) + (suspend) + ) + ) + (task-node-close! (game-task-node castle-break-in-resolution)) + (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) 'open) + (set! (-> a1-7 param 0) (the-as uint 6000)) + (set! (-> a1-7 param 1) (the-as uint #f)) + (let ((t9-10 send-event-function) + (v1-47 (-> self door-actor 0)) + ) + (t9-10 + (if v1-47 + (-> v1-47 extra process) + ) + a1-7 + ) + ) + ) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) (process->ppointer self)) + (set! (-> a1-8 num-params) 2) + (set! (-> a1-8 message) 'open) + (set! (-> a1-8 param 0) (the-as uint 6000)) + (set! (-> a1-8 param 1) (the-as uint #f)) + (let ((t9-11 send-event-function) + (v1-54 (-> self door-actor 1)) + ) + (t9-11 + (if v1-54 + (-> v1-54 extra process) + ) + a1-8 + ) + ) + ) + (let ((gp-3 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-3) (seconds 2.5)) + (suspend) + ) + ) + (remove-setting! 'entity-name) + (until (process-release? *target*) + (suspend) + ) + (sleep-code) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-robot-door ((obj cas-robot-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" + (stack-size-set! (-> obj main-thread) 512) + (local-vars (sv-16 res-tag) (sv-32 res-tag)) + (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 hit-by-others-list 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 0.0 0.0 20480.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) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-robot-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj spawner-actor) (the-as symbol (entity-actor-lookup arg0 'alt-actor 0))) + (set! (-> obj door-actor 0) (entity-actor-lookup arg0 'alt-actor 1)) + (set! (-> obj door-actor 1) (entity-actor-lookup arg0 'alt-actor 2)) + (set! (-> obj spawn-max) 5) + (set! (-> obj spawn-total) -1) + (set! (-> obj last-guard) (the-as handle #f)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-13 (res-lump-data arg0 'extra-id (pointer int32) :tag-ptr (& sv-16)))) + (when v1-13 + (set! (-> obj spawn-max) (-> v1-13 0)) + (if (< (the-as uint 1) (-> sv-16 elt-count)) + (set! (-> obj spawn-total) (-> v1-13 1)) + ) + ) + ) + (set! (-> obj notice-dist) (res-lump-float arg0 'notice-dist :default 122880.0)) + (set! (-> obj anim-index) + (res-lump-value (-> obj entity) 'index int :default (the-as uint128 -1) :time -1000000000.0) + ) + (set! sv-32 (new 'static 'res-tag)) + (let ((v1-17 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-32)))) + (cond + ((and v1-17 (nonzero? (-> sv-32 elt-count))) + (set! (-> obj actor-group) (the-as (pointer actor-group) v1-17)) + (set! (-> obj actor-group-count) (the-as int (-> sv-32 elt-count))) + ) + (else + (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> obj actor-group-count) 0) + 0 + ) + ) + ) + (let ((a0-27 (-> obj skel root-channel 0))) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> a0-27 frame-num) 0.0) + (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +(deftype lightning-ball (process-drawable) + ((root-override collide-shape :offset 128) + (timer time-frame :offset-assert 200) + ) + :heap-base #x50 + :method-count-assert 21 + :size-assert #xd0 + :flag-assert #x15005000d0 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(set! (-> *lightning-spec-id-table* 28) (new 'static 'lightning-spec + :name "lightning-ball-shock" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 60.0 + :texture (new 'static 'texture-id :index #x83 :page #xc) + :reduction 0.42 + :num-points 16 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 8192.0 + :duration 30.0 + :sound (static-sound-spec "shock" :volume 50.0 :fo-min 10 :fo-max 30) + ) + ) + +(defstate idle (lightning-ball) + :virtual #t + :code (the-as (function none :behavior lightning-ball) sleep-code) + :post (behavior () + (when (>= (- (-> self clock frame-counter) (-> self timer)) (seconds 0.08)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (let ((f30-1 (* 182.04445 (rand-vu-float-range -20.0 20.0))) + (f28-1 (* 182.04445 (rand-vu-float-range -180.0 180.0))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> *x-vector* quad)) + (vector-rotate-around-z! s5-0 s5-0 f30-1) + (vector-rotate-around-y! s5-0 s5-0 f28-1) + (vector+float*! (-> gp-0 start-pos) (-> self root-override trans) s5-0 56320.0) + (vector-float*! (-> gp-0 move-dist) s5-0 81920.0) + ) + (let ((v1-11 gp-0)) + (set! (-> v1-11 radius) 409.6) + (set! (-> v1-11 collide-with) (collide-spec backgnd obstacle hit-by-others-list)) + (set! (-> v1-11 ignore-process0) self) + (set! (-> v1-11 ignore-process1) #f) + (set! (-> v1-11 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-11 action-mask) (collide-action solid)) + ) + (let ((f30-2 (fill-and-probe-using-line-sphere *collide-cache* gp-0))) + (if (< 0.0 f30-2) + (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> *lightning-spec-id-table* 28) + (the int (* 300.0 (rand-vu-float-range 0.1 0.3))) + #f + #f + (-> gp-0 start-pos) + (vector+float*! (new 'stack-no-clear 'vector) (-> gp-0 start-pos) (-> gp-0 move-dist) f30-2) + :to self + ) + ) + ) + ) + (set! (-> self timer) (-> self clock frame-counter)) + ) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! lightning-ball ((obj lightning-ball) (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" + (with-pp + (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 56320.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (set! (-> obj timer) (-> pp clock frame-counter)) + (update-transforms (-> obj root-override)) + (go (method-of-object obj idle)) + (none) + ) + ) diff --git a/goal_src/jak2/levels/landing_pad/castle-part.gc b/goal_src/jak2/levels/landing_pad/castle-part.gc index a56dbb839f..f96928539c 100644 --- a/goal_src/jak2/levels/landing_pad/castle-part.gc +++ b/goal_src/jak2/levels/landing_pad/castle-part.gc @@ -7,3 +7,1221 @@ ;; DECOMP BEGINS +(deftype castle-part (part-spawner) + () + :heap-base #x30 + :method-count-assert 16 + :size-assert #xb0 + :flag-assert #x10003000b0 + ) + + +(defpartgroup group-castle-hanging-lights + :id 1187 + :bounds (static-bspherem 0 0 0 5) + :parts ((sp-item 5121 :fade-after (meters 120) :flags (bit6))) + ) + +(defpart 5121 + :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 4.5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 409.6) + (sp-flt spt-rot-z (degrees -17.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 117.0) + (sp-flt spt-g 80.0) + (sp-flt spt-b 54.0) + (sp-flt spt-a 32.0) + (sp-flt spt-omega 494387.2) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +(defpart 5122 + :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 4.5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 819.2) + (sp-flt spt-rot-z (degrees -17.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 96.0) + (sp-flt spt-b 62.0) + (sp-flt spt-a 32.0) + (sp-flt spt-omega 494387.2) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +(defpartgroup group-castle-red-gauge + :id 1188 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 4) (degrees 0) (degrees 0)) + :parts ((sp-item 5123 :fade-after (meters 200) :flags (bit6 bit7))) + ) + +(defpart 5123 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters -0.1)) + (sp-flt spt-scale-x (meters 3.5)) + (sp-flt spt-rot-x 409.6) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 5)) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 32.0 2.0 1.0) + (sp-flt spt-omega 822067.2) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 glow) + (sp-flt spt-userdata 409.6) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-castle-pipe-green-drip + :id 1189 + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 5124 :fade-after (meters 140) :falloff-to (meters 140)) + (sp-item 5125 :fade-after (meters 140) :flags (is-3d)) + ) + ) + +(defpart 5124 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-rnd-flt spt-num 0.0 0.1 1.0) + (sp-int spt-rot-x 4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 196.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 196.0) + (sp-flt spt-scalevel-x (meters 0.00044444445)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-timer 900) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 use-global-acc) + (sp-flt spt-userdata 114892.8) + (sp-func spt-func 'check-drop-level-castle-drop-userdata) + (sp-int-plain-rnd spt-next-time 225 224 1) + (sp-launcher-by-id spt-next-launcher 5126) + ) + ) + +(defpart 5126 + :init-specs ((sp-rnd-flt spt-accel-y -8.192 2.7306666 1.0) + (sp-rnd-flt spt-friction 0.93 0.02 1.0) + (sp-int-plain-rnd spt-next-time 0 224 1) + (sp-launcher-by-id spt-next-launcher 5127) + ) + ) + +(defpart 5127 + :init-specs ((sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-int spt-next-time 5) + (sp-launcher-by-id spt-next-launcher 5128) + ) + ) + +(defpart 5128 + :init-specs ((sp-flt spt-r 128.0) + (sp-flt spt-g 196.0) + (sp-flt spt-b 0.0) + (sp-int-plain-rnd spt-next-time 0 449 1) + (sp-launcher-by-id spt-next-launcher 5127) + ) + ) + +(defun check-drop-level-castle-drop-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (when (< (-> arg2 vector 0 y) (-> arg1 user-float)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s3-0 (-> arg2 vector 0 x) (-> arg1 user-float) (-> arg2 vector 0 z) 1.0) + (let ((t9-1 sp-launch-particles-var) + (a0-3 *sp-particle-system-2d*) + (a1-2 (-> *part-id-table* 5129)) + (a2-1 *launch-matrix*) + ) + (set! (-> a2-1 trans quad) (-> s3-0 quad)) + (t9-1 a0-3 a1-2 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-3d*) + (a1-3 (-> *part-id-table* 5130)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> s3-0 quad)) + (t9-2 a0-4 a1-3 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-3 sp-launch-particles-var) + (a0-5 *sp-particle-system-3d*) + (a1-4 (-> *part-id-table* 5131)) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> s3-0 quad)) + (t9-3 a0-5 a1-4 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-4 sp-launch-particles-var) + (a0-6 *sp-particle-system-3d*) + (a1-5 (-> *part-id-table* 5132)) + (a2-4 *launch-matrix*) + ) + (set! (-> a2-4 trans quad) (-> s3-0 quad)) + (t9-4 a0-6 a1-5 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + (sparticle-motion-blur arg0 arg1 (the-as vector arg2)) + (none) + ) + +(defpart 5129 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.05) 1.0) + (sp-int spt-rot-x 4) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 196.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-flt spt-omega 8.192) + (sp-rnd-flt spt-vel-y (meters 0.013333334) (meters 0.01) 1.0) + (sp-flt spt-fade-a -0.16) + (sp-rnd-flt spt-accel-y -4.096 -0.68266666 1.0) + (sp-flt spt-friction 0.97) + (sp-int spt-timer 200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (sp-int-plain-rnd spt-next-time 0 224 1) + (sp-launcher-by-id spt-next-launcher 5127) + (sp-rnd-flt spt-conerot-x (degrees 25.000002) (degrees 30.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-rotate-y (degrees 180.0)) + ) + ) + +(defpart 5130 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 196.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-flt spt-omega 0.0) + (sp-rnd-flt spt-scalevel-x (meters 0.006666667) (meters 0.006666667) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -1.2) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 10 0 0 #xc0c900 #xc03300 #xc02c00) + ) + (sp-func spt-func 'sparticle-texture-animate) + ) + ) + +(defpart 5125 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters -2.375)) + (sp-flt spt-scale-x (meters 4.5)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 196.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 32.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + ) + ) + +(defpart 5131 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-r 128.0) + (sp-flt spt-g 196.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-flt spt-scalevel-x (meters 0.0027777778)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.10666667) + (sp-int spt-timer 900) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + ) + ) + +(defpart 5132 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 0.05)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 196.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 32.0 16.0 1.0) + (sp-flt spt-scalevel-x (meters 0.0027777778)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.10666667) + (sp-int spt-timer 900) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-4) + ) + ) + +(defpartgroup group-castle-console-green-screen + :id 1190 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 4) (degrees 0) (degrees 0)) + :parts ((sp-item 5133 :fade-after (meters 200) :flags (bit6 bit7))) + ) + +(defpart 5133 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters -0.1)) + (sp-flt spt-scale-x (meters 3)) + (sp-flt spt-rot-x 409.6) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 0.0 128.0 1.0) + (sp-rnd-flt spt-a 16.0 16.0 1.0) + (sp-flt spt-omega 822067.2) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 glow) + (sp-flt spt-userdata 1024.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-castle-console-flashing-red-light-1 + :id 1191 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 4) (degrees 0) (degrees 0)) + :parts ((sp-item 5134 :fade-after (meters 120) :flags (bit6 bit7) :period 150 :length 5)) + ) + +(defpartgroup group-castle-console-flashing-red-light-2 + :id 1192 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 4) (degrees 0) (degrees 0)) + :parts ((sp-item 5134 :fade-after (meters 120) :flags (bit6 bit7) :period 115 :length 5 :offset 65)) + ) + +(defpart 5134 + :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 -0.1)) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 1)) + (sp-flt spt-rot-x 409.6) + (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 8.0) + (sp-flt spt-b 8.0) + (sp-flt spt-a 16.0) + (sp-flt spt-omega 494387.2) + (sp-int spt-timer 75) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 glow) + (sp-flt spt-userdata 1024.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5120 + :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 -0.15)) + (sp-flt spt-scale-x (meters 3)) + (sp-flt spt-rot-x 409.6) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 64.0) + (sp-flt spt-a 32.0) + (sp-flt spt-omega 494387.2) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 1024.0) + ) + ) + +(defpart 5119 + :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 -0.15)) + (sp-flt spt-scale-x (meters 3)) + (sp-flt spt-rot-x 409.6) + (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-flt spt-a 32.0) + (sp-flt spt-omega 494387.2) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 1024.0) + ) + ) + +(defpartgroup group-castle-green-dome-light + :id 1193 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5135 :flags (bit6 bit7))) + ) + +(defpart 5135 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters -0.25)) + (sp-flt spt-scale-x (meters 4.5)) + (sp-flt spt-rot-x 409.6) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 48.0) + (sp-flt spt-g 196.0) + (sp-flt spt-b 48.0) + (sp-flt spt-a 32.0) + (sp-flt spt-omega 822067.2) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 1024.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defun castle-green-dome-light-pulsate ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (with-pp + (let ((s5-0 lerp-scale) + (s4-0 32.0) + (s3-0 64.0) + (t9-0 sin) + (f0-0 3640.889) + (f1-1 (* 0.0033333334 (the float (-> pp clock frame-counter)))) + ) + (set! (-> arg2 coneradius) + (s5-0 s4-0 s3-0 (t9-0 (* f0-0 (- f1-1 (* (the float (the int (/ f1-1 360.0))) 360.0)))) -1.0 1.0) + ) + ) + ) + ) + +(defpartgroup group-castle-steamvent + :id 1194 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 5136 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit7)) + (sp-item 5137 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit7)) + ) + ) + +(defpart 5136 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.5 1.0 1.0) + (sp-rnd-int-flt spt-x (meters -0.4) 4 819.2) + (sp-rnd-flt spt-y (meters -0.1) (meters 0.3) 1.0) + (sp-rnd-flt spt-z (meters 0.2) (meters 0.2) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.4) (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-rnd-flt spt-r 64.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 16.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 0.0) + (sp-rnd-flt spt-vel-z (meters 0.006666667) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.0016666667) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a 0.42666668) + (sp-rnd-flt spt-accel-y 0.54613334 0.54613334 1.0) + (sp-flt spt-friction 0.99) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-int-plain-rnd spt-next-time 100 24 1) + (sp-launcher-by-id spt-next-launcher 5138) + (sp-rnd-flt spt-launchrot-x (degrees -5.0) (degrees 10.0) 1.0) + (sp-rnd-flt spt-launchrot-y (degrees -5.0) (degrees 10.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5137 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-rnd-int-flt spt-x (meters -0.3) 1 0.0) + (sp-rnd-flt spt-y (meters 0) (meters 0.3) 1.0) + (sp-rnd-flt spt-z (meters 0.6) (meters 0.2) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.3) (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-rnd-flt spt-r 64.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 16.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 0.0) + (sp-rnd-flt spt-vel-z (meters 0.006666667) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.0016666667) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a 0.42666668) + (sp-rnd-flt spt-accel-y 0.4096 0.4096 1.0) + (sp-flt spt-friction 0.99) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-int-plain-rnd spt-next-time 100 24 1) + (sp-launcher-by-id spt-next-launcher 5138) + (sp-rnd-flt spt-launchrot-x (degrees -5.0) (degrees 10.0) 1.0) + (sp-rnd-flt spt-launchrot-y (degrees -5.0) (degrees 10.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5138 + :init-specs ((sp-rnd-flt spt-fade-r 0.64 0.42666668 1.0) + (sp-rnd-flt spt-fade-g 0.85333335 0.42666668 1.0) + (sp-rnd-flt spt-fade-a -0.10666667 -0.10666667 1.0) + ) + ) + +(defpart 5139 + :init-specs ((sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 64.0) + (sp-rnd-flt spt-fade-a -0.10666667 -0.10666667 1.0) + ) + ) + +(defpartgroup group-castle-pipe-green-steam + :id 1195 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 5140 :fade-after (meters 60) :falloff-to (meters 60) :flags (bit7)) + (sp-item 5141 :fade-after (meters 100) :falloff-to (meters 140) :flags (bit7)) + ) + ) + +(defpart 5140 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-rnd-flt spt-num 0.0 5.0 1.0) + (sp-flt spt-scale-x (meters 0.1)) + (sp-int spt-rot-x 4) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 64.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 64.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-flt spt-omega 4.096) + (sp-rnd-flt spt-vel-z (meters 0.083333336) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-fade-a -0.64 -0.64 1.0) + (sp-rnd-flt spt-friction 0.93 0.025 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-rnd-flt spt-launchrot-x (degrees -7.5) (degrees 15.0) 1.0) + (sp-rnd-flt spt-launchrot-y (degrees -7.5) (degrees 15.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5141 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 1.0 3.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 128.0 1.0) + (sp-rnd-flt spt-g 128.0 32.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 0.0) + (sp-rnd-flt spt-vel-z (meters 0.05) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.01) (meters 0.016666668) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a 0.96) + (sp-rnd-flt spt-friction 0.93 0.025 1.0) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12) + (sp-int-plain-rnd spt-next-time 25 24 1) + (sp-launcher-by-id spt-next-launcher 5142) + (sp-rnd-flt spt-launchrot-x (degrees -5.0) (degrees 10.0) 1.0) + (sp-rnd-flt spt-launchrot-y (degrees -5.0) (degrees 10.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5142 + :init-specs ((sp-rnd-flt spt-fade-a -0.48 -0.48 1.0)) + ) + +(defpartgroup group-castle-pod-pipe + :id 1196 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 5143 :fade-after (meters 60) :falloff-to (meters 60) :flags (bit7)) + (sp-item 5144 :fade-after (meters 100) :falloff-to (meters 140) :flags (bit7)) + ) + ) + +(defpart 5143 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-rnd-flt spt-num 0.0 5.0 1.0) + (sp-flt spt-scale-x (meters 0.1)) + (sp-int spt-rot-x 4) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-flt spt-omega 4.096) + (sp-rnd-flt spt-vel-z (meters 0.083333336) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-fade-a -0.64 -0.64 1.0) + (sp-rnd-flt spt-friction 0.93 0.025 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-rnd-flt spt-launchrot-x (degrees -7.5) (degrees 15.0) 1.0) + (sp-rnd-flt spt-launchrot-y (degrees -7.5) (degrees 15.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5144 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 1.0 3.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-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-z (meters 0.083333336) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.01) (meters 0.016666668) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a 0.96) + (sp-rnd-flt spt-friction 0.93 0.025 1.0) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12) + (sp-int-plain-rnd spt-next-time 25 24 1) + (sp-launcher-by-id spt-next-launcher 5145) + (sp-rnd-flt spt-launchrot-x (degrees -5.0) (degrees 10.0) 1.0) + (sp-rnd-flt spt-launchrot-y (degrees -5.0) (degrees 10.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5145 + :init-specs ((sp-rnd-flt spt-fade-a -0.48 -0.48 1.0)) + ) + +(defpartgroup group-castle-green-slime + :id 1197 + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5146 :fade-after (meters 150) :falloff-to (meters 85) :period 300 :length 5) + (sp-item 5147 :fade-after (meters 150) :falloff-to (meters 100)) + ) + ) + +(defpart 5146 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xb9a)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters -3) (meters 6) 1.0) + (sp-rnd-flt spt-z (meters -3) (meters 6) 1.0) + (sp-flt spt-scale-x (meters 0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 32.0) + (sp-flt spt-g 196.0) + (sp-flt spt-b 48.0) + (sp-flt spt-a 196.0) + (sp-int spt-timer 900) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int-plain-rnd spt-next-time 0 599 1) + (sp-launcher-by-id spt-next-launcher 5148) + ) + ) + +(defpart 5148 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.002) (meters 0.002) 1.0) + (sp-rnd-flt spt-scalevel-y (meters 0.001) (meters 0.001) 1.0) + (sp-int spt-timer 300) + (sp-int-plain-rnd spt-next-time 150 149 1) + (sp-launcher-by-id spt-next-launcher 5149) + ) + ) + +(defpart 5149 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.00066666666) (meters 0.00066666666) 1.0) + (sp-rnd-flt spt-scalevel-y (meters 0.00033333333) (meters 0.00033333333) 1.0) + (sp-int spt-timer 600) + (sp-int-plain-rnd spt-next-time 150 449 1) + (sp-launcher-by-id spt-next-launcher 5150) + ) + ) + +(defpart 5150 + :init-specs ((sp-func spt-func 'castle-green-slime-popper)) + ) + +(defun castle-green-slime-popper ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (set! (-> arg1 sp-func) (the-as (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none) 0)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! gp-0 (-> arg2 vector 0 x) (-> arg2 vector 0 y) (-> arg2 vector 0 z) 1.0) + (let ((t9-1 sp-launch-particles-var) + (a0-2 *sp-particle-system-2d*) + (a1-1 (-> *part-id-table* 5151)) + (a2-1 *launch-matrix*) + ) + (set! (-> a2-1 trans quad) (-> gp-0 quad)) + (t9-1 a0-2 a1-1 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-2 sp-launch-particles-var) + (a0-3 *sp-particle-system-2d*) + (a1-2 (-> *part-id-table* 5152)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> gp-0 quad)) + (t9-2 a0-3 a1-2 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-3 sp-launch-particles-var) + (a0-4 *sp-particle-system-3d*) + (a1-3 (-> *part-id-table* 5153)) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> gp-0 quad)) + (t9-3 a0-4 a1-3 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + (none) + ) + +(defpart 5153 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x33 :page #xc)) + (sp-flt spt-num 3.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 0.25) (meters 0.1) 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 128.0 1.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 255.0) + (sp-rnd-flt spt-scalevel-x (meters 0.0375) (meters 0.0375) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -3.1875 -3.1875 1.0) + (sp-int spt-timer 80) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12) + ) + ) + +(defpart 5152 + :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 2) (meters 0.1) 1.0) + (sp-flt spt-rot-x 409.6) + (sp-flt spt-rot-z (degrees -17.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 64.0 196.0 1.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 0.0 64.0 1.0) + (sp-flt spt-a 22.0) + (sp-flt spt-omega 494387.2) + (sp-flt spt-fade-a -0.8) + (sp-int spt-timer 15) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +(defpart 5151 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-rnd-flt spt-num 8.0 8.0 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 0.3) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-rnd-flt spt-r 0.0 128.0 1.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.026666667) (meters 0.013333334) 1.0) + (sp-rnd-flt spt-scalevel-x (meters -0.0013333333) (meters 0.00033333333) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-rnd-flt spt-scalevel-y (meters -0.0013333333) (meters 0.00033333333) 1.0) + (sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) + (sp-rnd-flt spt-accel-y -4.096 -2.7306666 1.0) + (sp-rnd-flt spt-friction 0.93 0.02 1.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 use-global-acc) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 60.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.2) 1.0) + ) + ) + +(defpart 5147 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.0 0.05 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 5) 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 4) (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 0.0 128.0 1.0) + (sp-rnd-flt spt-g 128.0 128.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 0.0) + (sp-rnd-flt spt-vel-y (meters 0.006666667) (meters 0.006666667) 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.21333334) + (sp-rnd-flt spt-friction 0.92 0.01 1.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int-plain-rnd spt-next-time 75 74 1) + (sp-launcher-by-id spt-next-launcher 5154) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +(defpart 5154 + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 5155)) + ) + +(defpart 5155 + :init-specs ((sp-flt spt-fade-g -0.42666668) (sp-int spt-next-time 150) (sp-launcher-by-id spt-next-launcher 5156)) + ) + +(defpart 5156 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-a -0.10666667)) + ) + +(defpartgroup group-castle-green-slime-tube + :id 1198 + :linger-duration (seconds 12) + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 4 0 6) + :rotate ((degrees 4) (degrees 0) (degrees 8)) + :parts ((sp-item 5157 :fade-after (meters 150) :falloff-to (meters 100) :flags (is-3d bit7)) + (sp-item 5158 :fade-after (meters 150) :falloff-to (meters 100) :flags (is-3d bit7)) + ) + ) + +(defpart 5157 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x14 :page #xc)) + (sp-func spt-birth-func 'birth-func-castle-green-slime-tube) + (sp-rnd-flt spt-num 0.008 0.002 1.0) + (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) + (sp-rnd-flt spt-y (meters -0.5) (meters -1) 1.0) + (sp-rnd-flt spt-scale-x (meters 3) (meters 2) 1.0) + (sp-flt spt-rot-x 16384.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 16.0 8.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-rnd-flt spt-b 16.0 8.0 1.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.0033333334) (meters 0.0044444446) 1.0) + (sp-rnd-flt spt-scalevel-x (meters -0.00083333335) (meters -0.00083333335) 1.0) + (sp-rnd-flt spt-rotvel-y (degrees -0.2) (degrees 0.2) 1.0) + (sp-rnd-flt spt-scalevel-y (meters -0.00055555557) (meters -0.00083333335) 1.0) + (sp-flt spt-friction 0.9995) + (sp-int spt-timer 3600) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-flt spt-userdata 34816.0) + (sp-func spt-func 'castle-green-slime-tube-check-delta) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5158 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x14 :page #xc)) + (sp-func spt-birth-func 'birth-func-castle-green-slime-tube) + (sp-rnd-flt spt-num 0.008 0.002 1.0) + (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0) + (sp-rnd-flt spt-y (meters -0.8) (meters -1) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) + (sp-flt spt-rot-x 16384.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 32.0 8.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-rnd-flt spt-b 32.0 8.0 1.0) + (sp-rnd-flt spt-a 48.0 16.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.0033333334) (meters 0.0044444446) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.0016666667) (meters 0.00055555557) 1.0) + (sp-rnd-flt spt-rotvel-y (degrees -0.2) (degrees 0.2) 1.0) + (sp-rnd-flt spt-scalevel-y (meters 0.0011111111) (meters 0.00055555557) 1.0) + (sp-flt spt-friction 0.9995) + (sp-int spt-timer 3600) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-flt spt-userdata 34816.0) + (sp-func spt-func 'castle-green-slime-tube-check-delta) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defun birth-func-castle-green-slime-tube ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (set! (-> arg1 omega) (-> arg2 launchrot y)) + 0 + (none) + ) + +(defun castle-green-slime-tube-check-delta ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (let ((f1-1 (- (-> arg2 vector 0 y) (-> arg1 omega)))) + (set! (-> arg1 user-float) (- (-> arg1 user-float) (fabs f1-1))) + ) + (set! (-> arg1 omega) (-> arg2 vector 0 y)) + (when (< (-> arg1 user-float) 8192.0) + (let ((f0-7 (fabs (/ (-> arg1 user-float) (-> arg1 vel-sxvel y))))) + (/ (- (-> arg2 vector 1 w)) f0-7) + (set! (-> arg1 fade w) (/ (- (-> arg2 vector 2 w)) f0-7)) + ) + (set! (-> arg1 sp-func) (the-as (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none) 0)) + 0 + ) + (none) + ) + +(defpartgroup group-castle-pod-green-slime-tube + :id 1199 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 4 0 6) + :rotate ((degrees 4) (degrees 0) (degrees 8)) + :parts ((sp-item 209)) + ) + +(defpartgroup group-castle-pod-dial-small + :id 1200 + :flags (use-local-clock unk-4 unk-6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 4) (degrees 0) (degrees 0)) + :parts ((sp-item 5159 :flags (is-3d launch-asap bit7) :period 300 :length 5) + (sp-item 5160 :flags (is-3d bit6 bit7)) + (sp-item 5161 :fade-after (meters 100) :flags (bit7) :period 150 :length 5) + ) + ) + +(defpart 5160 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xb9a)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0.9)) + (sp-flt spt-rot-z (degrees 0.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-int spt-timer 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 aux-list) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5159 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #xb9a)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0.05)) + (sp-flt spt-scale-x (meters 0.158)) + (sp-flt spt-scale-y (meters 0.8)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 80.0) + (sp-rnd-flt spt-rotvel-y (degrees -1.2) (degrees 2.4) 1.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 aux-list left-multiply-quat) + (sp-int-plain-rnd spt-next-time 25 599 1) + (sp-launcher-by-id spt-next-launcher 5162) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 5161 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0.025)) + (sp-flt spt-z (meters 0.35)) + (sp-flt spt-scale-x (meters 0.15)) + (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 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 155) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 5163) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-castle-pod-dial-large + :id 1201 + :flags (use-local-clock unk-4 unk-6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 4) (degrees 0) (degrees 0)) + :parts ((sp-item 5164 :flags (is-3d launch-asap bit6 bit7) :period 300 :length 5) + (sp-item 5165 :flags (is-3d bit6 bit7)) + (sp-item 5166 :fade-after (meters 100) :flags (bit7) :period 150 :length 5) + ) + ) + +(defpart 5165 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xb9a)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1.45)) + (sp-flt spt-rot-z (degrees 0.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-int spt-timer 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 aux-list) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5164 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #xb9a)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0.05)) + (sp-flt spt-scale-x (meters 0.225)) + (sp-flt spt-scale-y (meters 1.4)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 80.0) + (sp-rnd-flt spt-rotvel-y (degrees -1.2) (degrees 2.4) 1.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 aux-list left-multiply-quat) + (sp-int-plain-rnd spt-next-time 25 599 1) + (sp-launcher-by-id spt-next-launcher 5162) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 5166 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0.025)) + (sp-flt spt-z (meters 0.5)) + (sp-flt spt-scale-x (meters 0.15)) + (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 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 155) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 5163) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-castle-dial-small + :id 1202 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 4) (degrees 0) (degrees 0)) + :parts ((sp-item 5167 :flags (is-3d launch-asap bit7) :period 300 :length 5) + (sp-item 5168 :flags (is-3d bit6 bit7)) + (sp-item 5169 :fade-after (meters 100) :flags (bit7) :period 150 :length 5) + ) + ) + +(defpart 5168 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xb9a)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1.7)) + (sp-flt spt-rot-z (degrees 0.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-int spt-timer 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 aux-list) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5167 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #xb9a)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0.05)) + (sp-flt spt-scale-x (meters 0.225)) + (sp-flt spt-scale-y (meters 1.5)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 80.0) + (sp-rnd-flt spt-rotvel-y (degrees -1.2) (degrees 2.4) 1.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 aux-list left-multiply-quat) + (sp-int-plain-rnd spt-next-time 25 599 1) + (sp-launcher-by-id spt-next-launcher 5162) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 5162 + :init-specs ((sp-rnd-flt spt-rotvel-y (degrees -1.2) (degrees 2.4) 1.0) + (sp-int spt-timer 1200) + (sp-int-plain-rnd spt-next-time 25 599 1) + (sp-launcher-by-id spt-next-launcher 5162) + ) + ) + +(defpart 5169 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0.025)) + (sp-flt spt-z (meters 0.6)) + (sp-flt spt-scale-x (meters 0.2)) + (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 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 155) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 5163) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5163 + :init-specs ((sp-flt spt-r 64.0) (sp-flt spt-g 0.0) (sp-flt spt-b 0.0) (sp-flt spt-a 128.0)) + ) + +(defpartgroup group-castle-dial-large + :id 1203 + :flags (use-local-clock unk-4 unk-6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 4) (degrees 0) (degrees 0)) + :parts ((sp-item 5170 :flags (is-3d launch-asap bit7) :period 300 :length 5) + (sp-item 5171 :flags (is-3d bit6 bit7)) + (sp-item 5172 :fade-after (meters 100) :flags (bit7) :period 150 :length 5) + (sp-item 5173 :fade-after (meters 100) :flags (bit7) :period 150 :length 5 :offset 65) + (sp-item 5174 :fade-after (meters 100) :flags (bit7) :period 150 :length 5 :offset 35) + ) + ) + +(defpart 5171 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xb9a)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2.3)) + (sp-flt spt-rot-z (degrees 0.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-int spt-timer 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 aux-list) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5170 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #xb9a)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0.05)) + (sp-flt spt-scale-x (meters 0.345)) + (sp-flt spt-scale-y (meters 2.2)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 80.0) + (sp-rnd-flt spt-rotvel-y (degrees -1.2) (degrees 2.4) 1.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 aux-list left-multiply-quat) + (sp-int-plain-rnd spt-next-time 25 599 1) + (sp-launcher-by-id spt-next-launcher 5162) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 5172 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0.025)) + (sp-flt spt-z (meters 0.8)) + (sp-flt spt-scale-x (meters 0.25)) + (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 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 155) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 5163) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5173 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 0.3)) + (sp-flt spt-y (meters 0.025)) + (sp-flt spt-z (meters 0.8)) + (sp-flt spt-scale-x (meters 0.25)) + (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 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 155) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 5163) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 5174 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters -0.3)) + (sp-flt spt-y (meters 0.025)) + (sp-flt spt-z (meters 0.8)) + (sp-flt spt-scale-x (meters 0.25)) + (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 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 155) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 5163) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) diff --git a/goal_src/jak2/levels/landing_pad/castle-texture.gc b/goal_src/jak2/levels/landing_pad/castle-texture.gc index 3d7fdce6b9..8f12656a01 100644 --- a/goal_src/jak2/levels/landing_pad/castle-texture.gc +++ b/goal_src/jak2/levels/landing_pad/castle-texture.gc @@ -7,3 +7,484 @@ ;; DECOMP BEGINS +(define *slime-clut* (new 'static 'clut16x16 :clut (new 'static 'array rgba 256 + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x53 :g #x55 :b #x13 :a #x80) + (new 'static 'rgba :r #x55 :g #x58 :b #x13 :a #x80) + (new 'static 'rgba :r #x57 :g #x5c :b #x13 :a #x80) + (new 'static 'rgba :r #x59 :g #x5f :b #x13 :a #x80) + (new 'static 'rgba :r #x5b :g #x63 :b #x13 :a #x80) + (new 'static 'rgba :r #x5c :g #x66 :b #x13 :a #x80) + (new 'static 'rgba :r #x5e :g #x69 :b #x13 :a #x80) + (new 'static 'rgba :r #x60 :g #x6d :b #x13 :a #x80) + (new 'static 'rgba :r #x60 :g #x6d :b #x14 :a #x80) + (new 'static 'rgba :r #x5e :g #x69 :b #x13 :a #x80) + (new 'static 'rgba :r #x5c :g #x66 :b #x13 :a #x80) + (new 'static 'rgba :r #x5a :g #x62 :b #x13 :a #x80) + (new 'static 'rgba :r #x59 :g #x5f :b #x13 :a #x80) + (new 'static 'rgba :r #x57 :g #x5c :b #x13 :a #x80) + (new 'static 'rgba :r #x55 :g #x58 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x53 :b #x12 :a #x80) + (new 'static 'rgba :r #x53 :g #x54 :b #x12 :a #x80) + (new 'static 'rgba :r #x54 :g #x55 :b #x12 :a #x80) + (new 'static 'rgba :r #x55 :g #x56 :b #x12 :a #x80) + (new 'static 'rgba :r #x55 :g #x58 :b #x12 :a #x80) + (new 'static 'rgba :r #x56 :g #x59 :b #x12 :a #x80) + (new 'static 'rgba :r #x57 :g #x5a :b #x12 :a #x80) + (new 'static 'rgba :r #x58 :g #x5b :b #x12 :a #x80) + (new 'static 'rgba :r #x58 :g #x5c :b #x12 :a #x80) + (new 'static 'rgba :r #x59 :g #x5e :b #x12 :a #x80) + (new 'static 'rgba :r #x5a :g #x5f :b #x12 :a #x80) + (new 'static 'rgba :r #x5b :g #x60 :b #x12 :a #x80) + (new 'static 'rgba :r #x5c :g #x61 :b #x12 :a #x80) + (new 'static 'rgba :r #x5c :g #x62 :b #x12 :a #x80) + (new 'static 'rgba :r #x5d :g #x64 :b #x12 :a #x80) + (new 'static 'rgba :r #x5e :g #x65 :b #x12 :a #x80) + (new 'static 'rgba :r #x5f :g #x66 :b #x12 :a #x80) + (new 'static 'rgba :r #x5f :g #x67 :b #x12 :a #x80) + (new 'static 'rgba :r #x60 :g #x68 :b #x12 :a #x80) + (new 'static 'rgba :r #x61 :g #x6a :b #x12 :a #x80) + (new 'static 'rgba :r #x62 :g #x6b :b #x12 :a #x80) + (new 'static 'rgba :r #x63 :g #x6c :b #x12 :a #x80) + (new 'static 'rgba :r #x63 :g #x6d :b #x12 :a #x80) + (new 'static 'rgba :r #x64 :g #x6e :b #x12 :a #x80) + (new 'static 'rgba :r #x65 :g #x70 :b #x12 :a #x80) + (new 'static 'rgba :r #x66 :g #x71 :b #x12 :a #x80) + (new 'static 'rgba :r #x66 :g #x72 :b #x12 :a #x80) + (new 'static 'rgba :r #x67 :g #x73 :b #x12 :a #x80) + (new 'static 'rgba :r #x68 :g #x74 :b #x12 :a #x80) + (new 'static 'rgba :r #x69 :g #x76 :b #x12 :a #x80) + (new 'static 'rgba :r #x69 :g #x77 :b #x12 :a #x80) + (new 'static 'rgba :r #x6c :g #x7c :b #x12 :a #x80) + (new 'static 'rgba :r #x73 :g #x86 :b #x12 :a #x80) + (new 'static 'rgba :r #x7a :g #x91 :b #x12 :a #x80) + (new 'static 'rgba :r #x81 :g #x9c :b #x11 :a #x80) + (new 'static 'rgba :r #x88 :g #xa6 :b #x11 :a #x80) + (new 'static 'rgba :r #x8f :g #xb1 :b #x11 :a #x80) + (new 'static 'rgba :r #x96 :g #xbc :b #x11 :a #x80) + (new 'static 'rgba :r #x9e :g #xc7 :b #x11 :a #x80) + (new 'static 'rgba :r #x9e :g #xc7 :b #x11 :a #x80) + (new 'static 'rgba :r #x99 :g #xc0 :b #x11 :a #x80) + (new 'static 'rgba :r #x94 :g #xb9 :b #x11 :a #x80) + (new 'static 'rgba :r #x90 :g #xb2 :b #x11 :a #x80) + (new 'static 'rgba :r #x8b :g #xab :b #x11 :a #x80) + (new 'static 'rgba :r #x87 :g #xa4 :b #x11 :a #x80) + (new 'static 'rgba :r #x82 :g #x9d :b #x12 :a #x80) + (new 'static 'rgba :r #x79 :g #x8f :b #x12 :a #x80) + (new 'static 'rgba :r #x77 :g #x8b :b #x12 :a #x80) + (new 'static 'rgba :r #x77 :g #x8d :b #x12 :a #x80) + (new 'static 'rgba :r #x78 :g #x8e :b #x12 :a #x80) + (new 'static 'rgba :r #x79 :g #x8f :b #x12 :a #x80) + (new 'static 'rgba :r #x7a :g #x90 :b #x12 :a #x80) + (new 'static 'rgba :r #x7a :g #x91 :b #x12 :a #x80) + (new 'static 'rgba :r #x7b :g #x93 :b #x12 :a #x80) + (new 'static 'rgba :r #x7c :g #x94 :b #x12 :a #x80) + (new 'static 'rgba :r #x7d :g #x95 :b #x12 :a #x80) + (new 'static 'rgba :r #x7e :g #x96 :b #x12 :a #x80) + (new 'static 'rgba :r #x7e :g #x97 :b #x12 :a #x80) + (new 'static 'rgba :r #x7f :g #x99 :b #x12 :a #x80) + (new 'static 'rgba :r #x80 :g #x9a :b #x12 :a #x80) + (new 'static 'rgba :r #x81 :g #x9b :b #x12 :a #x80) + (new 'static 'rgba :r #x81 :g #x9c :b #x12 :a #x80) + (new 'static 'rgba :r #x82 :g #x9d :b #x12 :a #x80) + (new 'static 'rgba :r #x83 :g #x9f :b #x12 :a #x80) + (new 'static 'rgba :r #x84 :g #xa0 :b #x12 :a #x80) + (new 'static 'rgba :r #x85 :g #xa1 :b #x12 :a #x80) + (new 'static 'rgba :r #x85 :g #xa2 :b #x12 :a #x80) + (new 'static 'rgba :r #x86 :g #xa3 :b #x12 :a #x80) + (new 'static 'rgba :r #x87 :g #xa5 :b #x12 :a #x80) + (new 'static 'rgba :r #x88 :g #xa6 :b #x12 :a #x80) + (new 'static 'rgba :r #x88 :g #xa7 :b #x12 :a #x80) + (new 'static 'rgba :r #x89 :g #xa8 :b #x12 :a #x80) + (new 'static 'rgba :r #x8a :g #xa9 :b #x12 :a #x80) + (new 'static 'rgba :r #x8b :g #xab :b #x12 :a #x80) + (new 'static 'rgba :r #x8b :g #xac :b #x12 :a #x80) + (new 'static 'rgba :r #x8c :g #xad :b #x12 :a #x80) + (new 'static 'rgba :r #x8d :g #xae :b #x12 :a #x80) + (new 'static 'rgba :r #x8e :g #xaf :b #x12 :a #x80) + (new 'static 'rgba :r #x8f :g #xb1 :b #x12 :a #x80) + (new 'static 'rgba :r #x8f :g #xb2 :b #x12 :a #x80) + (new 'static 'rgba :r #x92 :g #xb5 :b #x11 :a #x80) + (new 'static 'rgba :r #x94 :g #xb9 :b #x11 :a #x80) + (new 'static 'rgba :r #x96 :g #xbc :b #x11 :a #x80) + (new 'static 'rgba :r #x99 :g #xbf :b #x11 :a #x80) + (new 'static 'rgba :r #x9b :g #xc3 :b #x11 :a #x80) + (new 'static 'rgba :r #x9d :g #xc6 :b #x11 :a #x80) + (new 'static 'rgba :r #xa0 :g #xca :b #x11 :a #x80) + (new 'static 'rgba :r #xa0 :g #xca :b #x11 :a #x80) + (new 'static 'rgba :r #x9e :g #xc7 :b #x11 :a #x80) + (new 'static 'rgba :r #x9c :g #xc4 :b #x11 :a #x80) + (new 'static 'rgba :r #x9a :g #xc2 :b #x11 :a #x80) + (new 'static 'rgba :r #x98 :g #xbf :b #x11 :a #x80) + (new 'static 'rgba :r #x96 :g #xbd :b #x12 :a #x80) + (new 'static 'rgba :r #x94 :g #xba :b #x12 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x12 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x12 :a #x80) + (new 'static 'rgba :r #x8f :g #xb4 :b #x12 :a #x80) + (new 'static 'rgba :r #x8e :g #xb3 :b #x12 :a #x80) + (new 'static 'rgba :r #x8d :g #xb2 :b #x12 :a #x80) + (new 'static 'rgba :r #x8d :g #xb1 :b #x12 :a #x80) + (new 'static 'rgba :r #x8c :g #xb0 :b #x13 :a #x80) + (new 'static 'rgba :r #x8b :g #xaf :b #x13 :a #x80) + (new 'static 'rgba :r #x8a :g #xae :b #x13 :a #x80) + (new 'static 'rgba :r #x8a :g #xae :b #x13 :a #x80) + (new 'static 'rgba :r #x89 :g #xad :b #x13 :a #x80) + (new 'static 'rgba :r #x88 :g #xac :b #x13 :a #x80) + (new 'static 'rgba :r #x87 :g #xab :b #x13 :a #x80) + (new 'static 'rgba :r #x87 :g #xaa :b #x13 :a #x80) + (new 'static 'rgba :r #x86 :g #xa9 :b #x13 :a #x80) + (new 'static 'rgba :r #x85 :g #xa8 :b #x13 :a #x80) + (new 'static 'rgba :r #x84 :g #xa7 :b #x13 :a #x80) + (new 'static 'rgba :r #x84 :g #xa7 :b #x13 :a #x80) + (new 'static 'rgba :r #x83 :g #xa6 :b #x13 :a #x80) + (new 'static 'rgba :r #x82 :g #xa5 :b #x14 :a #x80) + (new 'static 'rgba :r #x81 :g #xa4 :b #x14 :a #x80) + (new 'static 'rgba :r #x81 :g #xa3 :b #x14 :a #x80) + (new 'static 'rgba :r #x80 :g #xa2 :b #x14 :a #x80) + (new 'static 'rgba :r #x7f :g #xa1 :b #x14 :a #x80) + (new 'static 'rgba :r #x7e :g #xa0 :b #x14 :a #x80) + (new 'static 'rgba :r #x7e :g #xa0 :b #x14 :a #x80) + (new 'static 'rgba :r #x7d :g #x9f :b #x14 :a #x80) + (new 'static 'rgba :r #x7c :g #x9e :b #x14 :a #x80) + (new 'static 'rgba :r #x7b :g #x9d :b #x14 :a #x80) + (new 'static 'rgba :r #x7b :g #x9c :b #x14 :a #x80) + (new 'static 'rgba :r #x7a :g #x9b :b #x14 :a #x80) + (new 'static 'rgba :r #x79 :g #x9a :b #x14 :a #x80) + (new 'static 'rgba :r #x79 :g #x9a :b #x15 :a #x80) + (new 'static 'rgba :r #x79 :g #x9a :b #x15 :a #x80) + (new 'static 'rgba :r #x7c :g #x9d :b #x14 :a #x80) + (new 'static 'rgba :r #x7f :g #xa1 :b #x14 :a #x80) + (new 'static 'rgba :r #x82 :g #xa5 :b #x14 :a #x80) + (new 'static 'rgba :r #x85 :g #xa8 :b #x13 :a #x80) + (new 'static 'rgba :r #x88 :g #xac :b #x13 :a #x80) + (new 'static 'rgba :r #x8b :g #xb0 :b #x13 :a #x80) + (new 'static 'rgba :r #x8e :g #xb3 :b #x12 :a #x80) + (new 'static 'rgba :r #x91 :g #xb7 :b #x12 :a #x80) + (new 'static 'rgba :r #x94 :g #xbb :b #x12 :a #x80) + (new 'static 'rgba :r #x97 :g #xbf :b #x12 :a #x80) + (new 'static 'rgba :r #x9a :g #xc2 :b #x11 :a #x80) + (new 'static 'rgba :r #x9d :g #xc6 :b #x11 :a #x80) + (new 'static 'rgba :r #xa0 :g #xca :b #x11 :a #x80) + (new 'static 'rgba :r #xa3 :g #xcd :b #x10 :a #x80) + (new 'static 'rgba :r #xa6 :g #xd1 :b #x10 :a #x80) + (new 'static 'rgba :r #xac :g #xd9 :b #x10 :a #x80) + (new 'static 'rgba :r #xab :g #xd8 :b #x10 :a #x80) + (new 'static 'rgba :r #xaa :g #xd7 :b #x10 :a #x80) + (new 'static 'rgba :r #xa9 :g #xd6 :b #x10 :a #x80) + (new 'static 'rgba :r #xa8 :g #xd5 :b #x10 :a #x80) + (new 'static 'rgba :r #xa8 :g #xd4 :b #x10 :a #x80) + (new 'static 'rgba :r #xa7 :g #xd3 :b #x10 :a #x80) + (new 'static 'rgba :r #xa6 :g #xd2 :b #x10 :a #x80) + (new 'static 'rgba :r #xa5 :g #xd1 :b #x10 :a #x80) + (new 'static 'rgba :r #xa4 :g #xd0 :b #x10 :a #x80) + (new 'static 'rgba :r #xa4 :g #xcf :b #x10 :a #x80) + (new 'static 'rgba :r #xa3 :g #xce :b #x10 :a #x80) + (new 'static 'rgba :r #xa2 :g #xcd :b #x11 :a #x80) + (new 'static 'rgba :r #xa1 :g #xcc :b #x11 :a #x80) + (new 'static 'rgba :r #xa0 :g #xcb :b #x11 :a #x80) + (new 'static 'rgba :r #xa0 :g #xca :b #x11 :a #x80) + (new 'static 'rgba :r #x9f :g #xc9 :b #x11 :a #x80) + (new 'static 'rgba :r #x9e :g #xc8 :b #x11 :a #x80) + (new 'static 'rgba :r #x9d :g #xc7 :b #x11 :a #x80) + (new 'static 'rgba :r #x9d :g #xc6 :b #x11 :a #x80) + (new 'static 'rgba :r #x9c :g #xc5 :b #x11 :a #x80) + (new 'static 'rgba :r #x9b :g #xc4 :b #x11 :a #x80) + (new 'static 'rgba :r #x9a :g #xc3 :b #x11 :a #x80) + (new 'static 'rgba :r #x99 :g #xc2 :b #x11 :a #x80) + (new 'static 'rgba :r #x99 :g #xc1 :b #x11 :a #x80) + (new 'static 'rgba :r #x98 :g #xc0 :b #x12 :a #x80) + (new 'static 'rgba :r #x97 :g #xbf :b #x12 :a #x80) + (new 'static 'rgba :r #x96 :g #xbe :b #x12 :a #x80) + (new 'static 'rgba :r #x95 :g #xbd :b #x12 :a #x80) + (new 'static 'rgba :r #x95 :g #xbc :b #x12 :a #x80) + (new 'static 'rgba :r #x94 :g #xbb :b #x12 :a #x80) + (new 'static 'rgba :r #x93 :g #xba :b #x12 :a #x80) + (new 'static 'rgba :r #x92 :g #xb9 :b #x12 :a #x80) + (new 'static 'rgba :r #x91 :g #xb8 :b #x12 :a #x80) + (new 'static 'rgba :r #x91 :g #xb7 :b #x12 :a #x80) + (new 'static 'rgba :r #x90 :g #xb6 :b #x12 :a #x80) + (new 'static 'rgba :r #x8f :g #xb5 :b #x12 :a #x80) + (new 'static 'rgba :r #x8e :g #xb4 :b #x12 :a #x80) + (new 'static 'rgba :r #x8e :g #xb3 :b #x13 :a #x80) + (new 'static 'rgba :r #x8c :g #xb1 :b #x13 :a #x80) + (new 'static 'rgba :r #x8c :g #xb1 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb6 :b #x12 :a #x80) + (new 'static 'rgba :r #x94 :g #xba :b #x12 :a #x80) + (new 'static 'rgba :r #x97 :g #xbf :b #x12 :a #x80) + (new 'static 'rgba :r #x9b :g #xc3 :b #x11 :a #x80) + (new 'static 'rgba :r #x9e :g #xc8 :b #x11 :a #x80) + (new 'static 'rgba :r #xa2 :g #xcc :b #x11 :a #x80) + (new 'static 'rgba :r #xa6 :g #xd1 :b #x11 :a #x80) + (new 'static 'rgba :r #xa6 :g #xd1 :b #x11 :a #x80) + (new 'static 'rgba :r #xa3 :g #xcd :b #x11 :a #x80) + (new 'static 'rgba :r #xa0 :g #xca :b #x11 :a #x80) + (new 'static 'rgba :r #x9d :g #xc6 :b #x11 :a #x80) + (new 'static 'rgba :r #x9b :g #xc3 :b #x12 :a #x80) + (new 'static 'rgba :r #x98 :g #xbf :b #x12 :a #x80) + (new 'static 'rgba :r #x95 :g #xbc :b #x12 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + ) + ) + ) + +(define *toxic-slime-texture-anim-array* + (the-as (texture-anim-array texture-anim) + (new 'static 'texture-anim-array :type texture-anim + (new 'static 'texture-anim + :func 'texture-anim-alpha-ramp-clut-upload + :init-func 'texture-anim-alpha-ramp-clut-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 28.0) + :color (new 'static 'rgba :a #x80) + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + (new 'static 'texture-anim + :num-layers #x2 + :func 'cloud-texture-anim-func + :init-func 'dest-texture-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 16.0 :y 8.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 300.0 + :frame-mod 600.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + (new 'static 'texture-anim + :num-layers #x2 + :func 'cloud-texture-anim-func + :init-func 'dest-texture-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 32.0 :y 9.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 300.0 + :frame-mod 300.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + (new 'static 'texture-anim + :num-layers #x2 + :func 'cloud-texture-anim-func + :init-func 'dest-texture-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 64.0 :y 10.0) + :color (new 'static 'rgba :a #x80) + :frame-time 99.0 + :frame-delta 300.0 + :frame-mod 150.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + (new 'static 'texture-anim + :num-layers #x2 + :func 'cloud-texture-anim-func + :init-func 'dest-texture-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 128.0 :y 12.0) + :color (new 'static 'rgba :a #x80) + :frame-time 199.0 + :frame-delta 300.0 + :frame-mod 75.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + (new 'static 'texture-anim + :num-layers #x4 + :func #f + :init-func 'dest-texture-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 128.0 :y 20.0) + :color (new 'static 'rgba :a #x80) + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + (new 'static 'texture-anim + :num-layers #x1 + :func #f + :init-func 'texture-anim-change-mt8h-init + :tex #f + :tex-name "cas-toxic-slime-dest" + :extra (new 'static 'vector :x 28.0 :y 12.0 :z 128.0 :w 128.0) + :color (new 'static 'rgba :a #x80) + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + (new 'static 'texture-anim + :func 'texture-anim-slime-clut-upload + :init-func 'texture-anim-slime-clut-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 28.0) + :color (new 'static 'rgba :a #x80) + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + (new 'static 'texture-anim + :num-layers #x1 + :func #f + :init-func 'texture-anim-overide-size-init + :tex #f + :tex-name "cas-toxic-slime-scroll-dest" + :extra (new 'static 'vector :x 64.0 :y 64.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 300.0 + :frame-mod 1200.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + ) + ) + ) + +(defun set-slime-alphas ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> *toxic-slime-texture-anim-array* array-data 5 data 0 start-color w) arg0) + (set! (-> *toxic-slime-texture-anim-array* array-data 5 data 1 start-color w) arg1) + (set! (-> *toxic-slime-texture-anim-array* array-data 5 data 2 start-color w) arg2) + (set! (-> *toxic-slime-texture-anim-array* array-data 5 data 3 start-color w) arg3) + ) + +;; WARN: Return type mismatch object vs none. +(defun get-slime-alphas () + (format + 0 + "~f ~f ~f ~f~%" + (-> *toxic-slime-texture-anim-array* array-data 5 data 0 start-color w) + (-> *toxic-slime-texture-anim-array* array-data 5 data 1 start-color w) + (-> *toxic-slime-texture-anim-array* array-data 5 data 2 start-color w) + (-> *toxic-slime-texture-anim-array* array-data 5 data 3 start-color w) + ) + (none) + ) + +(defun set-slime-speed ((arg0 float)) + (let ((v1-0 *toxic-slime-texture-anim-array*) + (f0-3 (the float (the int (* 300.0 arg0)))) + ) + (dotimes (a0-1 4) + (let ((a1-4 (-> v1-0 array-data (+ a0-1 1)))) + (set! (-> a1-4 frame-mod) f0-3) + (set! (-> a1-4 data 0 end-time) f0-3) + (set! (-> a1-4 data 1 end-time) f0-3) + ) + (set! f0-3 (* 0.5 f0-3)) + ) + ) + #f + ) + +(define *cas-conveyor-texture-anim-array* + (the-as (texture-anim-array texture-anim) + (new 'static 'texture-anim-array :type texture-anim + (new 'static 'texture-anim + :num-layers #x1 + :func #f + :init-func 'texture-anim-overide-size-init + :tex #f + :tex-name "cas-conveyor-dest" + :extra (new 'static 'vector :x 64.0 :y 32.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 555.0 + :frame-mod 300.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (new 'static 'texture-anim + :num-layers #x1 + :func #f + :init-func 'texture-anim-overide-size-init + :tex #f + :tex-name "cas-conveyor-dest-01" + :extra (new 'static 'vector :x 64.0 :y 32.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 555.0 + :frame-mod 300.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (new 'static 'texture-anim + :num-layers #x1 + :func #f + :init-func 'texture-anim-overide-size-init + :tex #f + :tex-name "cas-conveyor-dest-02" + :extra (new 'static 'vector :x 64.0 :y 32.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 555.0 + :frame-mod 300.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (new 'static 'texture-anim + :num-layers #x1 + :func #f + :init-func 'texture-anim-overide-size-init + :tex #f + :tex-name "cas-conveyor-dest-03" + :extra (new 'static 'vector :x 64.0 :y 32.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 555.0 + :frame-mod 300.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + ) + ) + ) + +(defun set-conveyor-speed! ((arg0 int) (arg1 float)) + (set! (-> *cas-conveyor-texture-anim-array* array-data arg0 frame-delta) (* 0.018066408 arg1)) + 0 + (none) + ) diff --git a/goal_src/jak2/levels/landing_pad/roboguard-level.gc b/goal_src/jak2/levels/landing_pad/roboguard-level.gc index 39b4128eeb..4c23a16fee 100644 --- a/goal_src/jak2/levels/landing_pad/roboguard-level.gc +++ b/goal_src/jak2/levels/landing_pad/roboguard-level.gc @@ -7,3 +7,1360 @@ ;; DECOMP BEGINS +(deftype roboguard-level (nav-enemy) + ((unknown-n12kjh3n123 int32 5 :offset-assert 604) + (flags uint16 :offset-assert 624) + (roll-timer time-frame :offset-assert 632) + (roll-dir vector :inline :offset-assert 640) + (incoming-attack-id uint32 :offset-assert 656) + (turning-acc float :offset-assert 660) + (speed float :offset-assert 664) + (roll-attack-count uint32 :offset-assert 668) + (roll-sound uint32 :offset-assert 672) + ) + :heap-base #x230 + :method-count-assert 189 + :size-assert #x2a4 + :flag-assert #xbd023002a4 + (:methods + (roboguard-level-method-178 (_type_) none 178) + (roboguard-level-method-179 (_type_) none 179) + (roll-enter () _type_ :state 180) + (roll-hostile () _type_ :state 181) + (roll-to-walk () _type_ :state 182) + (idle-dizzy () _type_ :state 183) + (explode () _type_ :state 184) + (roboguard-level-method-185 (_type_ symbol) none 185) + (roboguard-level-method-186 (_type_) none 186) + (roboguard-level-method-187 (_type_) none 187) + (roboguard-level-method-188 (_type_) none 188) + ) + ) + + +(defskelgroup skel-roboguard-level roboguard roboguard-lod0-jg roboguard-idle0-ja + ((roboguard-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :shadow roboguard-shadow-mg + :origin-joint-index 3 + ) + +(defskelgroup skel-roboguard-level-explode roboguard roboguard-explode-lod0-jg roboguard-explode-idle-ja + ((roboguard-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +(define *roboguard-level-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 8 :parent-joint-index 15) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index 11) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index 10) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index 9) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index 24) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index 27) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index 18) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index 21) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index 12) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index 8) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index 17) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index 4) + ) + :collide-spec #x1 + ) + ) + +(set! (-> *lightning-spec-id-table* 26) (new 'static 'lightning-spec + :name "lightning-roboguard-shock" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x83 :page #xc) + :reduction 0.42 + :num-points 6 + :box-size 6144.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound #f + ) + ) + +(define *roboguard-level-nav-enemy-info* (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script #f + :idle-anim 5 + :notice-anim 6 + :hostile-anim 8 + :hit-anim 5 + :knocked-anim 21 + :knocked-land-anim 22 + :die-anim 12 + :die-falling-anim 23 + :victory-anim 5 + :jump-wind-up-anim 5 + :jump-in-air-anim 5 + :jump-land-anim 5 + :neck-joint 5 + :look-at-joint 4 + :bullseye-joint 4 + :notice-distance (meters 50) + :notice-distance-delta (meters 20) + :proximity-notice-distance (meters 30) + :default-hit-points 8 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot enemy hit-by-others-list player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-giant + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + penetrate-33 + penetrate-34 + penetrate-35 + penetrate-36 + penetrate-37 + penetrate-38 + penetrate-39 + penetrate-40 + penetrate-41 + penetrate-42 + penetrate-43 + penetrate-44 + penetrate-45 + penetrate-46 + penetrate-47 + penetrate-48 + penetrate-49 + penetrate-50 + penetrate-51 + penetrate-52 + penetrate-53 + penetrate-54 + penetrate-55 + penetrate-56 + penetrate-57 + penetrate-58 + penetrate-59 + penetrate-60 + penetrate-61 + penetrate-62 + penetrate-63 + ) + :movement-gravity (meters -100) + :friction 0.5 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 20480.0 + :knocked-soft-vxz-hi 28672.0 + :knocked-soft-vy-lo 36864.0 + :knocked-soft-vy-hi 45056.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 49152.0 + :knocked-hard-vxz-hi 57344.0 + :knocked-hard-vy-lo 49152.0 + :knocked-hard-vy-hi 57344.0 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 20480.0 + :knocked-yellow-vxz-hi 28672.0 + :knocked-yellow-vy-lo 36864.0 + :knocked-yellow-vy-hi 4096.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 16384.0 + :knocked-blue-vxz-hi 20480.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 7 + :turn-anim 4 + :run-anim 8 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 2) + :run-turning-acceleration (meters 30) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 720.0) + :notice-nav-radius (meters 10) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +(set! (-> *roboguard-level-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defpart 5116 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x83 :page #xc)) + (sp-func spt-birth-func 'birth-func-set-quat) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1)) + (sp-flt spt-scale-y (meters 40)) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 64.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat) + ) + ) + +(defpart 5117 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbc :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 64.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-flt spt-fade-g -1.0666667) + (sp-flt spt-fade-b -1.0666667) + (sp-flt spt-fade-a -8.533334) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 5118 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbc :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 64.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-flt spt-fade-g -1.0666667) + (sp-flt spt-fade-b -1.0666667) + (sp-flt spt-fade-a -8.533334) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defbehavior roboguard-roll-travel-post roboguard-level () + (let ((a1-0 (new 'stack-no-clear 'collide-query)) + (gp-0 (-> self root-override2)) + ) + (if (find-ground gp-0 a1-0 (-> self enemy-info-override gnd-collide-with) 8192.0 81920.0 1024.0) + (set! (-> gp-0 trans y) (-> gp-0 gspot-pos y)) + ) + ) + (let ((a0-1 (-> self nav state)) + (v1-6 (-> self roll-dir)) + ) + (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) + (set! (-> a0-1 travel quad) (-> v1-6 quad)) + ) + 0 + (nav-enemy-travel-post) + (none) + ) + +(defstate ambush (roboguard-level) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 44)) enter))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (set! (-> self flags) (logand -9 (-> self flags))) + (logior! (-> self flags) 4) + (logior! (-> self nav flags) (nav-control-flag output-sphere-hash)) + (let ((a1-1 (new 'stack-no-clear 'collide-query))) + (enemy-method-125 self a1-1 (collide-spec backgnd) 8192.0 81920.0 1024.0) + ) + (let* ((v1-11 (-> self nav)) + (a1-2 (-> self root-override2 gspot-pos)) + (f0-0 (-> v1-11 extra-nav-sphere w)) + ) + (set! (-> v1-11 extra-nav-sphere quad) (-> a1-2 quad)) + (set! (-> v1-11 extra-nav-sphere w) f0-0) + ) + 0 + (let ((v1-14 (-> self nav))) + (set! (-> v1-14 extra-nav-sphere w) (-> self nav-radius-backup)) + ) + 0 + (let ((v1-16 (-> self nav))) + (logior! (-> v1-16 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (enemy-method-129 self) + (let ((a0-11 (handle->process (-> self focus handle)))) + (if a0-11 + (point-toward-point! (-> self root-override2) (get-trans (the-as process-focusable a0-11) 0)) + ) + ) + (none) + ) + :exit (behavior () + (logclear! (-> self nav flags) (nav-control-flag output-sphere-hash)) + (let ((v1-2 (-> self nav))) + (logclear! (-> v1-2 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (none) + ) + :code (behavior () + (let ((a0-0 (-> self skel root-channel 0))) + (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) + (set! (-> a0-0 frame-num) 3.0) + (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-identity) + ) + (until (logtest? (-> self root-override2 status) (collide-status on-surface)) + (nav-enemy-falling-post) + (suspend) + ) + (sound-play "robo-bounce") + (go-virtual roll-hostile) + (none) + ) + :post (behavior () + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self root-override2 gspot-pos quad)) + (set! (-> a1-0 w) (-> self nav-radius-backup)) + (if (not (add-root-sphere-to-hash! (-> self nav) a1-0 32)) + (nav-enemy-falling-post) + ) + ) + (none) + ) + ) + +(defstate idle (roboguard-level) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 31)) enter))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (roboguard-level-method-185 self (the-as symbol 0)) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! 2.0 (rand-vu-float-range 0.1 0.15)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 2.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! 3.0 (rand-vu-float-range 0.1 0.15)) + :frame-num 2.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 3.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! 4.0 (rand-vu-float-range 0.1 0.15)) + :frame-num 3.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 4.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! 5.0 (rand-vu-float-range 0.1 0.15)) + :frame-num 4.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 5.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! 6.0 (rand-vu-float-range 0.1 0.15)) + :frame-num 5.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 6.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! 7.0 0.07) :frame-num 6.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 7.0 0.07)) + ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! 8.0 0.07) :frame-num 7.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 8.0 0.07)) + ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! 9.0 0.07) :frame-num 8.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 9.0 0.07)) + ) + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! 10.0 (rand-vu-float-range 0.02 0.05)) + :frame-num 9.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 10.0 (rand-vu-float-range 0.02 0.05))) + ) + ) + #f + (none) + ) + :post (behavior () + (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) + (set! (-> self last-draw-time) (-> self clock frame-counter)) + ) + (enemy-method-129 self) + (ja-post) + (none) + ) + ) + +(defstate stare (roboguard-level) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 35)) enter))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (roboguard-level-method-185 self (the-as symbol 0)) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (get-rand-float-range self 0.9 1.1))) + (until #f + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! 10.0 (* 0.1 f30-0)) :frame-num 9.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 10.0 (* 0.1 f30-0))) + ) + ) + ) + #f + (none) + ) + ) + +(defstate roll-enter (roboguard-level) + :virtual #t + :enter (behavior () + (logior! (-> self flags) 4) + (roboguard-level-method-185 self (the-as symbol 1)) + (set! (-> self flags) (logand -9 (-> self flags))) + (none) + ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 9) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual roll-hostile) + (none) + ) + :post (behavior () + (let ((a1-0 (new 'stack-no-clear 'collide-query)) + (gp-0 (-> self root-override2)) + ) + (if (find-ground gp-0 a1-0 (-> self enemy-info-override gnd-collide-with) 8192.0 81920.0 1024.0) + (set! (-> gp-0 trans y) (-> gp-0 gspot-pos y)) + ) + ) + (nav-enemy-simple-post) + (none) + ) + ) + +(defstate roll-hostile (roboguard-level) + :virtual #t + :event (the-as + (function process int symbol event-message-block object :behavior roboguard-level) + enemy-event-handler + ) + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> self flags) 4) + (logclear! (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> self mask) (process-mask actor-pause)) + (when (logtest? (-> self enemy-flags) (enemy-flag drawn-mirrored)) + (logclear! (-> self enemy-flags) (enemy-flag drawn-mirrored)) + (let ((gp-0 (-> self on-hostile))) + (if gp-0 + (eval! + (new 'stack 'script-context (the-as basic (process->ppointer self)) self (-> self root-override2 trans)) + (the-as pair gp-0) + ) + ) + ) + ) + (set! (-> self speed) 81920.0) + (let ((v1-20 (-> self nav))) + (set! (-> v1-20 acceleration) 16384.0) + ) + 0 + (set! (-> self turning-acc) 122880.0) + (let ((v1-23 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-23 enemy-flags))) + (set! (-> v1-23 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-23 enemy-flags)))) + ) + (set! (-> v1-23 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-23 enemy-flags)))) + (set! (-> v1-23 nav callback-info) (-> v1-23 enemy-info-override callback-info)) + ) + 0 + (let ((v1-26 self)) + (set! (-> v1-26 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-26 enemy-flags)))) + ) + 0 + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> self state-time) (-> self clock frame-counter)) + (roboguard-level-method-185 self (the-as symbol 1)) + (vector-z-quaternion! (-> self roll-dir) (-> self root-override2 quat)) + (set! (-> self roll-timer) 0) + (set! (-> self roll-attack-count) (the-as uint 0)) + 0 + (none) + ) + :exit (behavior () + (sound-stop (the-as sound-id (-> self roll-sound))) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (none) + ) + :trans (behavior () + (let ((a0-0 (static-sound-spec "robo-roll"))) + (sound-play-by-spec a0-0 (the-as sound-id (-> self roll-sound)) (-> self root-override2 trans)) + ) + (cond + ((logtest? (-> self flags) 64) + (if (not (logtest? (-> self flags) 32)) + (sound-play "robo-ball-hit") + ) + (logior! (-> self flags) 32) + ) + (else + (set! (-> self flags) (logand -33 (-> self flags))) + ) + ) + (set! (-> self flags) (logand -65 (-> self flags))) + (seek! (-> self speed) 81920.0 (* 1228800.0 (-> self clock seconds-per-frame))) + (seek! (-> self turning-acc) 4096.0 (* 1228800.0 (-> self clock seconds-per-frame))) + (let ((v1-20 (-> self nav))) + (set! (-> v1-20 target-speed) (-> self speed)) + ) + 0 + (let ((v1-22 (-> self nav))) + (set! (-> v1-22 turning-acceleration) (-> self turning-acc)) + ) + 0 + (nav-enemy-method-160 self) + (when (< (-> self roll-timer) (-> self clock frame-counter)) + (set! (-> self roll-timer) + (+ (-> self clock frame-counter) (the int (* 300.0 (get-rand-float-range self 3.0 5.0)))) + ) + (let ((gp-2 (handle->process (-> self focus handle)))) + (when (and gp-2 + (and gp-2 + (zero? (logand (-> (the-as process-focusable gp-2) focus-status) (focus-status disable dead ignore grabbed))) + ) + (< 2 (the-as int (-> self focus aware))) + ) + (let ((s5-2 (vector-! + (new 'stack-no-clear 'vector) + (get-trans (the-as process-focusable gp-2) 0) + (-> self root-override2 trans) + ) + ) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-2 y) 0.0) + (vector-xz-normalize! s5-2 (if (logtest? (-> self pid) 1) + 10240.0 + -10240.0 + ) + ) + (vector-rotate-around-y! s5-2 s5-2 16384.0) + (vector+! s4-0 (get-trans (the-as process-focusable gp-2) 0) s5-2) + (vector-! (-> self roll-dir) s4-0 (-> self root-override2 trans)) + ) + (set! (-> self roll-dir y) 0.0) + (vector-normalize! (-> self roll-dir) 1.0) + ) + ) + ) + (let ((gp-3 (new 'stack-no-clear 'vector))) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override2 quat)) + (new 'stack-no-clear 'vector) + (set! (-> gp-3 quad) (-> self roll-dir quad)) + (let ((s3-2 (new 'stack-no-clear 'vector)) + (s4-1 (new 'stack-no-clear 'vector)) + (s5-3 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (let ((s2-0 (-> self nav state current-poly))) + (vector-xz-normalize-copy! s3-2 gp-3 20480.0) + (set! (-> s4-1 quad) (-> s3-2 quad)) + (clamp-vector-to-mesh-no-gaps (-> self nav) (-> self root-override2 trans) s2-0 s4-1 s5-3) + ) + (when (-> s5-3 found-boundary) + (let ((f30-1 (vector-length gp-3))) + (vector-flatten! gp-3 gp-3 (-> s5-3 boundary-normal)) + (vector-rotate-around-y! gp-3 (-> s5-3 boundary-normal) (if (logtest? (-> self pid) 1) + 17294.223 + -17294.223 + ) + ) + (vector-normalize! gp-3 f30-1) + ) + ) + ) + (set! (-> self roll-dir quad) (-> gp-3 quad)) + ) + (if (>= (-> self roll-attack-count) (the-as uint 3)) + (go-virtual roll-to-walk) + ) + (none) + ) + :code (behavior () + (ja :group! (-> self draw art-group data 10)) + (until #f + (let ((a0-3 (-> self skel root-channel 0))) + (let ((f0-0 0.000024414063) + (a2-0 (-> self nav state)) + (v1-7 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-7 quad) (-> a2-0 velocity quad)) + (set! (-> a0-3 param 0) (* f0-0 (sqrtf (+ (* (-> v1-7 x) (-> v1-7 x)) (* (-> v1-7 z) (-> v1-7 z)))))) + ) + (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-loop!) + ) + (suspend) + ) + #f + (none) + ) + :post roboguard-roll-travel-post + ) + +(defstate roll-to-walk (roboguard-level) + :virtual #t + :event (the-as + (function process int symbol event-message-block object :behavior roboguard-level) + enemy-event-handler + ) + :enter (behavior () + '() + (none) + ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 27) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 27)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (when (< 17.0 (ja-aframe-num 0)) + (set! (-> self flags) (logand -5 (-> self flags))) + (roboguard-level-method-185 self (the-as symbol 0)) + ) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual idle-dizzy) + (none) + ) + :post (behavior () + (let ((a1-0 (new 'stack-no-clear 'collide-query)) + (gp-0 (-> self root-override2)) + ) + (if (find-ground gp-0 a1-0 (-> self enemy-info-override gnd-collide-with) 8192.0 81920.0 1024.0) + (set! (-> gp-0 trans y) (-> gp-0 gspot-pos y)) + ) + ) + (nav-enemy-face-focus-post) + (none) + ) + ) + +(defstate idle-dizzy (roboguard-level) + :virtual #t + :event (the-as + (function process int symbol event-message-block object :behavior roboguard-level) + enemy-event-handler + ) + :enter (behavior () + (set! (-> self flags) (logand -5 (-> self flags))) + (roboguard-level-method-185 self (the-as symbol 0)) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 28) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 28)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual roll-enter) + (none) + ) + :post (behavior () + (nav-enemy-simple-post) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod go-hostile roboguard-level ((obj roboguard-level)) + (go (method-of-object obj roll-enter)) + (none) + ) + +(defstate die (roboguard-level) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 38)) enter))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (roboguard-level-method-185 self (the-as symbol 0)) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data 12) + :num! (seek! (ja-aframe 20.0 0)) + :frame-num (ja-aframe 13.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 20.0 0))) + ) + (ja-no-eval :group! (-> self draw art-group data 12) + :num! (seek! (ja-aframe 25.0 0) 0.5) + :frame-num (ja-aframe 20.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 25.0 0) 0.5)) + ) + (ja-no-eval :group! (-> self draw art-group data 12) + :num! (seek! (ja-aframe 26.0 0)) + :frame-num (ja-aframe 25.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 26.0 0))) + ) + (let ((gp-6 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set-vector! (-> gp-6 fountain-rand-transv-lo) -163840.0 0.0 -163840.0 1.0) + (set-vector! (-> gp-6 fountain-rand-transv-hi) 163840.0 409.6 163840.0 1.0) + (set! (-> gp-6 gravity) -40960.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-roboguard-level-explode" (the-as (pointer uint32) #f)) + 31 + gp-6 + *roboguard-level-exploder-params* + :to self + ) + ) + (go-virtual explode) + (none) + ) + ) + +(defstate explode (roboguard-level) + :virtual #t + :enter (the-as (function none :behavior roboguard-level) #f) + :exit (the-as (function none :behavior roboguard-level) #f) + :trans (the-as (function none :behavior roboguard-level) #f) + :code (behavior () + (sound-play "robo-explode") + (let ((v1-2 (-> self root-override2 root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior roboguard-level) #f) + ) + +(defmethod roboguard-level-method-185 roboguard-level ((obj roboguard-level) (arg0 symbol)) + (let ((v1-1 (-> obj root-override2 root-prim)) + (a0-1 arg0) + ) + (cond + ((zero? a0-1) + (set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-as) (collide-spec enemy)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-with) + (collide-spec backgnd jak bot player-list) + ) + (set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-as) (collide-spec enemy)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-with) + (collide-spec backgnd jak bot player-list) + ) + (set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-as) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-with) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-as) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-with) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-as) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-with) (collide-spec)) + (set-vector! (-> v1-1 local-sphere) 0.0 8192.0 0.0 12288.0) + ) + ((= a0-1 1) + (set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-as) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-with) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-as) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-with) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-as) (collide-spec enemy)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-with) + (collide-spec jak bot enemy player-list) + ) + (set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-as) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-with) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-as) (collide-spec enemy)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-with) + (collide-spec jak bot player-list) + ) + (set-vector! (-> v1-1 local-sphere) 0.0 5734.4 0.0 7372.8) + ) + ((= a0-1 2) + (set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-as) (collide-spec enemy)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-with) + (collide-spec backgnd jak bot player-list) + ) + (set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-as) (collide-spec enemy)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-with) + (collide-spec backgnd jak bot player-list) + ) + (set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-as) (collide-spec enemy)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-with) + (collide-spec jak bot player-list) + ) + (set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-as) (collide-spec enemy)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-with) + (collide-spec jak bot player-list) + ) + (set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-as) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-with) (collide-spec)) + (set-vector! (-> v1-1 local-sphere) 0.0 8192.0 0.0 24576.0) + ) + ) + ) + 0 + (none) + ) + +(defmethod enemy-method-77 roboguard-level ((obj roboguard-level) (arg0 (pointer float))) + (ja-channel-push! 1 0) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-0) + (knocked-type knocked-type-1) + (knocked-type knocked-type-4) + (knocked-type knocked-type-6) + ) + (let ((a0-5 (-> obj skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 21))) + (set! (-> a0-5 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 21)) frames num-frames) -1)) + ) + (set! (-> a0-5 param 1) (-> arg0 0)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 21)) num-func-seek!) + ) + ) + (else + (let ((a0-6 (-> obj skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (set! (-> a0-6 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + ) + (set! (-> a0-6 param 1) (-> arg0 0)) + (set! (-> a0-6 frame-num) 0.0) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + ) + ) + ) + #t + ) + +(defmethod enemy-method-78 roboguard-level ((obj roboguard-level) (arg0 (pointer float))) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-0) + (knocked-type knocked-type-1) + (knocked-type knocked-type-4) + (knocked-type knocked-type-6) + ) + (let ((v1-4 (-> obj skel root-channel 0))) + (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (set! (-> v1-4 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + ) + (set! (-> v1-4 param 1) (-> arg0 0)) + (set! (-> v1-4 frame-num) 0.0) + (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + ) + ) + (else + (let ((v1-8 (-> obj skel root-channel 0))) + (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 24))) + (set! (-> v1-8 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 24)) frames num-frames) -1)) + ) + (set! (-> v1-8 param 1) (-> arg0 0)) + (set! (-> v1-8 frame-num) 0.0) + (joint-control-channel-group! v1-8 (the-as art-joint-anim (-> obj draw art-group data 24)) num-func-seek!) + ) + ) + ) + #t + ) + +(defmethod general-event-handler roboguard-level ((obj roboguard-level) (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 + (('attack) + (cond + ((logtest? (-> obj flags) 4) + (let ((v1-3 (the-as object (-> arg3 param 1))) + (a0-2 arg0) + ) + (cond + ((!= (-> (the-as attack-info v1-3) id) (-> obj incoming-attack-id)) + (set! (-> obj incoming-attack-id) (-> (the-as attack-info v1-3) id)) + (when (and a0-2 (zero? (logand (process-mask enemy) (-> a0-2 mask)))) + (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info v1-3)))) + (when s5-0 + (new 'stack-no-clear 'vector) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> s5-0 root-override trans quad)) + (if (< (-> obj roll-attack-count) (the-as uint 3)) + (+! (-> obj roll-attack-count) 1) + ) + (vector-! (-> obj roll-dir) (-> obj root-override2 trans) (-> s5-0 root-override trans)) + (set! (-> obj roll-dir y) 0.0) + (vector-xz-normalize! (-> obj roll-dir) 1.0) + (set! (-> obj speed) (+ 245760.0 (vector-length (-> s5-0 root-override transv)))) + (let ((a0-9 (-> obj nav state)) + (v1-19 (vector-float*! (new 'stack-no-clear 'vector) (-> obj roll-dir) (-> obj speed))) + ) + (set! (-> a0-9 velocity quad) (-> v1-19 quad)) + ) + 0 + (let ((v1-23 (-> obj nav state))) + (set! (-> v1-23 speed) (-> obj speed)) + ) + 0 + (let ((v1-25 (-> obj nav))) + (set! (-> v1-25 target-speed) (-> obj speed)) + ) + 0 + (sound-play "robo-ball-kick") + ) + ) + ) + #t + ) + (else + #f + ) + ) + ) + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) + ) + ) + (('hit 'hit-knocked 'hit-flinch) + (when (not (logtest? (-> obj flags) 4)) + (let ((s5-2 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> s5-2 fountain-rand-transv-lo quad) (-> obj incoming attacker-pos quad)) + (set! (-> s5-2 fountain-rand-transv-hi x) 4096.0) + (set! (-> s5-2 fountain-rand-transv-hi y) 122880.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-roboguard-level-explode" (the-as (pointer uint32) #f)) + 31 + s5-2 + *roboguard-level-exploder-params* + :to obj + ) + ) + (dispose! obj) + (go (method-of-object obj explode)) + ) + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) + ) + ) + +;; WARN: Return type mismatch object vs symbol. +(defmethod enemy-method-76 roboguard-level ((obj roboguard-level) (arg0 process) (arg1 event-message-block)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (the-as + symbol + (cond + ((or (= (-> arg0 type) target) (zero? (logand (-> obj flags) 4))) + ((method-of-type nav-enemy enemy-method-76) obj arg0 arg1) + ) + (else + (when (!= (-> arg0 type) target) + (-> arg1 param 0) + (let* ((s3-0 arg0) + (s1-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when (and s1-0 (logtest? (process-mask enemy) (-> s1-0 mask))) + (let ((s2-1 (vector-! + (new 'stack-no-clear 'vector) + (-> obj root-override2 trans) + (-> (the-as process-drawable s1-0) root trans) + ) + ) + ) + (new 'stack-no-clear 'vector) + 0.0 + (let ((s3-1 (new 'stack-no-clear 'vector))) + (vector-normalize! s2-1 1.0) + (let ((f0-3 + (- (vector-dot (-> obj root-override2 transv) s2-1) + (vector-dot (-> (the-as process-drawable s1-0) root transv) s2-1) + ) + ) + ) + (let ((a1-5 (-> obj nav state))) + (set! (-> s3-1 quad) (-> a1-5 velocity quad)) + ) + (let ((a0-16 s3-1)) + (let ((v1-20 s3-1)) + (let ((a1-9 (* -1.0 f0-3))) + (.mov vf7 a1-9) + ) + (.lvf vf5 (&-> s2-1 quad)) + (.lvf vf4 (&-> v1-20 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 (&-> a0-16 quad) vf6) + ) + ) + (let ((a0-17 (-> obj nav state)) + (v1-22 s3-1) + ) + (set! (-> a0-17 velocity quad) (-> v1-22 quad)) + ) + 0 + (set! (-> obj speed) (vector-length s3-1)) + (let ((v1-28 (-> obj nav state))) + (set! (-> v1-28 speed) (-> obj speed)) + ) + 0 + (let ((v1-30 (-> obj nav))) + (set! (-> v1-30 target-speed) (-> obj speed)) + ) + 0 + (set! (-> obj roll-timer) + (+ (-> pp clock frame-counter) (the int (* 300.0 (get-rand-float-range obj 3.0 5.0)))) + ) + (set! (-> obj roll-dir quad) (-> s3-1 quad)) + ) + ) + (set! (-> obj roll-dir y) 0.0) + (vector-xz-normalize! (-> obj roll-dir) 1.0) + (let ((a0-22 (-> obj nav state)) + (v1-40 (-> obj roll-dir)) + ) + (set! (-> a0-22 heading quad) (-> v1-40 quad)) + ) + 0 + (logior! (-> obj flags) 64) + ) + ) + (send-event arg0 'touch (-> arg1 param 0)) + ) + ) + ) + ) + ) + ) + ) + +(defmethod nav-enemy-method-142 roboguard-level ((obj roboguard-level) (arg0 nav-control)) + (with-pp + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let ((a1-1 (-> arg0 state))) + (set! (-> s3-0 quad) (-> a1-1 heading quad)) + ) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (let ((gp-0 (new 'stack-no-clear 'quaternion)) + (s5-1 (-> obj root-override2 quat)) + ) + (quaternion-set! gp-0 0.0 (-> s3-0 x) 0.0 (+ 1.0 (-> s3-0 z))) + (quaternion-normalize! gp-0) + (quaternion-pseudo-seek + s5-1 + s5-1 + gp-0 + (* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (-> pp clock seconds-per-frame)) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod nav-enemy-method-176 roboguard-level ((obj roboguard-level)) + (nav-enemy-method-177 obj) + (let ((a0-2 obj)) + (when (logtest? (enemy-flag enemy-flag36) (-> a0-2 enemy-flags)) + (cond + ((logtest? (enemy-flag enemy-flag38) (-> obj enemy-flags)) + (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag38)))) + (set! (-> obj root-override2 gspot-pos quad) (-> obj root-override2 trans quad)) + ) + (else + (nav-enemy-method-142 obj (-> obj nav)) + (nav-enemy-method-143 obj (-> obj nav)) + ) + ) + ) + ) + (track-target! obj) + (update-transforms (-> obj root-override2)) + 0 + (none) + ) + +(defmethod dispose! roboguard-level ((obj roboguard-level)) + "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" + (when (not (logtest? (enemy-flag recover-applied-velocity) (-> obj enemy-flags))) + (send-event (ppointer->process (-> obj parent)) 'roboguard-die) + ((method-of-type nav-enemy dispose!) obj) + ) + (none) + ) + +(defmethod deactivate roboguard-level ((obj roboguard-level)) + (sound-stop (the-as sound-id (-> obj roll-sound))) + ((the-as (function nav-enemy none) (find-parent-method roboguard-level 10)) obj) + (none) + ) + +;; WARN: Return type mismatch nav-enemy vs roboguard-level. +(defmethod relocate roboguard-level ((obj roboguard-level) (arg0 int)) + (the-as + roboguard-level + ((the-as (function nav-enemy int nav-enemy) (find-parent-method roboguard-level 7)) obj arg0) + ) + ) + +(defmethod init-enemy-collision! roboguard-level ((obj roboguard-level)) + "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" + (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) + (set! (-> s5-0 total-prims) (the-as uint 6)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak bot enemy hit-by-others-list player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 20480.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-12 prim-core collide-with) (collide-spec backgnd jak bot player-list)) + (set! (-> v1-12 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-12 local-sphere) 0.0 6144.0 0.0 6144.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec backgnd jak bot player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> v1-14 local-sphere) 0.0 9830.4 0.0 6144.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec backgnd enemy hit-by-others-list)) + (set! (-> v1-16 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-16 local-sphere) 0.0 5734.4 0.0 5734.4) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core action) (collide-action)) + (set! (-> v1-18 transform-index) 11) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-20 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-20 local-sphere) 0.0 5734.4 0.0 7372.8) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-22 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-22 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-22 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> obj root-override2) s5-0) + ) + 0 + (none) + ) + +(defmethod init-enemy! roboguard-level ((obj roboguard-level)) + "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-roboguard-level" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable-backup) (-> obj enemy-flags)))) + (init-enemy-behaviour-and-stats! obj *roboguard-level-nav-enemy-info*) + (let ((v1-8 (-> obj nav))) + (set! (-> v1-8 nav-cull-radius) 81920.0) + ) + 0 + (set! (-> obj fact-info-override cam-horz) 98304.0) + (set! (-> obj fact-info-override cam-vert) 24576.0) + (set! (-> obj fact-info-override cam-notice-dist) 122880.0) + (let ((v1-16 (-> obj nav))) + (logclear! (-> v1-16 flags) (nav-control-flag limit-rotation-rate output-sphere-hash)) + (logclear! (-> obj nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag43)))) + (let ((a0-13 v1-16)) + (set! (-> a0-13 sphere-mask) (the-as uint #x800fe)) + ) + 0 + (let ((a0-15 v1-16)) + (set! (-> a0-15 nav-cull-radius) 12288.0) + ) + 0 + (logclear! (-> v1-16 flags) (nav-control-flag output-sphere-hash)) + ) + (set! (-> obj enemy-info-override callback-info) *nav-enemy-physics-callback-info*) + (let ((v1-18 obj)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-18 enemy-flags))) + (set! (-> v1-18 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-18 enemy-flags)))) + ) + (set! (-> v1-18 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-18 enemy-flags)))) + (set! (-> v1-18 nav callback-info) (-> v1-18 enemy-info-override callback-info)) + ) + 0 + (set! (-> obj roll-sound) (the-as uint (new-sound-id))) + (set! (-> obj flags) (the-as uint 0)) + 0 + (none) + ) diff --git a/goal_src/jak2/levels/palace/pal-obs.gc b/goal_src/jak2/levels/palace/pal-obs.gc index cdeace5970..c3746a79f2 100644 --- a/goal_src/jak2/levels/palace/pal-obs.gc +++ b/goal_src/jak2/levels/palace/pal-obs.gc @@ -7,3 +7,1097 @@ ;; DECOMP BEGINS +(deftype pal-falling-plat (process-drawable) + ((root-override collide-shape-moving :offset 128) + ) + :heap-base #x50 + :method-count-assert 22 + :size-assert #xc8 + :flag-assert #x16005000c8 + (:methods + (idle () _type_ :state 20) + (fall () _type_ :state 21) + ) + ) + + +(defskelgroup skel-pal-falling-plat pal-falling-plat pal-falling-plat-lod0-jg pal-falling-plat-idle-ja + ((pal-falling-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.8) + ) + +(defstate idle (pal-falling-plat) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('ridden) + (go-virtual fall) + ) + ) + ) + :enter (behavior () + (logior! (-> self root-override root-prim prim-core action) (collide-action rideable)) + (none) + ) + :trans (the-as (function none :behavior pal-falling-plat) rider-trans) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 2) :num! zero) + (transform-post) + (sleep-code) + (none) + ) + :post (the-as (function none :behavior pal-falling-plat) rider-post) + ) + +(defstate fall (pal-falling-plat) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('touch) + (when ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> event param 0)) + (-> self root-override) + (the-as uint 8) + ) + (when (< 18.0 (ja-frame-num 0)) + (let ((v1-6 (-> self skel root-channel 0))) + (set! (-> v1-6 num-func) num-func-identity) + (set! (-> v1-6 frame-num) 18.0) + ) + ) + ) + ) + ) + ) + ) + :enter (behavior () + (sound-play "pal-fall-plat") + (none) + ) + :trans (the-as (function none :behavior pal-falling-plat) rider-trans) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (logclear! (-> self root-override root-prim prim-core action) (collide-action rideable)) + (ja-no-eval :group! (-> self draw art-group data 2) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual idle) + (none) + ) + :post (the-as (function none :behavior pal-falling-plat) rider-post) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pal-falling-plat ((obj pal-falling-plat) (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-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0))) + (set! (-> s4-0 total-prims) (the-as uint 5)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 11059.2 20480.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle 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) 12288.0 0.0 1228.8 4096.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid rideable)) + (set! (-> v1-17 transform-index) 3) + (set-vector! (-> v1-17 local-sphere) -12288.0 0.0 1228.8 4096.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-19 prim-core action) (collide-action solid rideable)) + (set! (-> v1-19 transform-index) 4) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 8192.0 19660.8) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 8)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-21 prim-core action) (collide-action)) + (set-vector! (-> v1-21 local-sphere) -16384.0 -4096.0 0.0 16384.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-24 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-24 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-24 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-pal-falling-plat" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (go (method-of-object obj idle)) + (none) + ) + +(defskelgroup skel-pal-ent-door pal-ent-door pal-ent-door-lod0-jg pal-ent-door-idle-ja + ((pal-ent-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6 0 10) + :origin-joint-index 3 + ) + +(deftype pal-ent-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! pal-ent-door ((obj pal-ent-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 ((v1-2 (new 'process 'collide-shape-prim-mesh s5-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 bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 24576.0 0.0 40960.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-ent-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj open-frame) 20.0) + (set! (-> obj sound-open-loop) (static-sound-spec "door-slide-open")) + (set! (-> obj sound-open-stop) (static-sound-spec "door-open-hit")) + (set! (-> obj sound-close-loop) (static-sound-spec "door-slide-cls")) + (set! (-> obj sound-close-stop) (static-sound-spec "door-close-hit")) + (go (method-of-object obj close) #t) + (none) + ) + +(deftype pal-grind-ring-center (process-focusable) + ((speed-y float :offset-assert 204) + (hit-sound-played? basic :offset-assert 208) + ) + :heap-base #x60 + :method-count-assert 30 + :size-assert #xd4 + :flag-assert #x1e006000d4 + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (pal-grind-ring-center-method-29 (_type_) none 29) + ) + ) + + +(defskelgroup skel-pal-grind-ring-center pal-grind-ring-center pal-grind-ring-center-lod0-jg pal-grind-ring-center-idle-ja + ((pal-grind-ring-center-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +(defskelgroup skel-pal-grind-ring-center-explode pal-grind-ring-center pal-grind-ring-center-explode-lod0-jg pal-grind-ring-center-explode-idle-ja + ((pal-grind-ring-center-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +(define *pal-grind-ring-center-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 3 :parent-joint-index -1) + (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) + ) + :collide-spec #x1 + ) + ) + +(defstate idle (pal-grind-ring-center) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('track) + #t + ) + (('attack) + (go-virtual die) + ) + ) + ) + :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 () + (ja-post) + (none) + ) + ) + +(defstate die (pal-grind-ring-center) + :virtual #t + :enter (behavior () + (sound-play "grind-ring-expl") + (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-1 fountain-rand-transv-lo quad) (-> self root-override trans quad)) + (set! (-> gp-1 fountain-rand-transv-hi x) 8192.0) + (set! (-> gp-1 fountain-rand-transv-hi y) 32768.0) + (set! (-> gp-1 fountain-rand-transv-hi z) 24576.0) + (set! (-> gp-1 fountain-rand-transv-hi w) 40960.0) + (set! (-> gp-1 gravity) -163840.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-pal-grind-ring-center-explode" (the-as (pointer uint32) #f)) + 5 + gp-1 + *pal-grind-ring-center-exploder-params* + :to self + ) + ) + (let ((v1-16 (-> self root-override root-prim))) + (set! (-> v1-16 prim-core collide-as) (collide-spec)) + (set! (-> v1-16 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (none) + ) + :exit (the-as (function none :behavior pal-grind-ring-center) #f) + :trans (the-as (function none :behavior pal-grind-ring-center) #f) + :code (behavior () + (send-event (ppointer->process (-> self parent)) 'fall) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior pal-grind-ring-center) #f) + ) + +(defmethod pal-grind-ring-center-method-29 pal-grind-ring-center ((obj pal-grind-ring-center)) + (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 ((v1-6 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 16384.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pal-grind-ring-center ((obj pal-grind-ring-center) (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" + (pal-grind-ring-center-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-pal-grind-ring-center" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj mask) (logior (process-mask enemy) (-> obj mask))) + (set! (-> obj mask) (logior (process-mask collectable) (-> obj mask))) + (go (method-of-object obj idle)) + (none) + ) + +(defbehavior pal-grind-ring-center-init-by-other pal-grind-ring-center ((arg0 entity-actor)) + (init-from-entity! self arg0) + (none) + ) + +(deftype pal-grind-ring (process-focusable) + ((speed-y float :offset-assert 204) + (hit-sound-played? basic :offset-assert 208) + ) + :heap-base #x60 + :method-count-assert 30 + :size-assert #xd4 + :flag-assert #x1e006000d4 + (:methods + (idle () _type_ :state 27) + (fall () _type_ :state 28) + (pal-grind-ring-method-29 (_type_) none 29) + ) + ) + + +(defskelgroup skel-pal-grind-ring pal-grind-ring pal-grind-ring-lod0-jg pal-grind-ring-idle-ja + ((pal-grind-ring-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) + +(defstate idle (pal-grind-ring) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('track) + #t + ) + (('fall) + (go-virtual fall) + ) + ) + ) + :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 () + (spawn (-> self part) (-> self root-override trans)) + (ja-post) + (none) + ) + ) + +(defstate fall (pal-grind-ring) + :virtual #t + :enter (behavior () + (set! (-> self speed-y) 0.0) + (sound-play "grind-ring-fall") + (set! (-> self hit-sound-played?) #f) + (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-1 + (let ((t9-3 (method-of-type part-tracker activate))) + (t9-3 + (the-as part-tracker gp-1) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((t9-4 run-function-in-process) + (a0-4 gp-1) + (a1-3 part-tracker-init) + (a2-5 (-> *part-group-id-table* 1132)) + (a3-2 0) + (t0-1 #f) + (t1-1 #f) + (t2-1 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> self root-override trans quad)) + ((the-as (function object object object object object object object object none) t9-4) + a0-4 + a1-3 + a2-5 + a3-2 + t0-1 + t1-1 + t2-1 + t3-0 + ) + ) + (-> gp-1 ppointer) + ) + ) + (none) + ) + :trans (behavior () + (+! (-> self speed-y) (* -163840.0 (-> self clock seconds-per-frame))) + (+! (-> self root-override trans y) (* (-> self speed-y) (-> self clock seconds-per-frame))) + (when (< (-> self root-override trans y) 1441792.0) + (when (not (-> self hit-sound-played?)) + (sound-play "grind-ring-hit") + (set! (-> self hit-sound-played?) (the-as basic #t)) + ) + (set! (-> self root-override trans y) 1441792.0) + (set! (-> self speed-y) (* -0.3 (-> self speed-y))) + ) + (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 pal-grind-ring) transform-post) + ) + +(defmethod pal-grind-ring-method-29 pal-grind-ring ((obj pal-grind-ring)) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 102400.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pal-grind-ring ((obj pal-grind-ring) (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" + (pal-grind-ring-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-grind-ring" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj mask) (logior (process-mask enemy) (-> obj mask))) + (set! (-> obj mask) (logior (process-mask collectable) (-> obj mask))) + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1131) obj)) + (process-spawn pal-grind-ring-center arg0 :to obj) + (go (method-of-object obj idle)) + (none) + ) + +(defskelgroup skel-pal-ent-glass pal-ent-glass pal-ent-glass-lod0-jg pal-ent-glass-idle-ja + ((pal-ent-glass-lod0-mg (meters 999999))) + :bounds (static-spherem 0 8.5 0 8.5) + ) + +(defskelgroup skel-pal-ent-glass-explode pal-ent-glass pal-ent-glass-explode-lod0-jg pal-ent-glass-explode-idle-ja + ((pal-ent-glass-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +(define *pal-ent-glass-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 3 :parent-joint-index -1) + (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) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + ) + :collide-spec #x1 + ) + ) + +(deftype pal-ent-glass (process-focusable) + () + :heap-base #x50 + :method-count-assert 31 + :size-assert #xcc + :flag-assert #x1f005000cc + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (pal-ent-glass-method-29 (_type_) none 29) + (pal-ent-glass-method-30 (_type_) none 30) + ) + ) + + +(defstate die (pal-ent-glass) + :virtual #t + :enter (the-as (function none :behavior pal-ent-glass) #f) + :exit (the-as (function none :behavior pal-ent-glass) #f) + :trans (the-as (function none :behavior pal-ent-glass) #f) + :code (behavior () + (sound-play "glass-crash") + (let ((v1-2 (-> self root-override root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior pal-ent-glass) #f) + ) + +(defstate idle (pal-ent-glass) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (when (not (and (-> self next-state) (= (-> self next-state name) 'die))) + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set-vector! (-> gp-0 fountain-rand-transv-lo) -8192.0 20480.0 -8192.0 1.0) + (set-vector! (-> gp-0 fountain-rand-transv-hi) 8192.0 40960.0 8192.0 1.0) + (set! (-> gp-0 rot-speed) 2.0) + (set! (-> gp-0 gravity) -163840.0) + (set! (-> gp-0 hit-y-reaction) 0.4) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-pal-ent-glass-explode" (the-as (pointer uint32) #f)) + 5 + gp-0 + *pal-ent-glass-exploder-params* + :to self + ) + ) + ) + (go-virtual die) + ) + ) + ) + :exit (behavior () + '() + (none) + ) + :code (the-as (function none :behavior pal-ent-glass) sleep-code) + :post (behavior () + '() + (none) + ) + ) + +(defmethod pal-ent-glass-method-29 pal-ent-glass ((obj pal-ent-glass)) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 34816.0 0.0 34816.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +(defmethod pal-ent-glass-method-30 pal-ent-glass ((obj pal-ent-glass)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pal-ent-glass ((obj pal-ent-glass) (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" + (pal-ent-glass-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-ent-glass" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (pal-ent-glass-method-30 obj) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +(deftype palent-turret-shot (guard-shot) + () + :heap-base #x170 + :method-count-assert 40 + :size-assert #x1f0 + :flag-assert #x28017001f0 + ) + + +(defmethod play-impact-sound palent-turret-shot ((obj palent-turret-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "turret-gun") + ) + ((= v1-0 (projectile-options lose-altitude)) + (sound-play "turret-impact") + ) + ) + ) + 0 + (none) + ) + +(defskelgroup skel-palent-turret palent-turret palent-turret-lod0-jg palent-turret-idle-ja + ((palent-turret-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 7) + ) + +(deftype palent-turret (process-focusable) + ((next-shoot uint64 :offset-assert 208) + ) + :heap-base #x60 + :method-count-assert 29 + :size-assert #xd8 + :flag-assert #x1d006000d8 + (:methods + (idle () _type_ :state 27) + (palent-turret-method-28 (_type_) none 28) + ) + ) + + +(defun palent-turret-callback ((arg0 cspace) (arg1 transformq)) + (-> arg0 param1) + (quaternion-rotate-local-x! (-> arg1 quat) (-> arg1 quat) 910.2222) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + +(defstate idle (palent-turret) + :virtual #t + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :exit (behavior () + '() + (none) + ) + :trans (behavior () + (cond + ((not (task-node-closed? (game-task-node palace-sneak-in-meeting))) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (else + (let* ((f0-0 65536.0) + (f1-0 -0.5) + (f2-0 0.16666667) + (f3-1 (* 0.0033333334 (the float (- (-> self clock frame-counter) (-> self state-time))))) + (f30-0 (* f0-0 (+ f1-0 (* f2-0 (- f3-1 (* (the float (the int (/ f3-1 6.0))) 6.0)))))) + (s4-0 (-> self node-list data 5 bone transform)) + (s5-0 (matrix->trans s4-0 (new 'stack-no-clear 'vector))) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> s4-0 vector 2 quad)) + (let ((f0-2 (* 5097.2446 (sin f30-0)))) + (quaternion-rotate-local-y! (-> self root-override quat) (-> self entity quat) f0-2) + ) + (when (< (the-as time-frame (-> self next-shoot)) (-> self clock frame-counter)) + (set-palent-turret-flash! 1.0) + (let ((a1-2 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> a1-2 ent) (-> self entity)) + (set! (-> a1-2 charge) 1.0) + (set! (-> a1-2 options) (projectile-options)) + (set! (-> a1-2 notify-handle) (process->handle self)) + (set! (-> a1-2 owner-handle) (the-as handle #f)) + (set! (-> a1-2 ignore-handle) (process->handle self)) + (let* ((v1-26 *game-info*) + (a0-17 (+ (-> v1-26 attack-id) 1)) + ) + (set! (-> v1-26 attack-id) a0-17) + (set! (-> a1-2 attack-id) a0-17) + ) + (set! (-> a1-2 timeout) (new 'static 'handle :process #x4b0 :u64 #x4b0)) + (set! (-> a1-2 pos quad) (-> s5-0 quad)) + (set! (-> a1-2 vel quad) (-> gp-0 quad)) + (spawn-projectile palent-turret-shot a1-2 self *default-dead-pool*) + ) + (set! (-> self next-shoot) (the-as uint (+ (-> self clock frame-counter) (seconds 0.1)))) + ) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior palent-turret) sleep-code) + :post (behavior () + (transform-post) + (none) + ) + ) + +(defmethod palent-turret-method-28 palent-turret ((obj palent-turret)) + (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 3) 0))) + (set! (-> s5-0 total-prims) (the-as uint 4)) + (set! (-> s4-0 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 28672.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 4) + (set-vector! (-> v1-12 local-sphere) 0.0 0.0 10240.0 8192.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 1)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 8192.0 0.0 16384.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 1)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-16 prim-core action) (collide-action solid)) + (set! (-> v1-16 transform-index) 3) + (set-vector! (-> v1-16 local-sphere) 0.0 10240.0 8192.0 14336.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-19 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-19 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-19 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! palent-turret ((obj palent-turret) (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" + (palent-turret-method-28 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-palent-turret" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((a0-5 (-> obj node-list data 4))) + (set! (-> a0-5 param0) palent-turret-callback) + (set! (-> a0-5 param1) obj) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +(defskelgroup skel-pal-breakable-window pal-breakable-window pal-breakable-window-lod0-jg pal-breakable-window-idle-ja + ((pal-breakable-window-lod0-mg (meters 999999))) + :bounds (static-spherem 0 12 0 38) + ) + +(defskelgroup skel-pal-breakable-window-explode pal-breakable-window pal-breakable-window-explode-lod0-jg pal-breakable-window-explode-idle-ja + ((pal-breakable-window-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +(define *pal-breakable-window-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 3 :parent-joint-index -1) + (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) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 24 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 26 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 27 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 28 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 29 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 30 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 31 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 32 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 33 :parent-joint-index -1) + ) + :collide-spec #x1 + ) + ) + +(deftype pal-breakable-window (process-focusable) + () + :heap-base #x50 + :method-count-assert 31 + :size-assert #xcc + :flag-assert #x1f005000cc + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (pal-breakable-window-method-29 (_type_) none 29) + (pal-breakable-window-method-30 (_type_) none 30) + ) + ) + + +(defstate die (pal-breakable-window) + :virtual #t + :enter (the-as (function none :behavior pal-breakable-window) #f) + :exit (the-as (function none :behavior pal-breakable-window) #f) + :trans (the-as (function none :behavior pal-breakable-window) #f) + :code (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior pal-breakable-window) #f) + ) + +(defstate idle (pal-breakable-window) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (sound-play "glass-crash-big") + (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set-vector! (-> gp-1 fountain-rand-transv-lo) -8192.0 4096.0 -8192.0 1.0) + (set-vector! (-> gp-1 fountain-rand-transv-hi) 8192.0 40960.0 8192.0 1.0) + (set! (-> gp-1 rot-speed) 2.0) + (set! (-> gp-1 gravity) -163840.0) + (set! (-> gp-1 hit-y-reaction) 0.4) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-pal-breakable-window-explode" (the-as (pointer uint32) #f)) + 5 + gp-1 + *pal-breakable-window-exploder-params* + :to self + ) + ) + (go-virtual die) + ) + ) + ) + :exit (behavior () + '() + (none) + ) + :code (the-as (function none :behavior pal-breakable-window) sleep-code) + :post (behavior () + '() + (none) + ) + ) + +(defmethod pal-breakable-window-method-29 pal-breakable-window ((obj pal-breakable-window)) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 49152.0 0.0 155648.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +(defmethod pal-breakable-window-method-30 pal-breakable-window ((obj pal-breakable-window)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pal-breakable-window ((obj pal-breakable-window) (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" + (pal-breakable-window-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-pal-breakable-window" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (pal-breakable-window-method-30 obj) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) diff --git a/goal_src/jak2/levels/palace/roof/palroof-obs.gc b/goal_src/jak2/levels/palace/roof/palroof-obs.gc index 092f2e24f4..1312023b6b 100644 --- a/goal_src/jak2/levels/palace/roof/palroof-obs.gc +++ b/goal_src/jak2/levels/palace/roof/palroof-obs.gc @@ -7,3 +7,235 @@ ;; DECOMP BEGINS +(deftype pal-lowrez-throne (med-res-level) + () + :heap-base #x60 + :method-count-assert 21 + :size-assert #xd4 + :flag-assert #x15006000d4 + ) + + +(defskelgroup skel-pal-lowrez-throne pal-lowrez-throne pal-lowrez-throne-lod0-jg pal-lowrez-throne-idle-ja + ((pal-lowrez-throne-lod0-mg (meters 999999))) + :bounds (static-spherem -5 40 -10 75) + ) + +(defpartgroup group-pal-prong-energy + :id 1111 + :bounds (static-bspherem 0 0 0 160) + :parts ((sp-item 4762 :fade-after (meters 80) :falloff-to (meters 80)) + (sp-item 4763 :fade-after (meters 220) :flags (bit6)) + ) + ) + +(defpart 4762 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 2.0) + (sp-flt spt-scale-x (meters 0)) + (sp-flt spt-rot-z (degrees 90.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 32.0) + (sp-flt spt-vel-y (meters -0.03)) + (sp-rnd-flt spt-scalevel-x (meters 0.005) (meters 0.005) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.98) + (sp-flt spt-fade-g -0.98) + (sp-flt spt-fade-a 0.19393939) + (sp-int spt-timer 250) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 165) + (sp-launcher-by-id spt-next-launcher 4764) + (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-flt spt-conerot-radius (meters 6)) + ) + ) + +(defpart 4764 + :init-specs ((sp-flt spt-fade-a -0.7529412) (sp-flt spt-friction 0.1)) + ) + +(defpart 4763 + :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 8)) + (sp-flt spt-rot-x 1228.8) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 64.0 1.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 64.0) + (sp-flt spt-omega 822476.8) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 8192.0) + ) + ) + +(deftype pal-prong (process-drawable) + ((root-override collide-shape :offset 128) + ) + :heap-base #x50 + :method-count-assert 23 + :size-assert #xc8 + :flag-assert #x17005000c8 + (:methods + (idle () _type_ :state 20) + (break-it () _type_ :state 21) + (broken () _type_ :state 22) + ) + ) + + +(defskelgroup skel-pal-prong pal-prong pal-prong-lod0-jg pal-prong-idle-ja + ((pal-prong-lod0-mg (meters 999999))) + :bounds (static-spherem 0 5 0 5.5) + :origin-joint-index 3 + ) + +(defskelgroup skel-pal-prong-explode pal-prong pal-prong-explode-lod0-jg pal-prong-explode-idle-ja + ((pal-prong-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) + +(define *pal-prong-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 3 :parent-joint-index -1) + (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) + ) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pal-prong ((obj pal-prong) (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 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (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 20480.0 0.0 22528.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) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 20480.0 0.0 22528.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 8192.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-13 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-13 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-pal-prong" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1111) obj)) + (if (task-node-closed? (game-task-node palace-boss-resolution)) + (go (method-of-object obj broken)) + (go (method-of-object obj idle)) + ) + (none) + ) + +(defbehavior pal-prong-small-collision pal-prong () + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) child 0))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (none) + ) + +(defstate broken (pal-prong) + :virtual #t + :enter (behavior () + (setup-masks (-> self draw) 0 1) + (pal-prong-small-collision) + (transform-post) + (none) + ) + :code (the-as (function none :behavior pal-prong) sleep-code) + ) + +(defstate break-it (pal-prong) + :virtual #t + :enter (behavior () + (setup-masks (-> self draw) 0 1) + (pal-prong-small-collision) + (transform-post) + (sound-play "sqd-post-break") + (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-pal-prong-explode" (the-as (pointer uint32) #f)) + 5 + gp-1 + *pal-prong-exploder-params* + :to self + ) + ) + (none) + ) + :trans (behavior () + (go-virtual broken) + (none) + ) + :code (the-as (function none :behavior pal-prong) sleep-code) + ) + +(defstate idle (pal-prong) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger) + (go-virtual break-it) + ) + ) + ) + :enter (behavior () + (transform-post) + (none) + ) + :trans (behavior () + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self root-override trans quad)) + (set! (-> a1-0 y) (+ 36864.0 (-> a1-0 y))) + (spawn (-> self part) a1-0) + ) + (none) + ) + :code (the-as (function none :behavior pal-prong) sleep-code) + ) diff --git a/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc b/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc index 94793f36bc..9f23b758bd 100644 --- a/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc @@ -453,7 +453,7 @@ (go-hostile (_type_) none 70) (go-flee (_type_) none 71) (react-to-focus (_type_) none 72) - (kill-prefer-falling (_type_) none 73) + (kill-prefer-falling (_type_) object 73) (general-event-handler (_type_ process int symbol event-message-block) object 74) (enemy-method-75 (_type_ process touching-shapes-entry) none 75) (enemy-method-76 (_type_ process event-message-block) symbol 76) diff --git a/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc b/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc index 34e244fae9..2ede3f2a08 100644 --- a/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc +++ b/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc @@ -601,14 +601,12 @@ ) ;; definition for method 73 of type enemy -;; WARN: Return type mismatch object vs none. (defmethod kill-prefer-falling enemy ((obj enemy)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (if (-> obj enemy-info use-die-falling) (go (method-of-object obj die-falling)) (go (method-of-object obj die)) ) - (none) ) ;; definition for method 135 of type enemy @@ -1710,9 +1708,11 @@ This commonly includes things such as: ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 17] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 28] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 89] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 105] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 202] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 274] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 346] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 407] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 413] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 490] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 493] @@ -1720,6 +1720,7 @@ This commonly includes things such as: ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 560] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 610] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 641] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 720] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 774] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 807] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 814] diff --git a/test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc b/test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc index 18f084c289..86622e8eea 100644 --- a/test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc @@ -229,7 +229,7 @@ ;; definition of type mysql-nav-graph-level-info (deftype mysql-nav-graph-level-info (structure) - ((level basic :offset-assert 0) + ((level string :offset-assert 0) (level-id uint32 :offset-assert 4) (node-count int32 :offset-assert 8) (branch-count int32 :offset-assert 12) @@ -1216,7 +1216,72 @@ returns `-1` if none is found" ) ;; definition for method 18 of type mysql-nav-graph -;; ERROR: function was not converted to expressions. Cannot decompile. +(defmethod lookup-level-info2 mysql-nav-graph ((obj mysql-nav-graph) (arg0 mysql-nav-node) (arg1 symbol)) + "TODO - this was originally called `lookup-level-info` but it clashes with the function defined in `level`" + (let ((s5-0 (the-as mysql-nav-graph-level-info #f))) + (b! (>= (-> obj level-info-last-lookup) (-> obj level-info-array-length)) cfg-3 :delay #f) + (let ((v1-5 (-> obj level-info-array (-> obj level-info-last-lookup)))) + (let ((a0-2 (-> v1-5 level))) + (b! (!= (-> arg0 level_name) a0-2) cfg-3 :delay (empty-form)) + ) + (set! s5-0 v1-5) + ) + (b! #t cfg-18 :delay (nop!)) + (label cfg-3) + (let ((v1-6 0)) + (b! #t cfg-9 :delay (nop!)) + (label cfg-4) + (let ((a0-6 (-> obj level-info-array v1-6))) + (let ((a3-1 (-> a0-6 level))) + (b! (!= (-> arg0 level_name) a3-1) cfg-8 :delay (empty-form)) + ) + (if arg1 + (set! (-> obj level-info-last-lookup) v1-6) + ) + (set! s5-0 a0-6) + ) + (b! #t cfg-18 :delay (nop!)) + (label cfg-8) + (+! v1-6 1) + (label cfg-9) + (b! (< v1-6 (-> obj level-info-array-length)) cfg-4) + ) + (let ((v1-9 (-> obj level-info-array-length))) + (cond + ((< v1-9 32) + (if arg1 + (set! (-> obj level-info-last-lookup) v1-9) + ) + (set! s5-0 (-> obj level-info-array v1-9)) + (set! (-> s5-0 level) (the-as string (-> arg0 level_name))) + (set! (-> s5-0 node-count) 0) + (+! (-> obj level-info-array-length) 1) + ) + (else + (format + 0 + "mysql-nav-graph::lookup-level-info: Error, too many unique level names in nav-graph. May need to increase the max (currently ~d)~%" + 32 + ) + (let ((s4-0 0)) + (b! #t cfg-16 :delay (nop!)) + (label cfg-15) + (let ((v1-17 (-> obj level-info-array s4-0))) + (format 0 "~d ~s~%" s4-0 (-> v1-17 level)) + ) + (+! s4-0 1) + (label cfg-16) + (b! (< s4-0 (-> obj level-info-array-length)) cfg-15) + ) + (break!) + 0 + ) + ) + ) + (label cfg-18) + s5-0 + ) + ) ;; definition for method 19 of type mysql-nav-graph ;; WARN: Return type mismatch int vs none. @@ -1309,3 +1374,6 @@ returns `-1` if none is found" ) ) + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim-h_REF.gc index b9d9350b1a..42886f959a 100644 --- a/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim-h_REF.gc @@ -85,7 +85,7 @@ ((num-layers uint32 :offset-assert 0) (func symbol :offset-assert 4) (func-id basic :offset 4) - (init-func basic :offset-assert 8) + (init-func symbol :offset-assert 8) (init-func-id basic :offset 8) (tex texture :offset-assert 12) (tex-name string :offset-assert 16) 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 e8a3ce960c..fb35c7bd61 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 @@ -171,7 +171,7 @@ (info rigid-body-info :offset-assert 4) (flags rigid-body-flag :offset-assert 8) (force-callback (function object float none) :offset-assert 12) - (blocked-by basic :offset-assert 16) + (blocked-by rigid-body-object :offset-assert 16) (time-remaining float :offset-assert 20) (step-count int16 :offset-assert 24) (position vector :inline :offset-assert 32) @@ -268,26 +268,8 @@ ;; definition of type rigid-body-control (deftype rigid-body-control (basic) - ((process process :offset-assert 4) - (state rigid-body :inline :offset-assert 16) - (work basic :offset 16) - (info rigid-body-info :offset 20) - (flags rigid-body-flag :offset 24) - (force-callback basic :offset 28) - (blocked-by basic :offset 32) - (time-remaining float :offset 36) - (step-count int16 :offset 40) - (position vector :inline :offset 48) - (rot vector :inline :offset 64) - (rotation quaternion :inline :offset 64) - (lin-momentum vector :inline :offset 80) - (ang-momentum vector :inline :offset 96) - (force vector :inline :offset 112) - (torque vector :inline :offset 128) - (lin-velocity vector :inline :offset 144) - (ang-velocity vector :inline :offset 160) - (matrix matrix :inline :offset 176) - (inv-i-world matrix :inline :offset 240) + ((process process :offset-assert 4) + (state rigid-body :inline :offset-assert 16) ) :method-count-assert 26 :size-assert #x130 @@ -566,7 +548,7 @@ ;; definition of type rigid-body-queue (deftype rigid-body-queue (structure) ((count int8 :offset-assert 0) - (array uint64 128 :offset 8) + (array handle 128 :offset 8) ) :method-count-assert 17 :size-assert #x408 @@ -574,11 +556,11 @@ (:methods (rigid-body-queue-method-9 (_type_) none 9) (rigid-body-queue-method-10 (_type_) none 10) - (rigid-body-queue-method-11 (_type_) none 11) + (rigid-body-queue-method-11 (_type_ rigid-body-object) none 11) (rigid-body-queue-method-12 (_type_ int int) none 12) - (rigid-body-queue-method-13 (_type_) none 13) + (rigid-body-queue-method-13 (_type_ int rigid-body-object) none 13) (rigid-body-queue-method-14 (_type_ int) none 14) - (rigid-body-queue-method-15 (_type_) none 15) + (rigid-body-queue-method-15 (_type_ rigid-body-object) none 15) (validate (_type_) symbol 16) ) ) diff --git a/test/decompiler/reference/jak2/engine/physics/rigid-body-queue_REF.gc b/test/decompiler/reference/jak2/engine/physics/rigid-body-queue_REF.gc new file mode 100644 index 0000000000..9df0efe9ca --- /dev/null +++ b/test/decompiler/reference/jak2/engine/physics/rigid-body-queue_REF.gc @@ -0,0 +1,320 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 9 of type rigid-body-queue +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-queue-method-9 rigid-body-queue ((obj rigid-body-queue)) + (set! (-> obj count) 0) + (dotimes (v1-0 128) + (set! (-> obj array v1-0) (the-as handle #f)) + ) + 0 + (none) + ) + +;; definition for method 16 of type rigid-body-queue +(defmethod validate rigid-body-queue ((obj rigid-body-queue)) + (let ((gp-0 0)) + (dotimes (v1-0 (-> obj count)) + (let ((a1-2 (-> obj array v1-0)) + (a2-0 (+ v1-0 1)) + ) + (while (< a2-0 (-> obj count)) + (if (= a1-2 (-> obj array a2-0)) + (+! gp-0 1) + ) + (+! a2-0 1) + ) + ) + ) + (if (> gp-0 0) + (format 0 "rigid-body-queue::validate: duplicate count ~d~%" gp-0) + ) + (zero? gp-0) + ) + ) + +;; definition for method 10 of type rigid-body-queue +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-queue-method-10 rigid-body-queue ((obj rigid-body-queue)) + (local-vars (s4-0 process)) + (with-pp + (let ((f0-0 (-> pp clock seconds-per-frame)) + (v1-1 (-> obj count)) + ) + (b! #t cfg-9 :delay (nop!)) + (label cfg-1) + (+! v1-1 -1) + (let ((a0-4 (handle->process (-> obj array v1-1)))) + (cond + (a0-4 + (let ((a0-6 (-> (the-as rigid-body-object a0-4) rbody))) + (set! (-> a0-6 state time-remaining) f0-0) + (set! (-> a0-6 state blocked-by) #f) + (set! (-> a0-6 state step-count) 0) + (logclear! (-> a0-6 state flags) (rigid-body-flag blocker)) + ) + ) + (else + ) + ) + ) + (label cfg-9) + (b! (nonzero? v1-1) cfg-1 :delay (nop!)) + ) + (let ((s5-0 0)) + (b! #t cfg-35 :delay (nop!)) + (until (= (-> obj array s5-0) (process->handle s4-0)) + (label cfg-11) + (set! s4-0 (handle->process (-> obj array s5-0))) + (b! (not s4-0) cfg-34 :delay (empty-form)) + (let ((s3-0 (-> (the-as rigid-body-object s4-0) rbody))) + (b! + (not (and (logtest? (-> s3-0 state flags) (rigid-body-flag enable-physics)) + (and (< 0.001 (-> s3-0 state time-remaining)) (< (-> s3-0 state step-count) 4)) + ) + ) + cfg-34 + :delay (empty-form) + ) + (rigid-body-object-method-51 (the-as rigid-body-object s4-0)) + (+! (-> s3-0 state step-count) 1) + (let ((a2-2 (-> s3-0 state blocked-by))) + (b! (not a2-2) cfg-34 :delay (empty-form)) + (b! (not #t) cfg-34 :delay (empty-form)) + (logior! (-> a2-2 rbody state flags) (rigid-body-flag blocker)) + (rigid-body-queue-method-13 obj s5-0 a2-2) + ) + ) + ) + (label cfg-34) + (+! s5-0 1) + (label cfg-35) + (b! (< s5-0 (-> obj count)) cfg-11) + ) + (let ((s5-1 0)) + (b! #t cfg-48 :delay (nop!)) + (label cfg-37) + (let ((a0-20 (handle->process (-> obj array s5-1)))) + (when (and a0-20 + (logtest? (-> (the-as rigid-body-object a0-20) rbody state flags) (rigid-body-flag enable-physics)) + ) + (let ((s4-1 pp)) + (set! pp (the-as rigid-body-object a0-20)) + (rigid-body-object-method-52 (the-as rigid-body-object a0-20)) + (set! pp s4-1) + ) + ) + ) + (+! s5-1 1) + (label cfg-48) + (b! (< s5-1 (-> obj count)) cfg-37) + ) + 0 + (none) + ) + ) + +;; definition for method 11 of type rigid-body-queue +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-queue-method-11 rigid-body-queue ((obj rigid-body-queue) (arg0 rigid-body-object)) + (let ((v1-0 -1)) + (let ((a2-0 0)) + (b! #t cfg-9 :delay (nop!)) + (label cfg-1) + (b! (handle->process (-> obj array a2-0)) cfg-8 :delay (empty-form)) + (set! v1-0 a2-0) + (b! #t cfg-11 :delay (nop!)) + (label cfg-8) + (+! a2-0 1) + (label cfg-9) + (b! (< a2-0 (-> obj count)) cfg-1) + ) + (label cfg-11) + (b! (= v1-0 -1) cfg-18 :delay (nop!)) + (set! (-> obj array v1-0) (process->handle arg0)) + ) + (b! #t cfg-25 :delay (nop!)) + (label cfg-18) + (b! (>= (-> obj count) 128) cfg-25 :delay #f) + (set! (-> obj array (-> obj count)) (process->handle arg0)) + (+! (-> obj count) 1) + (label cfg-25) + 0 + 0 + (none) + ) + +;; definition for method 12 of type rigid-body-queue +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-queue-method-12 rigid-body-queue ((obj rigid-body-queue) (arg0 int) (arg1 int)) + (when (< arg0 arg1) + (let ((v1-1 arg1) + (a3-0 (+ arg1 -1)) + (a2-3 (-> obj array arg1)) + ) + (while (>= a3-0 arg0) + (set! (-> obj array v1-1) (-> obj array a3-0)) + (+! a3-0 -1) + (+! v1-1 -1) + ) + (set! (-> obj array arg0) a2-3) + ) + ) + 0 + (none) + ) + +;; definition for method 13 of type rigid-body-queue +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-queue-method-13 rigid-body-queue ((obj rigid-body-queue) (arg0 int) (arg1 rigid-body-object)) + (let ((v1-2 (process->handle arg1)) + (a2-4 (+ arg0 1)) + ) + (b! #t cfg-9 :delay (nop!)) + (label cfg-6) + (b! (!= (-> obj array a2-4) v1-2) cfg-8 :delay (empty-form)) + (rigid-body-queue-method-12 obj arg0 a2-4) + (b! #t cfg-11 :delay (nop!)) + (label cfg-8) + (+! a2-4 1) + (label cfg-9) + (b! (< a2-4 (-> obj count)) cfg-6) + ) + (label cfg-11) + 0 + 0 + (none) + ) + +;; definition for method 14 of type rigid-body-queue +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-queue-method-14 rigid-body-queue ((obj rigid-body-queue) (arg0 int)) + (let ((v1-0 arg0) + (a1-1 (+ arg0 1)) + ) + (while (< a1-1 (-> obj count)) + (set! (-> obj array v1-0) (-> obj array a1-1)) + (+! a1-1 1) + (+! v1-0 1) + ) + ) + (+! (-> obj count) -1) + 0 + (none) + ) + +;; definition for method 15 of type rigid-body-queue +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-queue-method-15 rigid-body-queue ((obj rigid-body-queue) (arg0 rigid-body-object)) + (let ((v1-2 (process->handle arg0)) + (a1-4 0) + ) + (b! #t cfg-9 :delay (nop!)) + (label cfg-6) + (b! (!= (-> obj array a1-4) v1-2) cfg-8 :delay (empty-form)) + (rigid-body-queue-method-14 obj a1-4) + (b! #t cfg-11 :delay (nop!)) + (label cfg-8) + (+! a1-4 1) + (label cfg-9) + (b! (< a1-4 (-> obj count)) cfg-6) + ) + (label cfg-11) + 0 + 0 + (none) + ) + +;; definition of type rigid-body-queue-manager +(deftype rigid-body-queue-manager (process) + ((queue rigid-body-queue :offset-assert 128) + ) + :heap-base #x10 + :method-count-assert 15 + :size-assert #x84 + :flag-assert #xf00100084 + (:methods + (idle () _type_ :state 14) + ) + ) + +;; definition for method 3 of type rigid-body-queue-manager +(defmethod inspect rigid-body-queue-manager ((obj rigid-body-queue-manager)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Tqueue: #~%" (-> obj queue)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defstate idle (rigid-body-queue-manager) + :virtual #t + :exit (behavior () + (set! (-> self queue count) 0) + 0 + (none) + ) + :code (the-as (function none :behavior rigid-body-queue-manager) sleep-code) + :post (behavior () + (local-vars (a0-3 int) (a0-5 int)) + (let* ((v1-1 (-> *perf-stats* data 17)) + (a0-0 (-> v1-1 ctrl)) + ) + (+! (-> v1-1 count) 1) + (b! (zero? a0-0) cfg-2 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf a0-0) + ) + (.sync.l) + (.sync.p) + (label cfg-2) + 0 + (rigid-body-queue-method-10 (-> self queue)) + (let ((v1-6 (-> *perf-stats* data 17))) + (b! (zero? (-> v1-6 ctrl)) cfg-4 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a0-3 pcr0) + (+! (-> v1-6 accum0) a0-3) + (.mfpc a0-5 pcr1) + (+! (-> v1-6 accum1) a0-5) + ) + (label cfg-4) + 0 + (none) + ) + ) + +;; definition for function rigid-body-queue-manager-init-by-other +(defbehavior rigid-body-queue-manager-init-by-other rigid-body-queue-manager ((arg0 rigid-body-queue)) + (stack-size-set! (-> self main-thread) 128) + (set! (-> self queue) arg0) + (rigid-body-queue-method-9 (-> self queue)) + (go-virtual idle) + ) + +;; definition for function rigid-body-queue-manager-spawn +(defun rigid-body-queue-manager-spawn ((arg0 rigid-body-queue) (arg1 process-tree)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn rigid-body-queue-manager arg0 :to arg1))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + gp-0 + ) + ) 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 30113dd7af..8b74657e5c 100644 --- a/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc @@ -559,10 +559,11 @@ (vector-rotate*! (-> s5-0 vec-7) (-> s5-0 vec-7) (-> s3-0 inv-i-world)) (vector-cross! (-> s5-0 vec-7) (-> s5-0 vec-7) (-> s5-0 vec-6)) (+! (-> s5-0 float-3) (+ (-> s3-0 info inv-mass) (vector-dot (-> s5-0 vec-5) (-> s5-0 vec-7)))) - (set! f30-1 (fmax - (fmax f30-1 (-> s3-0 info bounce-factor)) - (* (-> arg0 info bounce-mult-factor) (-> s3-0 info bounce-mult-factor)) - ) + (set! f30-1 + (fmax + (fmax f30-1 (-> s3-0 info bounce-factor)) + (* (-> arg0 info bounce-mult-factor) (-> s3-0 info bounce-mult-factor)) + ) ) ) (else @@ -577,12 +578,14 @@ ) (vector+float*! (-> s5-0 vec-9) (-> s5-0 vec-3) (-> s5-0 vec-5) (- (-> s5-0 float-2))) (vector-normalize! (-> s5-0 vec-9) 1.0) - (let ((f0-31 (* -1.0 (fmin - (* (vector-dot (-> s5-0 vec-9) (-> s5-0 vec-3)) f30-2) - (* (-> arg0 info friction-factor) (-> s5-0 float-4)) - ) - ) + (let ((f0-31 + (* -1.0 + (fmin + (* (vector-dot (-> s5-0 vec-9) (-> s5-0 vec-3)) f30-2) + (* (-> arg0 info friction-factor) (-> s5-0 float-4)) ) + ) + ) ) (vector+float*! (-> s5-0 vec-8) (-> s5-0 vec-8) (-> s5-0 vec-9) f0-31) ) @@ -627,7 +630,9 @@ (b! #t cfg-42 :delay (nop!)) (label cfg-39) (b! (not s3-0) cfg-41 :delay (empty-form)) - (set! (-> arg0 blocked-by) (-> (the-as collide-shape-prim-mesh (-> s5-0 cquery num-spheres)) cshape process)) + (set! (-> arg0 blocked-by) + (the-as rigid-body-object (-> (the-as collide-shape-prim-mesh (-> s5-0 cquery num-spheres)) cshape process)) + ) 0 (label cfg-41) (vector+float*! (-> arg0 position) (-> arg0 position) (-> s5-0 vec-5) 40.96) diff --git a/test/decompiler/reference/jak2/levels/city/common/ctywide-part_REF.gc b/test/decompiler/reference/jak2/levels/city/common/ctywide-part_REF.gc new file mode 100644 index 0000000000..2b9e76d33b --- /dev/null +++ b/test/decompiler/reference/jak2/levels/city/common/ctywide-part_REF.gc @@ -0,0 +1,1294 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type ctywide-part +(deftype ctywide-part (part-spawner) + () + :heap-base #x30 + :method-count-assert 16 + :size-assert #xb0 + :flag-assert #x10003000b0 + ) + +;; definition for method 3 of type ctywide-part +(defmethod inspect ctywide-part ((obj ctywide-part)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type part-spawner inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type citywide-part +(deftype citywide-part (part-spawner) + () + :heap-base #x30 + :method-count-assert 16 + :size-assert #xb0 + :flag-assert #x10003000b0 + ) + +;; definition for method 3 of type citywide-part +(defmethod inspect citywide-part ((obj citywide-part)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type part-spawner inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for function birth-func-race-poster +;; WARN: Return type mismatch int vs none. +(defun birth-func-race-poster ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (let ((s4-0 (the-as object (-> arg1 user-float)))) + (when (nonzero? (the-as float s4-0)) + (let ((s3-0 2)) + (cond + ((task-node-closed? (game-task-node stadium-race-class1-resolution)) + (set! s3-0 3) + ) + ((task-node-closed? (game-task-node stadium-race-class2-resolution)) + (set! s3-0 0) + ) + ((task-node-closed? (game-task-node stadium-race-class3-resolution)) + (set! s3-0 1) + ) + ) + (let ((s4-1 (-> (the-as (array int32) s4-0) (+ s3-0 3)))) + (when (nonzero? s4-1) + (let* ((f30-0 200.0) + (f28-0 (floor f30-0)) + (f1-0 (* 0.00024414062 (vector-vector-distance (-> arg2 x-y-z-sx) (math-camera-pos)))) + (f0-1 (/ f1-0 f28-0)) + ) + (set! (-> arg2 r-g-b-a w) (if (>= f30-0 f1-0) + (* 128.0 (- 1.0 f0-1)) + 0.0 + ) + ) + ) + ) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id s4-1)) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-race-poster-extra-small + :id 165 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 806 :fade-after (meters 200) :flags (is-3d bit6 bit7))) + ) + +;; failed to figure out what this is: +(defpart 806 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7a :page #x45e)) + (sp-func spt-birth-func 'birth-func-race-poster) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 6)) + (sp-flt spt-scale-y (meters 6)) + (sp-flt spt-r 90.0) + (sp-flt spt-g 90.0) + (sp-flt spt-b 90.0) + (sp-flt spt-a 128.0) + (sp-flt spt-omega 50.5) + (sp-int spt-timer 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 left-multiply-quat) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 #x45e07c00 #x45e07900 #x45e07a00 #x45e07d00) + ) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-race-poster-small + :id 166 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 807 :fade-after (meters 200) :flags (is-3d bit6 bit7))) + ) + +;; failed to figure out what this is: +(defpart 807 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7a :page #x45e)) + (sp-func spt-birth-func 'birth-func-race-poster) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-scale-y (meters 8)) + (sp-flt spt-r 90.0) + (sp-flt spt-g 90.0) + (sp-flt spt-b 90.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 left-multiply-quat) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 #x45e07c00 #x45e07900 #x45e07a00 #x45e07d00) + ) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-race-poster-medium + :id 167 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 9) + :parts ((sp-item 808 :fade-after (meters 200) :flags (is-3d bit6 bit7))) + ) + +;; failed to figure out what this is: +(defpart 808 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7a :page #x45e)) + (sp-func spt-birth-func 'birth-func-race-poster) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 12)) + (sp-flt spt-scale-y (meters 12)) + (sp-flt spt-r 90.0) + (sp-flt spt-g 90.0) + (sp-flt spt-b 90.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 left-multiply-quat) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 #x45e07c00 #x45e07900 #x45e07a00 #x45e07d00) + ) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-race-poster-large + :id 168 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 18) + :parts ((sp-item 809 :fade-after (meters 200) :flags (is-3d bit6 bit7))) + ) + +;; failed to figure out what this is: +(defpart 809 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7a :page #x45e)) + (sp-func spt-birth-func 'birth-func-race-poster) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 32)) + (sp-flt spt-scale-y (meters 32)) + (sp-flt spt-r 90.0) + (sp-flt spt-g 90.0) + (sp-flt spt-b 90.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 left-multiply-quat) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 5 0 0 #x45e07c00 #x45e07900 #x45e07a00 #x45e07d00) + ) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-stadium-light + :id 169 + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 810 :flags (bit6) :hour-mask #b111111111110000000) + (sp-item 811 :flags (bit6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 810 + :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 48.5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 8192.0) + (sp-flt spt-rot-z (degrees -17.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 32.0) + (sp-flt spt-omega 8195277.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 0.0) + ) + ) + +;; failed to figure out what this is: +(defpart 811 + :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 96) (meters 0.1) 1.0) + (sp-flt spt-rot-x 14336.0) + (sp-flt spt-rot-z (degrees -17.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 255.0 255.0 1.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 8.0) + (sp-flt spt-omega 8195277.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 0.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-baron-propoganda-holo + :id 170 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 818 :flags (is-3d bit6 bit7)) + (sp-item 819 :fade-after (meters 150) :flags (bit6 bit7)) + (sp-item 820 :binding 812) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 813) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 814) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 815) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 816) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 817) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 813) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 814) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 815) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 816) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 817) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 813) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 814) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 815) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 816) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 817) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 813) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 814) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 815) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 816) + (sp-item 812 :flags (bit1 start-dead launch-asap) :binding 817) + (sp-item 813 :flags (is-3d bit1 start-dead)) + (sp-item 814 :flags (is-3d bit1 start-dead)) + (sp-item 815 :flags (is-3d bit1 start-dead)) + (sp-item 816 :flags (is-3d bit1 start-dead)) + (sp-item 817 :flags (is-3d bit1 start-dead)) + (sp-item 813 :flags (is-3d bit1 start-dead)) + (sp-item 814 :flags (is-3d bit1 start-dead)) + (sp-item 815 :flags (is-3d bit1 start-dead)) + (sp-item 816 :flags (is-3d bit1 start-dead)) + (sp-item 817 :flags (is-3d bit1 start-dead)) + (sp-item 813 :flags (is-3d bit1 start-dead)) + (sp-item 814 :flags (is-3d bit1 start-dead)) + (sp-item 815 :flags (is-3d bit1 start-dead)) + (sp-item 816 :flags (is-3d bit1 start-dead)) + (sp-item 817 :flags (is-3d bit1 start-dead)) + (sp-item 813 :flags (is-3d bit1 start-dead)) + (sp-item 814 :flags (is-3d bit1 start-dead)) + (sp-item 815 :flags (is-3d bit1 start-dead)) + (sp-item 816 :flags (is-3d bit1 start-dead)) + (sp-item 817 :flags (is-3d bit1 start-dead)) + (sp-item 821 :flags (is-3d bit6 bit7)) + (sp-item 822 :fade-after (meters 150) :flags (bit6)) + ) + ) + +;; failed to figure out what this is: +(defpart 822 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-rnd-flt spt-num 0.9 0.1 1.0) + (sp-flt spt-y (meters 3.1)) + (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) + (sp-flt spt-rot-x 409.6) + (sp-rnd-flt spt-rot-z (degrees 17.0) (degrees 8.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-int spt-g 1124073472 1 128.0) + (sp-rnd-flt spt-b 0.0 128.0 1.0) + (sp-rnd-flt spt-a 16.0 16.0 1.0) + (sp-flt spt-omega 616448.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 2048.0) + ) + ) + +;; definition for function birth-func-ctywide-baron-propoganda-ticker-rotate +;; WARN: Return type mismatch int vs none. +(defun birth-func-ctywide-baron-propoganda-ticker-rotate ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (local-vars (v1-6 float) (v1-7 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (-> arg4 sprite))) + (let ((s4-0 (new 'stack-no-clear 'quaternion))) + (let* ((v1-0 arg2) + (f0-0 (-> v1-0 qx-qy-qz-sy x)) + (f1-0 (-> v1-0 qx-qy-qz-sy y)) + (f2-0 (-> v1-0 qx-qy-qz-sy z)) + ) + (set! (-> s4-0 x) f0-0) + (set! (-> s4-0 y) f1-0) + (set! (-> s4-0 z) f2-0) + (set! (-> s4-0 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0)))) + ) + (quaternion-rotate-y! s4-0 s4-0 (+ 8192.0 (-> s5-0 sprite flag-rot-sy z))) + (let ((v1-5 arg2)) + (cond + ((< (-> s4-0 w) 0.0) + (.lvf vf1 (&-> v1-5 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s4-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> v1-5 qx-qy-qz-sy quad) vf1) + (.mov v1-6 vf1) + ) + (else + (.lvf vf1 (&-> v1-5 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s4-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> v1-5 qx-qy-qz-sy quad) vf1) + (.mov v1-7 vf1) + ) + ) + ) + ) + (set! (-> arg2 r-g-b-a w) (-> s5-0 sprite r-g-b-a w)) + ) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defpart 820 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 0.1) + (sp-flt spt-y (meters 5)) + (sp-flt spt-scale-x (meters 0.1)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 812 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 0)) + (sp-flt spt-y (meters 0)) + (sp-flt spt-z (meters 2)) + (sp-flt spt-scale-x (meters 2)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 32.0) + (sp-flt spt-g 32.0) + (sp-flt spt-b 96.0) + (sp-flt spt-a 0.0) + (sp-flt spt-omega 8192.0) + (sp-flt spt-vel-x (meters 0.02)) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-flt spt-rotvel-z (degrees 0.45)) + (sp-flt spt-fade-a 0.8) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-int spt-next-time 80) + (sp-launcher-by-id spt-next-launcher 823) + ) + ) + +;; failed to figure out what this is: +(defpart 823 + :init-specs ((sp-flt spt-a 64.0) + (sp-flt spt-fade-a 0.0) + (sp-int spt-next-time 440) + (sp-launcher-by-id spt-next-launcher 824) + ) + ) + +;; failed to figure out what this is: +(defpart 824 + :init-specs ((sp-flt spt-fade-a -0.8)) + ) + +;; failed to figure out what this is: +(defpart 813 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x6f :page #x45e)) + (sp-func spt-birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 0.65)) + (sp-flt spt-rot-x 16384.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 64.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 814 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x70 :page #x45e)) + (sp-func spt-birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 0.65)) + (sp-flt spt-rot-x 16384.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 64.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 815 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x71 :page #x45e)) + (sp-func spt-birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 0.65)) + (sp-flt spt-rot-x 16384.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 64.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 816 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x72 :page #x45e)) + (sp-func spt-birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 0.65)) + (sp-flt spt-rot-x 16384.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 64.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 817 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x73 :page #x45e)) + (sp-func spt-birth-func 'birth-func-ctywide-baron-propoganda-ticker-rotate) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 0.65)) + (sp-flt spt-rot-x 16384.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 128.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 819 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-rnd-flt spt-scale-x (meters 10) (meters 0.1) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 96.0 96.0 1.0) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 20.0 4.0 1.0) + (sp-flt spt-omega 616448.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 10240.0) + ) + ) + +;; failed to figure out what this is: +(defpart 818 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x74 :page #x45e)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-flt spt-z (meters 0.05)) + (sp-rnd-flt spt-scale-x (meters 4.5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 192.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 96.0 16.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 821 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x74 :page #x45e)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 5.75)) + (sp-flt spt-z (meters 0.05)) + (sp-rnd-flt spt-scale-x (meters 6.5) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-x 14563.556 728.1778 1.0) + (sp-flt spt-rot-y (degrees 90.0)) + (sp-flt spt-rot-z (degrees 90.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 32.0) + (sp-flt spt-b 16.0) + (sp-rnd-flt spt-a 32.0 16.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-14 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-burning-bush-holo-off + :id 171 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 825 :flags (is-3d bit6 bit7)) + (sp-item 826 :flags (is-3d bit6 bit7)) + (sp-item 827 :flags (is-3d bit6 bit7)) + (sp-item 828 :flags (is-3d bit6 bit7)) + ) + ) + +;; failed to figure out what this is: +(defpart 825 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7b :page #x45e)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-flt spt-z (meters -0.02)) + (sp-rnd-flt spt-scale-x (meters 4.5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.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-rnd-flt spt-a 64.0 32.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 827 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xd3 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 5)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-y (degrees 90.0)) + (sp-flt spt-rot-z (degrees 90.0)) + (sp-flt spt-scale-y (meters 6)) + (sp-rnd-flt spt-r 64.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 128.0 1.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 828 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-flt spt-z (meters -0.05)) + (sp-flt spt-scale-x (meters 5)) + (sp-flt spt-rot-x -16384.0) + (sp-flt spt-rot-y (degrees 90.0)) + (sp-flt spt-rot-z (degrees 90.0)) + (sp-flt spt-scale-y (meters 6)) + (sp-flt spt-r 255.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 0.0 8.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-12 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 826 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x7b :page #x45e)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-flt spt-z (meters 0.02)) + (sp-rnd-flt spt-scale-x (meters 5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-y (degrees 90.0)) + (sp-flt spt-rot-z (degrees 90.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 8.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-12 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-burning-bush-holo-red + :id 172 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 829 :flags (is-3d bit6 bit7)) (sp-item 830 :fade-after (meters 150) :flags (bit6 bit7))) + ) + +;; failed to figure out what this is: +(defpart 829 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xd3 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 5)) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 5)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-y (degrees 90.0)) + (sp-flt spt-rot-z (degrees 90.0)) + (sp-flt spt-scale-y (meters 4)) + (sp-flt spt-r 255.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 830 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x84 :page #xc)) + (sp-rnd-flt spt-num 2.0 4.0 1.0) + (sp-rnd-flt spt-x (meters -2.25) (meters 4.5) 1.0) + (sp-flt spt-y (meters 4.5)) + (sp-flt spt-scale-x (meters 1)) + (sp-rnd-int-flt spt-rot-z (degrees 0.0) 1 32768.0) + (sp-rnd-flt spt-scale-y (meters 3) (meters 1.5) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 0.0) + (sp-flt spt-fade-a 1.6) + (sp-int spt-timer 40) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 20) + (sp-launcher-by-id spt-next-launcher 831) + (sp-rnd-int-flt spt-rotate-y (degrees 0.0) 1 32768.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-burning-bush-holo-on + :id 173 + :flags (unk-4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 832 :flags (is-3d bit6 bit7)) + (sp-item 833 :flags (is-3d bit6 bit7)) + (sp-item 834 :flags (is-3d bit6 bit7)) + (sp-item 835 :fade-after (meters 150) :flags (bit6 bit7)) + ) + ) + +;; failed to figure out what this is: +(defpart 835 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x84 :page #xc)) + (sp-rnd-flt spt-num 2.0 4.0 1.0) + (sp-rnd-flt spt-x (meters -2.25) (meters 4.5) 1.0) + (sp-rnd-flt spt-y (meters 5.5) (meters 0.5) 1.0) + (sp-flt spt-scale-x (meters 1)) + (sp-rnd-int-flt spt-rot-z (degrees 0.0) 1 32768.0) + (sp-flt spt-scale-y (meters 6)) + (sp-rnd-int spt-r 1124073472 1 128.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 0.0) + (sp-flt spt-fade-a 1.6) + (sp-int spt-timer 40) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 20) + (sp-launcher-by-id spt-next-launcher 831) + (sp-rnd-int-flt spt-rotate-y (degrees 0.0) 1 32768.0) + ) + ) + +;; failed to figure out what this is: +(defpart 831 + :init-specs ((sp-flt spt-fade-a -1.6)) + ) + +;; failed to figure out what this is: +(defpart 832 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x78 :page #x45e)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-flt spt-z (meters -0.02)) + (sp-rnd-flt spt-scale-x (meters 3.5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.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 0.0) + (sp-rnd-flt spt-a 128.0 32.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 834 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xd3 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 5)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-y (degrees 90.0)) + (sp-flt spt-rot-z (degrees 90.0)) + (sp-flt spt-scale-y (meters 6)) + (sp-flt spt-r 255.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 32.0 64.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 833 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x78 :page #x45e)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 6)) + (sp-flt spt-z (meters 0.02)) + (sp-rnd-flt spt-scale-x (meters 4) (meters 0.1) 1.0) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-y (degrees 90.0)) + (sp-flt spt-rot-z (degrees 90.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 64.0 16.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-12 left-multiply-quat) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-palace-high-fire + :id 174 + :flags (unk-8) + :bounds (static-bspherem 0 2 0 5) + :parts ((sp-item 836 :fade-after (meters 500) :falloff-to (meters 600)) + (sp-item 837 :fade-after (meters 500) :flags (bit6)) + ) + ) + +;; failed to figure out what this is: +(defpart 836 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x33 :page #xc)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 1.5) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) + (sp-rnd-flt spt-scale-y (meters 4) (meters 2) 1.0) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-rnd-flt spt-b 0.0 32.0 1.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0) (meters -0.0033333334) 1.0) + (sp-flt spt-scalevel-x (meters -0.009375)) + (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-g -0.7111111) + (sp-rnd-flt spt-fade-a -0.1 -0.1 1.0) + (sp-rnd-flt spt-accel-y 3.4133334 2.7306666 1.0) + (sp-int-plain-rnd spt-timer 160 49 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-3) + (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) + ) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.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.05) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 837 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 0.5) + (sp-flt spt-y (meters 4)) + (sp-rnd-flt spt-scale-x (meters 16) (meters 0.5) 1.0) + (sp-flt spt-rot-x 40.96) + (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 128.0 64.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-rnd-flt spt-b 0.0 32.0 1.0) + (sp-rnd-flt spt-a 16.0 16.0 1.0) + (sp-flt spt-scalevel-x (meters -0.0016666667)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.7111111) + (sp-flt spt-fade-a -1.0666667) + (sp-int spt-timer 25) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.05) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-misc-citylights-red-1 + :id 175 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 838 :flags (bit6) :period 1200 :length 5 :hour-mask #b111111111110000000)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-misc-citylights-red-2 + :id 176 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 838 :flags (bit6) :period 1200 :length 5 :offset 400 :hour-mask #b111111111110000000)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-misc-citylights-red-3 + :id 177 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 838 :flags (bit6) :period 1200 :length 5 :offset 800 :hour-mask #b111111111110000000)) + ) + +;; failed to figure out what this is: +(defpart 838 + :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 7.5)) + (sp-flt spt-rot-x 2048.0) + (sp-flt spt-scale-y (meters 6)) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 0.0 32.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 8.0) + (sp-flt spt-omega 12290867.0) + (sp-flt spt-scalevel-x (meters 0.075)) + (sp-flt spt-scalevel-y (meters 0.06)) + (sp-flt spt-fade-a 0.08) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + (sp-int spt-next-time 100) + (sp-launcher-by-id spt-next-launcher 839) + ) + ) + +;; failed to figure out what this is: +(defpart 839 + :init-specs ((sp-flt spt-scale-y (meters 12)) + (sp-flt spt-a 16.0) + (sp-flt spt-scalevel-x (meters 0)) + (sp-flt spt-scalevel-y (meters 0)) + (sp-flt spt-fade-a 0.0) + (sp-int spt-next-time 600) + (sp-launcher-by-id spt-next-launcher 840) + ) + ) + +;; failed to figure out what this is: +(defpart 840 + :init-specs ((sp-flt spt-scalevel-x (meters -0.075)) + (sp-flt spt-scalevel-y (meters -0.06)) + (sp-flt spt-fade-a -0.08) + (sp-int spt-next-time 100) + (sp-launcher-by-id spt-next-launcher 841) + ) + ) + +;; failed to figure out what this is: +(defpart 841 + :init-specs ((sp-flt spt-scale-y (meters 6)) + (sp-flt spt-a 8.0) + (sp-flt spt-scalevel-x (meters 0)) + (sp-flt spt-scalevel-y (meters 0)) + (sp-flt spt-fade-a 0.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-misc-citylights-blue-1 + :id 178 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 842 :flags (bit6) :period 1200 :length 5 :hour-mask #b111111111110000000)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-misc-citylights-blue-2 + :id 179 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 842 :flags (bit6) :period 1200 :length 5 :offset 400 :hour-mask #b111111111110000000)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-misc-citylights-blue-3 + :id 180 + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 842 :flags (bit6) :period 1200 :length 5 :offset 800 :hour-mask #b111111111110000000)) + ) + +;; failed to figure out what this is: +(defpart 842 + :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 7.5)) + (sp-flt spt-rot-x 2048.0) + (sp-flt spt-scale-y (meters 6)) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 128.0 32.0 1.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 8.0) + (sp-flt spt-omega 12290867.0) + (sp-flt spt-scalevel-x (meters 0.075)) + (sp-flt spt-scalevel-y (meters 0.06)) + (sp-flt spt-fade-a 0.08) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + (sp-int spt-next-time 100) + (sp-launcher-by-id spt-next-launcher 839) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-cable-lights + :id 181 + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 843 :fade-after (meters 3000) :flags (bit6) :hour-mask #b111111111110000000)) + ) + +;; failed to figure out what this is: +(defpart 843 + :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)) + (sp-rnd-flt spt-scale-x (meters 12) (meters 4) 1.0) + (sp-flt spt-rot-x 10240.0) + (sp-flt spt-rot-z (degrees 17.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 196.0 64.0 1.0) + (sp-flt spt-b 64.0) + (sp-rnd-flt spt-a 20.0 8.0 1.0) + (sp-flt spt-omega 12290867.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-slums-seal-of-mar-glow + :id 182 + :flags (unk-6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 4) (degrees 0) (degrees 4)) + :parts ((sp-item 844) (sp-item 845) (sp-item 846 :flags (bit7))) + ) + +;; failed to figure out what this is: +(defpart 844 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 0.5) + (sp-flt spt-z (meters -0.05)) + (sp-rnd-flt spt-scale-x (meters 0.9) (meters 0.25) 1.0) + (sp-flt spt-rot-x 409.6) + (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 96.0 32.0 1.0) + (sp-rnd-flt spt-g 64.0 16.0 1.0) + (sp-rnd-flt spt-b 12.0 4.0 1.0) + (sp-rnd-flt spt-a 16.0 16.0 1.0) + (sp-flt spt-fade-a -1.1) + (sp-int spt-timer 50) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 845 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 0.5) + (sp-flt spt-z (meters 0.05)) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) + (sp-flt spt-rot-x 409.6) + (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 96.0 32.0 1.0) + (sp-rnd-flt spt-g 64.0 16.0 1.0) + (sp-rnd-flt spt-b 12.0 4.0 1.0) + (sp-rnd-flt spt-a 12.0 12.0 1.0) + (sp-flt spt-fade-a -0.48) + (sp-int spt-timer 50) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 846 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-rnd-flt spt-num 4.0 2.0 1.0) + (sp-flt spt-x (meters 0.2)) + (sp-rnd-flt spt-scale-x (meters 0.01) (meters 0.0025) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 196.0 32.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 128.0 128.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.02) (meters 0.02) 1.0) + (sp-rnd-flt spt-fade-a -0.42666668 -0.42666668 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-chimney + :id 183 + :flags (unk-8) + :bounds (static-bspherem 0 0 -10 64) + :parts ((sp-item 847 :fade-after (meters 600) :falloff-to (meters 600)) + (sp-item 848 :fade-after (meters 600) :flags (bit6)) + ) + ) + +;; failed to figure out what this is: +(defpart 848 + :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 1)) + (sp-rnd-flt spt-scale-x (meters 24) (meters 1.1) 1.0) + (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 240.0) + (sp-flt spt-b 100.0) + (sp-rnd-flt spt-a 12.0 4.0 1.0) + (sp-flt spt-omega 2460057.5) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 16384.0) + ) + ) + +;; failed to figure out what this is: +(defpart 847 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 0.0 0.3 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 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.03) (meters 0.01) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.053333335) (meters 0.053333335) 1.0) + (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.0) + (sp-flt spt-fade-g -0.36) + (sp-flt spt-fade-b -4.24) + (sp-rnd-flt spt-fade-a -0.053333335 -0.053333335 1.0) + (sp-rnd-flt spt-accel-x -4.096 -1.3653333 1.0) + (sp-rnd-flt spt-accel-y 0.4096 0.4096 1.0) + (sp-flt spt-friction 0.96) + (sp-int spt-timer 2400) + (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 #xc00000 #xc03300) + ) + (sp-int-plain-rnd spt-next-time 25 4 1) + (sp-launcher-by-id spt-next-launcher 849) + ) + ) + +;; failed to figure out what this is: +(defpart 849 + :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 10 39 1) + (sp-launcher-by-id spt-next-launcher 850) + ) + ) + +;; failed to figure out what this is: +(defpart 850 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.026666667) (meters 0.026666667) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.14666666) + (sp-flt spt-fade-g -0.7866667) + (sp-flt spt-fade-b -0.88) + (sp-int-plain-rnd spt-next-time 105 44 1) + (sp-launcher-by-id spt-next-launcher 851) + ) + ) + +;; failed to figure out what this is: +(defpart 851 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.013333334) (meters 0.013333334) 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-int-plain-rnd spt-next-time 150 29 1) + (sp-launcher-by-id spt-next-launcher 852) + ) + ) + +;; failed to figure out what this is: +(defpart 852 + :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.024)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-chimney-smoke + :id 184 + :flags (unk-8) + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 853 :fade-after (meters 950) :falloff-to (meters 1200))) + ) + +;; failed to figure out what this is: +(defpart 853 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 0.0 0.5 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 128.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 24.0 24.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.03) (meters 0.01) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.026666667) (meters 0.026666667) 1.0) + (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.21333334) + (sp-flt spt-fade-g -0.21333334) + (sp-flt spt-fade-b -0.21333334) + (sp-rnd-flt spt-fade-a -0.026666667 -0.026666667 1.0) + (sp-rnd-flt spt-accel-x -4.096 -1.3653333 1.0) + (sp-rnd-flt spt-accel-y 0.4096 0.4096 1.0) + (sp-flt spt-friction 0.96) + (sp-int spt-timer 1800) + (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 #xc00000 #xc03300) + ) + (sp-int-plain-rnd spt-next-time 75 4 1) + (sp-launcher-by-id spt-next-launcher 854) + ) + ) + +;; failed to figure out what this is: +(defpart 854 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.026666667) (meters 0.026666667) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int-plain-rnd spt-next-time 105 44 1) + (sp-launcher-by-id spt-next-launcher 855) + ) + ) + +;; failed to figure out what this is: +(defpart 855 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.026666667) (meters 0.026666667) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + ) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/city/common/nav-graph-h_REF.gc b/test/decompiler/reference/jak2/levels/city/common/nav-graph-h_REF.gc index b373917b9e..6c3a602a82 100644 --- a/test/decompiler/reference/jak2/levels/city/common/nav-graph-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/nav-graph-h_REF.gc @@ -296,7 +296,7 @@ (node-at-idx (_type_ int) nav-node 41) (nav-graph-method-42 (_type_) none 42) (nav-graph-method-43 (_type_ nav-graph-link string) none 43) - (from-editor () none 44) + (from-editor (_type_ nav-node symbol) none 44) ) ) 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 ea65e80e53..e57a3cb2b1 100644 --- a/test/decompiler/reference/jak2/levels/city/common/vehicle_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/vehicle_REF.gc @@ -1532,11 +1532,13 @@ (if (zero? (-> obj draw light-index)) (set! (-> obj draw light-index) (the-as uint 10)) ) - (rigid-body-queue-method-11 (if (logtest? (-> obj info-override flags) 1024) - *race-rigid-body-queue* - *traffic-rigid-body-queue* - ) - ) + (rigid-body-queue-method-11 + (if (logtest? (-> obj info-override flags) 1024) + *race-rigid-body-queue* + *traffic-rigid-body-queue* + ) + obj + ) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/farm/ctyfarm-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/farm/ctyfarm-obs_REF.gc new file mode 100644 index 0000000000..54024cb041 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/city/farm/ctyfarm-obs_REF.gc @@ -0,0 +1,2694 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-farm-marrow-explode + :id 1025 + :duration (seconds 3.335) + :flags (use-local-clock unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 4462 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d bit7) :period 1200 :length 10) + (sp-item 4463 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d bit7) :period 1200 :length 15) + (sp-item 4464 :fade-after (meters 40) :falloff-to (meters 60) :flags (bit7) :period 1200 :length 15) + (sp-item 4465 :fade-after (meters 100) :falloff-to (meters 120) :flags (bit7) :period 1200 :length 30) + (sp-item 4466 :fade-after (meters 90) :falloff-to (meters 110) :flags (bit7) :period 1200 :length 40) + (sp-item 4467 :fade-after (meters 50) :period 1200 :length 5) + ) + ) + +;; failed to figure out what this is: +(defpart 4465 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc)) + (sp-flt spt-num 32.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 5) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (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-rnd-flt spt-r 64.0 64.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 92.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-rnd-flt spt-fade-a -0.16 -0.16 1.0) + (sp-rnd-flt spt-accel-y -6.826667 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.95 0.03 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 0.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.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 4464 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-flt spt-num 32.0) + (sp-rnd-flt spt-y (meters 0) (meters 5) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.05) 1.0) + (sp-int spt-rot-x 4) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-rnd-flt spt-b 128.0 32.0 1.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-omega 2.8672 1.6384 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.083333336) 1.0) + (sp-rnd-flt spt-accel-y -12.288 -2.7306666 1.0) + (sp-rnd-flt spt-friction 0.96 0.02 1.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-21) + (sp-flt spt-userdata 36864.0) + (sp-func spt-func 'check-water-level-drop-motion) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 85.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 1) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4466 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 12.0 2.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 5) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 2) (meters 2) 1.0) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-rnd-flt spt-g 64.0 128.0 1.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 16.0 8.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-rnd-flt spt-scalevel-y (meters 0) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-fade-a -0.02 -0.02 1.0) + (sp-rnd-flt spt-accel-y -3.4133334 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.82 0.07 1.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-conerot-x (degrees 30.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.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 4467 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 3)) + (sp-flt spt-scale-x (meters 7)) + (sp-flt spt-rot-x 122.88) + (sp-flt spt-scale-y (meters 5)) + (sp-flt spt-r 32.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 64.0) + (sp-flt spt-omega 206848.0) + (sp-flt spt-scalevel-x (meters 0.2)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -2.56) + (sp-int spt-timer 25) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4463 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #xae7)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 12.0 6.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 5) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 0.00048828125) 8192.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.3) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.3) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.083333336) (meters 0.1) 1.0) + (sp-flt spt-scalevel-x (meters -0.00022222222)) + (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-scalevel-y (meters -0.00022222222)) + (sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) + (sp-rnd-flt spt-accel-y -13.653334 -6.826667 1.0) + (sp-rnd-flt spt-friction 0.92 0.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 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 5 0 0 -1368390400 -1368390656 -1368390912) + ) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 1200) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4462 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #xae7)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 12.0 3.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 5) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 0.00048828125) 8192.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.5) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.1) (meters 0.13333334) 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.07 1.0) + (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 5 0 0 -1368390400 -1368390656 -1368390912) + ) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 120) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 15.0) (degrees 150.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; definition for function check-farm-piece-ground +;; WARN: Return type mismatch number vs none. +(defun check-farm-piece-ground ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (if (and (>= 35225.6 (-> arg2 vector 0 y)) (>= 0.0 (-> arg1 vel-sxvel y))) + (set! (-> arg2 vector 0 y) 35225.6) + (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 4468 + :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 150 299 1) + (sp-launcher-by-id spt-next-launcher 4469) + ) + ) + +;; failed to figure out what this is: +(defpart 4469 + :init-specs ((sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) (sp-cpuinfo-flags sp-cpuinfo-flag-2 left-multiply-quat)) + ) + +;; failed to figure out what this is: +(defpartgroup group-farm-beetree-explode + :id 1026 + :duration (seconds 3.335) + :flags (use-local-clock unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 4470 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d bit7) :period 1200 :length 15) + (sp-item 4471 :fade-after (meters 100) :falloff-to (meters 120) :flags (bit7) :period 1200 :length 30) + (sp-item 4472 :fade-after (meters 90) :falloff-to (meters 110) :flags (bit7) :period 1200 :length 40) + (sp-item 4473 :fade-after (meters 50) :period 1200 :length 5) + (sp-item 4474 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d bit7) :period 1200 :length 10) + (sp-item 4475 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d bit7) :period 1200 :length 15) + ) + ) + +;; failed to figure out what this is: +(defpart 4475 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xae7)) + (sp-rnd-flt spt-num 12.0 6.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 9) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 0.00048828125) 8192.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.4) (meters 0.3) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.083333336) (meters 0.1) 1.0) + (sp-flt spt-scalevel-x (meters -0.00022222222)) + (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-scalevel-y (meters -0.00022222222)) + (sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) + (sp-rnd-flt spt-accel-y -13.653334 -6.826667 1.0) + (sp-rnd-flt spt-friction 0.92 0.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 1200) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4474 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xae7)) + (sp-rnd-flt spt-num 12.0 3.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 9) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 0.00048828125) 8192.0) + (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.4) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 1) (meters 0.5) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.1) (meters 0.13333334) 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.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 120) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 15.0) (degrees 150.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-farm-cabbage-explode + :id 1027 + :duration (seconds 3.335) + :flags (use-local-clock unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 4476 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d bit7) :period 1200 :length 10) + (sp-item 4477 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d bit7) :period 1200 :length 15) + (sp-item 4478 :fade-after (meters 40) :falloff-to (meters 60) :flags (bit7) :period 1200 :length 15) + (sp-item 4479 :fade-after (meters 100) :falloff-to (meters 120) :flags (bit7) :period 1200 :length 30) + (sp-item 4480 :fade-after (meters 90) :falloff-to (meters 110) :flags (bit7) :period 1200 :length 40) + (sp-item 4481 :fade-after (meters 50) :period 1200 :length 5) + ) + ) + +;; failed to figure out what this is: +(defpart 4479 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc)) + (sp-flt spt-num 32.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 3) 1.0) + (sp-rnd-flt spt-z (meters -4) (meters 8) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (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-rnd-flt spt-r 196.0 64.0 1.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 0.0 64.0 1.0) + (sp-rnd-flt spt-a 92.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-rnd-flt spt-fade-a -0.16 -0.16 1.0) + (sp-rnd-flt spt-accel-y -6.826667 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.95 0.03 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 0.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.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 4478 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-flt spt-num 32.0) + (sp-rnd-flt spt-y (meters 0) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.05) 1.0) + (sp-int spt-rot-x 4) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 0.0 128.0 1.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-omega 2.8672 1.6384 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.083333336) 1.0) + (sp-rnd-flt spt-accel-y -12.288 -2.7306666 1.0) + (sp-rnd-flt spt-friction 0.96 0.02 1.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-21) + (sp-flt spt-userdata 36864.0) + (sp-func spt-func 'check-water-level-drop-motion) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 85.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 1) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4480 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 12.0 2.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 3) 1.0) + (sp-rnd-flt spt-z (meters -4) (meters 8) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 2) (meters 2) 1.0) + (sp-rnd-flt spt-r 196.0 64.0 1.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 0.0 64.0 1.0) + (sp-rnd-flt spt-a 16.0 8.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-rnd-flt spt-scalevel-y (meters 0) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-fade-a -0.02 -0.02 1.0) + (sp-rnd-flt spt-accel-y -3.4133334 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.82 0.07 1.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-conerot-x (degrees 30.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.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 4481 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 1.5)) + (sp-flt spt-scale-x (meters 3)) + (sp-flt spt-rot-x 122.88) + (sp-flt spt-scale-y (meters 5)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-omega 206848.0) + (sp-flt spt-scalevel-x (meters 0.2)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -2.56) + (sp-int spt-timer 25) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4477 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xae7)) + (sp-rnd-flt spt-num 12.0 6.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 2) 1.0) + (sp-rnd-flt spt-z (meters -1.5) (meters 0.00048828125) 12288.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.3) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.3) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.083333336) (meters 0.1) 1.0) + (sp-flt spt-scalevel-x (meters -0.00022222222)) + (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-scalevel-y (meters -0.00022222222)) + (sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) + (sp-rnd-flt spt-accel-y -13.653334 -6.826667 1.0) + (sp-rnd-flt spt-friction 0.92 0.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 1200) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4476 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xae7)) + (sp-rnd-flt spt-num 12.0 3.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 2) 1.0) + (sp-rnd-flt spt-z (meters -1.5) (meters 0.00048828125) 12288.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 1) (meters 0.5) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.1) (meters 0.13333334) 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.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 120) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 15.0) (degrees 150.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-farm-small-cabbage-explode + :id 1028 + :duration (seconds 3.335) + :flags (use-local-clock unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 4470 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d bit7) :period 1200 :length 15) + (sp-item 4471 :fade-after (meters 100) :falloff-to (meters 120) :flags (bit7) :period 1200 :length 30) + (sp-item 4472 :fade-after (meters 90) :falloff-to (meters 110) :flags (bit7) :period 1200 :length 40) + (sp-item 4473 :fade-after (meters 50) :period 1200 :length 5) + ) + ) + +;; failed to figure out what this is: +(defpart 4471 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc)) + (sp-flt spt-num 20.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 2) 1.0) + (sp-rnd-flt spt-z (meters -2) (meters 4) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (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-rnd-flt spt-r 196.0 64.0 1.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 0.0 64.0 1.0) + (sp-rnd-flt spt-a 92.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-rnd-flt spt-fade-a -0.16 -0.16 1.0) + (sp-rnd-flt spt-accel-y -6.826667 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.95 0.03 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 0.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.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 4472 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 8.0 2.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 2) 1.0) + (sp-rnd-flt spt-z (meters -2) (meters 4) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 1) (meters 1) 1.0) + (sp-rnd-flt spt-r 196.0 64.0 1.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 0.0 64.0 1.0) + (sp-rnd-flt spt-a 16.0 8.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-rnd-flt spt-scalevel-y (meters 0) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-fade-a -0.02 -0.02 1.0) + (sp-rnd-flt spt-accel-y -3.4133334 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.82 0.07 1.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-conerot-x (degrees 30.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.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 4473 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 1.5)) + (sp-flt spt-scale-x (meters 2)) + (sp-flt spt-rot-x 122.88) + (sp-flt spt-scale-y (meters 3.5)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-omega 206848.0) + (sp-flt spt-scalevel-x (meters 0.2)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -2.56) + (sp-int spt-timer 25) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4470 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xae7)) + (sp-rnd-flt spt-num 12.0 6.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0) + (sp-rnd-flt spt-z (meters -1.5) (meters 0.00048828125) 12288.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.3) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.3) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.083333336) (meters 0.1) 1.0) + (sp-flt spt-scalevel-x (meters -0.00022222222)) + (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-scalevel-y (meters -0.00022222222)) + (sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) + (sp-rnd-flt spt-accel-y -13.653334 -6.826667 1.0) + (sp-rnd-flt spt-friction 0.92 0.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 1200) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-farm-chilirots-explode + :id 1029 + :duration (seconds 3.335) + :flags (use-local-clock unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 4482 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d bit7) :period 1200 :length 10) + (sp-item 4483 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d bit7) :period 1200 :length 15) + (sp-item 4484 :fade-after (meters 90) :falloff-to (meters 110) :flags (bit7) :period 1200 :length 40) + (sp-item 4485 :fade-after (meters 50) :period 1200 :length 5) + (sp-item 4486 :fade-after (meters 100) :falloff-to (meters 120) :flags (bit7) :period 1200 :length 30) + ) + ) + +;; failed to figure out what this is: +(defpart 4486 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x32 :page #xc)) + (sp-flt spt-num 32.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 5) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (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-rnd-flt spt-r 64.0 64.0 1.0) + (sp-rnd-flt spt-g 0.0 32.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 92.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-rnd-flt spt-fade-a -0.16 -0.16 1.0) + (sp-rnd-flt spt-accel-y -6.826667 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.95 0.03 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 0.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.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 4484 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 12.0 2.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 5) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 2) (meters 2) 1.0) + (sp-flt spt-r 64.0) + (sp-rnd-flt spt-g 0.0 16.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 16.0 8.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-rnd-flt spt-scalevel-y (meters 0) (meters 0.0033333334) 1.0) + (sp-rnd-flt spt-fade-a -0.02 -0.02 1.0) + (sp-rnd-flt spt-accel-y -3.4133334 -3.4133334 1.0) + (sp-rnd-flt spt-friction 0.82 0.07 1.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-rnd-flt spt-conerot-x (degrees 30.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.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 4485 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 3)) + (sp-flt spt-scale-x (meters 7)) + (sp-flt spt-rot-x 122.88) + (sp-flt spt-scale-y (meters 5)) + (sp-flt spt-r 255.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-omega 206848.0) + (sp-flt spt-scalevel-x (meters 0.2)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -2.56) + (sp-int spt-timer 25) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4483 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xae7)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 12.0 6.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 5) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 0.00048828125) 8192.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.3) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.3) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.083333336) (meters 0.1) 1.0) + (sp-flt spt-scalevel-x (meters -0.00022222222)) + (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-scalevel-y (meters -0.00022222222)) + (sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) + (sp-rnd-flt spt-accel-y -13.653334 -6.826667 1.0) + (sp-rnd-flt spt-friction 0.92 0.07 1.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 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 5 0 0 -1368391424 -1368391168) + ) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 1200) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 180.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4482 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xae7)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-rnd-flt spt-num 12.0 3.0 1.0) + (sp-rnd-flt spt-y (meters 0.5) (meters 5) 1.0) + (sp-rnd-flt spt-z (meters -1) (meters 0.00048828125) 8192.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-x 0.0 655360.0 1.0) + (sp-rnd-flt spt-rot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.5) 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-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.1) (meters 0.13333334) 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.07 1.0) + (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 5 0 0 -1368391424 -1368391168) + ) + (sp-func spt-func 'check-farm-piece-ground) + (sp-int spt-next-time 120) + (sp-launcher-by-id spt-next-launcher 4468) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 110.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 15.0) (degrees 150.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-farm-sprinkler-barrels-water + :id 1030 + :duration (seconds 0.5) + :linger-duration (seconds 1) + :flags (use-local-clock unk-4) + :bounds (static-bspherem 0 0 0 128) + :parts ((sp-item 4487 :fade-after (meters 300) :falloff-to (meters 300) :flags (bit7) :period 600 :length 50 :offset 80) + (sp-item 4488 :fade-after (meters 200) :falloff-to (meters 300) :flags (bit7) :period 600 :length 50 :offset 80) + (sp-item 4489 :fade-after (meters 180) :falloff-to (meters 180) :flags (bit7) :period 600 :length 100 :offset 30) + (sp-item 4489 :fade-after (meters 180) :falloff-to (meters 180) :flags (bit7) :period 600 :length 75 :offset 55) + (sp-item 4489 :fade-after (meters 180) :falloff-to (meters 180) :flags (bit7) :period 600 :length 100 :offset 80) + (sp-item 4490 :fade-after (meters 100) :falloff-to (meters 100) :flags (bit7) :period 600 :length 50 :offset 80) + ) + ) + +;; failed to figure out what this is: +(defpart 4488 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 6.0 1.0 1.0) + (sp-flt spt-z (meters -0.5)) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.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 32.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 32.0 64.0 1.0) + (sp-rnd-flt spt-vel-z (meters 0.2) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.026666667) (meters 0.01) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.6) (degrees 1.2) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-a -0.28444445 -0.28444445 1.0) + (sp-rnd-flt spt-accel-y -1.3653333 -1.3653333 1.0) + (sp-rnd-flt spt-friction 0.8 0.08 1.0) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 use-global-acc) + (sp-rnd-flt spt-launchrot-x (degrees -15.0) (degrees 30.0) 1.0) + (sp-rnd-flt spt-launchrot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4487 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-rnd-flt spt-num 10.0 1.0 1.0) + (sp-flt spt-z (meters -0.5)) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) + (sp-int spt-rot-x 4) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-omega 4.096) + (sp-rnd-flt spt-vel-z (meters 0.2) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-accel-y -13.653334 1.3653333 1.0) + (sp-flt spt-friction 0.99) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 use-global-acc) + (sp-flt spt-userdata 32768.0) + (sp-func spt-func 'check-drop-level-ctyfarma-drop-userdata) + (sp-int-plain-rnd spt-next-time 0 224 1) + (sp-launcher-by-id spt-next-launcher 4491) + (sp-rnd-flt spt-launchrot-x (degrees -5.0) (degrees 10.0) 1.0) + (sp-rnd-flt spt-launchrot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4489 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-rnd-flt spt-num 2.0 0.5 1.0) + (sp-flt spt-z (meters -0.5)) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) + (sp-int spt-rot-x 4) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-omega 4.096) + (sp-rnd-flt spt-vel-z (meters 0.13333334) (meters 0.13333334) 1.0) + (sp-rnd-flt spt-accel-y -13.653334 1.3653333 1.0) + (sp-flt spt-friction 0.99) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 use-global-acc) + (sp-flt spt-userdata 32768.0) + (sp-func spt-func 'check-drop-level-ctyfarma-drop-userdata) + (sp-int-plain-rnd spt-next-time 0 224 1) + (sp-launcher-by-id spt-next-launcher 4491) + (sp-rnd-flt spt-launchrot-x (degrees -16.0) (degrees 32.0) 1.0) + (sp-rnd-flt spt-launchrot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4490 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-rnd-flt spt-num 2.0 0.5 1.0) + (sp-flt spt-z (meters -0.5)) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.1) 1.0) + (sp-int spt-rot-x 4) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 32.0 1.0) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-omega 4.096) + (sp-rnd-flt spt-vel-z (meters 0.1) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-accel-y -13.653334 1.3653333 1.0) + (sp-flt spt-friction 0.99) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 use-global-acc) + (sp-flt spt-userdata 32768.0) + (sp-func spt-func 'check-drop-level-ctyfarma-drop-userdata) + (sp-int-plain-rnd spt-next-time 0 224 1) + (sp-launcher-by-id spt-next-launcher 4491) + (sp-rnd-flt spt-launchrot-x (degrees -70.0) (degrees 140.0) 1.0) + (sp-rnd-flt spt-launchrot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; definition of type shaker +(deftype shaker (structure) + ((axis vector :inline :offset-assert 0) + (start-time time-frame :offset-assert 16) + (decay-time float :offset-assert 24) + (amplitude float :offset-assert 28) + (freq float :offset-assert 32) + (y-decay-time float :offset-assert 36) + (y-amplitude float :offset-assert 40) + (y-freq float :offset-assert 44) + (shake float :offset-assert 48) + (y-shake float :offset-assert 52) + ) + :method-count-assert 10 + :size-assert #x38 + :flag-assert #xa00000038 + (:methods + (shaker-method-9 (_type_) none 9) + ) + ) + +;; definition for method 3 of type shaker +(defmethod inspect shaker ((obj shaker)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'shaker) + (format #t "~1Taxis: #~%" (-> obj axis)) + (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) + (format #t "~1Tdecay-time: ~f~%" (-> obj decay-time)) + (format #t "~1Tamplitude: ~f~%" (-> obj amplitude)) + (format #t "~1Tfreq: ~f~%" (-> obj freq)) + (format #t "~1Ty-decay-time: ~f~%" (-> obj y-decay-time)) + (format #t "~1Ty-amplitude: ~f~%" (-> obj y-amplitude)) + (format #t "~1Ty-freq: ~f~%" (-> obj y-freq)) + (format #t "~1Tshake: ~f~%" (-> obj shake)) + (format #t "~1Ty-shake: ~f~%" (-> obj y-shake)) + (label cfg-4) + obj + ) + +;; definition for method 9 of type shaker +;; WARN: Return type mismatch float vs none. +(defmethod shaker-method-9 shaker ((obj shaker)) + (with-pp + (let ((s5-0 (- (-> pp clock frame-counter) (-> obj start-time)))) + (set! (-> obj shake) (* (-> obj amplitude) + (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> obj decay-time)) + (cos (* 65536.0 (/ (the float s5-0) (-> obj freq)))) + ) + ) + (set! (-> obj y-shake) (* (-> obj y-amplitude) + (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> obj y-decay-time)) + (cos (* 65536.0 (/ (the float s5-0) (-> obj y-freq)))) + ) + ) + ) + (none) + ) + ) + +;; definition for function pu->knocked-type +;; WARN: Return type mismatch int vs knocked-type. +(defun pu->knocked-type ((arg0 penetrate)) + (the-as knocked-type (cond + ((logtest? arg0 (penetrate vehicle)) + 7 + ) + ((logtest? (penetrate jak-blue-shot) arg0) + 6 + ) + ((logtest? (penetrate jak-yellow-shot enemy-yellow-shot) arg0) + 4 + ) + ((logtest? (penetrate jak-red-shot) arg0) + 5 + ) + ((logtest? (penetrate explode jak-dark-shot enemy-dark-shot) arg0) + 2 + ) + ((logtest? (penetrate dark-bomb dark-giant) arg0) + 3 + ) + ((logtest? arg0 (penetrate mech-punch)) + 1 + ) + (else + 0 + ) + ) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-farm-marrow farm-marrow farm-marrow-lod0-jg farm-marrow-idle-ja + ((farm-marrow-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2.4 0 4) + ) + +;; failed to figure out what this is: +(defskelgroup skel-farm-marrow-explode farm-marrow farm-marrow-explode-lod0-jg farm-marrow-explode-idle-ja + ((farm-marrow-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +;; definition for symbol *farm-marrow-exploder-params*, type joint-exploder-static-params +(define *farm-marrow-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 3 :parent-joint-index -1) + (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) + ) + :collide-spec #x1 + ) + ) + +;; definition of type farm-marrow +(deftype farm-marrow (process-focusable) + ((shakers shaker 5 :inline :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 528) + ) + :heap-base #x1a0 + :method-count-assert 31 + :size-assert #x214 + :flag-assert #x1f01a00214 + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (farm-marrow-method-29 (_type_) none 29) + (farm-marrow-method-30 (_type_) none 30) + ) + ) + +;; definition for method 3 of type farm-marrow +(defmethod inspect farm-marrow ((obj farm-marrow)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (format #t "~2Tshakers[5] @ #x~X~%" (-> obj shakers)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) + (label cfg-4) + obj + ) + +;; definition for function farm-marrow-callback +;; WARN: Return type mismatch int vs none. +(defun farm-marrow-callback ((arg0 cspace) (arg1 transformq)) + (with-pp + (let ((s4-0 (the-as farm-marrow (-> arg0 param1))) + (s3-0 (the-as int (-> arg0 param2))) + ) + (quaternion*! (-> arg1 quat) (-> arg1 quat) (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + (the-as vector (-> s4-0 shakers s3-0)) + (-> s4-0 shakers s3-0 shake) + ) + ) + (quaternion-rotate-local-y! (-> arg1 quat) (-> arg1 quat) (-> s4-0 shakers s3-0 y-shake)) + (if (< (the int (-> s4-0 shakers s3-0 decay-time)) + (- (-> pp clock frame-counter) (-> s4-0 shakers s3-0 start-time)) + ) + (set! (-> arg0 param0) #f) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die (farm-marrow) + :virtual #t + :enter (the-as (function none :behavior farm-marrow) #f) + :exit (the-as (function none :behavior farm-marrow) #f) + :trans (the-as (function none :behavior farm-marrow) #f) + :code (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior farm-marrow) #f) + ) + +;; failed to figure out what this is: +(defstate idle (farm-marrow) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (let ((a1-1 (the-as object (-> event param 1))) + (a0-2 proc) + ) + (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info a1-1) id)) + (when a0-2 + (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) + (when s5-0 + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (cond + ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) + (sound-play "hit-veggies") + (let ((gp-4 (new 'stack-no-clear 'vector))) + (vector-inv-orient-by-quat! + gp-4 + (vector-cross! + (new 'stack-no-clear 'vector) + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (-> s5-0 root-override trans) (-> self root-override trans)) + 1.0 + ) + *up-vector* + ) + (-> self root-override quat) + ) + (let ((v1-10 (-> self shakers))) + (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) + (set! (-> v1-10 0 start-time) (-> self clock frame-counter)) + (set! (-> v1-10 0 decay-time) 300.0) + (set! (-> v1-10 0 freq) 150.0) + (set! (-> v1-10 0 amplitude) 1820.4445) + (set! (-> v1-10 0 y-amplitude) 0.0) + ) + (let ((a0-17 (-> self node-list data 6))) + (set! (-> a0-17 param0) farm-marrow-callback) + (set! (-> a0-17 param1) self) + (set! (-> a0-17 param2) (the-as basic 0)) + ) + (let ((v1-13 (-> self shakers 1))) + (set! (-> v1-13 axis quad) (-> gp-4 quad)) + (set! (-> v1-13 start-time) (+ (-> self clock frame-counter) (seconds -0.06))) + (set! (-> v1-13 decay-time) 450.0) + (set! (-> v1-13 freq) 150.0) + (set! (-> v1-13 amplitude) 1820.4445) + (set! (-> v1-13 y-amplitude) 0.0) + ) + (let ((v1-15 (-> self node-list data 7))) + (set! (-> v1-15 param0) farm-marrow-callback) + (set! (-> v1-15 param1) self) + (set! (-> v1-15 param2) (the-as basic 1)) + ) + (let ((v1-16 (-> self shakers 2))) + (set! (-> v1-16 axis quad) (-> gp-4 quad)) + (set! (-> v1-16 start-time) (+ (-> self clock frame-counter) (seconds -0.12))) + (set! (-> v1-16 decay-time) 600.0) + (set! (-> v1-16 freq) 150.0) + (set! (-> v1-16 amplitude) 1820.4445) + (set! (-> v1-16 y-amplitude) 0.0) + ) + (let ((v1-18 (-> self node-list data 8))) + (set! (-> v1-18 param0) farm-marrow-callback) + (set! (-> v1-18 param1) self) + (set! (-> v1-18 param2) (the-as basic 2)) + ) + (let ((v1-19 (-> self shakers 3))) + (set! (-> v1-19 axis quad) (-> gp-4 quad)) + (set! (-> v1-19 start-time) (+ (-> self clock frame-counter) (seconds -0.06))) + (set! (-> v1-19 decay-time) 300.0) + (set! (-> v1-19 freq) 150.0) + (set! (-> v1-19 amplitude) 910.2222) + (set! (-> v1-19 y-decay-time) 300.0) + (set! (-> v1-19 y-freq) 150.0) + (set! (-> v1-19 y-amplitude) -1820.4445) + ) + (let ((v1-21 (-> self node-list data 4))) + (set! (-> v1-21 param0) farm-marrow-callback) + (set! (-> v1-21 param1) self) + (set! (-> v1-21 param2) (the-as basic 3)) + ) + (let ((v1-22 (-> self shakers 4))) + (set! (-> v1-22 axis quad) (-> gp-4 quad)) + (set! (-> v1-22 start-time) (+ (-> self clock frame-counter) (seconds -0.12))) + (set! (-> v1-22 decay-time) 600.0) + (set! (-> v1-22 freq) 150.0) + (set! (-> v1-22 amplitude) 910.2222) + (set! (-> v1-22 y-amplitude) 0.0) + ) + ) + (let ((v0-0 (the-as object (-> self node-list data 5)))) + (set! (-> (the-as cspace v0-0) param0) farm-marrow-callback) + (set! (-> (the-as cspace v0-0) param1) self) + (set! (-> (the-as cspace v0-0) param2) (the-as basic 4)) + v0-0 + ) + ) + (else + (sound-play "veggie-burst") + (let ((gp-6 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-6 fountain-rand-transv-lo quad) (-> s5-0 root-override trans quad)) + (set! (-> gp-6 fountain-rand-transv-hi x) 4096.0) + (set! (-> gp-6 fountain-rand-transv-hi y) 122880.0) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1025) + 300 + #f + #f + #f + (-> self node-list data 3 bone transform) + :to self + ) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-farm-marrow-explode" (the-as (pointer uint32) #f)) + 5 + gp-6 + *farm-marrow-exploder-params* + :to self + ) + ) + (go-virtual die) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :exit (behavior () + '() + (none) + ) + :code (the-as (function none :behavior farm-marrow) sleep-code) + :post (behavior () + (dotimes (gp-0 5) + (shaker-method-9 (-> self shakers gp-0)) + ) + (transform-post) + (none) + ) + ) + +;; definition for method 29 of type farm-marrow +;; WARN: Return type mismatch int vs none. +(defmethod farm-marrow-method-29 farm-marrow ((obj farm-marrow)) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 9830.4 0.0 16384.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; definition for method 30 of type farm-marrow +;; WARN: Return type mismatch int vs none. +(defmethod farm-marrow-method-30 farm-marrow ((obj farm-marrow)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; definition for method 11 of type farm-marrow +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! farm-marrow ((obj farm-marrow) (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" + (farm-marrow-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-marrow" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (farm-marrow-method-30 obj) + (quaternion-vector-angle! + (-> obj root-override quat) + *up-vector* + (* 182.04445 (rand-vu-float-range 0.0 360.0)) + ) + (let ((f0-2 (rand-vu-float-range 0.9 1.1))) + (set-vector! (-> obj root-override scale) f0-2 f0-2 f0-2 1.0) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-farm-beetree farm-beetree farm-beetree-lod0-jg farm-beetree-idle-ja + ((farm-beetree-lod0-mg (meters 999999))) + :bounds (static-spherem 0 4 0 7) + ) + +;; failed to figure out what this is: +(defskelgroup skel-farm-beetree-explode farm-beetree farm-beetree-explode-lod0-jg farm-beetree-explode-idle-ja + ((farm-beetree-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +;; definition for symbol *farm-beetree-exploder-params*, type joint-exploder-static-params +(define *farm-beetree-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 3 :parent-joint-index -1) + (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) + ) + :collide-spec #x1 + ) + ) + +;; definition of type farm-beetree +(deftype farm-beetree (process-focusable) + ((shakers shaker 2 :inline :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 336) + ) + :heap-base #xe0 + :method-count-assert 31 + :size-assert #x154 + :flag-assert #x1f00e00154 + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (farm-beetree-method-29 (_type_) none 29) + (farm-beetree-method-30 (_type_) none 30) + ) + ) + +;; definition for method 3 of type farm-beetree +(defmethod inspect farm-beetree ((obj farm-beetree)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (format #t "~2Tshakers[2] @ #x~X~%" (-> obj shakers)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) + (label cfg-4) + obj + ) + +;; definition for function farm-beetree-callback +;; WARN: Return type mismatch int vs none. +(defun farm-beetree-callback ((arg0 cspace) (arg1 transformq)) + (with-pp + (let ((s4-0 (the-as farm-beetree (-> arg0 param1))) + (s3-0 (the-as int (-> arg0 param2))) + ) + (quaternion*! (-> arg1 quat) (-> arg1 quat) (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + (the-as vector (-> s4-0 shakers s3-0)) + (-> s4-0 shakers s3-0 shake) + ) + ) + (quaternion-rotate-local-y! (-> arg1 quat) (-> arg1 quat) (-> s4-0 shakers s3-0 y-shake)) + (if (< (the int (-> s4-0 shakers s3-0 decay-time)) + (- (-> pp clock frame-counter) (-> s4-0 shakers s3-0 start-time)) + ) + (set! (-> arg0 param0) #f) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die (farm-beetree) + :virtual #t + :enter (the-as (function none :behavior farm-beetree) #f) + :exit (the-as (function none :behavior farm-beetree) #f) + :trans (the-as (function none :behavior farm-beetree) #f) + :code (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior farm-beetree) #f) + ) + +;; failed to figure out what this is: +(defstate idle (farm-beetree) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (let ((a1-1 (the-as object (-> event param 1))) + (a0-2 proc) + ) + (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info a1-1) id)) + (when a0-2 + (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) + (when s5-0 + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (cond + ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) + (sound-play "hit-veggies") + (let ((gp-4 (new 'stack-no-clear 'vector))) + (vector-inv-orient-by-quat! + gp-4 + (vector-cross! + (new 'stack-no-clear 'vector) + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (-> s5-0 root-override trans) (-> self root-override trans)) + 1.0 + ) + *up-vector* + ) + (-> self root-override quat) + ) + (let ((v1-10 (-> self shakers))) + (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) + (set! (-> v1-10 0 start-time) (-> self clock frame-counter)) + (set! (-> v1-10 0 decay-time) 300.0) + (set! (-> v1-10 0 freq) 150.0) + (set! (-> v1-10 0 amplitude) 1820.4445) + (set! (-> v1-10 0 y-amplitude) 0.0) + ) + (let ((a0-17 (-> self node-list data 4))) + (set! (-> a0-17 param0) farm-beetree-callback) + (set! (-> a0-17 param1) self) + (set! (-> a0-17 param2) (the-as basic 0)) + ) + (let ((v1-13 (-> self shakers 1))) + (set! (-> v1-13 axis quad) (-> gp-4 quad)) + (set! (-> v1-13 start-time) (+ (-> self clock frame-counter) (seconds -0.06))) + (set! (-> v1-13 decay-time) 600.0) + (set! (-> v1-13 freq) 150.0) + (set! (-> v1-13 amplitude) 364.0889) + (set! (-> v1-13 y-decay-time) 450.0) + (set! (-> v1-13 y-freq) 150.0) + (set! (-> v1-13 y-amplitude) 3640.889) + ) + ) + (let ((v0-0 (the-as object (-> self node-list data 5)))) + (set! (-> (the-as cspace v0-0) param0) farm-beetree-callback) + (set! (-> (the-as cspace v0-0) param1) self) + (set! (-> (the-as cspace v0-0) param2) (the-as basic 1)) + v0-0 + ) + ) + (else + (sound-play "veggie-burst") + (let ((gp-6 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-6 fountain-rand-transv-lo quad) (-> s5-0 root-override trans quad)) + (set! (-> gp-6 fountain-rand-transv-hi x) 4096.0) + (set! (-> gp-6 fountain-rand-transv-hi y) 122880.0) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1026) + 300 + #f + #f + #f + (-> self node-list data 3 bone transform) + :to self + ) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-farm-beetree-explode" (the-as (pointer uint32) #f)) + 5 + gp-6 + *farm-beetree-exploder-params* + :to self + ) + ) + (go-virtual die) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :exit (the-as (function none :behavior farm-beetree) #f) + :code (the-as (function none :behavior farm-beetree) sleep-code) + :post (behavior () + (dotimes (gp-0 2) + (shaker-method-9 (-> self shakers gp-0)) + ) + (transform-post) + (none) + ) + ) + +;; definition for method 29 of type farm-beetree +;; WARN: Return type mismatch int vs none. +(defmethod farm-beetree-method-29 farm-beetree ((obj farm-beetree)) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 16384.0 0.0 28672.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; definition for method 30 of type farm-beetree +;; WARN: Return type mismatch int vs none. +(defmethod farm-beetree-method-30 farm-beetree ((obj farm-beetree)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; definition for method 11 of type farm-beetree +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! farm-beetree ((obj farm-beetree) (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" + (farm-beetree-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-beetree" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (farm-beetree-method-30 obj) + (quaternion-vector-angle! + (-> obj root-override quat) + *up-vector* + (* 182.04445 (rand-vu-float-range 0.0 360.0)) + ) + (let ((f0-2 (rand-vu-float-range 0.9 1.1))) + (set-vector! (-> obj root-override scale) f0-2 f0-2 f0-2 1.0) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-farm-cabbage farm-cabbage farm-cabbage-lod0-jg farm-cabbage-idle-ja + ((farm-cabbage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +;; failed to figure out what this is: +(defskelgroup skel-farm-cabbage-explode farm-cabbage farm-cabbage-explode-lod0-jg farm-cabbage-explode-idle-ja + ((farm-cabbage-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +;; definition for symbol *farm-cabbage-exploder-params*, type joint-exploder-static-params +(define *farm-cabbage-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 3 :parent-joint-index -1) + (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) + ) + :collide-spec #x1 + ) + ) + +;; definition of type farm-cabbage +(deftype farm-cabbage (process-focusable) + ((shakers shaker 2 :inline :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 336) + ) + :heap-base #xe0 + :method-count-assert 31 + :size-assert #x154 + :flag-assert #x1f00e00154 + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (farm-cabbage-method-29 (_type_) none 29) + (farm-cabbage-method-30 (_type_) none 30) + ) + ) + +;; definition for method 3 of type farm-cabbage +(defmethod inspect farm-cabbage ((obj farm-cabbage)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (format #t "~2Tshakers[2] @ #x~X~%" (-> obj shakers)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) + (label cfg-4) + obj + ) + +;; definition for function farm-cabbage-callback +;; WARN: Return type mismatch int vs none. +(defun farm-cabbage-callback ((arg0 cspace) (arg1 transformq)) + (with-pp + (let ((s4-0 (the-as farm-cabbage (-> arg0 param1))) + (s3-0 (the-as int (-> arg0 param2))) + ) + (quaternion*! (-> arg1 quat) (-> arg1 quat) (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + (the-as vector (-> s4-0 shakers s3-0)) + (-> s4-0 shakers s3-0 shake) + ) + ) + (quaternion-rotate-local-y! (-> arg1 quat) (-> arg1 quat) (-> s4-0 shakers s3-0 y-shake)) + (if (< (the int (-> s4-0 shakers s3-0 decay-time)) + (- (-> pp clock frame-counter) (-> s4-0 shakers s3-0 start-time)) + ) + (set! (-> arg0 param0) #f) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die (farm-cabbage) + :virtual #t + :enter (the-as (function none :behavior farm-cabbage) #f) + :exit (the-as (function none :behavior farm-cabbage) #f) + :trans (the-as (function none :behavior farm-cabbage) #f) + :code (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior farm-cabbage) #f) + ) + +;; failed to figure out what this is: +(defstate idle (farm-cabbage) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (let ((a1-1 (the-as object (-> event param 1))) + (a0-2 proc) + ) + (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info a1-1) id)) + (when a0-2 + (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) + (when s5-0 + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (cond + ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) + (sound-play "hit-veggies") + (let ((gp-4 (new 'stack-no-clear 'vector))) + (vector-inv-orient-by-quat! + gp-4 + (vector-cross! + (new 'stack-no-clear 'vector) + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (-> s5-0 root-override trans) (-> self root-override trans)) + 1.0 + ) + *up-vector* + ) + (-> self root-override quat) + ) + (let ((v1-10 (-> self shakers))) + (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) + (set! (-> v1-10 0 start-time) (-> self clock frame-counter)) + (set! (-> v1-10 0 decay-time) 300.0) + (set! (-> v1-10 0 freq) 150.0) + (set! (-> v1-10 0 amplitude) 1820.4445) + (set! (-> v1-10 0 y-amplitude) 0.0) + ) + (let ((a0-17 (-> self node-list data 4))) + (set! (-> a0-17 param0) farm-cabbage-callback) + (set! (-> a0-17 param1) self) + (set! (-> a0-17 param2) (the-as basic 0)) + ) + (let ((v1-13 (-> self shakers 1))) + (set! (-> v1-13 axis quad) (-> gp-4 quad)) + (set! (-> v1-13 start-time) (+ (-> self clock frame-counter) (seconds -0.06))) + (set! (-> v1-13 decay-time) 600.0) + (set! (-> v1-13 freq) 150.0) + (set! (-> v1-13 amplitude) 364.0889) + (set! (-> v1-13 y-decay-time) 450.0) + (set! (-> v1-13 y-freq) 150.0) + (set! (-> v1-13 y-amplitude) 910.2222) + ) + ) + (let ((v0-0 (the-as object (-> self node-list data 5)))) + (set! (-> (the-as cspace v0-0) param0) farm-cabbage-callback) + (set! (-> (the-as cspace v0-0) param1) self) + (set! (-> (the-as cspace v0-0) param2) (the-as basic 1)) + v0-0 + ) + ) + (else + (sound-play "veggie-burst") + (let ((gp-6 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-6 fountain-rand-transv-lo quad) (-> s5-0 root-override trans quad)) + (set! (-> gp-6 fountain-rand-transv-hi x) 40960.0) + (set! (-> gp-6 fountain-rand-transv-hi y) 122880.0) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1027) + 300 + #f + #f + #f + (-> self node-list data 3 bone transform) + :to self + ) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-farm-cabbage-explode" (the-as (pointer uint32) #f)) + 5 + gp-6 + *farm-cabbage-exploder-params* + :to self + ) + ) + (go-virtual die) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :exit (the-as (function none :behavior farm-cabbage) #f) + :code (the-as (function none :behavior farm-cabbage) sleep-code) + :post (behavior () + (dotimes (gp-0 2) + (shaker-method-9 (-> self shakers gp-0)) + ) + (transform-post) + (none) + ) + ) + +;; definition for method 29 of type farm-cabbage +;; WARN: Return type mismatch int vs none. +(defmethod farm-cabbage-method-29 farm-cabbage ((obj farm-cabbage)) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 4) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; definition for method 30 of type farm-cabbage +;; WARN: Return type mismatch int vs none. +(defmethod farm-cabbage-method-30 farm-cabbage ((obj farm-cabbage)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; definition for method 11 of type farm-cabbage +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! farm-cabbage ((obj farm-cabbage) (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" + (farm-cabbage-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-cabbage" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (farm-cabbage-method-30 obj) + (quaternion-vector-angle! + (-> obj root-override quat) + *up-vector* + (* 182.04445 (rand-vu-float-range 0.0 360.0)) + ) + (let ((f0-2 (rand-vu-float-range 0.9 1.1))) + (set-vector! (-> obj root-override scale) f0-2 f0-2 f0-2 1.0) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-farm-small-cabbage farm-small-cabbage farm-small-cabbage-lod0-jg farm-small-cabbage-idle-ja + ((farm-small-cabbage-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.5) + ) + +;; failed to figure out what this is: +(defskelgroup skel-farm-small-cabbage-explode farm-small-cabbage farm-small-cabbage-explode-lod0-jg farm-small-cabbage-explode-idle-ja + ((farm-small-cabbage-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +;; definition for symbol *farm-small-cabbage-exploder-params*, type joint-exploder-static-params +(define *farm-small-cabbage-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 3 :parent-joint-index -1) + (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) + ) + :collide-spec #x1 + ) + ) + +;; definition of type farm-small-cabbage +(deftype farm-small-cabbage (process-focusable) + ((shakers shaker 1 :inline :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 272) + ) + :heap-base #xa0 + :method-count-assert 31 + :size-assert #x114 + :flag-assert #x1f00a00114 + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (farm-small-cabbage-method-29 (_type_) none 29) + (farm-small-cabbage-method-30 (_type_) none 30) + ) + ) + +;; definition for method 3 of type farm-small-cabbage +(defmethod inspect farm-small-cabbage ((obj farm-small-cabbage)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (format #t "~2Tshakers[1] @ #x~X~%" (-> obj shakers)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) + (label cfg-4) + obj + ) + +;; definition for function farm-small-cabbage-callback +;; WARN: Return type mismatch int vs none. +(defun farm-small-cabbage-callback ((arg0 cspace) (arg1 transformq)) + (with-pp + (let ((s4-0 (the-as farm-small-cabbage (-> arg0 param1))) + (s3-0 (the-as int (-> arg0 param2))) + ) + (quaternion*! (-> arg1 quat) (-> arg1 quat) (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + (the-as vector (-> s4-0 shakers s3-0)) + (-> s4-0 shakers s3-0 shake) + ) + ) + (quaternion-rotate-local-y! (-> arg1 quat) (-> arg1 quat) (-> s4-0 shakers s3-0 y-shake)) + (if (< (the int (-> s4-0 shakers s3-0 decay-time)) + (- (-> pp clock frame-counter) (-> s4-0 shakers s3-0 start-time)) + ) + (set! (-> arg0 param0) #f) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die (farm-small-cabbage) + :virtual #t + :enter (the-as (function none :behavior farm-small-cabbage) #f) + :exit (the-as (function none :behavior farm-small-cabbage) #f) + :trans (the-as (function none :behavior farm-small-cabbage) #f) + :code (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior farm-small-cabbage) #f) + ) + +;; failed to figure out what this is: +(defstate idle (farm-small-cabbage) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (let ((a1-1 (the-as object (-> event param 1))) + (a0-2 proc) + ) + (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info a1-1) id)) + (when a0-2 + (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) + (when s5-0 + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (cond + ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) + (sound-play "hit-veggies") + (let ((gp-4 (new 'stack-no-clear 'vector))) + (vector-inv-orient-by-quat! + gp-4 + (vector-cross! + (new 'stack-no-clear 'vector) + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (-> s5-0 root-override trans) (-> self root-override trans)) + 1.0 + ) + *up-vector* + ) + (-> self root-override quat) + ) + (let ((v1-10 (-> self shakers))) + (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) + (set! (-> v1-10 0 start-time) (-> self clock frame-counter)) + (set! (-> v1-10 0 decay-time) 300.0) + (set! (-> v1-10 0 freq) 150.0) + (set! (-> v1-10 0 amplitude) 910.2222) + (set! (-> v1-10 0 y-amplitude) 0.0) + ) + ) + (let ((v0-0 (the-as object (-> self node-list data 4)))) + (set! (-> (the-as cspace v0-0) param0) farm-small-cabbage-callback) + (set! (-> (the-as cspace v0-0) param1) self) + (set! (-> (the-as cspace v0-0) param2) (the-as basic 0)) + v0-0 + ) + ) + (else + (sound-play "veggie-burst") + (let ((gp-6 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-6 fountain-rand-transv-lo quad) (-> s5-0 root-override trans quad)) + (set! (-> gp-6 fountain-rand-transv-hi x) 4096.0) + (set! (-> gp-6 fountain-rand-transv-hi y) 122880.0) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1028) + 300 + #f + #f + #f + (-> self node-list data 3 bone transform) + :to self + ) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-farm-small-cabbage-explode" (the-as (pointer uint32) #f)) + 5 + gp-6 + *farm-small-cabbage-exploder-params* + :to self + ) + ) + (go-virtual die) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :exit (the-as (function none :behavior farm-small-cabbage) #f) + :code (the-as (function none :behavior farm-small-cabbage) sleep-code) + :post (behavior () + (dotimes (gp-0 1) + (shaker-method-9 (-> self shakers gp-0)) + ) + (transform-post) + (none) + ) + ) + +;; definition for method 29 of type farm-small-cabbage +;; WARN: Return type mismatch int vs none. +(defmethod farm-small-cabbage-method-29 farm-small-cabbage ((obj farm-small-cabbage)) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 4) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 10240.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; definition for method 30 of type farm-small-cabbage +;; WARN: Return type mismatch int vs none. +(defmethod farm-small-cabbage-method-30 farm-small-cabbage ((obj farm-small-cabbage)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; definition for method 11 of type farm-small-cabbage +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! farm-small-cabbage ((obj farm-small-cabbage) (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" + (farm-small-cabbage-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-small-cabbage" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (farm-small-cabbage-method-30 obj) + (quaternion-vector-angle! + (-> obj root-override quat) + *up-vector* + (* 182.04445 (rand-vu-float-range 0.0 360.0)) + ) + (let ((f0-2 (rand-vu-float-range 0.9 1.1))) + (set-vector! (-> obj root-override scale) f0-2 f0-2 f0-2 1.0) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-farm-chilirots farm-chilirots farm-chilirots-lod0-jg farm-chilirots-idle-ja + ((farm-chilirots-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 4.5) + ) + +;; failed to figure out what this is: +(defskelgroup skel-farm-chilirots-explode farm-chilirots farm-chilirots-explode-lod0-jg farm-chilirots-explode-idle-ja + ((farm-chilirots-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +;; definition for symbol *farm-chilirots-exploder-params*, type joint-exploder-static-params +(define *farm-chilirots-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 3 :parent-joint-index -1) + (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) + ) + :collide-spec #x1 + ) + ) + +;; definition of type farm-chilirots +(deftype farm-chilirots (process-focusable) + ((shakers shaker 4 :inline :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 464) + ) + :heap-base #x160 + :method-count-assert 31 + :size-assert #x1d4 + :flag-assert #x1f016001d4 + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (farm-chilirots-method-29 (_type_) none 29) + (farm-chilirots-method-30 (_type_) none 30) + ) + ) + +;; definition for method 3 of type farm-chilirots +(defmethod inspect farm-chilirots ((obj farm-chilirots)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (format #t "~2Tshakers[4] @ #x~X~%" (-> obj shakers)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) + (label cfg-4) + obj + ) + +;; definition for function farm-chilirots-callback +;; WARN: Return type mismatch int vs none. +(defun farm-chilirots-callback ((arg0 cspace) (arg1 transformq)) + (with-pp + (let ((s4-0 (the-as farm-chilirots (-> arg0 param1))) + (s3-0 (the-as int (-> arg0 param2))) + ) + (quaternion*! (-> arg1 quat) (-> arg1 quat) (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + (the-as vector (-> s4-0 shakers s3-0)) + (-> s4-0 shakers s3-0 shake) + ) + ) + (quaternion-rotate-local-y! (-> arg1 quat) (-> arg1 quat) (-> s4-0 shakers s3-0 y-shake)) + (if (< (the int (-> s4-0 shakers s3-0 decay-time)) + (- (-> pp clock frame-counter) (-> s4-0 shakers s3-0 start-time)) + ) + (set! (-> arg0 param0) #f) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die (farm-chilirots) + :virtual #t + :enter (the-as (function none :behavior farm-chilirots) #f) + :exit (the-as (function none :behavior farm-chilirots) #f) + :trans (the-as (function none :behavior farm-chilirots) #f) + :code (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior farm-chilirots) #f) + ) + +;; failed to figure out what this is: +(defstate idle (farm-chilirots) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (let ((a1-1 (the-as object (-> event param 1))) + (a0-2 proc) + ) + (when (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info a1-1) id)) + (when a0-2 + (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) + (when s5-0 + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) event))) + (cond + ((and (not (logtest? (penetrate dark-skin) a0-4)) (zero? (pu->knocked-type a0-4))) + (sound-play "hit-veggies") + (let ((gp-4 (new 'stack-no-clear 'vector))) + (vector-inv-orient-by-quat! + gp-4 + (vector-cross! + (new 'stack-no-clear 'vector) + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (-> s5-0 root-override trans) (-> self root-override trans)) + 1.0 + ) + *up-vector* + ) + (-> self root-override quat) + ) + (let ((v1-10 (-> self shakers))) + (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) + (set! (-> v1-10 0 start-time) (-> self clock frame-counter)) + (set! (-> v1-10 0 decay-time) 300.0) + (set! (-> v1-10 0 freq) 150.0) + (set! (-> v1-10 0 amplitude) 1820.4445) + (set! (-> v1-10 0 y-amplitude) 0.0) + ) + (let ((a0-17 (-> self node-list data 4))) + (set! (-> a0-17 param0) farm-chilirots-callback) + (set! (-> a0-17 param1) self) + (set! (-> a0-17 param2) (the-as basic 0)) + ) + (let ((v1-13 (-> self shakers 1))) + (set! (-> v1-13 axis quad) (-> gp-4 quad)) + (set! (-> v1-13 start-time) (+ (-> self clock frame-counter) (seconds -0.06))) + (set! (-> v1-13 decay-time) 450.0) + (set! (-> v1-13 freq) 150.0) + (set! (-> v1-13 amplitude) 1820.4445) + (set! (-> v1-13 y-decay-time) 450.0) + (set! (-> v1-13 y-freq) 150.0) + (set! (-> v1-13 y-amplitude) 1820.4445) + ) + (let ((v1-15 (-> self node-list data 5))) + (set! (-> v1-15 param0) farm-chilirots-callback) + (set! (-> v1-15 param1) self) + (set! (-> v1-15 param2) (the-as basic 1)) + ) + (let ((v1-16 (-> self shakers 2))) + (set! (-> v1-16 axis quad) (-> gp-4 quad)) + (set! (-> v1-16 start-time) (+ (-> self clock frame-counter) (seconds -0.12))) + (set! (-> v1-16 decay-time) 600.0) + (set! (-> v1-16 freq) 150.0) + (set! (-> v1-16 amplitude) 1820.4445) + (set! (-> v1-16 y-decay-time) 450.0) + (set! (-> v1-16 y-freq) 150.0) + (set! (-> v1-16 y-amplitude) 1820.4445) + ) + (let ((v1-18 (-> self node-list data 6))) + (set! (-> v1-18 param0) farm-chilirots-callback) + (set! (-> v1-18 param1) self) + (set! (-> v1-18 param2) (the-as basic 2)) + ) + (let ((v1-19 (-> self shakers 3))) + (set! (-> v1-19 axis quad) (-> gp-4 quad)) + (set! (-> v1-19 start-time) (+ (-> self clock frame-counter) (seconds -0.18))) + (set! (-> v1-19 decay-time) 750.0) + (set! (-> v1-19 freq) 150.0) + (set! (-> v1-19 amplitude) 1820.4445) + (set! (-> v1-19 y-decay-time) 450.0) + (set! (-> v1-19 y-freq) 150.0) + (set! (-> v1-19 y-amplitude) 1820.4445) + ) + ) + (let ((v0-0 (the-as object (-> self node-list data 7)))) + (set! (-> (the-as cspace v0-0) param0) farm-chilirots-callback) + (set! (-> (the-as cspace v0-0) param1) self) + (set! (-> (the-as cspace v0-0) param2) (the-as basic 3)) + v0-0 + ) + ) + (else + (sound-play "veggie-burst") + (let ((gp-6 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-6 fountain-rand-transv-lo quad) (-> s5-0 root-override trans quad)) + (set! (-> gp-6 fountain-rand-transv-hi x) 4096.0) + (set! (-> gp-6 fountain-rand-transv-hi y) 122880.0) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 1029) + 300 + #f + #f + #f + (-> self node-list data 3 bone transform) + :to self + ) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-farm-chilirots-explode" (the-as (pointer uint32) #f)) + 5 + gp-6 + *farm-chilirots-exploder-params* + :to self + ) + ) + (go-virtual die) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :code (the-as (function none :behavior farm-chilirots) sleep-code) + :post (behavior () + (dotimes (gp-0 4) + (shaker-method-9 (-> self shakers gp-0)) + ) + (transform-post) + (none) + ) + ) + +;; definition for method 29 of type farm-chilirots +;; WARN: Return type mismatch int vs none. +(defmethod farm-chilirots-method-29 farm-chilirots ((obj farm-chilirots)) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 8192.0 0.0 18432.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; definition for method 30 of type farm-chilirots +;; WARN: Return type mismatch int vs none. +(defmethod farm-chilirots-method-30 farm-chilirots ((obj farm-chilirots)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; definition for method 11 of type farm-chilirots +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! farm-chilirots ((obj farm-chilirots) (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" + (farm-chilirots-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-chilirots" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (farm-chilirots-method-30 obj) + (quaternion-vector-angle! + (-> obj root-override quat) + *up-vector* + (* 182.04445 (rand-vu-float-range 0.0 360.0)) + ) + (let ((f0-2 (rand-vu-float-range 0.9 1.1))) + (set-vector! (-> obj root-override scale) f0-2 f0-2 f0-2 1.0) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-farm-sprinkler-barrels farm-sprinkler-barrels farm-sprinkler-barrels-lod0-jg farm-sprinkler-barrels-idle-ja + ((farm-sprinkler-barrels-lod0-mg (meters 999999))) + :bounds (static-spherem 0 8 3 4) + ) + +;; definition of type farm-sprinkler-barrels +(deftype farm-sprinkler-barrels (process-focusable) + () + :heap-base #x50 + :method-count-assert 30 + :size-assert #xcc + :flag-assert #x1e005000cc + (:methods + (idle () _type_ :state 27) + (farm-sprinkler-barrels-method-28 (_type_) none 28) + (farm-sprinkler-barrels-method-29 (_type_) none 29) + ) + ) + +;; definition for method 3 of type farm-sprinkler-barrels +(defmethod inspect farm-sprinkler-barrels ((obj farm-sprinkler-barrels)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defstate idle (farm-sprinkler-barrels) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (-> self draw art-group data 2) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (behavior () + (transform-post) + (none) + ) + ) + +;; definition for method 28 of type farm-sprinkler-barrels +;; WARN: Return type mismatch int vs none. +(defmethod farm-sprinkler-barrels-method-28 farm-sprinkler-barrels ((obj farm-sprinkler-barrels)) + (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 crate camera-blocker)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> s4-0 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> s4-0 local-sphere) -12288.0 32768.0 0.0 20480.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-12 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-12 transform-index) 5) + (set-vector! (-> v1-12 local-sphere) 0.0 6144.0 4096.0 12288.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 6144.0 4096.0 12288.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; definition for method 29 of type farm-sprinkler-barrels +;; WARN: Return type mismatch int vs none. +(defmethod farm-sprinkler-barrels-method-29 farm-sprinkler-barrels ((obj farm-sprinkler-barrels)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; definition for method 11 of type farm-sprinkler-barrels +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! farm-sprinkler-barrels ((obj farm-sprinkler-barrels) (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" + (farm-sprinkler-barrels-method-28 obj) + (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-farm-sprinkler-barrels" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (farm-sprinkler-barrels-method-29 obj) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +;; definition for function farm-activate +;; WARN: Return type mismatch int vs none. +(defun farm-activate ((arg0 level)) + (let* ((v1-0 (-> arg0 name)) + (s5-0 (cond + ((= v1-0 'ctyfarma) + (new 'static 'boxed-array :type int32 5 0 0 -1368390400 -1368390656 -1368390912) + ) + ((= v1-0 'ctyfarmb) + (new 'static 'boxed-array :type int32 5 0 0 -1145043712 -1145043968 -1145044224) + ) + ) + ) + (v1-1 (-> arg0 name)) + (gp-0 (cond + ((= v1-1 'ctyfarma) + (new 'static 'boxed-array :type int32 5 0 0 -1368391424 -1368391168) + ) + ((= v1-1 'ctyfarmb) + (new 'static 'boxed-array :type int32 5 0 0 -1145044736 -1145044480) + ) + ) + ) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 4463) (sp-field-id spt-userdata)) initial-valuef) + (the-as float s5-0) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 4462) (sp-field-id spt-userdata)) initial-valuef) + (the-as float s5-0) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 4483) (sp-field-id spt-userdata)) initial-valuef) + (the-as float gp-0) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 4482) (sp-field-id spt-userdata)) initial-valuef) + (the-as float gp-0) + ) + ) + (setup-user-array (-> *part-id-table* 4463) "ctyfarm-eggplant-body") + (setup-user-array (-> *part-id-table* 4462) "ctyfarm-eggplant-body") + (setup-user-array (-> *part-id-table* 4475) "ctyfarm-chili-stem") + (setup-user-array (-> *part-id-table* 4474) "ctyfarm-chili-stem") + (setup-user-array (-> *part-id-table* 4477) "ctyfarm-cab-body") + (setup-user-array (-> *part-id-table* 4476) "ctyfarm-cab-body") + (setup-user-array (-> *part-id-table* 4470) "ctyfarm-cab-body") + (setup-user-array (-> *part-id-table* 4483) "ctyfarm-chili-stem") + (setup-user-array (-> *part-id-table* 4482) "ctyfarm-chili-stem") + 0 + (none) + ) diff --git a/test/decompiler/reference/jak2/levels/city/misc/delivery/delivery-task_REF.gc b/test/decompiler/reference/jak2/levels/city/misc/delivery/delivery-task_REF.gc new file mode 100644 index 0000000000..8a2fc1eb43 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/city/misc/delivery/delivery-task_REF.gc @@ -0,0 +1,573 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-krew-package krew-package krew-package-lod0-jg krew-package-idle-ja + ((krew-package-lod0-mg (meters 20)) (krew-package-lod1-mg (meters 40)) (krew-package-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.6) + ) + +;; definition of type krew-package +(deftype krew-package (process-drawable) + ((attach-object handle :offset-assert 200) + (scale float :offset-assert 208) + ) + :heap-base #x60 + :method-count-assert 24 + :size-assert #xd4 + :flag-assert #x18006000d4 + (:methods + (idle () _type_ :state 20) + (die () _type_ :state 21) + (krew-package-method-22 (_type_) none 22) + (krew-package-method-23 (_type_) none 23) + ) + ) + +;; definition for method 3 of type krew-package +(defmethod inspect krew-package ((obj krew-package)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tattach-object: ~D~%" (-> obj attach-object)) + (format #t "~2Tscale: ~f~%" (-> obj scale)) + (label cfg-4) + obj + ) + +;; definition for method 22 of type krew-package +;; WARN: Return type mismatch int vs none. +(defmethod krew-package-method-22 krew-package ((obj krew-package)) + (set! (-> obj root) (new 'process 'trsqv)) + 0 + (none) + ) + +;; definition for method 23 of type krew-package +;; WARN: Return type mismatch int vs none. +(defmethod krew-package-method-23 krew-package ((obj krew-package)) + (with-pp + (set! (-> pp level) (level-get *level* 'lpackage)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-krew-package" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj scale) 1.0) + (set! (-> obj draw lod-set lod 0 dist) 81920.0) + (set! (-> obj draw lod-set lod 1 dist) 204800.0) + (set! (-> obj draw lod-set lod 1 dist) 327680.0) + (logior! (-> obj skel status) (joint-control-status sync-math)) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate idle (krew-package) + :virtual #t + :code (the-as (function none :behavior krew-package) sleep-code) + :post (behavior () + (let ((gp-0 (handle->process (-> self attach-object)))) + (cond + (gp-0 + (when (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status dead)) + (seek! (-> self scale) 0.0 (* 0.5 (-> self clock seconds-per-frame))) + (if (= (-> self scale) 0.0) + (go-virtual die) + ) + ) + (set! (-> self draw color-mult quad) (-> (the-as process-focusable gp-0) draw color-mult quad)) + (set! (-> self root trans quad) (-> (the-as process-focusable gp-0) root-override trans quad)) + (quaternion-copy! (-> self root quat) (-> (the-as process-focusable gp-0) root-override quat)) + ) + (else + ) + ) + ) + (let ((f0-5 (-> self scale))) + (set-vector! (-> self root scale) f0-5 f0-5 f0-5 1.0) + ) + (ja-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die (krew-package) + :virtual #t + :code (behavior () + (cleanup-for-death self) + (none) + ) + ) + +;; definition for method 11 of type krew-package +;; WARN: Return type mismatch entity-perm-status vs none. +(defmethod init-from-entity! krew-package ((obj krew-package) (arg0 entity-actor)) + "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. +This commonly includes things such as: +- stack size +- collision information +- loading the skeleton group / bones +- sounds" + (process-entity-status! obj (entity-perm-status dead) #t) + (none) + ) + +;; definition for function krew-package-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior krew-package-init-by-other krew-package ((arg0 process-drawable)) + (stack-size-set! (-> self main-thread) 16) + (set! (-> self mask) (logior (process-mask platform) (-> self mask))) + (logclear! (-> self mask) (process-mask actor-pause movie)) + (krew-package-method-22 self) + (set! (-> self attach-object) (process->handle arg0)) + (set! (-> self root trans quad) (-> arg0 root trans quad)) + (quaternion-copy! (-> self root quat) (-> arg0 root quat)) + (krew-package-method-23 self) + (go-virtual idle) + (none) + ) + +;; definition for function krew-package-spawn +(defun krew-package-spawn ((arg0 process) (arg1 process)) + (process-spawn krew-package arg1 :to arg0) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 24 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (while (!= (level-status *level* 'ctysluma) 'active) + (suspend) + ) + (let ((v1-3 (entity-by-name "parking-spot-8"))) + (if v1-3 + (logior! (-> v1-3 extra perm status) (entity-perm-status bit-9)) + ) + ) + (set! (-> self end-pos quad) (-> (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) quad)) + (set-setting! 'minimap 'clear 0 32) + (let ((gp-1 *traffic-manager*)) + (let ((s5-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s5-0 position quad) (-> (new 'static 'vector :x 4698112.0 :y 45875.2 :z 81920.0 :w 1.0) quad)) + (quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 32768.0) + (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 gp-1 'spawn-object s5-0) + (when (-> s5-0 proc) + (set! (-> self slave 0) (process->handle (-> s5-0 proc))) + (let ((v1-20 (-> s5-0 proc))) + (set! (-> (the-as vehicle v1-20) damage-factor) 2.0) + ) + (let ((v1-22 (krew-package-spawn (-> s5-0 proc) (-> s5-0 proc)))) + (if v1-22 + (set! (-> self slave 1) (process->handle (-> v1-22 0))) + ) + ) + ) + (let ((s4-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> s4-0 pos quad) (-> s5-0 position quad)) + (quaternion-identity! (-> s4-0 quat)) + (set! (-> s4-0 flags) (task-arrow-flags task-arrow-flag-03)) + (set! (-> s4-0 map-icon) (the-as uint 15)) + (label cfg-21) + (let ((a0-30 (task-arrow-spawn s4-0 (the-as task-arrow self)))) + (when (not a0-30) + (format #t "waiting for task-arrow~%") + (suspend) + (goto cfg-21) + ) + (set! (-> self arrow) (process->handle a0-30)) + ) + ) + ) + (send-event gp-1 'set-target-level #x3f800000) + (send-event gp-1 'set-guard-target-count-range 4 0 1) + (send-event gp-1 'set-guard-target-count-range 5 0 0) + ) + (set! (-> self sub-state) (the-as uint -1)) + (set! (-> self data-int8 0) 0) + (set! (-> self data-int8 1) 0) + 0 + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 24 + 1 + (the-as + (function object) + (lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none)) + ) + ) + +;; definition for function delivery-task-setup-ambush-1 +(defun delivery-task-setup-ambush-1 () + (format #t "delivery-task-setup-ambush-1~%") + (let ((gp-0 + (new 'static 'city-ambush-info + :count 10 + :array (new 'static 'inline-array city-ambush-spot 10 + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4501504.0 :y 32768.0 :z 2297856.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4501504.0 :y 32768.0 :z 2322432.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4501504.0 :y 32768.0 :z 2347008.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4501504.0 :y 32768.0 :z 2371584.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4501504.0 :y 32768.0 :z 2396160.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4513792.0 :y 69632.0 :z 2306048.0 :w 1.0) + :obj-type #x13 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4513792.0 :y 69632.0 :z 2387968.0 :w 1.0) + :obj-type #x13 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4464640.0 :y 69632.0 :z 2285568.0 :w 1.0) + :obj-type #x12 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4464640.0 :y 69632.0 :z 2347008.0 :w 1.0) + :obj-type #x12 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 4464640.0 :y 69632.0 :z 2408448.0 :w 1.0) + :obj-type #x12 + ) + ) + ) + ) + (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 2)) + (set! (-> s5-0 guard-type) (the-as uint 1)) + (vector-reset! (-> s5-0 velocity)) + (forward-up-nopitch->quaternion + (-> s5-0 rotation) + (new 'static 'vector :x -1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + ) + (city-ambush-info-method-9 gp-0 s5-0) + ) + (none) + ) + +;; definition for function delivery-task-setup-ambush-2 +(defun delivery-task-setup-ambush-2 () + (format #t "delivery-task-setup-ambush-2~%") + (let ((gp-0 + (new 'static 'city-ambush-info + :count 10 + :array (new 'static 'inline-array city-ambush-spot 10 + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3325952.0 :y 32768.0 :z 4689920.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3342336.0 :y 32768.0 :z 4689920.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3358720.0 :y 32768.0 :z 4689920.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3375104.0 :y 32768.0 :z 4689920.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3391488.0 :y 32768.0 :z 4689920.0 :w 1.0) + :obj-type #x6 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3338240.0 :y 69632.0 :z 4689920.0 :w 1.0) + :obj-type #x13 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3383296.0 :y 69632.0 :z 4689920.0 :w 1.0) + :obj-type #x13 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3338240.0 :y 45056.0 :z 4722688.0 :w 1.0) + :obj-type #x12 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3358720.0 :y 45056.0 :z 4722688.0 :w 1.0) + :obj-type #x12 + ) + (new 'static 'city-ambush-spot + :pos (new 'static 'vector :x 3379200.0 :y 45056.0 :z 4722688.0 :w 1.0) + :obj-type #x12 + ) + ) + ) + ) + (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 2)) + (set! (-> s5-0 guard-type) (the-as uint 1)) + (vector-reset! (-> s5-0 velocity)) + (forward-up-nopitch->quaternion + (-> s5-0 rotation) + (new 'static 'vector :x -1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + ) + (city-ambush-info-method-9 gp-0 s5-0) + ) + (none) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 24 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (local-vars (a0-32 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (handle->process (-> self slave 0)))) + (cond + ((and gp-0 (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status dead)))) + (cond + ((zero? (-> self data-int8 0)) + (when (= (level-status *level* 'ctyindb) 'active) + (set! (-> self data-int8 0) 1) + (delivery-task-setup-ambush-1) + ) + ) + (else + (when (!= (level-status *level* 'ctyindb) 'active) + (set! (-> self data-int8 0) 0) + 0 + ) + ) + ) + (cond + ((zero? (-> self data-int8 1)) + (when (= (level-status *level* 'ctyinda) 'active) + (set! (-> self data-int8 1) 1) + (delivery-task-setup-ambush-2) + ) + ) + (else + (when (!= (level-status *level* 'ctyinda) 'active) + (set! (-> self data-int8 1) 0) + 0 + ) + ) + ) + (let ((f0-0 (vector-vector-distance-squared (-> (the-as process-drawable gp-0) root trans) (target-pos 0))) + (f1-0 12288.0) + ) + (cond + ((and (< f0-0 (* f1-0 f1-0)) *target* (logtest? (focus-status pilot) (-> *target* focus-status))) + (when (nonzero? (-> self sub-state)) + (send-event (handle->process (-> self arrow)) 'set-position (-> self end-pos)) + (send-event (handle->process (-> self arrow)) 'modify-flags 1 0) + (send-event (handle->process (-> self arrow)) 'map-icon 8) + (set! (-> self sub-state) (the-as uint 0)) + 0 + ) + ) + (else + (let* ((v1-59 (new 'stack-no-clear 'inline-array 'vector 1)) + (f0-1 409.6) + (f0-3 (* f0-1 f0-1)) + ) + (.lvf vf1 (&-> (-> (the-as process-drawable gp-0) root transv) 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 a0-32 vf1) + (when (>= f0-3 a0-32) + (set! (-> v1-59 0 quad) (-> (the-as process-drawable gp-0) root trans quad)) + (set! (-> v1-59 0 y) (+ -14336.0 (-> v1-59 0 y))) + (send-event (handle->process (-> self arrow)) 'set-position (-> v1-59 0)) + ) + ) + (when (!= (-> self sub-state) 1) + (send-event (handle->process (-> self arrow)) 'modify-flags 0 1) + (send-event (handle->process (-> self arrow)) 'map-icon 15) + (set! (-> self sub-state) (the-as uint 1)) + ) + ) + ) + ) + (let ((f30-0 49152.0) + (f0-6 (vector-vector-distance-squared (-> (the-as process-drawable gp-0) root trans) (-> self end-pos))) + ) + (if (>= (* f30-0 f30-0) f0-6) + (go-virtual complete) + ) + ) + ) + (else + (go-virtual fail) + ) + ) + ) + (none) + ) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 24 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (let ((gp-0 (new 'static 'vector :x 4501504.0 :y 73728.0 :z 2338816.0 :w 204800.0)) + (s5-0 #f) + ) + (while (not s5-0) + (let ((v1-1 (handle->process (-> self slave 0)))) + (when v1-1 + (let ((f0-0 (vector-vector-distance-squared (-> (the-as process-drawable v1-1) root trans) gp-0)) + (f1-0 (-> gp-0 w)) + ) + (set! s5-0 (< f0-0 (* f1-0 f1-0))) + ) + ) + ) + (suspend) + ) + ) + (send-event *traffic-manager* 'set-guard-target-count-range 0 0 0) + (send-event *traffic-manager* 'set-guard-target-count-range 1 4 4) + (send-event *traffic-manager* 'set-guard-target-count-range 2 0 0) + (send-event *traffic-manager* 'set-guard-target-count-range 4 0 10) + (send-event *traffic-manager* 'set-guard-target-count-range 5 0 10) + (send-event *traffic-manager* 'set-alert-level 3) + (send-event *traffic-manager* 'set-alert-duration #xa4cb80) + (speech-control-method-10 *speech-control* 7 (new 'static 'speech-type-info + :channel #x1 + :priority -2 + :min-delay #x258 + :max-delay #x4b0 + :list (new 'static 'boxed-array :type string + "kg243a" + "kg241a" + "kg242a" + "kg244a" + "kg245a" + "kg246a" + "kg247a" + "kg248a" + "kg249a" + "kg250a" + "kg251a" + "kg252a" + ) + ) + ) + (talker-spawn-func (-> *talker-speech* 49) *entity-pool* (target-pos 0) (the-as region #f)) + (let ((gp-2 (new 'static 'vector :x 3358720.0 :y 32768.0 :z 4689920.0 :w 204800.0)) + (s5-2 #f) + ) + (while (not s5-2) + (let ((v1-48 (handle->process (-> self slave 0)))) + (when v1-48 + (let ((f0-1 (vector-vector-distance-squared (-> (the-as process-drawable v1-48) root trans) gp-2)) + (f1-3 (-> gp-2 w)) + ) + (set! s5-2 (< f0-1 (* f1-3 f1-3))) + ) + ) + ) + (suspend) + ) + ) + (talker-spawn-func (-> *talker-speech* 50) *entity-pool* (target-pos 0) (the-as region #f)) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 24 + 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) + (if (and *target* (logtest? (focus-status pilot) (-> *target* focus-status))) + (send-event *target* 'change-mode 'normal) + ) + (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) + ) + (none) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc b/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc new file mode 100644 index 0000000000..594b23543a --- /dev/null +++ b/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc @@ -0,0 +1,438 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 251 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) + (send-event *target* 'change-mode 'darkjak #f 65) + (set! (-> self sound-id 0) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (send-event *target* 'get-notify self) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 251 + 1 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *target* 'get-pickup 7 (-> self data-float 0)) + (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'get-notify #f) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id 0) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (close! (-> self node-info) 'event) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 251 + 6 + (the-as (function object) (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('attack) + (if (= (-> arg3 param 1) 16) + (go-virtual complete) + ) + ) + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 251 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (if (and *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (send-event *target* 'change-mode 'darkjak #f 65) + ) + (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) + (let ((gp-1 (new + 'stack + 'font-context + *font-default-matrix* + 32 + 280 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + ) + (set! (-> gp-1 flags) (font-flags shadow kerning large)) + (let ((v1-14 gp-1)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-1)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-1)) + (set! (-> v1-16 scale) 0.7) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id oracle-tutorial-dark-bomb) #f)) + (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) + ) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 253 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) + (send-event *target* 'change-mode 'darkjak #f 65) + (set! (-> self sound-id 0) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (send-event *target* 'get-notify self) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 253 + 1 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *target* 'get-pickup 7 (-> self data-float 0)) + (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'get-notify #f) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id 0) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (close! (-> self node-info) 'event) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 253 + 6 + (the-as (function object) (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('notify) + (case (-> arg3 param 0) + (('attack) + (if (= (-> arg3 param 1) 17) + (go-virtual complete) + ) + ) + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 253 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (if (and *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (send-event *target* 'change-mode 'darkjak #f 65) + ) + (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) + (let ((gp-1 (new + 'stack + 'font-context + *font-default-matrix* + 32 + 280 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + ) + (set! (-> gp-1 flags) (font-flags shadow kerning large)) + (let ((v1-14 gp-1)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-1)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-1)) + (set! (-> v1-16 scale) 0.7) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id oracle-tutorial-dark-blast) #f)) + (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) + ) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 255 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) + (send-event *target* 'change-mode 'darkjak #f 65) + (set! (-> self sound-id 0) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (send-event *target* 'get-notify self) + (set! (-> self start-time) (-> self clock frame-counter)) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 255 + 1 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *target* 'get-pickup 7 (-> self data-float 0)) + (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'get-notify #f) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id 0) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (close! (-> self node-info) 'event) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 255 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (if (and *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (send-event *target* 'change-mode 'darkjak #f 65) + ) + (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) + (let ((gp-1 (new + 'stack + 'font-context + *font-default-matrix* + 32 + 280 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + ) + (set! (-> gp-1 flags) (font-flags shadow kerning large)) + (let ((v1-14 gp-1)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-1)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-1)) + (set! (-> v1-16 scale) 0.7) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id oracle-tutorial-dark-invincible) #f)) + (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) + ) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 257 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup 7))) + (send-event *target* 'change-mode 'darkjak #f 65) + (set! (-> self sound-id 0) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (send-event *target* 'get-notify self) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 257 + 1 + (the-as (function object) (lambda :behavior task-manager + () + (send-event *target* 'get-pickup 7 (-> self data-float 0)) + (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'get-notify #f) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id 0) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (close! (-> self node-info) 'event) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 257 + 6 + (the-as (function object) (lambda :behavior task-manager + ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (the-as object (case arg2 + (('notify) + (case (-> arg3 param 0) + (('attack) + (if (= (-> arg3 param 1) 18) + #f + ) + ) + ) + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 257 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (if (and *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (send-event *target* 'change-mode 'darkjak #f 65) + ) + (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) + (let ((gp-1 (new + 'stack + 'font-context + *font-default-matrix* + 32 + 280 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + ) + (set! (-> gp-1 flags) (font-flags shadow kerning large)) + (let ((v1-14 gp-1)) + (set! (-> v1-14 width) (the float 440)) + ) + (let ((v1-15 gp-1)) + (set! (-> v1-15 height) (the float 80)) + ) + (let ((v1-16 gp-1)) + (set! (-> v1-16 scale) 0.7) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id oracle-tutorial-dark-giant) #f)) + (s5-0 *temp-string* gp-1 #f 44 (bucket-id progress)) + ) + ) + ) + (none) + ) + ) + ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot-h_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot-h_REF.gc index 7e3a6b277b..ff4584a0d8 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot-h_REF.gc @@ -32,8 +32,8 @@ ;; definition of type bombbot-path (deftype bombbot-path (structure) - ((node-count uint16 :offset-assert 0) - (node uint32 :offset-assert 4) + ((node-count uint16 :offset-assert 0) + (node (inline-array bombbot-node) :offset-assert 4) ) :method-count-assert 9 :size-assert #x8 @@ -55,7 +55,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot-path_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot-path_REF.gc new file mode 100644 index 0000000000..bbae121332 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot-path_REF.gc @@ -0,0 +1,822 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *bombbot-path-1*, type bombbot-path +(define *bombbot-path-1* (new 'static 'bombbot-path + :node-count #x1c + :node (new 'static 'inline-array bombbot-node 28 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3258277.5 :y 36837.375 :z 2919952.0) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3527335.0 :y 36837.375 :z 2643463.2) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3614297.8 :y 36837.375 :z 2580864.5) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4291214.0 :y 38298.008 :z 2591629.0) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4390092.0 :y 36837.375 :z 2643881.2) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4455013.0 :y 36837.375 :z 2753605.2) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4538736.0 :y 36837.375 :z 2739244.8) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4589772.0 :y 36837.375 :z 2653011.2) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4602265.0 :y 38390.58 :z 2465177.2) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4529397.0 :y 36837.375 :z 2365566.2) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4405943.0 :y 36837.375 :z 2328894.8) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4000464.5 :y 36837.375 :z 2104958.2) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4013141.5 :y 36837.375 :z 1832038.0) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4521655.0 :y 36837.375 :z 1745903.2) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4506131.5 :y 33105.92 :z 1321582.1) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4644699.5 :y 37455.055 :z 1207492.2) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4667923.5 :y 37455.055 :z 1168281.2) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4659813.0 :y 41026.766 :z 977706.6) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4733418.5 :y 37455.055 :z 871554.7) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4753079.0 :y 37459.56 :z 775511.6) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4692417.5 :y 37457.51 :z 759676.5) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4495687.0 :y 37457.51 :z 765365.9) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4472339.5 :y 37457.51 :z 496651.88) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4383906.5 :y 37457.51 :z 276074.1) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4582235.5 :y 37446.043 :z 83403.57) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4677671.5 :y 37446.043 :z 70415.56) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4685986.5 :y 37446.043 :z 217373.9) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4718386.5 :y 37446.043 :z 233280.72) + :nav-mesh-id #x2578 + ) + ) + ) + ) + +;; definition for symbol *bombbot-path-2*, type bombbot-path +(define *bombbot-path-2* (new 'static 'bombbot-path + :node-count #x21 + :node (new 'static 'inline-array bombbot-node 33 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1677880.9 :y 32856.473 :z -190588.11) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1826967.1 :y 36825.906 :z -179154.53) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1879178.9 :y 36858.266 :z -70936.164) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2041179.8 :y 36852.12 :z -62959.617) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2200935.8 :y 37035.62 :z -327732.44) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2238988.0 :y 36855.81 :z -502779.5) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2280828.0 :y 36862.363 :z -594517.6) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2382253.8 :y 36858.266 :z -654388.8) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2463849.8 :y 36852.53 :z -811904.6) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2693455.5 :y 32287.129 :z -782532.2) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2787884.8 :y 36854.168 :z -1143430.8) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2870263.5 :y 36964.76 :z -1137082.0) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3010809.5 :y 35717.53 :z -1025650.25) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3058421.2 :y 36852.53 :z -689659.5) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3038600.5 :y 37395.66 :z -597171.8) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2939293.0 :y 45748.223 :z -549240.44) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2885557.8 :y 43587.586 :z -452988.53) + :nav-mesh-id #x2644 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3289734.2 :y 37456.28 :z -52194.508) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3266022.5 :y 37448.09 :z 309003.88) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3520949.8 :y 38775.6 :z 423140.97) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3753070.2 :y 37448.09 :z 611843.7) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3987242.5 :y 37458.74 :z 642600.56) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4035505.2 :y 37454.234 :z 575893.1) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4232519.0 :y 37457.51 :z 589045.4) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4315381.0 :y 37457.51 :z 524410.5) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4324351.0 :y 37457.51 :z 385351.7) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4224859.5 :y 37457.51 :z 381204.47) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4227849.5 :y 37457.51 :z 289628.56) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4357856.5 :y 37457.51 :z 260807.06) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4588256.5 :y 37446.043 :z 68193.89) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4668702.0 :y 37446.043 :z 85842.74) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4679515.5 :y 37446.043 :z 238454.38) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4716789.0 :y 37446.043 :z 252433.2) + :nav-mesh-id #x2578 + ) + ) + ) + ) + +;; definition for symbol *bombbot-path-3*, type bombbot-path +(define *bombbot-path-3* (new 'static 'bombbot-path + :node-count #x1b + :node (new 'static 'inline-array bombbot-node 27 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3349143.2 :y 36837.375 :z 1716903.5) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3350859.2 :y 36837.375 :z 2284261.0) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3585396.0 :y 38390.58 :z 2270354.8) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3678752.2 :y 36837.375 :z 2124566.0) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3780005.5 :y 37188.402 :z 1886043.8) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3988593.8 :y 38456.523 :z 1788928.0) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4476435.5 :y 36837.375 :z 1664429.6) + :nav-mesh-id #x429e + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4459273.5 :y 30950.605 :z 1375608.4) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4297235.5 :y 37457.92 :z 1336405.6) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4267007.0 :y 37444.402 :z 1361804.9) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4239564.0 :y 37457.92 :z 1410236.0) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4136713.5 :y 42312.09 :z 1466470.0) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3730288.2 :y 37457.92 :z 1464053.4) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3679088.2 :y 37457.51 :z 1307471.5) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3718180.5 :y 37457.51 :z 1220591.2) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3999309.5 :y 40812.543 :z 1229811.2) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4089249.5 :y 37457.51 :z 1150664.2) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4044267.0 :y 37457.51 :z 856497.75) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4036837.0 :y 37457.51 :z 757390.94) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4235918.0 :y 37457.51 :z 741895.8) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4270160.5 :y 37457.51 :z 614477.44) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4392795.5 :y 37457.51 :z 371413.8) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4414668.0 :y 41926.246 :z 210297.23) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4583751.0 :y 37446.043 :z 98254.85) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4685045.0 :y 37446.043 :z 85629.336) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4691557.0 :y 37446.043 :z 193381.17) + :nav-mesh-id #x2578 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4719328.5 :y 37446.043 :z 209884.78) + :nav-mesh-id #x2578 + ) + ) + ) + ) + +;; definition for symbol *bombbot-path-4*, type bombbot-path +(define *bombbot-path-4* (new 'static 'bombbot-path + :node-count #x1b + :node (new 'static 'inline-array bombbot-node 27 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 882802.25 :y 36859.902 :z 3621834.2) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 872205.94 :y 36854.168 :z 3192081.5) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1050914.4 :y 69632.0 :z 3175034.5) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1498271.4 :y 69626.266 :z 3185827.5) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1481735.8 :y 69642.24 :z 2830061.2) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1456881.2 :y 69642.24 :z 2057588.4) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1502514.8 :y 69642.24 :z 1884434.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1484082.8 :y 69632.0 :z 1743306.4) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1115516.5 :y 69642.24 :z 1752252.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 639340.1 :y 69639.78 :z 1770094.1) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 128253.54 :y 69642.24 :z 1734078.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 73947.95 :y 69642.24 :z 1844170.4) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 109042.07 :y 69642.24 :z 2066944.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 122852.555 :y 69642.24 :z 2758323.5) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 79918.28 :y 69626.266 :z 3150474.8) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 517484.12 :y 69632.0 :z 3181182.2) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 602791.5 :y 36854.168 :z 3181075.8) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 699465.3 :y 36854.168 :z 3194715.2) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 674786.94 :y 36864.0 :z 3605937.2) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 421895.78 :y 36864.0 :z 3631988.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 369729.12 :y 36859.902 :z 3813134.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 397331.66 :y 36861.953 :z 4427570.5) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 731725.44 :y 36864.0 :z 4451286.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1126035.0 :y 36864.0 :z 4429454.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1190809.2 :y 36859.902 :z 4295065.0) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1190031.0 :y 36861.953 :z 3726978.8) + :nav-mesh-id #x5881 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1073888.9 :y 36859.902 :z 3629100.8) + :nav-mesh-id #x5881 + ) + ) + ) + ) + +;; definition for symbol *bombbot-path-5*, type bombbot-path +(define *bombbot-path-5* (new 'static 'bombbot-path + :node-count #x33 + :node (new 'static 'inline-array bombbot-node 51 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 388330.7 :y 35735.55 :z 5592473.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 235137.44 :y 35738.418 :z 5335571.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 74786.0 :y 35725.312 :z 5357485.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -245602.72 :y 35892.43 :z 5523168.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -478199.4 :y 35809.28 :z 5729811.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -633699.94 :y 39457.586 :z 5876857.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -667004.5 :y 59325.234 :z 5924289.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -696929.9 :y 58614.58 :z 5964103.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -732503.6 :y 22183.527 :z 6010224.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -856731.25 :y 21815.297 :z 6198476.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -870399.56 :y 35786.344 :z 6224935.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -976211.56 :y 35637.656 :z 6564699.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -719711.9 :y 38689.176 :z 6634986.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -531132.0 :y 38689.176 :z 6696467.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -354006.62 :y 38696.14 :z 6784162.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x -180439.86 :y 38695.32 :z 6879559.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 20982.58 :y 35575.81 :z 7042620.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 195429.98 :y 35792.895 :z 6968032.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 312721.8 :y 35971.89 :z 6998506.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 453852.78 :y 37415.73 :z 7159356.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 678702.7 :y 75903.38 :z 7154687.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 891694.7 :y 75898.06 :z 7155056.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1123581.5 :y 37389.105 :z 7159807.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1262735.0 :y 36363.06 :z 7003381.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1435963.0 :y 35584.82 :z 6967623.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1585966.8 :y 37874.895 :z 7002643.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1763491.4 :y 38840.32 :z 6884228.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1928056.4 :y 38840.32 :z 6786702.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2107686.0 :y 38849.332 :z 6696098.5) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2293435.5 :y 38841.547 :z 6626262.0) + :nav-mesh-id #x48db + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2510294.8 :y 35697.46 :z 6572563.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2539388.0 :y 36340.53 :z 6489415.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2446294.8 :y 35794.535 :z 6219815.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2430483.8 :y 23202.611 :z 6190160.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2307473.0 :y 22759.834 :z 5994905.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2275430.0 :y 56630.066 :z 5951815.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2247085.8 :y 59249.05 :z 5913271.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2208775.2 :y 40428.34 :z 5866126.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 2049703.5 :y 35709.746 :z 5719040.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1805794.9 :y 35787.98 :z 5533326.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1550716.5 :y 35767.91 :z 5390949.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1386327.6 :y 35697.05 :z 5346631.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1270820.5 :y 35735.14 :z 5479013.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1179094.6 :y 35735.55 :z 5589237.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1153597.0 :y 23880.09 :z 5588172.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1028533.9 :y 21655.96 :z 5589810.5) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 1001635.44 :y 37785.19 :z 5586247.0) + :nav-mesh-id #x48e9 + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 782425.7 :y 35723.67 :z 5569207.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 574987.9 :y 35949.363 :z 5584567.0) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 546176.6 :y 21655.553 :z 5588704.5) + :nav-mesh-id #x48cc + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 417185.38 :y 24605.082 :z 5599353.5) + :nav-mesh-id #x48cc + ) + ) + ) + ) + +;; definition for symbol *bombbot-path-6*, type bombbot-path +(define *bombbot-path-6* (new 'static 'bombbot-path + :node-count #x1a + :node (new 'static 'inline-array bombbot-node 26 + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4673330.5 :y 103528.04 :z 4155801.2) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4680252.0 :y 103531.31 :z 3704430.2) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4259757.5 :y 103531.31 :z 3700010.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3996306.8 :y 103531.31 :z 3698474.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3866263.2 :y 103531.31 :z 3698322.8) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3350626.0 :y 103528.04 :z 3702615.8) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3346918.5 :y 103528.04 :z 4084702.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3694755.5 :y 103528.04 :z 4096572.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3703221.8 :y 103528.04 :z 4352286.0) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3958894.2 :y 103528.04 :z 4364409.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3958861.5 :y 103528.04 :z 4683570.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3573743.2 :y 103528.04 :z 4682791.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3563831.0 :y 103528.04 :z 4222893.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3185090.2 :y 103528.04 :z 4217609.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3184090.8 :y 103443.25 :z 3811204.8) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3179494.5 :y 36837.375 :z 3575176.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3264048.8 :y 36837.375 :z 3525590.8) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3247177.0 :y 36837.375 :z 4148510.0) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3650235.5 :y 36837.375 :z 4178902.8) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3655273.8 :y 36837.375 :z 4465417.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 3942530.8 :y 36837.375 :z 4631551.0) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4158422.8 :y 36837.375 :z 4682956.0) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4413520.5 :y 103528.04 :z 4686642.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4432117.0 :y 103528.04 :z 4430192.0) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4616723.5 :y 103528.04 :z 4419378.5) + :nav-mesh-id #x34ad + ) + (new 'static 'bombbot-node + :position (new 'static 'vector :x 4627783.0 :y 103531.31 :z 4174642.5) + :nav-mesh-id #x34ad + ) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot_REF.gc new file mode 100644 index 0000000000..1998a25109 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot_REF.gc @@ -0,0 +1,3559 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *bombbot-body-constants*, type rigid-body-object-constants +(define *bombbot-body-constants* (new 'static 'rigid-body-object-constants + :info (new 'static 'rigid-body-info + :mass 1.0 + :inv-mass 1.0 + :linear-damping 0.8 + :angular-damping 0.8 + :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 2) (meters 2) (meters 2)) + ) + :max-time-step 0.02 + :gravity (meters 10) + :idle-distance (meters 200) + :attack-force-scale 2.0 + :name '*bombbot-body-constants* + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-bombbot-explode0 + :id 1060 + :duration (seconds 3) + :linger-duration (seconds 2) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4608 :fade-after (meters 200) :falloff-to (meters 200) :period 9600 :length 25) + (sp-item 4609 :period 9600 :length 10 :offset 10) + (sp-item 4610 :fade-after (meters 120) :falloff-to (meters 120) :period 9600 :length 100 :offset 25) + (sp-item 4611 :fade-after (meters 60) :period 9600 :length 35 :offset 10) + (sp-item 4612 :period 9600 :length 50 :offset 15) + (sp-item 4613 :period 9600 :length 5) + (sp-item 4614 :period 9600 :length 50 :offset 15) + (sp-item 4615 :period 9600 :length 5) + ) + ) + +;; failed to figure out what this is: +(defpart 4613 + :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 4616) + ) + ) + +;; failed to figure out what this is: +(defpart 4616 + :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 4615 + :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 4617) + ) + ) + +;; failed to figure out what this is: +(defpart 4617 + :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 4611 + :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 4618) + (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 90.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4618 + :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 4619) + ) + ) + +;; failed to figure out what this is: +(defpart 4619 + :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 4614 + :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 4620) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-conerot-x) + :flags (sp-flag from-pointer) + :func '*sp-temp* + ) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 90.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 2) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4620 + :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 4621) + ) + ) + +;; failed to figure out what this is: +(defpart 4621 + :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 4612 + :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 4622) + (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-flt spt-rotate-y (degrees 90.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 8) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4622 + :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 4623) + ) + ) + +;; failed to figure out what this is: +(defpart 4623 + :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 4624) + ) + ) + +;; failed to figure out what this is: +(defpart 4624 + :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 4625) + ) + ) + +;; failed to figure out what this is: +(defpart 4625 + :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 4610 + :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 4626) + (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-flt spt-rotate-y (degrees 90.0)) + (sp-rnd-flt spt-conerot-radius (meters 3) (meters 5) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4626 + :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 4627) + ) + ) + +;; failed to figure out what this is: +(defpart 4627 + :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 4608 + :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 4628) + (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-flt spt-rotate-y (degrees 90.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4628 + :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 4629) + ) + ) + +;; failed to figure out what this is: +(defpart 4629 + :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 4609 + :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 3600.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: +(defpart 4630 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x83 :page #xc)) + (sp-func spt-birth-func 'birth-func-set-quat) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2)) + (sp-flt spt-scale-y (meters 40)) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 64.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat) + ) + ) + +;; failed to figure out what this is: +(defpart 4631 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbc :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 64.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-flt spt-fade-g -1.0666667) + (sp-flt spt-fade-b -1.0666667) + (sp-flt spt-fade-a -8.533334) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 4632 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbc :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 64.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-flt spt-fade-g -1.0666667) + (sp-flt spt-fade-b -1.0666667) + (sp-flt spt-fade-a -8.533334) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-bombbot bombbot bombbot-lod0-jg bombbot-idle-ja + ((bombbot-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12) + :shadow bombbot-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-bombbot-exploding bombbot bombbot-exploding-lod0-jg bombbot-exploding-idle-ja + ((bombbot-exploding-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12) + ) + +;; definition for symbol *bombbot-exploder-params*, type joint-exploder-static-params +(define *bombbot-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 3 :parent-joint-index -1) + (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) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + ) + :collide-spec #x241 + ) + ) + +;; definition of type bombbot-foot +(deftype bombbot-foot (structure) + ((pos-offset vector :inline :offset-assert 0) + (joint-index uint32 :offset-assert 16) + (offset float :offset-assert 20) + (position vector :inline :offset-assert 32) + (next-position vector :inline :offset-assert 48) + (real-position vector :inline :offset-assert 64) + (speed vector :inline :offset-assert 80) + (moving symbol :offset-assert 96) + (main-y float :offset-assert 100) + (delta-y float :offset-assert 104) + ) + :pack-me + :method-count-assert 9 + :size-assert #x6c + :flag-assert #x90000006c + ) + +;; definition for method 3 of type bombbot-foot +(defmethod inspect bombbot-foot ((obj bombbot-foot)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bombbot-foot) + (format #t "~1Tpos-offset: #~%" (-> obj pos-offset)) + (format #t "~1Tjoint-index: ~D~%" (-> obj joint-index)) + (format #t "~1Toffset: ~f~%" (-> obj offset)) + (format #t "~1Tposition: #~%" (-> obj position)) + (format #t "~1Tnext-position: #~%" (-> obj next-position)) + (format #t "~1Treal-position: #~%" (-> obj real-position)) + (format #t "~1Tspeed: #~%" (-> obj speed)) + (format #t "~1Tmoving: ~A~%" (-> obj moving)) + (format #t "~1Tmain-y: ~f~%" (-> obj main-y)) + (format #t "~1Tdelta-y: ~f~%" (-> obj delta-y)) + (label cfg-4) + obj + ) + +;; definition of type bombbot +(deftype bombbot (nav-enemy) + ((joint-ik joint-mod-ik 4 :offset-assert 604) + (feet bombbot-foot 4 :inline :offset-assert 624) + (legs-strength float 4 :offset-assert 1072) + (last-trans vector :inline :offset-assert 1088) + (linear-speed vector :inline :offset-assert 1104) + (last-quat quaternion :inline :offset-assert 1120) + (y-angular-velocity float :offset-assert 1136) + (main-quat quaternion :inline :offset-assert 1152) + (main-spd-y float :offset-assert 1168) + (main-pos-y float :offset-assert 1172) + (main-pos vector :inline :offset-assert 1184) + (city-path bombbot-path :offset-assert 1200) + (current-node uint32 :offset-assert 1204) + (shot-count uint32 :offset-assert 1208) + (next-shoot uint64 :offset-assert 1216) + (stop-shoot uint64 :offset-assert 1224) + (next-target uint64 :offset-assert 1232) + (start-target uint64 :offset-assert 1240) + (beep-time time-frame :offset-assert 1248) + (target-pos vector :inline :offset-assert 1264) + (start-target-pos vector :inline :offset-assert 1280) + (start-target-vel vector :inline :offset-assert 1296) + (top-quat quaternion :inline :offset-assert 1312) + (gun-swivel-quat quaternion :inline :offset-assert 1328) + (gun-quat quaternion :inline :offset-assert 1344) + (angle-turret float :offset-assert 1360) + (angle-gun float :offset-assert 1364) + (high float :offset-assert 1368) + (shield-hit-points float :offset-assert 1372) + (hit-axis vector :inline :offset-assert 1376) + (rigidbody rigid-body-control :offset-assert 1392) + (info rigid-body-object-constants :offset-assert 1396) + (explosing symbol :offset-assert 1400) + (minimap connection-minimap :offset-assert 1404) + (lazer-sound uint32 :offset-assert 1408) + (head-sound uint32 :offset-assert 1412) + (cannon-sound uint32 :offset-assert 1416) + (last-head-roty-speed float :offset-assert 1420) + (head-roty-speed float :offset-assert 1424) + (last-cannon-roty-speed float :offset-assert 1428) + (cannon-roty-speed float :offset-assert 1432) + ) + :heap-base #x520 + :method-count-assert 185 + :size-assert #x59c + :flag-assert #xb90520059c + (:methods + (kill-prefer-falling () symbol :replace 73) + (explode () _type_ :state 178) + (bombbot-method-179 (_type_) none 179) + (bombbot-method-180 (_type_) none 180) + (bombbot-method-181 (_type_ vector) none 181) + (bombbot-method-182 (_type_) none 182) + (bombbot-method-183 (_type_) none 183) + (bombbot-method-184 (_type_) none 184) + ) + ) + +;; definition for method 3 of type bombbot +(defmethod inspect bombbot ((obj bombbot)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 obj) + ) + (format #t "~2Tjoint-ik[4] @ #x~X~%" (-> obj joint-ik)) + (format #t "~2Tfeet[4] @ #x~X~%" (-> obj feet)) + (format #t "~2Tlegs-strength[4] @ #x~X~%" (-> obj legs-strength)) + (format #t "~2Tlast-trans: #~%" (-> obj last-trans)) + (format #t "~2Tlinear-speed: #~%" (-> obj linear-speed)) + (format #t "~2Tlast-quat: #~%" (-> obj last-quat)) + (format #t "~2Ty-angular-velocity: ~f~%" (-> obj y-angular-velocity)) + (format #t "~2Tmain-quat: #~%" (-> obj main-quat)) + (format #t "~2Tmain-spd-y: ~f~%" (-> obj main-spd-y)) + (format #t "~2Tmain-pos-y: ~f~%" (-> obj main-pos-y)) + (format #t "~2Tmain-pos: #~%" (-> obj main-pos)) + (format #t "~2Tcity-path: #~%" (-> obj city-path)) + (format #t "~2Tcurrent-node: ~D~%" (-> obj current-node)) + (format #t "~2Tshot-count: ~D~%" (-> obj shot-count)) + (format #t "~2Tnext-shoot: ~D~%" (-> obj next-shoot)) + (format #t "~2Tstop-shoot: ~D~%" (-> obj stop-shoot)) + (format #t "~2Tnext-target: ~D~%" (-> obj next-target)) + (format #t "~2Tstart-target: ~D~%" (-> obj start-target)) + (format #t "~2Tbeep-time: ~D~%" (-> obj beep-time)) + (format #t "~2Ttarget-pos: #~%" (-> obj target-pos)) + (format #t "~2Tstart-target-pos: #~%" (-> obj start-target-pos)) + (format #t "~2Tstart-target-vel: #~%" (-> obj start-target-vel)) + (format #t "~2Ttop-quat: #~%" (-> obj top-quat)) + (format #t "~2Tgun-swivel-quat: #~%" (-> obj gun-swivel-quat)) + (format #t "~2Tgun-quat: #~%" (-> obj gun-quat)) + (format #t "~2Tangle-turret: ~f~%" (-> obj angle-turret)) + (format #t "~2Tangle-gun: ~f~%" (-> obj angle-gun)) + (format #t "~2Thigh: ~f~%" (-> obj high)) + (format #t "~2Tshield-hit-points: ~f~%" (-> obj shield-hit-points)) + (format #t "~2Thit-axis: #~%" (-> obj hit-axis)) + (format #t "~2Trigidbody: ~A~%" (-> obj rigidbody)) + (format #t "~2Tinfo: #~%" (-> obj info)) + (format #t "~2Texplosing: ~A~%" (-> obj explosing)) + (format #t "~2Tminimap: #~%" (-> obj minimap)) + (format #t "~2Tlazer-sound: ~D~%" (-> obj lazer-sound)) + (format #t "~2Thead-sound: ~D~%" (-> obj head-sound)) + (format #t "~2Tcannon-sound: ~D~%" (-> obj cannon-sound)) + (format #t "~2Tlast-head-roty-speed: ~f~%" (-> obj last-head-roty-speed)) + (format #t "~2Thead-roty-speed: ~f~%" (-> obj head-roty-speed)) + (format #t "~2Tlast-cannon-roty-speed: ~f~%" (-> obj last-cannon-roty-speed)) + (format #t "~2Tcannon-roty-speed: ~f~%" (-> obj cannon-roty-speed)) + (label cfg-4) + obj + ) + +;; definition for symbol *bombbot-nav-enemy-info*, type nav-enemy-info +(define *bombbot-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e) + (new 'static 'idle-control-frame :command (ic-cmd play) :anim #x3 :param0 #x64 :param1 #x64) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim 3 + :hit-anim 3 + :knocked-anim 3 + :knocked-land-anim 3 + :die-anim 3 + :die-falling-anim 3 + :victory-anim -1 + :jump-wind-up-anim 3 + :jump-in-air-anim 3 + :jump-land-anim 3 + :neck-joint -1 + :look-at-joint 4 + :bullseye-joint 4 + :sound-hit (static-sound-name "bombbot-hit") + :sound-die (static-sound-name "bombbot-die") + :notice-distance (meters 20) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 90 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :attack-shove-up (meters 2) + :attack-mode 'shock + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #f + :walk-anim 3 + :turn-anim -1 + :run-anim 3 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 8) + :run-turning-acceleration (meters 10) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 16) + :walk-turning-acceleration (meters 40) + :maximum-rotation-rate (degrees 60.0) + :notice-nav-radius (meters 2) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *bombbot-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition of type ik-setup +(deftype ik-setup (structure) + ((elbow-index int32 :offset-assert 0) + (hand-dist float :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type ik-setup +(defmethod inspect ik-setup ((obj ik-setup)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ik-setup) + (format #t "~1Telbow-index: ~D~%" (-> obj elbow-index)) + (format #t "~1Thand-dist: ~f~%" (-> obj hand-dist)) + (label cfg-4) + obj + ) + +;; definition for symbol *bombbot-ik-setup*, type (array ik-setup) +(define *bombbot-ik-setup* (new 'static 'boxed-array :type ik-setup + (new 'static 'ik-setup :elbow-index 19 :hand-dist 14880.768) + (new 'static 'ik-setup :elbow-index 13 :hand-dist -14880.768) + (new 'static 'ik-setup :elbow-index 15 :hand-dist 14880.768) + (new 'static 'ik-setup :elbow-index 17 :hand-dist -14880.768) + ) + ) + +;; definition for function bombbot-do-spline +(defun bombbot-do-spline ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((f1-1 (* arg5 arg5)) + (f0-2 (* arg5 f1-1)) + ) + (let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2)) + (f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5))) + (f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1))) + ) + (vector-float*! arg0 arg1 f2-3) + (let ((t2-0 arg0)) + (let ((v1-10 arg0)) + (let ((t1-3 (vector+! (new 'stack-no-clear 'vector) arg1 arg2))) + (let ((a1-1 f3-7)) + (.mov vf7 a1-1) + ) + (.lvf vf5 (&-> t1-3 quad)) + ) + (.lvf vf4 (&-> v1-10 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 (&-> t2-0 quad) vf6) + ) + (let ((a2-1 arg0)) + (let ((v1-11 arg0)) + (let ((a1-3 (vector+! (new 'stack-no-clear 'vector) arg3 arg4))) + (let ((t0-1 f1-3)) + (.mov vf7 t0-1) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> v1-11 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 (&-> a2-1 quad) vf6) + ) + ) + (let ((v0-0 arg0)) + (let ((v1-12 arg0)) + (let ((a0-1 arg3)) + (let ((a1-4 f0-2)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-12 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 (&-> v0-0 quad) vf6) + v0-0 + ) + ) + ) + ) + +;; definition for method 180 of type bombbot +;; INFO: Used lq/sq +(defmethod bombbot-method-180 bombbot ((obj bombbot)) + (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> a1-0 sphere quad) (-> obj root-override2 trans quad)) + (set! (-> a1-0 sphere r) 40960.0) + (set! (-> a1-0 velocity quad) (-> obj root-override2 transv quad)) + (vector-reset! (-> a1-0 velocity)) + (set! (-> a1-0 notify-radius) 122880.0) + (set! (-> a1-0 danger-level) 1.0) + (set! (-> a1-0 decay-rate) 0.0) + (set! (-> a1-0 flags) (traffic-danger-flags tdf0)) + (set! (-> a1-0 danger-type) (traffic-danger-type tdt0)) + (add-danger-sphere *traffic-engine* a1-0) + ) + (none) + ) + +;; definition for method 179 of type bombbot +;; INFO: Used lq/sq +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-method-179 bombbot ((obj bombbot)) + (local-vars + (at-0 int) + (sv-864 vector) + (sv-880 vector) + (sv-896 float) + (sv-912 float) + (sv-928 (function vector vector float)) + (sv-944 uint) + ) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-0 (-> s5-0 bbox)) + (a0-2 (-> obj root-override2 trans)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-0 x) 24576.0) + (set! (-> a1-0 y) 22528.0) + (set! (-> a1-0 z) 24576.0) + (set! (-> a1-0 w) 1.0) + (vector-! (the-as vector v1-0) a0-2 a1-0) + ) + (let ((v1-2 (-> s5-0 bbox max)) + (a0-4 (-> obj root-override2 trans)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 x) 24576.0) + (set! (-> a1-1 y) 22528.0) + (set! (-> a1-1 z) 24576.0) + (set! (-> a1-1 w) 1.0) + (vector+! v1-2 a0-4 a1-1) + ) + (set! (-> s5-0 collide-with) (collide-spec backgnd)) + (set! (-> s5-0 ignore-process0) #f) + (set! (-> s5-0 ignore-process1) #f) + (set! (-> s5-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (fill-using-bounding-box *collide-cache* s5-0) + (dotimes (s4-0 4) + (-> obj joint-ik s4-0 shoulder-matrix-no-ik) + (-> obj joint-ik s4-0 elbow-matrix-no-ik) + (new 'stack-no-clear 'vector) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s2-0 quad) (-> obj node-list data 3 bone transform vector 1 quad)) + (new 'stack-no-clear 'vector) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let ((f30-0 0.4)) + (vector-normalize! s2-0 1.0) + (let ((s1-0 (-> obj feet s4-0))) + (let* ((f0-10 (+ (* 0.0033333334 (the float (mod (-> pp clock frame-counter) 300))) (-> s1-0 offset))) + (f28-0 (- f0-10 (* (the float (the int (/ f0-10 1.0))) 1.0))) + (s0-0 (new 'stack-no-clear 'vector)) + ) + (cond + ((>= f30-0 f28-0) + (vector-orient-by-quat! s3-0 (-> s1-0 pos-offset) (-> obj root-override2 quat)) + (let ((f26-0 (- f30-0 f28-0))) + (set! sv-880 s0-0) + (set! sv-864 (new 'stack-no-clear 'vector)) + (set! (-> sv-864 x) 0.0) + (set! (-> sv-864 y) (sin (* (-> obj y-angular-velocity) (-> pp clock frames-per-second)))) + (set! (-> sv-864 z) 0.0) + (set! (-> sv-864 w) 1.0) + (let ((v1-39 s3-0)) + (.lvf vf1 (&-> sv-864 quad)) + (.lvf vf2 (&-> v1-39 quad)) + ) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> sv-880 quad) vf3) + (let ((a1-5 s0-0) + (v1-41 s0-0) + (a0-11 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> (-> obj linear-speed) quad)) + (let ((f0-17 (-> pp clock frames-per-second))) + (.mov at-0 f0-17) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> a0-11 quad) vf1) + (vector+! a1-5 v1-41 a0-11) + ) + (let ((a1-7 (-> s1-0 speed))) + (let ((v1-42 (-> s1-0 speed))) + (let ((a0-13 (vector-! (new 'stack-no-clear 'vector) s0-0 (-> s1-0 speed)))) + (let ((a2-14 (* 4.0 (-> pp clock seconds-per-frame)))) + (.mov vf7 a2-14) + ) + (.lvf vf5 (&-> a0-13 quad)) + ) + (.lvf vf4 (&-> v1-42 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-7 quad) vf6) + ) + (let ((a1-8 s3-0)) + (let ((v1-43 s3-0)) + (let ((a0-14 (-> s1-0 speed))) + (let ((a2-16 (+ 0.2 f26-0))) + (.mov vf7 a2-16) + ) + (.lvf vf5 (&-> a0-14 quad)) + ) + (.lvf vf4 (&-> v1-43 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-8 quad) vf6) + ) + ) + (vector+! s3-0 s3-0 (-> obj root-override2 trans)) + (let ((a1-11 (-> s5-0 start-pos))) + (let ((v1-45 s3-0)) + (let ((a0-17 s2-0)) + (let ((a2-18 24576.0)) + (.mov vf7 a2-18) + ) + (.lvf vf5 (&-> a0-17 quad)) + ) + (.lvf vf4 (&-> v1-45 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-11 quad) vf6) + ) + (vector-float*! (-> s5-0 move-dist) s2-0 -49152.0) + (let ((v1-48 s5-0)) + (set! (-> v1-48 radius) 40.96) + (set! (-> v1-48 collide-with) (collide-spec backgnd)) + (set! (-> v1-48 ignore-process0) #f) + (set! (-> v1-48 ignore-process1) #f) + (set! (-> v1-48 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-48 action-mask) (collide-action solid)) + ) + (let ((f0-25 (probe-using-line-sphere *collide-cache* s5-0))) + (when (>= f0-25 0.0) + (let ((v1-50 (new 'stack-no-clear 'vector))) + (let ((a0-25 (-> s5-0 start-pos))) + (let ((a1-14 (-> s5-0 move-dist))) + (let ((a2-19 f0-25)) + (.mov vf7 a2-19) + ) + (.lvf vf5 (&-> a1-14 quad)) + ) + (.lvf vf4 (&-> a0-25 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-50 quad) vf6) + (- (-> s3-0 y) (-> v1-50 y)) + (set! (-> s3-0 quad) (-> v1-50 quad)) + ) + ) + ) + (set! (-> s1-0 next-position quad) (-> s3-0 quad)) + (set! (-> s1-0 moving) #t) + (let ((a1-15 s3-0)) + (let ((v1-54 (-> s1-0 position))) + (let ((a0-30 (vector-! (new 'stack-no-clear 'vector) (-> s1-0 next-position) (-> s1-0 position)))) + (let ((a2-21 (/ f28-0 f30-0))) + (.mov vf7 a2-21) + ) + (.lvf vf5 (&-> a0-30 quad)) + ) + (.lvf vf4 (&-> v1-54 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-15 quad) vf6) + ) + (let ((t9-5 bombbot-do-spline) + (a0-31 (new 'stack-no-clear 'vector)) + (a1-16 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-16 x) 0.0) + (set! (-> a1-16 y) 0.0) + (set! (-> a1-16 z) 0.0) + (set! (-> a1-16 w) 1.0) + (let ((a2-22 (new 'stack-no-clear 'vector))) + (set! (-> a2-22 x) 0.0) + (set! (-> a2-22 y) 0.0) + (set! (-> a2-22 z) 0.5) + (set! (-> a2-22 w) 1.0) + (let ((a3-1 (new 'stack-no-clear 'vector))) + (set! (-> a3-1 x) 0.0) + (set! (-> a3-1 y) 0.0) + (set! (-> a3-1 z) 1.0) + (set! (-> a3-1 w) 1.0) + (let ((t0-0 (new 'stack-no-clear 'vector))) + (set! (-> t0-0 x) 0.0) + (set! (-> t0-0 y) 4.0) + (set! (-> t0-0 z) 0.0) + (set! (-> t0-0 w) 1.0) + (let ((v0-5 (t9-5 a0-31 a1-16 a2-22 a3-1 t0-0 (/ f28-0 f30-0)))) + (set! (-> s1-0 delta-y) (* 0.05 (-> v0-5 y) (vector-length (-> s1-0 speed)))) + ) + ) + ) + ) + ) + (+! (-> s3-0 y) (-> s1-0 delta-y)) + ) + (else + (when (-> s1-0 moving) + (set! (-> s1-0 position quad) (-> s1-0 next-position quad)) + (set! (-> s1-0 moving) #f) + (let ((s0-1 lerp-scale)) + (set! sv-896 (the-as float 819.2)) + (set! sv-912 (the-as float 0.0)) + (set! sv-928 vector-vector-distance) + (let* ((a0-34 (camera-pos)) + (a1-17 (-> s1-0 position)) + (a2-23 (sv-928 a0-34 a1-17)) + (a3-2 40960.0) + (t0-1 409600.0) + (f30-1 (s0-1 sv-896 sv-912 a2-23 a3-2 t0-1)) + ) + (when (and (!= f30-1 0.0) (< 16384.0 (vector-length (-> s1-0 speed)))) + (activate! *camera-smush-control* f30-1 37 600 1.0 0.1 (-> pp clock)) + (let ((s0-2 (get-process *default-dead-pool* part-tracker #x4000))) + (when s0-2 + (let ((t9-11 (method-of-type part-tracker activate))) + (t9-11 (the-as part-tracker s0-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-12 run-function-in-process) + (a0-39 s0-2) + (a1-22 part-tracker-init) + (a2-29 (-> *part-group-id-table* 21)) + (a3-5 0) + (t0-3 #f) + (t1-2 #f) + (t2-1 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> s1-0 position quad)) + ((the-as (function object object object object object object object object none) t9-12) + a0-39 + a1-22 + a2-29 + a3-5 + t0-3 + t1-2 + t2-1 + t3-0 + ) + ) + (-> s0-2 ppointer) + ) + ) + (when (or (zero? s4-0) (= s4-0 1)) + (let ((s0-3 sound-play-by-name)) + (set! sv-944 (make-u128 0 (the-as uint #x6b6c61772d6262))) + (let ((a1-23 (new-sound-id)) + (a2-30 1024) + (a3-6 0) + (t0-4 0) + (t1-3 1) + (t2-2 (-> s1-0 position)) + ) + (s0-3 (the-as sound-name sv-944) a1-23 a2-30 a3-6 t0-4 (the-as sound-group t1-3) t2-2) + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 (* 0.0012207031 f30-1))) (seconds 0.2)) + ) + ) + ) + ) + ) + (set! (-> s1-0 delta-y) 0.0) + (set! (-> s3-0 quad) (-> s1-0 position quad)) + ) + ) + ) + (let ((a1-25 (-> s5-0 start-pos))) + (let ((v1-96 s3-0)) + (let ((a0-45 s2-0)) + (let ((a2-33 12288.0)) + (.mov vf7 a2-33) + ) + (.lvf vf5 (&-> a0-45 quad)) + ) + (.lvf vf4 (&-> v1-96 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-25 quad) vf6) + ) + (vector-float*! (-> s5-0 move-dist) s2-0 -24576.0) + (let ((v1-99 s5-0)) + (set! (-> v1-99 radius) 40.96) + (set! (-> v1-99 collide-with) (collide-spec backgnd)) + (set! (-> v1-99 ignore-process0) #f) + (set! (-> v1-99 ignore-process1) #f) + (set! (-> v1-99 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-99 action-mask) (collide-action solid)) + ) + (let ((f0-62 (probe-using-line-sphere *collide-cache* s5-0))) + (when (>= f0-62 0.0) + (let ((s0-4 (new 'stack-no-clear 'vector))) + (let ((v1-102 (-> s5-0 start-pos))) + (let ((a0-52 (-> s5-0 move-dist))) + (let ((a1-28 f0-62)) + (.mov vf7 a1-28) + ) + (.lvf vf5 (&-> a0-52 quad)) + ) + (.lvf vf4 (&-> v1-102 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-4 quad) vf6) + (let ((f0-64 (- (-> s3-0 y) (-> s0-4 y)))) + (lerp-scale 1.0 0.0 f0-64 0.0 8192.0) + ) + (- (-> s0-4 y) (-> obj root-override2 trans y)) + (vector-dot s2-0 (vector-! (new 'stack-no-clear 'vector) s0-4 (-> obj root-override2 trans))) + ) + ) + ) + (set! (-> s1-0 real-position quad) (-> s3-0 quad)) + ) + ) + (handle-copy! (-> obj joint-ik s4-0) s3-0) + ) + ) + ) + ) + 0 + (none) + ) + ) + ) + +;; definition for method 55 of type bombbot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod track-target! bombbot ((obj bombbot)) + "Does a lot of various things relating to interacting with the target +- tracks when the enemy was last drawn +- looks at the target and handles attacking +@TODO Not extremely well understood yet" + (local-vars (sv-16 sparticle-launcher) (sv-20 sparticle-launcher)) + (let ((t9-0 (method-of-type nav-enemy track-target!))) + (t9-0 obj) + ) + (cond + ((= (-> obj nav state mesh) *default-nav-mesh*) + (dotimes (s5-0 4) + (enable-set! (-> obj joint-ik s5-0) #f) + ) + ) + (else + (bombbot-method-179 obj) + (dotimes (s5-1 4) + (enable-set! (-> obj joint-ik s5-1) #t) + ) + ) + ) + (vector-! (-> obj linear-speed) (-> obj root-override2 trans) (-> obj last-trans)) + (set! (-> obj last-trans quad) (-> obj root-override2 trans quad)) + (set! (-> obj y-angular-velocity) + (deg- (quaternion-y-angle (-> obj root-override2 quat)) (quaternion-y-angle (-> obj last-quat))) + ) + (quaternion-copy! (-> obj last-quat) (-> obj root-override2 quat)) + (set! (-> obj rigidbody state force-callback) + (the-as (function object float none) (method-of-object obj bombbot-method-183)) + ) + (bombbot-method-184 obj) + (set! sv-16 (the-as sparticle-launcher #f)) + (set! sv-20 (the-as sparticle-launcher #f)) + (cond + ((< (-> obj hit-points) 30) + (set! sv-16 (-> *part-id-table* 778)) + (set! sv-20 (-> *part-id-table* 774)) + ) + ((< (-> obj hit-points) 60) + (set! sv-16 (-> *part-id-table* 781)) + ) + (else + (if (< (rand-vu) 0.05) + (set! sv-16 (-> *part-id-table* 783)) + ) + ) + ) + (when sv-16 + (let ((gp-1 (-> obj node-list data 4 bone transform)) + (s5-3 (new 'stack-no-clear 'vector)) + ) + (dotimes (s4-1 2) + (vector-matrix*! + s5-3 + (vector-rotate-around-y! (new 'stack-no-clear 'vector) (new 'static 'vector :z 6144.0 :w 1.0) (if (< s4-1 1) + 5461.3335 + 38229.332 + ) + ) + gp-1 + ) + (vector-! *particle-vel* s5-3 (matrix->trans gp-1 (new 'stack-no-clear 'vector))) + (set! (-> *particle-vel* y) (+ 4096.0 (-> *particle-vel* y))) + (vector-float*! *particle-vel* *particle-vel* 0.0033333334) + (when (and sv-20 (< (rand-vu) 0.005)) + (let ((t9-14 sp-launch-particles-var) + (a0-22 *sp-particle-system-2d*) + (a1-9 sv-16) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> s5-3 quad)) + (t9-14 a0-22 a1-9 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + (let ((t9-15 sp-launch-particles-var) + (a0-23 *sp-particle-system-2d*) + (a1-10 sv-16) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> s5-3 quad)) + (t9-15 a0-23 a1-10 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 12 of type bombbot +(defmethod run-logic? bombbot ((obj bombbot)) + #t + ) + +;; definition for method 58 of type bombbot +(defmethod enemy-method-58 bombbot ((obj bombbot) (arg0 process) (arg1 event-message-block)) + ((method-of-type nav-enemy enemy-method-58) obj arg0 arg1) + 'hit-flinch + ) + +;; definition for method 56 of type bombbot +(defmethod damage-amount-from-attack bombbot ((obj bombbot) (arg0 process) (arg1 event-message-block)) + "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" + (-> arg1 param 1) + (let ((f0-1 (the float (penetrate-using->damage (the-as penetrate (-> obj incoming penetrate-using)))))) + (cond + ((logtest? #xc0000 (-> obj incoming penetrate-using)) + (if (and (logtest? #x40000 (-> obj incoming penetrate-using)) + (logtest? #x80000 (-> obj incoming penetrate-using)) + ) + #x42c80000 + (the int (* 1.8 f0-1)) + ) + ) + ((logtest? #x20000 (-> obj incoming penetrate-using)) + (the int (* 2.0 f0-1)) + ) + (else + (the int f0-1) + ) + ) + ) + ) + +;; definition for method 74 of type bombbot +;; INFO: Used lq/sq +(defmethod general-event-handler bombbot ((obj bombbot) (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" + (with-pp + (case arg2 + (('nav-mesh-kill) + (change-to *default-nav-mesh* obj) + #t + ) + (('hit-flinch) + (send-event *traffic-manager* 'set-alert-level 1) + (cond + ((zero? (-> obj hit-points)) + (if (not (and (-> obj next-state) (= (-> obj next-state name) 'die))) + ((method-of-object obj kill-prefer-falling)) + ) + ) + (else + (let ((a1-3 (-> arg3 param 1))) + (when arg0 + (let ((v1-14 (find-offending-process-focusable arg0 (the-as attack-info a1-3)))) + (when v1-14 + (let ((s5-1 (new 'stack-no-clear 'vector))) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (set! (-> s4-1 quad) (-> v1-14 root-override trans quad)) + (let ((s3-1 (matrix->trans (-> obj node-list data 3 bone transform) (new 'stack-no-clear 'vector)))) + (+! (-> s4-1 x) (* 4096.0 (rand-vu-float-range -20.0 20.0))) + (+! (-> s4-1 y) (* 4096.0 (rand-vu-float-range -20.0 20.0))) + (+! (-> s4-1 z) (* 4096.0 (rand-vu-float-range -20.0 20.0))) + (vector-! s5-1 s3-1 s4-1) + ) + ) + (vector-normalize! s5-1 4096000.0) + (vector-inv-orient-by-quat! s5-1 s5-1 (-> obj root-override2 quat)) + (let* ((s4-2 (-> obj rigidbody)) + (v1-26 (-> obj rigidbody)) + (a1-10 (new 'stack-no-clear 'vector)) + (a1-11 (rigid-body-method-23 (-> v1-26 state) a1-10)) + ) + (rigid-body-method-18 (-> s4-2 state) a1-11 s5-1) + ) + ) + ) + ) + ) + ) + 'back + ) + ) + ) + (('explode) + (if (not (and (-> obj next-state) (= (-> obj next-state name) 'explode))) + (go (method-of-object obj explode)) + ) + ) + (('touched 'touch 'attack) + (when (logtest? (process-mask vehicle) (-> arg0 mask)) + (let ((a1-14 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-14 from) (process->ppointer pp)) + (set! (-> a1-14 num-params) 2) + (set! (-> a1-14 message) 'attack) + (set! (-> a1-14 param 0) (-> arg3 param 0)) + (let ((v1-43 (new 'static 'attack-info :mask (attack-info-mask mode id)))) + (let* ((a0-27 *game-info*) + (a2-4 (+ (-> a0-27 attack-id) 1)) + ) + (set! (-> a0-27 attack-id) a2-4) + (set! (-> v1-43 id) a2-4) + ) + (set! (-> v1-43 mode) 'mine) + (set! (-> a1-14 param 1) (the-as uint v1-43)) + ) + (send-event-function arg0 a1-14) + ) + ) + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate notice (bombbot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy notice) enter))) + (if t9-0 + (t9-0) + ) + ) + (react-to-focus self) + (none) + ) + ) + +;; definition for method 181 of type bombbot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-method-181 bombbot ((obj bombbot) (arg0 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (the-as process-drawable #f))) + (let ((f30-0 (the-as float #x7f800000)) + (s3-0 (new 'stack-no-clear 'array 'collide-shape 64)) + ) + (countdown (s2-0 (fill-actor-list-for-sphere *actor-hash* (the-as sphere arg0) s3-0 64)) + (let* ((s1-0 (-> s3-0 s2-0)) + (a0-3 (if (type? s1-0 collide-shape) + s1-0 + ) + ) + ) + (when a0-3 + (let* ((s0-0 (-> a0-3 process)) + (s1-1 (if (type? s0-0 process-focusable) + s0-0 + ) + ) + ) + (when (and s1-1 + (!= obj s1-1) + (not (logtest? (-> obj focus-status) (focus-status inactive))) + (not (logtest? (-> obj focus-status) (focus-status disable))) + (not (logtest? (-> obj focus-status) (focus-status dead))) + (not (logtest? (process-mask guard) (-> s1-1 mask))) + (not (logtest? (process-mask crate) (-> s1-1 mask))) + (logtest? (process-mask vehicle) (-> s1-1 mask)) + s1-1 + (zero? (logand (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) + ) + (let ((f0-0 (vector-vector-xz-distance (-> obj root-override2 trans) (-> s1-1 root trans)))) + (when (or (not gp-0) (< f0-0 f30-0)) + (set! gp-0 s1-1) + (set! f30-0 f0-0) + ) + ) + ) + ) + ) + ) + ) + ) + (if (and *target* (< (vector-vector-distance (target-pos 0) arg0) (-> arg0 w))) + (set! gp-0 *target*) + ) + (cond + (gp-0 + (set! (-> obj target-pos quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) + (let ((v1-34 (-> obj target-pos))) + (let ((a0-16 (-> gp-0 root trans))) + (let ((a1-8 (-> gp-0 root transv))) + (let ((a2-1 0.0)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a1-8 quad)) + ) + (.lvf vf4 (&-> a0-16 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-34 quad) vf6) + ) + (set! (-> obj start-target-pos quad) (-> gp-0 root trans quad)) + (set! (-> obj start-target-vel quad) (-> gp-0 root transv quad)) + (try-update-focus (-> obj focus) (the-as process-focusable gp-0) obj) + ) + (else + (clear-focused (-> obj focus)) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for function bombbot-spread-lightning-lazer +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defun bombbot-spread-lightning-lazer ((arg0 lightning-control) (arg1 vector) (arg2 vector) (arg3 vector)) + (local-vars (sv-656 vector) (sv-672 vector) (sv-688 int) (sv-704 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (set! sv-656 arg1) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> sv-656 quad)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> arg2 quad)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! sv-672 (new 'stack-no-clear 'vector)) + (let ((s2-0 (new 'stack-no-clear 'quaternion))) + (vector-length arg2) + (let ((s1-0 (new 'stack-no-clear 'vector))) + (set! (-> s1-0 quad) (-> arg3 quad)) + (let ((s0-0 (new 'stack-no-clear 'collide-query)) + (f30-0 6144.0) + ) + (vector-normalize! s4-0 f30-0) + (let ((v1-9 (-> sv-656 quad))) + (set! (-> sv-672 quad) v1-9) + ) + (set! sv-688 0) + (while (< sv-688 15) + (let ((v1-11 s0-0)) + (set! (-> v1-11 radius) 6144.0) + (set! (-> v1-11 collide-with) (collide-spec vehicle-sphere hit-by-others-list)) + (set! (-> v1-11 ignore-process0) #f) + (set! (-> v1-11 ignore-process1) #f) + (set! (-> v1-11 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-11 action-mask) (collide-action solid)) + ) + (set! (-> s0-0 start-pos quad) (-> s5-0 quad)) + (set! (-> s0-0 move-dist quad) (-> s4-0 quad)) + (set-from-point-offset-pad! (-> s0-0 bbox) (-> s0-0 start-pos) (-> s0-0 move-dist) (-> s0-0 radius)) + (fill-using-bounding-box *collide-cache* s0-0) + (set! (-> s0-0 radius) 819.2) + (let ((f0-4 (probe-using-line-sphere *collide-cache* s0-0))) + (cond + ((>= f0-4 0.0) + (let ((a1-5 s3-0)) + (let ((v1-18 (-> s0-0 start-pos))) + (let ((a0-14 (-> s0-0 move-dist))) + (let ((a2-2 f0-4)) + (.mov vf7 a2-2) + ) + (.lvf vf5 (&-> a0-14 quad)) + ) + (.lvf vf4 (&-> v1-18 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-5 quad) vf6) + ) + (set! (-> s5-0 quad) (-> s3-0 quad)) + ) + (else + (vector+! (-> s0-0 start-pos) s5-0 s4-0) + (let ((a1-8 (-> s0-0 start-pos))) + (let ((v1-21 (-> s0-0 start-pos))) + (let ((a0-18 s1-0)) + (let ((a2-4 -4096.0)) + (.mov vf7 a2-4) + ) + (.lvf vf5 (&-> a0-18 quad)) + ) + (.lvf vf4 (&-> v1-21 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-8 quad) vf6) + ) + (vector-negate! (-> s0-0 move-dist) s4-0) + (set! f0-4 (probe-using-line-sphere *collide-cache* s0-0)) + (when (>= f0-4 0.0) + (let ((a1-11 s3-0)) + (let ((v1-24 (-> s0-0 start-pos))) + (let ((a0-21 (-> s0-0 move-dist))) + (let ((a2-5 f0-4)) + (.mov vf7 a2-5) + ) + (.lvf vf5 (&-> a0-21 quad)) + ) + (.lvf vf4 (&-> v1-24 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-11 quad) vf6) + ) + (let ((a1-12 s3-0)) + (let ((v1-25 s3-0)) + (let ((a0-22 s1-0)) + (let ((a2-7 4096.0)) + (.mov vf7 a2-7) + ) + (.lvf vf5 (&-> a0-22 quad)) + ) + (.lvf vf4 (&-> v1-25 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-12 quad) vf6) + ) + (set! (-> s5-0 quad) (-> s3-0 quad)) + ) + ) + ) + (cond + ((>= f0-4 0.0) + (+! (-> s3-0 x) (rand-vu-float-range -409.6 409.6)) + (+! (-> s3-0 y) (rand-vu-float-range -409.6 409.6)) + (+! (-> s3-0 z) (rand-vu-float-range -409.6 409.6)) + (set-point! arg0 (-> arg0 state points-to-draw) s3-0) + (+! (-> arg0 state points-to-draw) 1) + (set! sv-704 (-> s0-0 best-other-tri normal)) + (quaternion-from-two-vectors! s2-0 s1-0 sv-704) + (vector-orient-by-quat! s4-0 s4-0 s2-0) + (set! (-> s1-0 quad) (-> sv-704 quad)) + (vector-flatten! s4-0 s4-0 sv-704) + (vector-normalize! s4-0 f30-0) + ) + (else + (vector+! s5-0 s5-0 s4-0) + (when (< sv-688 14) + (set-point! arg0 (-> arg0 state points-to-draw) s5-0) + (+! (-> arg0 state points-to-draw) 1) + ) + ) + ) + ) + (set! sv-688 (+ sv-688 1)) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 182 of type bombbot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-method-182 bombbot ((obj bombbot)) + (local-vars + (v1-28 symbol) + (sv-880 matrix) + (sv-896 (function vector vector quaternion vector)) + (sv-912 vector) + (sv-928 vector) + (sv-944 (function quaternion vector float quaternion)) + (sv-960 quaternion) + (sv-976 vector) + (sv-992 basic) + (sv-1008 process) + (sv-1024 (pointer process)) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s2-0 (handle->process (-> obj focus handle)))) + (set! sv-880 (new 'stack-no-clear 'matrix)) + (let* ((a0-4 (-> obj node-list data 6 bone transform)) + (a2-0 (-> a0-4 quad 0)) + (a1-1 (-> a0-4 quad 1)) + (v1-7 (-> a0-4 quad 2)) + (a0-5 (-> a0-4 trans quad)) + ) + (set! (-> sv-880 quad 0) a2-0) + (set! (-> sv-880 quad 1) a1-1) + (set! (-> sv-880 quad 2) v1-7) + (set! (-> sv-880 trans quad) a0-5) + ) + (new 'stack-no-clear 'matrix) + (let ((s3-0 (new 'stack-no-clear 'collide-query)) + (s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s0-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (matrix->trans sv-880 s4-0) + (let ((a0-7 s4-0)) + (let ((v1-10 s4-0)) + (let ((a1-5 (-> sv-880 vector 2))) + (let ((a2-3 8192.0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a1-5 quad)) + ) + (.lvf vf4 (&-> v1-10 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 (&-> a0-7 quad) vf6) + ) + (vector-normalize-copy! s5-0 (-> sv-880 vector 2) 327680.0) + (set! (-> s3-0 start-pos quad) (-> s4-0 quad)) + (set! (-> s3-0 move-dist quad) (-> s5-0 quad)) + (let ((v1-14 s3-0)) + (set! (-> v1-14 radius) 40.96) + (set! (-> v1-14 collide-with) (collide-spec + backgnd + jak + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + ) + ) + (set! (-> v1-14 ignore-process0) obj) + (set! (-> v1-14 ignore-process1) #f) + (set! (-> v1-14 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-14 action-mask) (collide-action solid)) + ) + (let ((f0-2 (fill-and-probe-using-line-sphere *collide-cache* s3-0))) + (when (>= f0-2 0.0) + (vector-float*! s5-0 s5-0 f0-2) + (vector+! s1-0 (-> s3-0 start-pos) s5-0) + (point-in-plane-<-point+normal! s0-0 s1-0 (-> s3-0 best-other-tri normal)) + (vector-! s0-0 s0-0 s1-0) + (set! sv-896 vector-orient-by-quat!) + (set! sv-912 s0-0) + (set! sv-928 s0-0) + (set! sv-944 quaternion-vector-angle!) + (set! sv-960 (new 'stack-no-clear 'quaternion)) + (set! sv-976 (-> s3-0 best-other-tri normal)) + (let* ((a2-6 (rand-vu-float-range 0.0 65536.0)) + (a2-7 (sv-944 sv-960 sv-976 a2-6)) + ) + (sv-896 sv-912 sv-928 a2-7) + ) + (set! sv-992 (-> s3-0 best-other-tri collide-ptr)) + (let ((v1-25 (if (type? sv-992 collide-shape-prim) + sv-992 + ) + ) + ) + (when v1-25 + (cond + ((logtest? (-> (the-as collide-shape-prim v1-25) prim-core collide-as) (collide-spec vehicle-sphere)) + (set! sv-1008 (get-process *default-dead-pool* lightning-tracker #x4000)) + (set! v1-28 + (when sv-1008 + (set! sv-1024 (the-as (pointer process) v1-28)) + (let ((t9-9 (method-of-type lightning-tracker activate))) + (t9-9 + (the-as lightning-tracker sv-1008) + *entity-pool* + (symbol->string (-> lightning-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (run-now-in-process sv-1008 lightning-tracker-init (-> *lightning-spec-id-table* 13) 30 #f #f #f #f) + (set! sv-1024 (-> sv-1008 ppointer)) + v1-28 + ) + ) + (set-point! (-> (the-as lightning-tracker (-> sv-1024 0)) lightning) 0 s1-0) + (set! (-> (the-as lightning-tracker (-> sv-1024 0)) offset0 quad) (-> s1-0 quad)) + (set! (-> (the-as lightning-tracker (-> sv-1024 0)) lightning state points-to-draw) 1) + (bombbot-spread-lightning-lazer + (-> (the-as lightning-tracker (-> sv-1024 0)) lightning) + s1-0 + s0-0 + (-> s3-0 best-other-tri normal) + ) + (+! (-> (the-as lightning-tracker (-> sv-1024 0)) lightning state points-to-draw) -1) + (set! (-> (the-as lightning-tracker (-> sv-1024 0)) offset1 quad) + (-> (the-as lightning-tracker (-> sv-1024 0)) + lightning + state + path + data + (+ (-> (the-as lightning-tracker (-> sv-1024 0)) lightning state points-to-draw) -1) + quad + ) + ) + ) + ((logtest? (-> (the-as collide-shape-prim v1-25) prim-core collide-as) (collide-spec civilian)) + (let ((s1-1 process-drawable-shock-skel-effect) + (s0-1 (-> (the-as collide-shape-prim v1-25) cshape process)) + ) + (s1-1 + (if (type? s0-1 process-focusable) + s0-1 + ) + (-> *lightning-spec-id-table* 5) + lightning-probe-callback + (-> *part-id-table* 166) + 2048.0 + -1 + -1 + ) + ) + ) + ((logtest? (-> (the-as collide-shape-prim v1-25) prim-core collide-as) (collide-spec jak)) + ) + (else + ) + ) + (when (and s2-0 + s2-0 + (zero? (logand (-> (the-as process-focusable s2-0) focus-status) (focus-status disable dead ignore grabbed))) + ) + (let ((s2-1 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s2-1 ent) (-> obj entity)) + (set! (-> s2-1 charge) 1.0) + (set! (-> s2-1 options) (projectile-options)) + (set! (-> s2-1 notify-handle) (process->handle obj)) + (set! (-> s2-1 owner-handle) (the-as handle #f)) + (set! (-> s2-1 ignore-handle) (process->handle obj)) + (let* ((v1-69 *game-info*) + (a0-67 (+ (-> v1-69 attack-id) 1)) + ) + (set! (-> v1-69 attack-id) a0-67) + (set! (-> s2-1 attack-id) a0-67) + ) + (set! (-> s2-1 timeout) (new 'static 'handle :process #x4b0 :u64 #x4b0)) + (set! (-> s2-1 pos quad) (-> s3-0 start-pos quad)) + (vector+! (-> s2-1 vel) (-> s3-0 start-pos) s5-0) + (vector-normalize-copy! (-> s2-1 vel) (-> s3-0 move-dist) 40960000.0) + (spawn-projectile guard-lazer-shot s2-1 obj *default-dead-pool*) + ) + ) + ) + ) + (when (zero? (-> obj lazer-sound)) + (let ((s3-1 sound-play-by-spec) + (s2-2 (static-sound-spec "bb-laser-fire" :volume 0.0 :mask (pitch))) + ) + (set! (-> s2-2 volume) 1024) + (set! (-> s2-2 pitch-mod) 0) + (set! (-> obj lazer-sound) (the-as uint (s3-1 s2-2 (new-sound-id) s4-0))) + ) + ) + (set! (-> *part-id-table* 4630 init-specs 4 initial-valuef) (vector-length s5-0)) + (draw-beam (-> *part-id-table* 4630) s4-0 s5-0 #f #t) + (let ((t9-20 sp-launch-particles-var) + (a0-76 *sp-particle-system-2d*) + (a1-34 (-> *part-id-table* 4631)) + (a2-20 *launch-matrix*) + ) + (set! (-> a2-20 trans quad) (-> s4-0 quad)) + (t9-20 a0-76 a1-34 a2-20 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-21 sp-launch-particles-var) + (a0-77 *sp-particle-system-2d*) + (a1-35 (-> *part-id-table* 4632)) + (a2-21 *launch-matrix*) + ) + (set! (-> a2-21 trans quad) (-> (vector+! (new 'stack-no-clear 'vector) s5-0 s4-0) quad)) + (t9-21 a0-77 a1-35 a2-21 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (bombbot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self enemy-flags) (logior (enemy-flag actor-pause-backup) (-> self enemy-flags))) + (set! (-> self shield-hit-points) (+ -1.0 (-> self shield-hit-points))) + (none) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) + (if t9-0 + (t9-0) + ) + ) + (sound-stop (the-as sound-id (-> self lazer-sound))) + (sound-stop (the-as sound-id (-> self head-sound))) + (sound-stop (the-as sound-id (-> self cannon-sound))) + (none) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (>= (the int (* 30.0 (-> self shield-hit-points))) (-> self hit-points)) + ) + (when (< (the-as time-frame (-> self next-target)) (-> self clock frame-counter)) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self root-override2 trans quad)) + (set! (-> a1-0 w) 122880.0) + (bombbot-method-181 self a1-0) + ) + (set! (-> self next-target) (the-as uint (+ (-> self clock frame-counter) (seconds 2)))) + (set! (-> self start-target) (the-as uint (-> self clock frame-counter))) + ) + (let ((gp-0 (handle->process (-> self focus handle)))) + (let ((f30-0 1.0)) + (when (and gp-0 (< (fabs (- (-> self target-pos y) (-> self root-override2 trans y))) 20480.0)) + ) + (seek! (-> self legs-strength 0) f30-0 (* 0.5 (-> self clock seconds-per-frame))) + (seek! (-> self legs-strength 1) f30-0 (* 0.5 (-> self clock seconds-per-frame))) + (seek! (-> self legs-strength 2) f30-0 (* 0.5 (-> self clock seconds-per-frame))) + (seek! (-> self legs-strength 3) f30-0 (* 0.5 (-> self clock seconds-per-frame))) + ) + (cond + (gp-0 + (let ((a1-6 (-> self target-pos))) + (let ((v1-34 (-> self start-target-pos))) + (let ((a0-14 (-> self start-target-vel))) + (let ((a2-8 (* 0.0033333334 (the float (- (-> self clock frame-counter) (the-as int (-> self start-target))))))) + (.mov vf7 a2-8) + ) + (.lvf vf5 (&-> a0-14 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-6 quad) vf6) + ) + (cond + ((< (the-as time-frame (+ (-> self next-target) -300)) (-> self clock frame-counter)) + (bombbot-method-182 self) + ) + (else + (sound-stop (the-as sound-id (-> self lazer-sound))) + (set! (-> self lazer-sound) (the-as uint 0)) + 0 + ) + ) + ) + (else + (sound-stop (the-as sound-id (-> self lazer-sound))) + (set! (-> self lazer-sound) (the-as uint 0)) + 0 + ) + ) + ) + (when (= (-> self nav state mesh) *default-nav-mesh*) + (let ((a0-23 (find-nearest-nav-mesh (-> self root-override2 trans) 0.0))) + (when a0-23 + (change-to a0-23 self) + (dotimes (gp-1 4) + (let ((s5-0 (-> self feet gp-1))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-orient-by-quat! s4-0 (-> s5-0 pos-offset) (-> self root-override2 quat)) + (vector+! s4-0 s4-0 (-> self root-override2 trans)) + (set! (-> s5-0 next-position quad) (-> s4-0 quad)) + (set! (-> s5-0 position quad) (-> s4-0 quad)) + ) + (set! (-> s5-0 delta-y) 0.0) + ) + (set! (-> self legs-strength gp-1) 1.0) + ) + ) + ) + ) + (new 'stack-no-clear 'vector) + (let ((f0-28 (* 0.25 (+ (-> self feet 0 next-position y) + (-> self feet 1 next-position y) + (-> self feet 2 next-position y) + (-> self feet 3 next-position y) + ) + ) + ) + ) + (if (!= (-> self nav state mesh) *default-nav-mesh*) + (+! (-> self root-override2 trans y) + (* 4.0 (-> self clock seconds-per-frame) (- f0-28 (-> self root-override2 trans y))) + ) + ) + ) + (if (= (vector-length (-> self root-override2 transv)) 0.0) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (set! (-> self last-head-roty-speed) (-> self head-roty-speed)) + (set! (-> self head-roty-speed) (vector-y-angle (-> self node-list data 4 bone transform vector 2))) + (set! (-> self last-cannon-roty-speed) (-> self cannon-roty-speed)) + (set! (-> self cannon-roty-speed) (vector-y-angle (-> self node-list data 6 bone transform vector 2))) + (let ((f0-39 (deg- (-> self last-head-roty-speed) (-> self head-roty-speed)))) + (cond + ((< 364.0889 (fabs f0-39)) + (when (zero? (-> self head-sound)) + (let ((gp-2 sound-play-by-spec) + (s5-1 (static-sound-spec "bb-turret-loop" :volume 0.0 :mask (pitch))) + ) + (set! (-> s5-1 volume) 1024) + (set! (-> s5-1 pitch-mod) 0) + (set! (-> self head-sound) (the-as uint (gp-2 s5-1 (new-sound-id) (-> self root-override2 trans)))) + ) + ) + ) + (else + (when (nonzero? (-> self head-sound)) + (sound-play "bb-turret-end") + (sound-stop (the-as sound-id (-> self head-sound))) + (set! (-> self head-sound) (the-as uint 0)) + 0 + ) + ) + ) + ) + (let ((f0-43 (deg- (-> self last-cannon-roty-speed) (-> self cannon-roty-speed)))) + (cond + ((< 364.0889 (fabs f0-43)) + (when (zero? (-> self cannon-sound)) + (let ((gp-4 sound-play-by-spec) + (s5-3 (static-sound-spec "bb-laser-loop" :volume 0.0 :mask (pitch))) + ) + (set! (-> s5-3 volume) 1024) + (set! (-> s5-3 pitch-mod) 0) + (set! (-> self cannon-sound) (the-as uint (gp-4 s5-3 (new-sound-id) (-> self root-override2 trans)))) + ) + ) + ) + (else + (when (nonzero? (-> self cannon-sound)) + (sound-stop (the-as sound-id (-> self cannon-sound))) + (sound-play "bb-laser-end") + (set! (-> self cannon-sound) (the-as uint 0)) + 0 + ) + ) + ) + ) + (bombbot-method-180 self) + (none) + ) + ) + :code (behavior () + (until #f + (suspend) + (ja-no-eval :group! bombbot-idle-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim bombbot-idle-ja) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (behavior () + (-> self current-node) + (let ((gp-1 (min (the-as int (+ (-> self current-node) 1)) (the-as int (+ (-> self city-path node-count) -1))))) + (cond + ((= (-> self nav state mesh) *default-nav-mesh*) + (vector-v+! + (-> self root-override2 trans) + (-> self root-override2 trans) + (vector-normalize! + (vector-! + (new 'stack-no-clear 'vector) + (the-as vector (-> self city-path node gp-1)) + (-> self root-override2 trans) + ) + (-> *bombbot-nav-enemy-info* run-travel-speed) + ) + ) + (seek! + (-> self root-override2 trans y) + (-> self city-path node gp-1 position y) + (* 16384.0 (-> self clock seconds-per-frame)) + ) + (track-target! self) + (update-transforms (-> self root-override2)) + ) + (else + (let ((v1-25 (-> self nav state)) + (a0-10 (-> self city-path node gp-1)) + ) + (logclear! (-> v1-25 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-25 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-25 target-post quad) (-> a0-10 position quad)) + ) + 0 + (nav-enemy-method-176 self) + ) + ) + (if (< (vector-vector-xz-distance (-> self root-override2 trans) (the-as vector (-> self city-path node gp-1))) + 32768.0 + ) + (set! (-> self current-node) + (the-as + uint + (min (the-as int (+ (-> self current-node) 1)) (the-as int (+ (-> self city-path node-count) -1))) + ) + ) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die (bombbot) + :virtual #t + :enter (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (set! (-> self explosing) #f) + (set! (-> self beep-time) 0) + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (let ((v1-0 (-> self nav))) + (set! (-> v1-0 target-speed) + (- (-> self nav target-speed) (* 0.4 (-> self clock seconds-per-frame) (-> self nav target-speed))) + ) + ) + 0 + (if (>= (- (-> self clock frame-counter) (-> self state-time)) 0) + (seek! (-> self legs-strength 0) 0.8 (* 10.0 (-> self clock seconds-per-frame))) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.8)) + (seek! (-> self legs-strength 3) 0.4 (* 10.0 (-> self clock seconds-per-frame))) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 1.6)) + (seek! (-> self legs-strength 1) 0.0 (* 10.0 (-> self clock seconds-per-frame))) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 2.4)) + (seek! (-> self legs-strength 2) 0.5 (* 10.0 (-> self clock seconds-per-frame))) + ) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 2.8)) + (sound-play "bb-explode") + (go-virtual explode) + ) + (when (< (-> self beep-time) (-> self clock frame-counter)) + (sound-play "bb-beep") + (set! (-> self beep-time) + (+ (-> self clock frame-counter) + (the int (* 0.2 (the float (- (seconds 2.8) (- (-> self clock frame-counter) (-> self state-time)))))) + ) + ) + ) + (none) + ) + :code (behavior () + (until #f + (suspend) + (ja-no-eval :group! bombbot-idle-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim bombbot-idle-ja) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (behavior () + (nav-enemy-method-176 self) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate explode (bombbot) + :virtual #t + :enter (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (set! (-> self explosing) #f) + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-0 fountain-rand-transv-lo quad) (-> self root-override2 trans quad)) + (set! (-> gp-0 duration) (seconds 3)) + (set! (-> gp-0 gravity) -163840.0) + (set! (-> gp-0 fountain-rand-transv-hi x) 8192.0) + (set! (-> gp-0 fountain-rand-transv-hi y) 32768.0) + (set! (-> gp-0 fountain-rand-transv-hi z) 8192.0) + (set! (-> gp-0 fountain-rand-transv-hi w) 24576.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-bombbot-exploding" (the-as (pointer uint32) #f)) + 6 + gp-0 + *bombbot-exploder-params* + :to self + ) + ) + (let ((v1-23 (new 'stack-no-clear 'vector))) + (set! (-> v1-23 quad) (-> self root-override2 trans quad)) + (set! (-> v1-23 y) (+ 2048.0 (-> v1-23 y))) + ) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (set! (-> gp-1 quad) (-> self node-list data 3 bone transform trans quad)) + (new 'stack-no-clear 'vector) + 4.0 + (activate! *camera-smush-control* 1024.0 37 210 1.0 0.995 (-> self clock)) + (let ((s5-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> s5-1 spawn-point quad) (-> gp-1 quad)) + (quaternion-copy! (-> s5-1 spawn-quat) (-> self root-override2 quat)) + (set! (-> s5-1 radius) 61440.0) + (set! (-> s5-1 group) (-> *part-group-id-table* 1060)) + (set! (-> s5-1 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> s5-1 penetrate-using) (penetrate explode)) + (explosion-spawn self explosion s5-1) + ) + ) + (dotimes (gp-2 4) + (let ((s4-1 (new 'stack-no-clear 'vector)) + (s5-2 (new 'stack-no-clear 'vector)) + ) + (let ((f30-0 (* 16384.0 (the float gp-2)))) + (set-vector! s4-1 (cos f30-0) 0.0 (sin f30-0) 1.0) + ) + (vector-float*! s4-1 s4-1 (* 4096.0 (+ 2.0 (* 2.0 (rand-vu))))) + (set! (-> s5-2 quad) (-> self root-override2 trans quad)) + (vector+! (-> self root-override2 trans) (-> self root-override2 trans) s4-1) + (set! (-> self fact-info-override pickup-type) (pickup-type ammo-random)) + (set! (-> self fact-info-override pickup-amount) 10.0) + (set! (-> self fact-info-override pickup-spawn-amount) 1.0) + (drop-pickup (-> self fact-info-override) #t *entity-pool* (-> self fact-info-override) 0) + (set! (-> self root-override2 trans quad) (-> s5-2 quad)) + ) + ) + (set! (-> self explosing) #t) + (let ((v1-62 (-> self root-override2 root-prim))) + (set! (-> v1-62 prim-core collide-as) (collide-spec)) + (set! (-> v1-62 prim-core collide-with) (collide-spec)) + ) + 0 + (ja-channel-set! 0) + (ja-post) + (none) + ) + :code (behavior () + (while (-> self child) + (suspend) + ) + (none) + ) + ) + +;; definition for method 7 of type bombbot +;; WARN: Return type mismatch nav-enemy vs bombbot. +(defmethod relocate bombbot ((obj bombbot) (arg0 int)) + (dotimes (v1-0 4) + (if (nonzero? (-> obj joint-ik v1-0)) + (&+! (-> obj joint-ik v1-0) arg0) + ) + ) + (if (nonzero? (-> obj rigidbody)) + (&+! (-> obj rigidbody) arg0) + ) + (the-as bombbot ((the-as (function nav-enemy int nav-enemy) (find-parent-method bombbot 7)) obj arg0)) + ) + +;; definition for method 114 of type bombbot +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! bombbot ((obj bombbot)) + "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" + (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 33) 0))) + (set! (-> s5-0 total-prims) (the-as uint 34)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 12288.0 0.0 24576.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-12 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) 0.0 1638.4 0.0 8192.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-14 transform-index) 19) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-16 transform-index) 19) + (set-vector! (-> v1-16 local-sphere) 0.0 4096.0 0.0 2867.2) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-18 transform-index) 19) + (set-vector! (-> v1-18 local-sphere) 0.0 8192.0 0.0 2867.2) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-20 transform-index) 19) + (set-vector! (-> v1-20 local-sphere) 0.0 12288.0 0.0 2867.2) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-22 transform-index) 18) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-24 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-24 transform-index) 18) + (set-vector! (-> v1-24 local-sphere) 0.0 4096.0 0.0 2867.2) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-26 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-26 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-26 transform-index) 18) + (set-vector! (-> v1-26 local-sphere) 0.0 8192.0 0.0 2867.2) + ) + (let ((v1-28 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-28 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-28 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-28 transform-index) 18) + (set-vector! (-> v1-28 local-sphere) 0.0 12288.0 0.0 2867.2) + ) + (let ((v1-30 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-30 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-30 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-30 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-30 transform-index) 13) + (set-vector! (-> v1-30 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-32 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-32 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-32 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-32 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-32 transform-index) 13) + (set-vector! (-> v1-32 local-sphere) 0.0 -4096.0 0.0 2867.2) + ) + (let ((v1-34 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-34 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-34 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-34 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-34 transform-index) 13) + (set-vector! (-> v1-34 local-sphere) 0.0 -8192.0 0.0 2867.2) + ) + (let ((v1-36 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-36 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-36 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-36 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-36 transform-index) 13) + (set-vector! (-> v1-36 local-sphere) 0.0 -12288.0 0.0 2867.2) + ) + (let ((v1-38 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-38 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-38 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-38 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-38 transform-index) 12) + (set-vector! (-> v1-38 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-40 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-40 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-40 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-40 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-40 transform-index) 12) + (set-vector! (-> v1-40 local-sphere) 0.0 -4096.0 0.0 2867.2) + ) + (let ((v1-42 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-42 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-42 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-42 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-42 transform-index) 12) + (set-vector! (-> v1-42 local-sphere) 0.0 -8192.0 0.0 2867.2) + ) + (let ((v1-44 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-44 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-44 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-44 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-44 transform-index) 12) + (set-vector! (-> v1-44 local-sphere) 0.0 -12288.0 0.0 2867.2) + ) + (let ((v1-46 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-46 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-46 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-46 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-46 transform-index) 17) + (set-vector! (-> v1-46 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-48 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-48 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-48 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-48 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-48 transform-index) 17) + (set-vector! (-> v1-48 local-sphere) 0.0 -4096.0 0.0 2867.2) + ) + (let ((v1-50 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-50 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-50 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-50 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-50 transform-index) 17) + (set-vector! (-> v1-50 local-sphere) 0.0 -8192.0 0.0 2867.2) + ) + (let ((v1-52 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-52 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-52 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-52 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-52 transform-index) 17) + (set-vector! (-> v1-52 local-sphere) 0.0 -12288.0 0.0 2867.2) + ) + (let ((v1-54 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-54 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-54 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-54 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-54 transform-index) 16) + (set-vector! (-> v1-54 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-56 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-56 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-56 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-56 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-56 transform-index) 16) + (set-vector! (-> v1-56 local-sphere) 0.0 -4096.0 0.0 2867.2) + ) + (let ((v1-58 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-58 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-58 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-58 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-58 transform-index) 16) + (set-vector! (-> v1-58 local-sphere) 0.0 -8192.0 0.0 2867.2) + ) + (let ((v1-60 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-60 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-60 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-60 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-60 transform-index) 16) + (set-vector! (-> v1-60 local-sphere) 0.0 -12288.0 0.0 2867.2) + ) + (let ((v1-62 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-62 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-62 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-62 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-62 transform-index) 15) + (set-vector! (-> v1-62 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-64 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-64 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-64 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-64 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-64 transform-index) 15) + (set-vector! (-> v1-64 local-sphere) 0.0 4096.0 0.0 2867.2) + ) + (let ((v1-66 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-66 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-66 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-66 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-66 transform-index) 15) + (set-vector! (-> v1-66 local-sphere) 0.0 8192.0 0.0 2867.2) + ) + (let ((v1-68 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-68 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-68 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-68 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-68 transform-index) 15) + (set-vector! (-> v1-68 local-sphere) 0.0 12288.0 0.0 2867.2) + ) + (let ((v1-70 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-70 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-70 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-70 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-70 transform-index) 14) + (set-vector! (-> v1-70 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-72 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-72 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-72 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-72 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-72 transform-index) 14) + (set-vector! (-> v1-72 local-sphere) 0.0 4096.0 0.0 2867.2) + ) + (let ((v1-74 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-74 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-74 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-74 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-74 transform-index) 14) + (set-vector! (-> v1-74 local-sphere) 0.0 8192.0 0.0 2867.2) + ) + (let ((v1-76 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-76 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-76 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) + (set! (-> v1-76 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-76 transform-index) 14) + (set-vector! (-> v1-76 local-sphere) 0.0 12288.0 0.0 2867.2) + ) + (set! (-> s5-0 nav-radius) 16384.0) + (let ((v1-78 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-78 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-78 prim-core collide-with)) + ) + (set! (-> obj root-override2) s5-0) + ) + 0 + (none) + ) + +;; definition for method 60 of type bombbot +(defmethod coin-flip? bombbot ((obj bombbot)) + "@returns The result of a 50/50 RNG roll" + #f + ) + +;; definition for function bombbot-callback +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun bombbot-callback ((arg0 cspace) (arg1 transformq)) + (local-vars + (sv-176 (function quaternion quaternion quaternion quaternion)) + (sv-192 quaternion) + (sv-208 quaternion) + (sv-224 vector) + (sv-240 vector) + ) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (the-as bombbot (-> arg0 param1)))) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) *unity-quaternion*)) + ) + (let ((f30-0 0.0) + (s2-0 (vector-reset! (new 'stack-no-clear 'vector))) + ) + (dotimes (s0-0 4) + (let ((v1-3 (-> s4-0 feet s0-0))) + (let ((a1-2 s2-0)) + (let ((a0-2 s2-0)) + (let ((a2-1 (+ (the-as uint (-> s4-0 feet 0 real-position)) (* 112 s0-0)))) + (let ((a3-3 0.25)) + (.mov vf7 a3-3) + ) + (.lvf vf5 (&-> (the-as (pointer int128) a2-1))) + ) + (.lvf vf4 (&-> a0-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 (&-> a1-2 quad) vf6) + ) + (set! (-> v1-3 main-y) (- (-> s4-0 feet s0-0 real-position y) (-> s4-0 root-override2 trans y))) + (set! (-> v1-3 main-y) (-> v1-3 delta-y)) + (+! f30-0 (* 0.25 (-> v1-3 main-y))) + (set! (-> s1-0 quad) (-> v1-3 pos-offset quad)) + (set! (-> s1-0 y) (* -2.0 (-> v1-3 main-y))) + (new 'stack-no-clear 'vector) + (set! sv-224 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> v1-3 pos-offset) 1.0)) + ) + (set! sv-240 (vector-normalize-copy! (new 'stack-no-clear 'vector) s1-0 1.0)) + (let ((f0-8 (vector-vector-angle-safe sv-224 sv-240))) + (when (!= f0-8 0.0) + (set! sv-176 quaternion*!) + (set! sv-192 s3-0) + (set! sv-208 s3-0) + (let ((t9-4 quaternion-vector-angle!) + (a0-14 (new 'stack-no-clear 'quaternion)) + (a1-8 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> sv-224 quad)) + (.lvf vf2 (&-> sv-240 quad)) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> a1-8 quad) vf3) + (let ((a2-5 (t9-4 a0-14 a1-8 f0-8))) + (sv-176 sv-192 sv-208 a2-5) + ) + ) + ) + ) + ) + (let* ((f0-9 0.0) + (f0-10 (+ -16384.0 f0-9)) + (f2-0 (- f30-0 (-> s4-0 main-pos-y))) + (f1-7 (- (-> s4-0 main-spd-y))) + (f0-12 (+ f0-10 (* 60.0 f2-0) (* 10.0 f1-7))) + ) + (+! (-> s4-0 main-spd-y) (* f0-12 (-> pp clock seconds-per-frame))) + ) + (+! (-> s4-0 main-pos-y) (* (-> s4-0 main-spd-y) (-> pp clock seconds-per-frame))) + (vector-! s2-0 s2-0 (-> s4-0 root-override2 trans)) + (vector-inv-orient-by-quat! s2-0 s2-0 (-> s4-0 root-override2 quat)) + (let ((a1-13 (-> s4-0 main-pos))) + (let ((v1-19 (-> s4-0 main-pos))) + (let ((a0-20 (vector-! (new 'stack-no-clear 'vector) s2-0 (-> s4-0 main-pos)))) + (let ((a2-10 (* 4.0 (-> pp clock seconds-per-frame)))) + (.mov vf7 a2-10) + ) + (.lvf vf5 (&-> a0-20 quad)) + ) + (.lvf vf4 (&-> v1-19 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-13 quad) vf6) + ) + ) + (quaternion-slerp! (-> s4-0 main-quat) (-> s4-0 main-quat) s3-0 0.8) + ) + (quaternion-copy! (-> arg1 quat) (-> s4-0 main-quat)) + (set! (-> arg1 trans quad) (-> s4-0 main-pos quad)) + (set! (-> arg1 trans y) (+ 16384.0 (-> s4-0 main-pos-y))) + (quaternion-copy! (-> arg1 quat) (-> s4-0 rigidbody state rotation)) + (let ((s3-1 (-> arg1 trans)) + (v1-23 (-> s4-0 rigidbody)) + (a1-17 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 quad) (-> (rigid-body-method-23 (-> v1-23 state) a1-17) quad)) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + ) + +;; definition for function bombbot-head-callback +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun bombbot-head-callback ((arg0 cspace) (arg1 transformq)) + (with-pp + (let ((s4-0 (the-as bombbot (-> arg0 param1)))) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'quaternion)) + ) + (let ((a1-1 (-> s4-0 nav state))) + (set! (-> s2-0 quad) (-> a1-1 target-post quad)) + ) + (vector-! s2-0 s2-0 (-> s4-0 root-override2 trans)) + (set! (-> s2-0 y) 0.0) + (vector-normalize! s2-0 1.0) + (quaternion-from-two-vectors! + s3-0 + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 root-override2 quat)) + s2-0 + ) + (quaternion-smooth-seek! (-> s4-0 top-quat) (-> s4-0 top-quat) s3-0 (* 4.0 (-> pp clock seconds-per-frame))) + ) + (quaternion-copy! (-> arg1 quat) (-> s4-0 top-quat)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +;; definition for function bombbot-gun-swivel-callback +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun bombbot-gun-swivel-callback ((arg0 cspace) (arg1 transformq)) + (local-vars (sv-128 vector) (sv-144 vector) (sv-160 vector)) + (with-pp + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (cspace<-parented-transformq-joint! arg0 arg1) + (let ((s3-0 (the-as bombbot (-> arg0 param1)))) + (set! sv-160 (new 'stack-no-clear 'vector)) + (let ((s4-0 (new 'stack-no-clear 'quaternion)) + (s0-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s5-0 (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector))) + ) + (set! sv-144 sv-160) + (set! sv-128 (-> s3-0 target-pos)) + (let ((v0-2 (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector)))) + (.lvf vf4 (&-> sv-128 quad)) + (.lvf vf5 (&-> v0-2 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-144 quad) vf6) + (rot-zxy-from-vector! s0-0 (-> arg0 bone transform vector 2)) + (rot-zxy-from-vector! s0-0 *z-vector*) + (rot-zxy-from-vector! s1-0 sv-160) + (set! (-> s2-0 x) (deg- (-> s1-0 x) (-> s0-0 x))) + (set! (-> s2-0 y) (deg- (-> s1-0 y) (-> s0-0 y))) + (set! (-> s2-0 y) (deg- (-> s1-0 y) 0.0)) + (set! (-> s3-0 angle-turret) + (deg-seek (-> s3-0 angle-turret) (-> s2-0 y) (* 36408.89 (-> pp clock seconds-per-frame))) + ) + (quaternion-vector-angle! s4-0 *up-vector* (-> s3-0 angle-turret)) + (quaternion->matrix (-> arg0 bone transform) s4-0) + (set! (-> arg0 bone transform trans quad) (-> s5-0 quad)) + ) + ) + 0 + (none) + ) + ) + ) + +;; definition for function bombbot-gun-callback +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun bombbot-gun-callback ((arg0 cspace) (arg1 transformq)) + (local-vars (sv-112 vector) (sv-128 vector)) + (with-pp + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (cspace<-parented-transformq-joint! arg0 arg1) + (let ((s4-0 (the-as bombbot (-> arg0 param1)))) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! sv-128 s0-0) + (set! sv-112 (-> s4-0 target-pos)) + (let ((v0-1 (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector)))) + (.lvf vf4 (&-> sv-112 quad)) + (.lvf vf5 (&-> v0-1 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-128 quad) vf6) + (rot-zxy-from-vector! s2-0 (-> arg0 bone transform vector 2)) + (rot-zxy-from-vector! s1-0 s0-0) + (set! (-> s3-0 x) (fmax -2730.6667 (fmin 2730.6667 (deg- (-> s1-0 x) (-> s2-0 x))))) + (set! (-> s3-0 y) (deg- (-> s1-0 y) (-> s2-0 y))) + (set! (-> s4-0 angle-gun) + (deg-seek (-> s4-0 angle-gun) (-> s3-0 x) (* 7281.778 (-> pp clock seconds-per-frame))) + ) + ) + ) + (quaternion-vector-angle! (-> arg1 quat) *x-vector* (-> s4-0 angle-gun)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + ) + +;; definition of type spring-setup +(deftype spring-setup (structure) + ((bpos1 vector :offset-assert 0) + (wpos2 vector :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type spring-setup +(defmethod inspect spring-setup ((obj spring-setup)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'spring-setup) + (format #t "~1Tbpos1: #~%" (-> obj bpos1)) + (format #t "~1Twpos2: #~%" (-> obj wpos2)) + (label cfg-4) + obj + ) + +;; definition for symbol *bombbot-spring-setup*, type (array spring-setup) +(define *bombbot-spring-setup* (new 'static 'boxed-array :type spring-setup + (new 'static 'spring-setup + :bpos1 (new 'static 'vector :x 4096.0 :y -4096.0 :z 4096.0 :w 1.0) + :wpos2 (new 'static 'vector :x 6144.0 :y 14336.0 :z 6144.0 :w 1.0) + ) + (new 'static 'spring-setup + :bpos1 (new 'static 'vector :x 4096.0 :y -4096.0 :z -4096.0 :w 1.0) + :wpos2 (new 'static 'vector :x 6144.0 :y 14336.0 :z -6144.0 :w 1.0) + ) + (new 'static 'spring-setup + :bpos1 (new 'static 'vector :x -4096.0 :y -4096.0 :z -4096.0 :w 1.0) + :wpos2 (new 'static 'vector :x -6144.0 :y 14336.0 :z -6144.0 :w 1.0) + ) + (new 'static 'spring-setup + :bpos1 (new 'static 'vector :x -4096.0 :y -4096.0 :z 4096.0 :w 1.0) + :wpos2 (new 'static 'vector :x -6144.0 :y 14336.0 :z 6144.0 :w 1.0) + ) + ) + ) + +;; definition for method 183 of type bombbot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-method-183 bombbot ((obj bombbot)) + (local-vars (at-0 int) (sv-160 vector) (sv-176 vector)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (vector-reset! a1-0) + (set! (-> a1-0 y) (* -1.0 (-> obj info gravity) (-> obj rigidbody state info mass))) + (rigid-body-method-20 (-> obj rigidbody state) a1-0) + ) + (rigid-body-method-24 (-> obj rigidbody state)) + (logclear! (-> obj rigidbody state flags) (rigid-body-flag active)) + (dotimes (s5-0 4) + (let ((s4-0 (vector-matrix*! + (new 'stack-no-clear 'vector) + (-> *bombbot-spring-setup* s5-0 bpos1) + (-> obj rigidbody state matrix) + ) + ) + ) + (set! sv-160 (new 'stack-no-clear 'vector)) + (let ((v1-22 (-> *bombbot-spring-setup* s5-0 wpos2 quad))) + (set! (-> sv-160 quad) v1-22) + ) + (set! sv-176 (new 'stack-no-clear 'vector)) + (let ((s0-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> sv-160 y) (* (-> obj legs-strength s5-0) (-> sv-160 y))) + (+! (-> sv-160 y) (-> obj feet s5-0 main-y)) + 0.0 + 0.0 + 0.0 + (let ((v1-33 (-> obj rigidbody)) + (a1-3 s4-0) + (a2-1 sv-176) + ) + (rigid-body-method-22 (-> v1-33 state) a1-3 a2-1) + ) + (let ((v1-36 s0-0)) + (.lvf vf4 (&-> s4-0 quad)) + (.lvf vf5 (&-> sv-160 quad)) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-36 quad) vf6) + ) + (let ((a1-4 s1-0) + (v1-37 *null-vector*) + ) + (vector-! a1-4 sv-176 v1-37) + ) + (let ((f0-10 (vector-length s0-0))) + (vector-float*! s2-0 s0-0 (/ 1.0 f0-10)) + (let ((f0-12 (* 60.0 (+ -40.96 f0-10))) + (f1-8 (* 0.8 (vector-dot s1-0 s2-0))) + ) + (vector-float*! s3-0 s2-0 (- (+ f0-12 f1-8))) + ) + ) + (rigid-body-method-18 (-> obj rigidbody state) s4-0 s3-0) + ) + ) + ) + (let ((v1-54 (new 'stack-no-clear 'vector))) + (.lvf vf1 (&-> (-> obj linear-speed) quad)) + (let ((f0-15 (-> pp clock frames-per-second))) + (.mov at-0 f0-15) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-54 quad) vf1) + ) + 0 + (none) + ) + ) + ) + +;; definition for method 184 of type bombbot +;; WARN: Return type mismatch int vs none. +(defmethod bombbot-method-184 bombbot ((obj bombbot)) + (with-pp + (rigid-body-control-method-10 + (-> obj rigidbody) + (the-as rigid-body-object obj) + (-> pp clock seconds-per-frame) + 0.033333335 + ) + 0 + (none) + ) + ) + +;; definition for method 115 of type bombbot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! bombbot ((obj bombbot)) + "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-bombbot" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-enemy-behaviour-and-stats! obj *bombbot-nav-enemy-info*) + (set-vector! (-> obj root-override2 scale) 1.0 1.0 1.0 1.0) + (let ((v1-7 (-> obj nav))) + (set! (-> v1-7 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> obj root-override2 dynam) 573440.0) + (logior! (-> obj nav flags) (nav-control-flag momentum-ignore-heading)) + (dotimes (s5-1 4) + (set! (-> obj joint-ik s5-1) + (new + 'process + 'joint-mod-ik + obj + (-> *bombbot-ik-setup* s5-1 elbow-index) + (-> *bombbot-ik-setup* s5-1 hand-dist) + ) + ) + (set! (-> obj joint-ik s5-1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> obj joint-ik s5-1 elbow-rotation-axis) (the-as uint 0)) + ) + (logior! (-> obj joint-ik 1 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> obj joint-ik 3 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> obj joint-ik 0 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> obj joint-ik 1 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> obj joint-ik 2 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> obj joint-ik 3 flags) (joint-mod-ik-flags elbow-rot-neg)) + (let ((f1-0 11878.4) + (f0-6 10240.0) + ) + (let ((f2-0 -10240.0)) + (let ((v1-51 (-> obj feet))) + (set! (-> v1-51 0 pos-offset x) f1-0) + (set! (-> v1-51 0 pos-offset y) 0.0) + (set! (-> v1-51 0 pos-offset z) f0-6) + (set! (-> v1-51 0 pos-offset w) 1.0) + ) + (set! (-> obj feet 0 offset) 0.0) + (let ((v1-52 (-> obj feet 1))) + (set! (-> v1-52 pos-offset x) f1-0) + (set! (-> v1-52 pos-offset y) 0.0) + (set! (-> v1-52 pos-offset z) f2-0) + (set! (-> v1-52 pos-offset w) 1.0) + ) + (set! (-> obj feet 1 offset) 0.5) + (let ((v1-54 (-> obj feet 2))) + (set! (-> v1-54 pos-offset x) (- f1-0)) + (set! (-> v1-54 pos-offset y) 0.0) + (set! (-> v1-54 pos-offset z) f2-0) + (set! (-> v1-54 pos-offset w) 1.0) + ) + ) + (set! (-> obj feet 2 offset) 0.1) + (let ((v1-56 (-> obj feet 3))) + (set! (-> v1-56 pos-offset x) (- f1-0)) + (set! (-> v1-56 pos-offset y) 0.0) + (set! (-> v1-56 pos-offset z) f0-6) + (set! (-> v1-56 pos-offset w) 1.0) + ) + ) + (set! (-> obj feet 3 offset) 0.6) + (quaternion-copy! (-> obj last-quat) (-> obj root-override2 quat)) + (quaternion-copy! (-> obj main-quat) *unity-quaternion*) + (let ((v1-60 (-> obj nav))) + (set! (-> v1-60 sphere-mask) (the-as uint 64)) + ) + 0 + (let ((a0-28 (-> obj node-list data 3))) + (set! (-> a0-28 param0) bombbot-callback) + (set! (-> a0-28 param1) obj) + ) + (let ((a0-29 (-> obj node-list data 4))) + (set! (-> a0-29 param0) bombbot-head-callback) + (set! (-> a0-29 param1) obj) + ) + (let ((a0-30 (-> obj node-list data 5))) + (set! (-> a0-30 param0) bombbot-gun-swivel-callback) + (set! (-> a0-30 param1) obj) + ) + (let ((a0-31 (-> obj node-list data 6))) + (set! (-> a0-31 param0) bombbot-gun-callback) + (set! (-> a0-31 param1) obj) + ) + (set! (-> obj rigidbody) (new 'process 'rigid-body-control obj)) + (set! (-> obj info) *bombbot-body-constants*) + (rigid-body-method-25 + (-> obj rigidbody state) + (-> obj info info) + *null-vector* + *unity-quaternion* + (method-of-object obj bombbot-method-183) + ) + (set! (-> obj shield-hit-points) 3.0) + (set! (-> obj lazer-sound) (the-as uint (new-sound-id))) + (set! (-> obj head-sound) (the-as uint 0)) + (set! (-> obj cannon-sound) (the-as uint 0)) + (transform-post) + (dotimes (s5-2 4) + (let ((s4-1 (-> obj feet s5-2))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-orient-by-quat! s3-0 (-> s4-1 pos-offset) (-> obj root-override2 quat)) + (vector+! s3-0 s3-0 (-> obj root-override2 trans)) + (set! (-> s4-1 next-position quad) (-> s3-0 quad)) + (set! (-> s4-1 position quad) (-> s3-0 quad)) + ) + (set! (-> s4-1 delta-y) 0.0) + ) + (set! (-> obj legs-strength s5-2) 1.0) + ) + (set! (-> obj draw light-index) (the-as uint 10)) + 0 + (none) + ) + +;; definition of type bombbot-spawn-params +(deftype bombbot-spawn-params (structure) + ((position vector :inline :offset-assert 0) + (quat quaternion :inline :offset-assert 16) + (nav-mesh basic :offset-assert 32) + (path bombbot-path :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + +;; definition for method 3 of type bombbot-spawn-params +(defmethod inspect bombbot-spawn-params ((obj bombbot-spawn-params)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bombbot-spawn-params) + (format #t "~1Tposition: #~%" (-> obj position)) + (format #t "~1Tquat: #~%" (-> obj quat)) + (format #t "~1Tnav-mesh: ~A~%" (-> obj nav-mesh)) + (format #t "~1Tpath: #~%" (-> obj path)) + (label cfg-4) + obj + ) + +;; definition for function bombbot-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior bombbot-init-by-other bombbot ((arg0 bombbot-spawn-params)) + (stack-size-set! (-> self main-thread) 512) + (set! (-> self city-path) (-> arg0 path)) + (set! (-> self current-node) (the-as uint 0)) + (init-enemy-collision! self) + (set! (-> self root-override2 trans quad) (-> self city-path node (-> self current-node) position quad)) + (quaternion-copy! (-> self root-override2 quat) (-> arg0 quat)) + (vector-identity! (-> self root-override2 scale)) + (-> arg0 nav-mesh) + (set! (-> *bombbot-nav-enemy-info* nav-mesh) *default-nav-mesh*) + (init-enemy! self) + (set! (-> self shot-count) (the-as uint 5)) + (set! (-> self last-trans quad) (-> self root-override2 trans quad)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 15) (the-as int #f) (the-as vector #t) 0)) + (set! (-> self mask) (logior (process-mask enemy guard) (-> self mask))) + (go-virtual hostile) + (none) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 186 + 0 + (the-as (function object) (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0 32) + (set-setting! 'exclusive-task #f 0 (-> self node-info task)) + (set! (-> self data-int32 0) 0) + 0 + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 186 + 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* + 186 + 2 + (the-as + (function object) + (lambda :behavior task-manager + () + (when (nonzero? (-> self data-int32 0)) + (let ((gp-0 0)) + (let ((s5-0 10000)) + (dotimes (s4-0 3) + (let* ((s2-0 (-> self slave s4-0 process 0)) + (s3-0 (if (type? s2-0 bombbot) + (the-as bombbot s2-0) + ) + ) + ) + (when s3-0 + (+! gp-0 1) + (let ((v1-14 + (the int (* 0.000030517578 (vector-vector-xz-distance + (-> s3-0 root-override2 trans) + (the-as vector (-> s3-0 city-path node (+ (-> s3-0 city-path node-count) -1))) + ) + ) + ) + ) + ) + (if (< v1-14 s5-0) + (set! s5-0 v1-14) + ) + ) + (when (= (-> s3-0 current-node) (+ (-> s3-0 city-path node-count) -1)) + ) + ) + ) + ) + (set! (-> self data-int32 1) s5-0) + (cond + ((< s5-0 10) + (set! (-> *game-info* timer) (the-as time-frame (the int (* 300.0 (the float s5-0))))) + (let ((v1-25 (handle->process (-> self hud-timer)))) + (if (and *target* (not v1-25)) + (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) + ) + ) + (when (zero? s5-0) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + (go-virtual fail) + ) + ) + (else + (if (handle->process (-> self hud-timer)) + (send-event (handle->process (-> self hud-timer)) 'hide-and-die) + ) + ) + ) + ) + (if (zero? gp-0) + (go-virtual complete) + ) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 186 + 3 + (the-as + (function object) + (lambda :behavior task-manager + () + (while (!= (-> (level-get-target-inside *level*) name) 'ctysluma) + (suspend) + ) + (set! (-> self data-int32 0) 1) + (set-setting! 'airlock #f 0 0) + (set-setting! 'sound-mode #f 0 1) + (let ((gp-1 *traffic-manager*)) + (send-event gp-1 'set-guard-target-count-range 4 0 0) + (send-event gp-1 'set-guard-target-count-range 5 0 0) + ) + (let ((gp-2 (new 'stack 'bombbot-spawn-params))) + (set! (-> gp-2 nav-mesh) (get-nav-mesh (the-as actor-id 9592))) + (set! (-> gp-2 position quad) + (-> (new 'static 'quaternion :x 4387619.0 :y 37262.54 :z 230567.11 :w 1.0) quad) + ) + (quaternion-copy! (-> gp-2 quat) (new 'static 'quaternion :x 0.0006 :y -0.8345 :z -0.0013 :w -0.5509)) + (set! (-> gp-2 path) *bombbot-path-1*) + (set! (-> self slave 0) (ppointer->handle (process-spawn bombbot gp-2 :to self))) + (set! (-> gp-2 path) *bombbot-path-2*) + (set! (-> self slave 1) (ppointer->handle (process-spawn bombbot gp-2 :to self))) + (set! (-> gp-2 path) *bombbot-path-3*) + (set! (-> self slave 2) (ppointer->handle (process-spawn bombbot gp-2 :to self))) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 186 + 4 + (the-as + (function object) + (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (talker-spawn-func (-> *talker-speech* 117) *entity-pool* (target-pos 0) (the-as region #f)) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 186 + 5 + (the-as + (function object) + (lambda :behavior task-manager + () + (when (and *target* + (not (logtest? (-> *target* focus-status) (focus-status dead))) + (zero? (-> self data-int32 1)) + (nonzero? (-> self data-int32 0)) + ) + (cond + ((= (level-status *level* 'ctysluma) 'active) + (set-setting! 'entity-name "camera-236" 0 0) + (set-setting! 'minimap 'clear 0 128) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (suspend) + ) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "bbotxplo" -99.0 0) + (dotimes (gp-1 3) + (let* ((s5-0 (-> self slave gp-1 process 0)) + (a0-7 (if (type? s5-0 bombbot) + s5-0 + ) + ) + ) + (if a0-7 + (send-event a0-7 'explode) + ) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.3)) + (suspend) + ) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (-> self clock seconds-per-frame) + (bucket-id tex-all-map) + ) + (while (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (suspend) + ) + (set-setting! 'interp-time 'abs 0 0) + (remove-setting! 'entity-name) + ) + (else + ) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 186 + 1 + (the-as (function object) (lambda :behavior task-manager () (disable *screen-filter*) (none))) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 297 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set-setting! 'minimap 'clear 0 32) + (set-setting! 'airlock #f 0 0) + (set-setting! 'exclusive-task #f 0 (-> self node-info task)) + (let ((gp-0 *traffic-manager*)) + (send-event gp-0 'set-guard-target-count-range 4 0 0) + (send-event gp-0 'set-guard-target-count-range 5 0 0) + ) + (let ((gp-1 (new 'stack 'bombbot-spawn-params))) + (set! (-> gp-1 nav-mesh) (get-nav-mesh (the-as actor-id 9592))) + (set! (-> gp-1 position quad) + (-> (new 'static 'quaternion :x 4387619.0 :y 37262.54 :z 230567.11 :w 1.0) quad) + ) + (quaternion-copy! (-> gp-1 quat) (new 'static 'quaternion :x 0.0006 :y -0.8345 :z -0.0013 :w -0.5509)) + (set! (-> gp-1 path) *bombbot-path-4*) + (set! (-> self slave 0) (ppointer->handle (process-spawn bombbot gp-1 :to self))) + (set! (-> gp-1 path) *bombbot-path-5*) + (set! (-> self slave 1) (ppointer->handle (process-spawn bombbot gp-1 :to self))) + (set! (-> gp-1 path) *bombbot-path-6*) + (set! (-> self slave 2) (ppointer->handle (process-spawn bombbot gp-1 :to self))) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 297 + 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* + 297 + 2 + (the-as (function object) (lambda :behavior task-manager + () + (let ((gp-0 0)) + 10000 + (dotimes (s5-0 3) + (let* ((s4-0 (-> self slave s5-0 process 0)) + (v1-6 (if (type? s4-0 bombbot) + (the-as bombbot s4-0) + ) + ) + ) + (when v1-6 + (+! gp-0 1) + (when (= (-> v1-6 current-node) (+ (-> v1-6 city-path node-count) -1)) + (set! (-> v1-6 current-node) (the-as uint 0)) + 0 + ) + ) + ) + ) + (if (zero? gp-0) + (go-virtual complete) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 297 + 3 + (the-as (function object) (lambda :behavior task-manager + () + (set! (-> self state-time) (-> self clock frame-counter)) + (until #f + (suspend) + ) + #f + (none) + ) + ) + ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc index c0adcc34f0..dde5da0005 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc @@ -415,7 +415,6 @@ ((method-of-type nav-enemy kill-prefer-falling) obj) ) ) - (none) ) ;; definition for method 90 of type hopper diff --git a/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc b/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc new file mode 100644 index 0000000000..3018a5360b --- /dev/null +++ b/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc @@ -0,0 +1,1643 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type demo-control +(deftype demo-control (process) + ((selected int32 :offset-assert 128) + (sprites hud-sprite 2 :inline :offset-assert 144) + (sprite-pos vector :inline :offset-assert 272) + (sprite-draw uint32 :offset-assert 288) + (buffer external-art-buffer 2 :offset-assert 292) + (want int32 2 :offset-assert 300) + (have int32 2 :offset-assert 308) + (draw int32 :offset-assert 316) + (active symbol :offset-assert 320) + (spark-time time-frame :offset-assert 328) + (gui-id uint32 :offset-assert 336) + ) + :heap-base #xe0 + :method-count-assert 15 + :size-assert #x154 + :flag-assert #xf00e00154 + (:methods + (idle () _type_ :state 14) + ) + ) + +;; definition for method 3 of type demo-control +(defmethod inspect demo-control ((obj demo-control)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Tselected: ~D~%" (-> obj selected)) + (format #t "~2Tsprites[2] @ #x~X~%" (-> obj sprites)) + (format #t "~2Tsprite-pos: ~`vector`P~%" (-> obj sprite-pos)) + (format #t "~2Tsprite-draw: ~D~%" (-> obj sprite-draw)) + (format #t "~2Tbuffer[2] @ #x~X~%" (-> obj buffer)) + (dotimes (s5-0 2) + (format #t "~T [~D]~2Tbuffer: ~A~%" s5-0 (-> obj buffer s5-0)) + ) + (format #t "~2Twant[2] @ #x~X~%" (-> obj want)) + (format #t "~2Thave[2] @ #x~X~%" (-> obj have)) + (format #t "~2Tdraw: ~D~%" (-> obj draw)) + (format #t "~2Tactive: ~A~%" (-> obj active)) + (format #t "~2Tspark-time: ~D~%" (-> obj spark-time)) + (format #t "~2Tgui-id: ~D~%" (-> obj gui-id)) + (label cfg-7) + obj + ) + +;; definition for method 7 of type demo-control +;; WARN: Return type mismatch process vs demo-control. +(defmethod relocate demo-control ((obj demo-control) (arg0 int)) + (dotimes (v1-0 2) + (if (nonzero? (-> obj buffer v1-0)) + (&+! (-> obj buffer v1-0) arg0) + ) + ) + (the-as demo-control ((method-of-type process relocate) obj arg0)) + ) + +;; definition for method 10 of type demo-control +(defmethod deactivate demo-control ((obj demo-control)) + (dotimes (s5-0 2) + (set-pending-file (-> obj buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) + ) + (dotimes (s5-1 2) + (update (-> obj buffer s5-1)) + ) + ((method-of-type process deactivate) obj) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-jak-demo-logo jak-logo jak-logo-lod0-jg -1 + ((jak-logo-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 20) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-jak-demo-stand jak-stand jak-stand-lod0-jg -1 + ((jak-stand-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 20) + :origin-joint-index 3 + ) + +;; definition for function demo-plug-lightning +;; INFO: Used lq/sq +;; WARN: Return type mismatch time-frame vs none. +(defun demo-plug-lightning ((arg0 process-drawable) (arg1 vector) (arg2 cspace)) + (local-vars (sv-32 cspace) (sv-48 int) (sv-64 symbol) (sv-80 int) (sv-96 vector)) + (set! sv-32 arg2) + (let ((s5-0 (get-process *default-dead-pool* lightning-tracker #x4000))) + (when s5-0 + (let ((t9-1 (method-of-type lightning-tracker activate))) + (t9-1 + (the-as lightning-tracker s5-0) + *entity-pool* + (symbol->string (-> lightning-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((s3-0 run-function-in-process) + (s2-0 s5-0) + (s1-0 lightning-tracker-init) + (s0-0 (-> *lightning-spec-id-table* 1)) + ) + (set! sv-48 30) + (set! sv-64 (the-as symbol #f)) + (set! sv-80 (+ (-> sv-32 joint number) 1)) + (set! sv-96 (new 'stack-no-clear 'vector)) + (set! (-> sv-96 x) (+ (-> arg1 x) (rand-vu-float-range -4096.0 4096.0))) + (set! (-> sv-96 y) (+ (-> arg1 y) (rand-vu-float-range -4096.0 4096.0))) + (set! (-> sv-96 z) (+ (-> arg1 z) (rand-vu-float-range -4096.0 4096.0))) + (set! (-> sv-96 w) 1.0) + ((the-as (function object object object object object object object object none) s3-0) + s2-0 + s1-0 + s0-0 + sv-48 + sv-64 + arg0 + sv-80 + sv-96 + ) + ) + (-> s5-0 ppointer) + ) + ) + (let ((v1-20 (handle->process (-> *game-info* controller 0)))) + (if v1-20 + (set! (-> (the-as demo-control v1-20) spark-time) (-> *display* base-clock frame-counter)) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(scene-method-16 + (new 'static 'scene + :name "demo-disk-intro" + :extra #f + :info #f + :mask-to-clear #x1000000 + :entity "scene-stage-47" + :art-group "scenecamera" + :anim "demo-disk-intro" + :parts 10 + :command-list '((0 + (want-force-vis 'ctysluma #t) + (want-force-vis 'ctywide #t) + (kill "ctysluma-part-181") + (kill "ctysluma-part-182") + (kill "ctysluma-part-187") + (kill "ctysluma-part-188") + (send-event "jak-demo-logo" 'color-mult 0 0 0 1) + (apply + ,(lambda () + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 23) + (send-event (ppointer->process *time-of-day*) 'change 'minute 0) + (send-event (ppointer->process *time-of-day*) 'change 'second 0) + (none) + ) + ) + (joint-eval + ,(lambda ((arg0 process-drawable)) + (logior! (-> arg0 draw global-effect) (draw-control-global-effect title-light)) + (case (scf-get-territory) + ((1) + (case (-> *setting-control* user-current language) + (((language-enum spanish)) + (send-event arg0 'segment 32 0) + ) + (((language-enum french)) + (send-event arg0 'segment 64 0) + ) + (else + (send-event arg0 'segment 512 0) + ) + ) + ) + ((2) + (send-event arg0 'segment 256 0) + ) + ) + (none) + ) + entity + "jak-demo-logo" + joint + "plugsparks" + ) + (fadein (seconds (new 'static 'bfloat :data 1.0))) + ) + (10 (want-force-vis 'ctysluma #f) (want-force-vis 'ctywide #f) (send-event *target* 'change-mode 'demo)) + (991 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + (part-tracker + "group-demo-plug" + entity + "jak-demo-logo" + joint + "plugsparks" + track + #t + duration + (frame-range (new 'static 'bfloat :data 991.0) (new 'static 'bfloat :data 1011.0)) + ) + ) + (992 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (998 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 0.3) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (999 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (1004 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (1005 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (1008 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 0.85) + (new 'static 'bfloat :data 0.85) + (new 'static 'bfloat :data 0.85) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (1009 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (1010 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (1011 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + (joint-eval demo-plug-lightning entity "jak-demo-logo" joint "plugsparks") + ) + (1012 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + ) + ) + (1013 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + ) + ) + (1033 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + ) + ) + (1063 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 0.5) + (new 'static 'bfloat :data 1.0) + ) + ) + (1073 + (send-event + "jak-demo-logo" + 'color-mult + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 1.0) + ) + (send-event "jak-demo-logo" 'segment 2 0) + ) + (1105 + (apply + ,(lambda ((arg0 process-drawable) (arg1 vector) (arg2 cspace)) + (with-pp + (let ((v1-1 + (lookup-gui-connection *gui-control* pp (gui-channel art-load) (the-as string #f) (new 'static 'sound-id)) + ) + ) + (if v1-1 + (sound-pause (-> v1-1 id)) + ) + ) + (send-event (handle->process (-> *game-info* controller 0)) 'pause) + (time-of-day-setup #t) + (the-as object (remove-setting! 'half-speed)) + ) + ) + ) + ) + ) + :cut-list '() + :wait-ground-time (seconds 1) + :draw-target #f + :abort #f + :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 'demo + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :light-index #x1e + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-demo-logo" + :level 'demo + :art-group "skel-jak-demo-logo" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x6e + ) + (new 'static 'scene-actor + :name "jak-demo-stand" + :level 'demo + :art-group "skel-jak-demo-stand" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "demo-movie" + :end-point-obj "demo-movie-end" + :borrow '() + :sfx-volume 1.0 + :ambient-volume 1.0 + :blackout-end #f + :peaceful #t + :music-delay 1500.0 + :save #t + ) + ) + +;; definition for function demo-screen-change +;; WARN: Return type mismatch int vs none. +(defbehavior demo-screen-change demo-control ((arg0 symbol) (arg1 int) (arg2 symbol) (arg3 int)) + (when arg3 + (let ((s3-0 (the-as int (-> *setting-control* user-current language)))) + (if (and (= (the-as language-enum s3-0) (language-enum english)) (= (scf-get-territory) 1)) + (set! s3-0 7) + ) + (if (>= (the-as int arg0) 0) + (set! arg0 (the-as symbol (+ (the-as uint arg0) (* 3 s3-0)))) + ) + (if (>= arg1 0) + (+! arg1 (* 3 s3-0)) + ) + ) + ) + (set! (-> self want 0) (the-as int arg0)) + (set! (-> self want 1) (-> self draw)) + (when arg2 + (set-setting! 'bg-a 'abs #x3f800000 0) + (set! (-> *setting-control* user-current bg-a) 1.0) + (apply-settings *setting-control*) + ) + (when (>= (-> self draw) 0) + (set-setting! 'bg-a 'abs #x3f800000 0) + (apply-settings *setting-control*) + (while (!= (-> *setting-control* user-current bg-a) 1.0) + (suspend) + ) + ) + (set! (-> self draw) (the-as int arg0)) + (set! (-> self active) #f) + (while (and (>= (-> self draw) 0) (not (-> self active))) + (suspend) + ) + (remove-setting! 'bg-a) + (set! (-> self want 1) arg1) + 0 + (none) + ) + +;; definition for function demo-wait-for-press +(defun demo-wait-for-press ((arg0 time-frame) (arg1 time-frame) (arg2 symbol)) + (with-pp + (let ((s4-0 (-> pp clock frame-counter)) + (s3-0 #f) + ) + (while (not (or (>= (- (-> pp clock frame-counter) s4-0) arg1) (and (>= (- (-> pp clock frame-counter) s4-0) arg0) s3-0)) + ) + (if (cpad-pressed? 0 triangle) + (set! s3-0 #t) + ) + (suspend) + ) + ) + #f + ) + ) + +;; definition for function demo-menu +;; WARN: Return type mismatch int vs object. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior demo-menu demo-control () + (local-vars (sv-112 font-context)) + (sound-play "dmenu-hit") + (let ((gp-1 (cond + ((= *kernel-boot-message* 'demo-shared) + (new 'static 'boxed-array :type uint32 #x24f #x250 #x123) + ) + ((= (scf-get-territory) 1) + (new 'static 'boxed-array :type uint32 #x24f #x250) + ) + (else + (new 'static 'boxed-array :type uint32 #x24f #x250 #x251) + ) + ) + ) + ) + (until #f + (when (not (paused?)) + (cond + ((and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (> (-> self selected) 0) + ) + (seekl! (-> self selected) 0 1) + (sound-play "dmenu-move") + ) + ((and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (< (-> self selected) (+ (-> gp-1 length) -1)) + ) + (seekl! (-> self selected) (+ (-> gp-1 length) -1) 1) + (sound-play "dmenu-move") + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (sound-play "dmenu-pick") + (return (the-as object (-> self selected))) + ) + ) + (set! sv-112 (new + 'stack + 'font-context + *font-default-matrix* + 64 + 312 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + (let ((v1-25 sv-112)) + (set! (-> v1-25 width) (the float 384)) + ) + (let ((v1-26 sv-112)) + (set! (-> v1-26 height) (the float 50)) + ) + (set! (-> sv-112 flags) (font-flags shadow kerning middle left large)) + (set! (-> sv-112 scale) 0.7) + (dotimes (s5-4 (-> gp-1 length)) + (if (= (-> self selected) s5-4) + (set! (-> sv-112 color) (font-color #f1f104)) + (set! (-> sv-112 color) (font-color #dadada)) + ) + (print-game-text + (lookup-text! *common-text* (the-as game-text-id (-> gp-1 s5-4)) #f) + sv-112 + #f + 44 + (bucket-id progress) + ) + (set! (-> sv-112 origin y) (+ 22.0 (-> sv-112 origin y))) + ) + ) + (suspend) + ) + ) + #f + -1 + ) + +;; failed to figure out what this is: +(defstate idle (demo-control) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('pause) + (let ((v0-0 2)) + (set! (-> *game-info* demo-state) (the-as uint v0-0)) + v0-0 + ) + ) + ) + ) + ) + :code (behavior () + (let ((v1-1 (-> *game-info* demo-state))) + (cond + ((or (zero? v1-1) (= v1-1 1)) + (when (zero? (-> *game-info* demo-state)) + (case (scf-get-territory) + ((2) + (let ((t9-1 demo-screen-change) + (a0-3 25) + (a1-1 26) + (a2-0 #t) + ) + (t9-1 (the-as symbol a0-3) a1-1 a2-0 (the-as int #f)) + (let ((a1-2 (new 'stack-no-clear 'array 'symbol 6))) + (set! (-> a1-2 5) #f) + (set! (-> a1-2 4) #f) + (set! (-> a1-2 3) #f) + (set! (-> a1-2 2) 'ctywide) + (set! (-> a1-2 1) 'ctysluma) + (set! (-> a1-2 0) 'demo) + (want-levels *load-state* a1-2) + ) + (demo-wait-for-press (seconds 1) (seconds 5) a2-0) + ) + (let ((t9-4 demo-screen-change) + (a0-6 26) + (a1-4 -1) + (a2-1 #f) + ) + (t9-4 (the-as symbol a0-6) a1-4 a2-1 (the-as int #f)) + (demo-wait-for-press (seconds 1) (seconds 5) a2-1) + ) + (demo-screen-change (the-as symbol -1) -1 #f (the-as int #t)) + ) + ) + ) + (set! (-> *game-info* demo-state) (the-as uint 1)) + (let ((gp-1 + (ppointer->handle (process-spawn scene-player :init scene-player-init "demo-disk-intro" #t "demo-movie")) + ) + ) + (while (and (handle->process (the-as handle gp-1)) (= (-> *game-info* demo-state) 1)) + (if *target* + (set! (-> *target* control trans quad) (-> (math-camera-pos) quad)) + ) + (set! (-> *game-info* kiosk-timeout) (the-as uint (-> *display* game-clock frame-counter))) + (set! (-> *ACTOR-bank* birth-max) 1000) + (suspend) + ) + ) + (set! (-> *game-info* demo-state) (the-as uint 10)) + ) + ((= v1-1 10) + (set! (-> self gui-id) + (the-as uint (add-process *gui-control* self (gui-channel jak) (gui-action queue) "demoend" -99.0 0)) + ) + (if (and (!= (scf-get-territory) 2) (= (-> *setting-control* user-current language) (language-enum japanese))) + (demo-screen-change (the-as symbol 2) -1 #t (the-as int #f)) + (demo-screen-change (the-as symbol 2) -1 #t (the-as int #t)) + ) + (while (!= (get-status *gui-control* (the-as sound-id (-> self gui-id))) (gui-status ready)) + (suspend) + ) + (set-action! + *gui-control* + (gui-action play) + (the-as sound-id (-> self gui-id)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (cond + ((zero? (scf-get-territory)) + (let ((gp-3 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-3) (seconds 0.38)) + (suspend) + ) + ) + (set! (-> self sprite-draw) (the-as uint 3)) + (set-vector! (-> self sprite-pos) -512.0 40.0 0.0 1.0) + (let ((gp-4 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-4) (seconds 0.25)) + (set! (-> self sprite-pos x) + (lerp-scale -512.0 0.0 (sin (* 218.45334 (the float (- (-> self clock frame-counter) gp-4)))) 0.0 1.0) + ) + (suspend) + ) + ) + (let ((gp-5 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-5) (seconds 2)) + (suspend) + ) + ) + (let ((gp-6 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-6) (seconds 0.25)) + (set! (-> self sprite-pos x) + (lerp-scale 0.0 512.0 (sin (* 218.45334 (the float (- (-> self clock frame-counter) gp-6)))) 0.0 1.0) + ) + (suspend) + ) + ) + (set! (-> self sprite-draw) (the-as uint 1)) + (set-vector! (-> self sprite-pos) 30.0 -240.0 0.0 1.0) + (let ((gp-7 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-7) (seconds 0.25)) + (set! (-> self sprite-pos y) + (lerp-scale -240.0 270.0 (sin (* 218.45334 (the float (- (-> self clock frame-counter) gp-7)))) 0.0 1.0) + ) + (suspend) + ) + ) + (let ((gp-8 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-8) (seconds 2)) + (suspend) + ) + ) + (let ((gp-9 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-9) (seconds 0.25)) + (set! (-> self sprite-pos y) + (lerp-scale 270.0 720.0 (sin (* 218.45334 (the float (- (-> self clock frame-counter) gp-9)))) 0.0 1.0) + ) + (suspend) + ) + ) + (set! (-> self sprite-draw) (the-as uint 2)) + (set-vector! (-> self sprite-pos) 20.0 40.0 0.0 1.0) + (let ((gp-10 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-10) (seconds 0.25)) + (set! (-> self sprite-pos y) + (lerp-scale 720.0 20.0 (sin (* 218.45334 (the float (- (-> self clock frame-counter) gp-10)))) 0.0 1.0) + ) + (suspend) + ) + ) + (let ((a1-21 (new 'stack-no-clear 'array 'symbol 6))) + (set! (-> a1-21 5) #f) + (set! (-> a1-21 4) #f) + (set! (-> a1-21 3) #f) + (set! (-> a1-21 2) 'ctysluma) + (set! (-> a1-21 1) 'ctywide) + (set! (-> a1-21 0) 'demo) + (want-levels *load-state* a1-21) + ) + (let ((gp-11 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-11) (seconds 2)) + (suspend) + ) + ) + (let ((gp-12 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-12) (seconds 0.25)) + (set! (-> self sprite-pos y) + (lerp-scale 20.0 -720.0 (sin (* 218.45334 (the float (- (-> self clock frame-counter) gp-12)))) 0.0 1.0) + ) + (suspend) + ) + ) + ) + (else + (let ((gp-13 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-13) (seconds 0.38)) + (suspend) + ) + ) + (let ((gp-14 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-14) (seconds 2)) + (suspend) + ) + ) + (let ((gp-15 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-15) (seconds 0.25)) + (suspend) + ) + ) + (let ((gp-16 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-16) (seconds 0.25)) + (suspend) + ) + ) + (let ((gp-17 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-17) (seconds 2)) + (suspend) + ) + ) + (let ((gp-18 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-18) (seconds 0.25)) + (suspend) + ) + ) + (let ((gp-19 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-19) (seconds 0.25)) + (suspend) + ) + ) + (let ((gp-20 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-20) (seconds 2)) + (suspend) + ) + ) + (let ((gp-21 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-21) (seconds 0.25)) + (suspend) + ) + ) + ) + ) + (let ((gp-22 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-22) (seconds 3)) + (suspend) + ) + ) + (demo-screen-change (the-as symbol -1) -1 #f (the-as int #t)) + (set! (-> *game-info* demo-state) (the-as uint 1)) + (start 'play (get-continue-by-name *game-info* "demo-start")) + (sleep-code) + ) + ) + ) + (set! (-> self want 0) 5) + (set! (-> self want 1) 6) + (remove-setting! 'allow-timeout) + (set! (-> *setting-control* user-default allow-timeout) #t) + (let ((gp-24 (demo-menu))) + (eval! + (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) + '(fadeout (seconds (new 'static 'bfloat :data 0.3))) + ) + (let ((s5-8 (-> self clock frame-counter))) + (while (or (!= (-> *setting-control* user-current bg-a) (-> *setting-control* user-target bg-a)) + (< (- (-> self clock frame-counter) s5-8) (seconds 0.3)) + ) + (suspend) + ) + ) + (set-blackout-frames (seconds 0.5)) + (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) + (while (-> *setting-control* user-current movie) + (suspend) + ) + (cond + ((zero? gp-24) + (let ((gp-25 (-> self mask))) + (logior! (-> self mask) (process-mask no-kill)) + (play-task (game-task atoll-sig) 'debug #f) + (send-event (ppointer->process *time-of-day*) 'change 'hour 8) + (set! (-> self mask) gp-25) + ) + (set-setting! 'allow-pause #t 0 0) + (let ((gp-27 + (ppointer->handle (process-spawn scene-player :init scene-player-init "atoll-2-intro-demo" #t "hiphog-demo")) + ) + ) + (while (handle->process (the-as handle gp-27)) + (suspend) + ) + ) + (set-setting! 'allow-timeout #f 0 0) + (set-setting! 'allow-pause #f 0 0) + (let ((t9-49 demo-screen-change) + (a0-81 0) + (a1-39 -1) + (a2-30 #t) + ) + (t9-49 (the-as symbol a0-81) a1-39 a2-30 (the-as int #t)) + (demo-wait-for-press (seconds 1) (seconds 15) a2-30) + ) + (demo-screen-change (the-as symbol -1) -1 #f (the-as int #t)) + (start 'play (get-continue-by-name *game-info* "atoll-start")) + ) + ((= gp-24 1) + (let ((gp-29 (-> self mask))) + (logior! (-> self mask) (process-mask no-kill)) + (play-task (game-task strip-rescue) 'debug #f) + (set! (-> self mask) gp-29) + ) + (set-setting! 'allow-pause #t 0 0) + (let ((gp-31 + (ppointer->handle (process-spawn scene-player :init scene-player-init "crane-intro-demo" #t "vinroom-demo")) + ) + ) + (while (handle->process (the-as handle gp-31)) + (suspend) + ) + ) + (let ((gp-32 (-> self mask))) + (logior! (-> self mask) (process-mask no-kill)) + (play-task (game-task strip-rescue) 'debug #f) + (set! (-> *game-info* gun-type) 1) + (logior! (-> *game-info* debug-features) (game-feature board)) + (logior! (-> *game-info* features) (game-feature board)) + (send-event (ppointer->process *time-of-day*) 'change 'hour 8) + (set! (-> self mask) gp-32) + ) + (set-setting! 'allow-timeout #f 0 0) + (set-setting! 'allow-pause #f 0 0) + (let ((t9-63 demo-screen-change) + (a0-105 1) + (a1-54 -1) + (a2-42 #t) + ) + (t9-63 (the-as symbol a0-105) a1-54 a2-42 (the-as int #t)) + (demo-wait-for-press (seconds 1) (seconds 15) a2-42) + ) + (demo-screen-change (the-as symbol -1) -1 #f (the-as int #t)) + (start 'play (get-continue-by-name *game-info* "strip-warp")) + ) + ((= gp-24 2) + (set-setting! 'allow-timeout #f 0 0) + (set-setting! 'allow-pause #f 0 0) + (demo-screen-change (the-as symbol -1) -1 #f (the-as int #t)) + (set! (-> *setting-control* user-default music-volume) 0.0) + (case *kernel-boot-message* + (('demo-shared) + (set! *master-exit* 'force) + ) + (else + (set! *master-exit* 'movie) + ) + ) + ) + ) + ) + (sleep-code) + (none) + ) + :post (behavior () + (local-vars (v1-70 external-art-buffer)) + (let ((gp-0 (the-as process-drawable (command-get-process "jak-demo-logo" (the-as process #f))))) + (when (and gp-0 (nonzero? (-> gp-0 draw))) + (let ((s5-0 (lookup-light-sphere-by-name "big-demo1" (-> self level bsp light-hash))) + (v1-6 (lookup-light-sphere-by-name "big-demo2" (-> self level bsp light-hash))) + ) + (if s5-0 + (set! (-> s5-0 brightness) (-> gp-0 draw color-mult x)) + ) + (if v1-6 + (set! (-> v1-6 brightness) (-> gp-0 draw color-mult x)) + ) + ) + ) + ) + (let ((gp-1 (lookup-light-sphere-by-name "small-demo" (-> self level bsp light-hash)))) + (when gp-1 + (if (>= (- (-> *display* base-clock frame-counter) (-> self spark-time)) (seconds 0.125)) + (set! (-> gp-1 brightness) 0.0) + (set! (-> gp-1 brightness) (rand-vu-float-range 0.5 2.0)) + ) + ) + ) + (dotimes (v1-16 2) + (set! (-> self buffer v1-16 frame-lock) #f) + (set! (-> self have v1-16) -1) + ) + (dotimes (gp-2 2) + (let ((s5-1 (-> self want gp-2))) + (when (>= s5-1 0) + (dotimes (s4-0 2) + (case (file-status (-> self buffer s4-0) "demo-screen" s5-1) + (('locked 'active) + (set! (-> self buffer s4-0 frame-lock) #t) + (set! (-> self have gp-2) s4-0) + ) + ) + ) + ) + ) + ) + (dotimes (gp-3 2) + (let ((a2-1 (-> self want gp-3))) + (when (and (>= a2-1 0) (< (-> self have gp-3) 0)) + (dotimes (v1-42 2) + (when (not (-> self buffer v1-42 frame-lock)) + (set-pending-file (-> self buffer v1-42) "demo-screen" a2-1 (process->handle self) -1.0) + (goto cfg-45) + ) + ) + ) + ) + (label cfg-45) + ) + (dotimes (gp-4 2) + (update (-> self buffer gp-4)) + ) + (set! (-> self active) #f) + (when (>= (-> self draw) 0) + (dotimes (gp-5 2) + (when (file-status (-> self buffer gp-5) "demo-screen" (-> self draw)) + (set! v1-70 (-> self buffer gp-5)) + (goto cfg-58) + ) + ) + (set! v1-70 (the-as external-art-buffer #f)) + (label cfg-58) + (when (and v1-70 (-> v1-70 art-group)) + (draw-raw-image (bucket-id debug-no-zbuf1) (-> v1-70 art-group) 512 416 (-> self level) 8) + (set! (-> self active) #t) + ) + ) + (when (nonzero? (-> self sprite-draw)) + (set! (-> self sprites 0 pos x) (the int (-> self sprite-pos x))) + (set! (-> self sprites 0 pos y) (the int (-> self sprite-pos y))) + (set! (-> self sprites 1 pos quad) (-> self sprites 0 pos quad)) + (case (-> self sprite-draw) + ((1) + (set! (-> self sprites 0 scale-y) 1.0) + (set! (-> self sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #x74c))) + (set! (-> self sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #x74c))) + (+! (-> self sprites 0 pos y) -256) + ) + ((2) + (set! (-> self sprites 0 scale-y) 2.0) + (set! (-> self sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x74c))) + (set! (-> self sprites 1 tex) #f) + ) + ((3) + (set! (-> self sprites 0 scale-y) 1.0) + (set! (-> self sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #x74c))) + (set! (-> self sprites 1 tex) #f) + ) + ) + (let* ((s5-2 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-6 (-> s5-2 base)) + ) + (dotimes (s4-1 2) + (if (and (-> self sprites s4-1 tex) (!= (-> self sprites s4-1 scale-x) 0.0)) + (draw (-> self sprites s4-1) s5-2 (-> self level)) + ) + ) + (let ((a3-6 (-> s5-2 base))) + (let ((v1-102 (the-as object (-> s5-2 base)))) + (set! (-> (the-as dma-packet v1-102) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-102) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-102) vif1) (new 'static 'vif-tag)) + (set! (-> s5-2 base) (&+ (the-as pointer v1-102) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id progress) + gp-6 + (the-as (pointer dma-tag) a3-6) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for function demo-control-init +;; WARN: Return type mismatch object vs none. +(defbehavior demo-control-init demo-control () + (stack-size-set! (-> self main-thread) 2048) + (logclear! (-> self mask) (process-mask freeze pause menu progress actor-pause)) + (set! (-> self level) (level-get *level* 'demo)) + (let ((a1-2 (if (and (nonzero? (-> self level entity)) (> (-> self level entity length) 0)) + (-> self level entity data 0 entity) + ) + ) + ) + (process-entity-set! self (the-as entity-actor a1-2)) + ) + (set-setting! 'allow-pause #f 0 0) + (set-setting! 'allow-progress #f 0 0) + (set-setting! 'airlock #f 0 0) + (set-setting! 'music #f 0 0) + (set-setting! 'allow-timeout #f 0 0) + (apply-settings *setting-control*) + (dotimes (gp-0 2) + (set! (-> self buffer gp-0) + (new + 'process + 'external-art-buffer + gp-0 + (lambda ((arg0 external-art-buffer)) + (let ((gp-0 (level-get *level* 'demo))) + (cond + ((not (-> gp-0 user-object (-> arg0 index))) + (let ((s4-0 (-> arg0 heap))) + (set! (-> s4-0 base) (kmalloc (-> gp-0 heap) #xd0000 (kmalloc-flags) "heap")) + (set! (-> s4-0 current) (-> s4-0 base)) + (set! (-> s4-0 top-base) (&+ (-> s4-0 base) #xd0000)) + (set! (-> s4-0 top) (-> s4-0 top-base)) + ) + (set! (-> gp-0 user-object (-> arg0 index)) (the-as basic (-> arg0 heap base))) + ) + (else + (let ((v1-10 (-> arg0 heap))) + (set! (-> v1-10 base) (the-as pointer (-> gp-0 user-object (-> arg0 index)))) + (set! (-> v1-10 current) (-> v1-10 base)) + (set! (-> v1-10 top-base) (&+ (-> v1-10 base) #xd0000)) + (set! (-> v1-10 top) (-> v1-10 top-base)) + ) + ) + ) + ) + 0 + (none) + ) + #f + ) + ) + ) + (set! (-> self selected) 0) + (dotimes (v1-32 2) + (set! (-> self want v1-32) -1) + (set! (-> self have v1-32) -1) + ) + (set! (-> self draw) -1) + (set! (-> self active) #f) + (dotimes (v1-36 2) + (let ((a0-14 (&+ (-> self sprites 0 color2) (* v1-36 64)))) + (set! (-> a0-14 0) 128) + (set! (-> a0-14 1) 128) + (set! (-> a0-14 2) 128) + (set! (-> a0-14 3) 128) + ) + (set! (-> self sprites v1-36 pos z) #xffffff) + (set! (-> self sprites v1-36 pos w) 0) + (set! (-> self sprites v1-36 scale-x) 1.0) + (set! (-> self sprites v1-36 scale-y) 1.0) + (set! (-> self sprites v1-36 angle) 0.0) + (set! (-> self sprites v1-36 flags) (the-as uint 0)) + (set! (-> self sprites v1-36 tex) #f) + ) + (set! (-> self sprite-draw) (the-as uint 0)) + (set! *demo-control* (the-as (pointer demo-control) (process->ppointer self))) + (set! (-> *game-info* controller 0) (process->handle self)) + (go-virtual idle) + (none) + ) + +;; failed to figure out what this is: +(defstate target-demo (target) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('change-mode) + (case (-> event param 0) + (('grab) + (if (not (-> event param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + ) + (else + (target-generic-event-handler proc arg1 event-type event) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (let ((a0-1 (-> *hud-engine* alive-list next0))) + *hud-engine* + (let ((s5-0 (-> a0-1 next0))) + (while (!= a0-1 (-> *hud-engine* alive-list-end)) + (deactivate ((method-of-type connection get-process) (the-as connection a0-1))) + (set! a0-1 s5-0) + *hud-engine* + (set! s5-0 (-> s5-0 next0)) + ) + ) + ) + (ja-channel-set! 0) + (when arg0 + (send-event (ppointer->process (-> *setting-control* user-current movie)) 'abort) + (kill-by-type demo-control *active-pool*) + (set! (-> self game controller 0) + (ppointer->handle (process-spawn demo-control :init demo-control-init :to *entity-pool*)) + ) + ) + (none) + ) + :code (the-as (function symbol none :behavior target) sleep-code) + :post target-no-move-post + ) + +;; failed to figure out what this is: +(defpartgroup group-demo-sign-naughtydog + :id 1290 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 5474 :flags (is-3d launch-asap bit7)) + (sp-item 5475 :flags (is-3d launch-asap bit7)) + (sp-item 5476 :fade-after (meters 200) :flags (bit6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 5476 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 32) (meters 0.1) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-rnd-flt spt-scale-y (meters 48) (meters 0.1) 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 10.0 2.0 1.0) + (sp-flt spt-omega 822476.8) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5474 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x754)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters 0.1)) + (sp-flt spt-scale-x (meters 16)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 8)) + (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-int spt-timer -1) + (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 5 0 0 #x75400300 -2139062144 0 1 #x75400300 #x60606060 #x202020 1) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5475 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #x754)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters -0.1)) + (sp-flt spt-scale-x (meters 16)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 180.0)) + (sp-flt spt-scale-y (meters 8)) + (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-int spt-timer -1) + (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 5 0 0 #x75400300 -2139062144 0 1 #x75400300 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-demo-sign-big-praxis + :id 1291 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 8) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 5477 :flags (is-3d launch-asap bit7)) + (sp-item 5478 :flags (is-3d launch-asap bit7)) + (sp-item 5479 :fade-after (meters 200) :flags (bit6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 5479 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 48) (meters 0.1) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-rnd-flt spt-scale-y (meters 32) (meters 0.1) 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 10.0 2.0 1.0) + (sp-flt spt-omega 822476.8) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5477 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x754)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 16)) + (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-int spt-timer -1) + (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 5 0 0 #x75400000 -2139062144 0 1 #x75400000 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5478 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x754)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters -0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 180.0)) + (sp-flt spt-scale-y (meters 16)) + (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-int spt-timer -1) + (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 5 0 0 #x75400000 -2139062144 0 1 #x75400000 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-demo-sign-wanted + :id 1292 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 5480 :flags (is-3d launch-asap bit7)) + (sp-item 5481 :flags (is-3d launch-asap bit7)) + (sp-item 5482 :fade-after (meters 200) :flags (bit6) :hour-mask #b111111111110000000) + ) + ) + +;; failed to figure out what this is: +(defpart 5482 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 32) (meters 0.1) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-rnd-flt spt-scale-y (meters 32) (meters 0.1) 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 10.0 2.0 1.0) + (sp-flt spt-omega 822476.8) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5480 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x754)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 8)) + (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-int spt-timer -1) + (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 5 0 0 #x75400200 -2139062144 0 1 #x75400200 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5481 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x754)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters -0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 180.0)) + (sp-flt spt-scale-y (meters 8)) + (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-int spt-timer -1) + (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 5 0 0 #x75400200 -2139062144 0 1 #x75400200 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-demo-sign-scea + :id 1293 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 4) + :rotate ((degrees 0) (degrees 4) (degrees 0)) + :parts ((sp-item 5483 :flags (is-3d launch-asap bit7)) (sp-item 5484 :flags (is-3d launch-asap bit7))) + ) + +;; failed to figure out what this is: +(defpart 5483 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x754)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters 0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 8)) + (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-int spt-timer -1) + (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 5 0 0 #x75400100 -2139062144 0 1 #x75400100 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5484 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x754)) + (sp-flt spt-num 1.0) + (sp-flt spt-z (meters -0.05)) + (sp-flt spt-scale-x (meters 8)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-z (degrees 180.0)) + (sp-flt spt-scale-y (meters 8)) + (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-int spt-timer -1) + (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 5 0 0 #x75400100 -2139062144 0 1 #x75400100 -2141167520 #x202020 0) + ) + (sp-func spt-func 'sparticle-texture-day-night) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(when (= (scf-get-territory) 1) + (let ((v1-40 (get-field-spec-by-id (-> *part-id-table* 5483) (sp-field-id spt-userdata)))) + (if v1-40 + (set! (-> v1-40 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 #x75400400 -2139062144 0 1 #x75400400 -2141167520 #x202020 0) + ) + ) + ) + ) + (let ((v1-43 (get-field-spec-by-id (-> *part-id-table* 5484) (sp-field-id spt-userdata)))) + (if v1-43 + (set! (-> v1-43 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 #x75400400 -2139062144 0 1 #x75400400 -2141167520 #x202020 0) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(when (= (scf-get-territory) 2) + (let ((v1-47 (get-field-spec-by-id (-> *part-id-table* 5483) (sp-field-id spt-userdata)))) + (if v1-47 + (set! (-> v1-47 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 #x75400500 -2139062144 0 1 #x75400500 -2141167520 #x202020 0) + ) + ) + ) + ) + (let ((v1-50 (get-field-spec-by-id (-> *part-id-table* 5484) (sp-field-id spt-userdata)))) + (if v1-50 + (set! (-> v1-50 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 #x75400500 -2139062144 0 1 #x75400500 -2141167520 #x202020 0) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(when (= (scf-get-territory) 3) + (let ((v1-54 (get-field-spec-by-id (-> *part-id-table* 5483) (sp-field-id spt-userdata)))) + (if v1-54 + (set! (-> v1-54 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 #x75400600 -2139062144 0 1 #x75400600 -2141167520 #x202020 0) + ) + ) + ) + ) + (let ((v1-57 (get-field-spec-by-id (-> *part-id-table* 5484) (sp-field-id spt-userdata)))) + (if v1-57 + (set! (-> v1-57 initial-valuef) + (the-as + float + (new 'static 'boxed-array :type int32 5 0 0 #x75400600 -2139062144 0 1 #x75400600 -2141167520 #x202020 0) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-demo-plug + :id 1294 + :linger-duration (seconds 2) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5485 :flags (bit6) :period 1500 :length 150) + (sp-item 5486 :flags (bit6) :period 1500 :length 150) + (sp-item 5487 :period 1500 :length 200) + (sp-item 5487 :period 1500 :length 100) + (sp-item 5487 :period 1500 :length 70) + (sp-item 5487 :period 1500 :length 45) + (sp-item 5487 :period 1500 :length 30) + (sp-item 5487 :period 1500 :length 25) + (sp-item 5487 :period 1500 :length 20) + (sp-item 5487 :period 1500 :length 15) + ) + ) + +;; failed to figure out what this is: +(defpart 5485 + :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 5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 1638.4) + (sp-rnd-flt spt-rot-z (degrees -5.0) (degrees 10.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 200.0 55.0 1.0) + (sp-rnd-flt spt-a 20.0 4.0 1.0) + (sp-flt spt-omega 411648.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 6144.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5486 + :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 32) (meters 0.1) 1.0) + (sp-flt spt-rot-x 1638.4) + (sp-rnd-flt spt-rot-z (degrees -2.0) (degrees 4.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 255.0 255.0 1.0) + (sp-rnd-flt spt-b 200.0 55.0 1.0) + (sp-rnd-flt spt-a 8.0 4.0 1.0) + (sp-flt spt-omega 1231667.2) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 6144.0) + ) + ) + +;; failed to figure out what this is: +(defpart 5487 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-rnd-flt spt-num 1.0 1.0 1.0) + (sp-flt spt-scale-x (meters 1.5)) + (sp-int spt-rot-x 4) + (sp-flt spt-scale-y (meters 0.05)) + (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 64.0 1.0) + (sp-flt spt-omega 8.192) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-fade-r -0.85 -0.85 1.0) + (sp-rnd-flt spt-fade-g -1.7 -1.7 1.0) + (sp-flt spt-fade-b -8.0) + (sp-rnd-flt spt-accel-y -6.826667 -2.7306666 1.0) + (sp-flt spt-friction 0.96) + (sp-int-plain-rnd spt-timer 300 1199 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (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) + ) + ) diff --git a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc index 4860e0c860..1d9f3f34d4 100644 --- a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc @@ -260,48 +260,42 @@ For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targett ) ;; definition for method 74 of type pegasus -;; WARN: Return type mismatch none vs object. (defmethod general-event-handler pegasus ((obj pegasus) (proc process) (arg2 int) (event-type symbol) (event 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" (with-pp - (let ((v1-0 event-type)) - (the-as - object - (cond - ((= v1-0 'track) - #f - ) - ((or (= v1-0 'hit) (= v1-0 'hit-knocked)) - (cond - ((zero? (-> obj hit-points)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) - ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (set! (-> obj enemy-flags) (logior (enemy-flag actor-pause-backup) (-> obj enemy-flags))) - (process-contact-action proc) - (send-event proc 'get-attack-count 1) - (the-as object (kill-prefer-falling obj)) + (case event-type + (('track) + #f + ) + (('hit 'hit-knocked) + (cond + ((zero? (-> obj hit-points)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> obj focus-status) (focus-status dangerous)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) + (logior! (-> obj focus-status) (focus-status hit)) + (if (zero? (-> obj hit-points)) + (logior! (-> obj focus-status) (focus-status dead)) ) - (else - (let ((v0-0 (the-as object (-> pp clock frame-counter)))) - (set! (-> obj targetted-timer) (the-as time-frame v0-0)) - v0-0 - ) - ) + (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 obj) + (set! (-> obj enemy-flags) (logior (enemy-flag actor-pause-backup) (-> obj enemy-flags))) + (process-contact-action proc) + (send-event proc 'get-attack-count 1) + (kill-prefer-falling obj) + ) + (else + (let ((v0-0 (the-as object (-> pp clock frame-counter)))) + (set! (-> obj targetted-timer) (the-as time-frame v0-0)) + v0-0 ) ) - (else - ((method-of-type enemy general-event-handler) obj proc arg2 event-type event) - ) - ) + ) + ) + (else + ((method-of-type enemy general-event-handler) obj proc arg2 event-type event) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-obs_REF.gc new file mode 100644 index 0000000000..ec47b0dd28 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-obs_REF.gc @@ -0,0 +1,482 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function fortress-login +;; WARN: Return type mismatch int vs none. +(defun fortress-login () + (set! *nav-network* (new 'loading-level 'nav-network)) + (nav-network-method-9 *nav-network*) + 0 + (none) + ) + +;; definition for function fortress-deactivate +;; WARN: Return type mismatch int vs none. +(defun fortress-deactivate () + (set! *nav-network* (the-as nav-network 0)) + 0 + (none) + ) + +;; definition for function fortress-activate +(defun fortress-activate ((arg0 level)) + (nav-network-method-10 *nav-network* arg0 *fortress-adjacency*) + (none) + ) + +;; definition of type fort-elec-button +(deftype fort-elec-button (cty-guard-turret-button) + ((start-up? symbol :offset-assert 288) + ) + :heap-base #xb0 + :method-count-assert 41 + :size-assert #x124 + :flag-assert #x2900b00124 + (:methods + (waiting () _type_ :state 40) + ) + ) + +;; definition for method 3 of type fort-elec-button +(defmethod inspect fort-elec-button ((obj fort-elec-button)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type cty-guard-turret-button inspect))) + (t9-0 obj) + ) + (format #t "~2Tstart-up?: ~A~%" (-> obj start-up?)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-fort-elec-button cty-guard-turret-button cty-guard-turret-button-lod0-jg cty-guard-turret-button-idle-ja + ((cty-guard-turret-button-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + ) + +;; failed to figure out what this is: +(defstate waiting (fort-elec-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger) + (go-virtual pop-up) + ) + ) + ) + :code (the-as (function none :behavior fort-elec-button) sleep-code) + ) + +;; definition for method 33 of type fort-elec-button +;; WARN: Return type mismatch int vs none. +(defmethod basebutton-method-33 fort-elec-button ((obj fort-elec-button)) + "TODO - joint stuff" + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-elec-button" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (cond + ((-> obj start-up?) + (let ((a0-4 (-> obj skel root-channel 0))) + (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> a0-4 frame-num) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 3)) frames num-frames) -1)) + ) + (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + ) + ) + (else + (let ((a0-5 (-> obj skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + ) + ) + ) + (transform-post) + (none) + ) + +;; definition for method 35 of type fort-elec-button +;; WARN: Return type mismatch process-mask vs none. +(defmethod prepare-trigger-event! fort-elec-button ((obj fort-elec-button)) + "Sets `event-going-down` to `'trigger`" + (set! (-> obj start-up?) (= 1 (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0))) + (set! (-> obj event-going-down) 'trigger) + (process-entity-status! obj (entity-perm-status no-kill) #t) + (logclear! (-> obj mask) (process-mask actor-pause)) + (none) + ) + +;; definition for method 32 of type fort-elec-button +(defmethod idle-state-transition fort-elec-button ((obj fort-elec-button)) + "If `button-status` has [[button-status:0]] set, transition to [[basebutton::27]] otherwise, [[basebutton::30]]" + (cond + ((-> obj start-up?) + (let ((s5-0 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-0 + (the-as art-joint-anim (-> obj draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-0 frame-num) 0.0) + ) + (go (method-of-object obj up-idle)) + ) + (else + (go (method-of-object obj waiting)) + ) + ) + ) + +;; definition of type fort-led +(deftype fort-led (process-drawable) + ((button-actor entity-actor :offset-assert 200) + ) + :heap-base #x50 + :method-count-assert 22 + :size-assert #xcc + :flag-assert #x16005000cc + (:methods + (red () _type_ :state 20) + (green () _type_ :state 21) + ) + ) + +;; definition for method 3 of type fort-led +(defmethod inspect fort-led ((obj fort-led)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tbutton-actor: ~A~%" (-> obj button-actor)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-fort-led fort-led fort-led-lod0-jg fort-led-idle-ja + ((fort-led-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; failed to figure out what this is: +(defstate red (fort-led) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger) + (go-virtual green) + ) + ) + ) + :code (behavior () + (setup-masks (-> self draw) 4 2) + (ja-post) + (sleep-code) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate green (fort-led) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('untrigger) + (go-virtual red) + ) + ) + ) + :code (behavior () + (setup-masks (-> self draw) 2 4) + (ja-post) + (sleep-code) + (none) + ) + ) + +;; definition for method 11 of type fort-led +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! fort-led ((obj fort-led) (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-fort-led" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj button-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (if (and (-> obj button-actor) + (logtest? (-> obj button-actor extra perm status) (entity-perm-status subtask-complete)) + ) + (go (method-of-object obj green)) + (go (method-of-object obj red)) + ) + (none) + ) + +;; definition of type elec-lock-gate +(deftype elec-lock-gate (fort-elec-gate) + ((actor-group (pointer actor-group) :offset-assert 516) + (actor-group-count int32 :offset-assert 520) + (all-gone? symbol :offset-assert 524) + ) + :heap-base #x190 + :method-count-assert 32 + :size-assert #x210 + :flag-assert #x2001900210 + (:methods + (pre-shutdown () _type_ :state 30) + (elec-lock-gate-method-31 (_type_ symbol) symbol 31) + ) + ) + +;; definition for method 3 of type elec-lock-gate +(defmethod inspect elec-lock-gate ((obj elec-lock-gate)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type fort-elec-gate inspect))) + (t9-0 obj) + ) + (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) + (dotimes (s5-0 (-> obj actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) + (format #t "~2Tall-gone?: ~A~%" (-> obj all-gone?)) + (label cfg-7) + obj + ) + +;; failed to figure out what this is: +(defstate active (elec-lock-gate) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger) + (if (elec-lock-gate-method-31 self (the-as symbol proc)) + (go-virtual pre-shutdown) + ) + ) + (else + ((-> (method-of-type elec-gate active) event) proc arg1 event-type event) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate pre-shutdown (elec-lock-gate) + :virtual #t + :trans (-> (method-of-type elec-lock-gate active) trans) + :code (behavior () + (let ((a0-0 *target*)) + (when (and a0-0 (< 81920.0 (vector-vector-distance (get-trans a0-0 0) (-> self root trans)))) + (set! (-> self quality-enabled?) #f) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 0.5)) + (suspend) + ) + ) + (hide-hud-quick #f) + (set-setting! 'entity-name "camera-243" 0 0) + (set-setting! 'process-mask 'set 0 (process-mask movie enemy)) + (process-grab? *target* #f) + (let ((gp-2 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-2) (seconds 2)) + (suspend) + ) + ) + ) + ) + (go-virtual shutdown) + (none) + ) + :post (-> (method-of-type elec-lock-gate active) post) + ) + +;; failed to figure out what this is: +(defstate shutdown (elec-lock-gate) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (the-as state (find-parent-method elec-lock-gate 22)) enter))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (set! (-> self all-gone?) #f) + (none) + ) + :trans (behavior () + (let ((gp-0 #t)) + (dotimes (s5-0 5) + (let ((s4-0 (-> self l-bolt s5-0))) + (seek! (-> s4-0 pos) 0.0 (* (- 1.14 (-> s4-0 pos)) (-> self clock seconds-per-frame))) + (set! gp-0 (cond + ((or (< 1.0 (-> s4-0 pos)) (>= 0.0 (-> s4-0 pos))) + (let ((v1-9 (-> self l-bolt s5-0 bolt)) + (a0-1 3) + ) + (let ((a1-2 (!= a0-1 (-> v1-9 state mode)))) + (case a0-1 + ((3) + (if a1-2 + (set! (-> v1-9 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-9 state start-color) (-> v1-9 spec start-color)) + (set! (-> v1-9 state end-color) (-> v1-9 spec end-color)) + ) + ) + ) + (set! (-> v1-9 state mode) (the-as lightning-mode a0-1)) + ) + (let ((v1-12 (-> self l-bolt s5-0 ring 0)) + (a0-2 3) + ) + (let ((a1-12 (!= a0-2 (-> v1-12 state mode)))) + (case a0-2 + ((3) + (if a1-12 + (set! (-> v1-12 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-12 state start-color) (-> v1-12 spec start-color)) + (set! (-> v1-12 state end-color) (-> v1-12 spec end-color)) + ) + ) + ) + (set! (-> v1-12 state mode) (the-as lightning-mode a0-2)) + ) + (let ((v1-15 (-> self l-bolt s5-0 ring 1)) + (a0-3 3) + ) + (let ((a1-22 (!= a0-3 (-> v1-15 state mode)))) + (case a0-3 + ((3) + (if a1-22 + (set! (-> v1-15 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-15 state start-color) (-> v1-15 spec start-color)) + (set! (-> v1-15 state end-color) (-> v1-15 spec end-color)) + ) + ) + ) + (set! (-> v1-15 state mode) (the-as lightning-mode a0-3)) + ) + gp-0 + ) + (else + #f + ) + ) + ) + ) + ) + (set! (-> self all-gone?) gp-0) + ) + (none) + ) + :code (behavior () + (until (-> self all-gone?) + (let ((gp-0 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-0) (seconds 0.5)) + (suspend) + ) + ) + ) + (set-setting! 'interp-time 'abs 0 0) + (remove-setting! 'entity-name) + (remove-setting! 'process-mask) + (dotimes (gp-1 2) + (suspend) + ) + (remove-setting! 'interp-time) + (process-release? *target*) + (go-virtual idle) + (none) + ) + ) + +;; definition for method 31 of type elec-lock-gate +(defmethod elec-lock-gate-method-31 elec-lock-gate ((obj elec-lock-gate) (arg0 symbol)) + (dotimes (v1-0 (-> obj actor-group-count)) + (dotimes (a2-0 (-> obj actor-group v1-0 length)) + (when (or (not arg0) (let ((a3-5 (-> obj actor-group v1-0 data a2-0 actor))) + (!= (if a3-5 + (-> a3-5 extra process) + ) + arg0 + ) + ) + ) + (if (not (logtest? (-> obj actor-group v1-0 data a2-0 actor extra perm status) (entity-perm-status subtask-complete)) + ) + (return #f) + ) + ) + ) + ) + #t + ) + +;; definition for method 26 of type elec-lock-gate +(defmethod set-state! elec-lock-gate ((obj elec-lock-gate)) + "If either [[actor-option::17]] is set on the [[elec-gate]] or the related subtask is completed +make the gate `idle`. + +Otherwise, the gate will be `active`." + (if (elec-lock-gate-method-31 obj #f) + (go (method-of-object obj shutdown)) + ((method-of-type fort-elec-gate set-state!) obj) + ) + (none) + ) + +;; definition for method 25 of type elec-lock-gate +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-palette! elec-lock-gate ((obj elec-lock-gate)) + "Sets the [[elec-gate]]'s `palette-id` appropriately" + (local-vars (sv-16 res-tag)) + (let ((t9-0 (method-of-type fort-elec-gate set-palette!))) + (t9-0 obj) + ) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-4 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-4 (nonzero? (-> sv-16 elt-count))) + (set! (-> obj actor-group) (the-as (pointer actor-group) v1-4)) + (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> obj actor-group-count) 0) + 0 + ) + ) + ) + (none) + ) diff --git a/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc new file mode 100644 index 0000000000..5ac27b9353 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc @@ -0,0 +1,898 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type fort-twist-rail +(deftype fort-twist-rail (process-drawable) + ((sync sync-eased :inline :offset-assert 200) + (init-quat quaternion :inline :offset-assert 256) + ) + :heap-base #x90 + :method-count-assert 21 + :size-assert #x110 + :flag-assert #x1500900110 + (:methods + (idle () _type_ :state 20) + ) + ) + +;; definition for method 3 of type fort-twist-rail +(defmethod inspect fort-twist-rail ((obj fort-twist-rail)) + (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)) + (format #t "~2Tinit-quat: #~%" (-> obj init-quat)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-fort-twist-rail fort-twist-rail 0 3 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 10 14) + ) + +;; failed to figure out what this is: +(defstate idle (fort-twist-rail) + :virtual #t + :trans (the-as (function none :behavior fort-twist-rail) rider-trans) + :code (the-as (function none :behavior fort-twist-rail) sleep-code) + :post (behavior () + (let ((f0-0 (get-norm! (-> self sync) 0))) + (quaternion-rotate-y! (-> self root quat) (-> self init-quat) (+ -2730.6667 (* 5461.3335 f0-0))) + ) + (rider-post) + (none) + ) + ) + +;; definition for method 11 of type fort-twist-rail +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! fort-twist-rail ((obj fort-twist-rail) (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-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 40960.0 57344.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec 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 -19660.8 0.0 24576.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid rideable)) + (set! (-> v1-17 transform-index) 3) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 45056.0 45056.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-20 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-20 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-20 prim-core collide-with)) + ) + (set! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-twist-rail" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (quaternion-copy! (-> obj init-quat) (-> obj root quat)) + (let ((a1-14 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-26 0)) + (if #t + (set! v1-26 (logior v1-26 1)) + ) + (set! (-> a1-14 sync-type) 'sync-eased) + (set! (-> a1-14 sync-flags) (the-as sync-flags v1-26)) + ) + (set! (-> a1-14 period) (the-as uint 900)) + (set! (-> a1-14 entity) (-> obj entity)) + (set! (-> a1-14 percent) 0.0) + (set! (-> a1-14 ease-in) 0.15) + (set! (-> a1-14 ease-out) 0.15) + (set! (-> a1-14 pause-in) 0.0) + (set! (-> a1-14 pause-out) 0.0) + (initialize! (-> obj sync) a1-14) + ) + (let ((a0-29 (-> obj skel root-channel 0))) + (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> a0-29 frame-num) 0.0) + (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type fort-elec-belt-inst +(deftype fort-elec-belt-inst (process-drawable) + ((l-spec lightning-spec :offset-assert 200) + (l-bolt lightning-control :offset-assert 204) + (points vector 17 :inline :offset-assert 208) + (path-u float :offset-assert 480) + (path-du float :offset-assert 484) + (attack-id uint32 :offset-assert 488) + (sound-id uint32 :offset-assert 492) + ) + :heap-base #x170 + :method-count-assert 23 + :size-assert #x1f0 + :flag-assert #x17017001f0 + (:methods + (idle () _type_ :state 20) + (running () _type_ :state 21) + (die () _type_ :state 22) + ) + ) + +;; definition for method 3 of type fort-elec-belt-inst +(defmethod inspect fort-elec-belt-inst ((obj fort-elec-belt-inst)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tl-spec: ~A~%" (-> obj l-spec)) + (format #t "~2Tl-bolt: ~A~%" (-> obj l-bolt)) + (format #t "~2Tpoints[17] @ #x~X~%" (-> obj points)) + (format #t "~2Tpath-u: ~f~%" (-> obj path-u)) + (format #t "~2Tpath-du: ~f~%" (-> obj path-du)) + (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) + (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-fort-elec-belt-inst fort-elec-belt fort-elec-belt-lod0-jg fort-elec-belt-idle-ja + ((fort-elec-belt-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 -19 20) + ) + +;; failed to figure out what this is: +(defstate idle (fort-elec-belt-inst) + :virtual #t + :code (behavior () + (suspend) + (let ((v1-0 (-> self l-bolt)) + (a0-0 1) + ) + (let ((a1-1 (!= a0-0 (-> v1-0 state mode)))) + (case a0-0 + ((3) + (if a1-1 + (set! (-> v1-0 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-0 state start-color) (-> v1-0 spec start-color)) + (set! (-> v1-0 state end-color) (-> v1-0 spec end-color)) + ) + ) + ) + (set! (-> v1-0 state mode) (the-as lightning-mode a0-0)) + ) + (go-virtual running) + (none) + ) + :post (behavior () + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'get-point-norm) + (set! (-> a1-0 param 0) (the-as uint (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 param 1) (the-as uint (-> self path-u))) + (let ((v1-7 (the-as vector (send-event-function (ppointer->process (-> self parent)) a1-0)))) + (set! (-> self root trans quad) (-> v1-7 quad)) + ) + ) + (+! (-> self path-u) (* (-> self path-du) (-> self clock seconds-per-frame))) + (ja-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate running (fort-elec-belt-inst) + :virtual #t + :exit (behavior () + (sound-stop (the-as sound-id (-> self sound-id))) + (none) + ) + :trans (behavior () + (if (>= (-> self path-u) 1.0) + (go-virtual die) + ) + (none) + ) + :code (the-as (function none :behavior fort-elec-belt-inst) sleep-code) + :post (behavior () + (local-vars + (sv-1696 + (function lightning-spec time-frame symbol process-drawable vector vector none :behavior lightning-tracker) + ) + (sv-1712 lightning-spec) + ) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'get-point-norm) + (set! (-> a1-0 param 0) (the-as uint (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 param 1) (the-as uint (-> self path-u))) + (let ((v1-7 (the-as vector (send-event-function (ppointer->process (-> self parent)) a1-0)))) + (set! (-> self root trans quad) (-> v1-7 quad)) + ) + ) + (+! (-> self path-u) (* (-> self path-du) (-> self clock seconds-per-frame))) + (let ((s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4))) + (s2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 5))) + ) + (let ((t2-0 (new 'stack-no-clear 'vector))) + (vector+! t2-0 s3-0 s2-0) + (vector-float*! t2-0 t2-0 0.5) + (set! (-> t2-0 y) (+ -20480.0 (-> t2-0 y))) + (sound-play "sliding-laser" :id (the-as sound-id (-> self sound-id)) :position t2-0) + ) + (let* ((v0-4 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s2-0 s3-0) 1.0)) + (gp-1 (vector-cross! (new 'stack-no-clear 'vector) v0-4 *up-vector*)) + (s5-0 (-> self l-bolt)) + (f30-0 90112.0) + (f0-6 (* f30-0 f30-0)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) s2-0 s3-0)) + (f1-4 (* 0.5 (vector-length s4-1))) + ) + (let ((f2-2 (* f1-4 f1-4))) + (vector-float*! s4-1 s4-1 0.5) + (vector+! s4-1 s3-0 s4-1) + (+! (-> s4-1 y) (sqrtf (- f0-6 f2-2))) + ) + (let* ((f0-12 (* 2.0 (asin (/ f1-4 f30-0)))) + (f28-1 (* 0.0625 f0-12)) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 x) 0.0) + (set! (-> s3-1 y) (- f30-0)) + (set! (-> s3-1 z) 0.0) + (set! (-> s3-1 w) 0.0) + (let ((a2-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) gp-1 (* -0.5 f0-12)))) + (vector-orient-by-quat! s3-1 s3-1 a2-2) + ) + (dotimes (s2-1 17) + (let ((s1-1 (vector+! (new 'stack-no-clear 'vector) s4-1 s3-1))) + (set-point! s5-0 s2-1 s1-1) + (set! (-> self points s2-1 quad) (-> s1-1 quad)) + ) + (let ((a2-5 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) gp-1 f28-1))) + (vector-orient-by-quat! s3-1 s3-1 a2-5) + ) + ) + ) + ) + ) + (let ((gp-2 (new 'stack-no-clear 'collide-query))) + (let ((s5-1 (new 'stack-no-clear 'bounding-box))) + (let ((a1-15 (new 'stack-no-clear 'inline-array 'sphere 17))) + (dotimes (v1-37 17) + (set! (-> a1-15 v1-37 quad) (-> self points v1-37 quad)) + (set! (-> a1-15 v1-37 r) 4096.0) + ) + (set-from-spheres! s5-1 a1-15 17) + ) + (set! (-> gp-2 collide-with) (collide-spec jak bot player-list)) + (set! (-> gp-2 ignore-process0) self) + (set! (-> gp-2 ignore-process1) #f) + (set! (-> gp-2 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> gp-2 action-mask) (collide-action solid)) + (mem-copy! (the-as pointer (-> gp-2 bbox)) (the-as pointer s5-1) 32) + ) + (fill-using-bounding-box *collide-cache* gp-2) + ) + (let ((gp-3 1)) + (while (< gp-3 17) + (let ((s3-2 (new 'stack-no-clear 'collide-query)) + (s5-2 (-> self points (+ gp-3 -1))) + (s4-2 (-> self points gp-3)) + ) + (let ((v1-52 (vector-! (new 'stack-no-clear 'vector) s4-2 s5-2))) + (set! (-> s3-2 start-pos quad) (-> s5-2 quad)) + (set! (-> s3-2 move-dist quad) (-> v1-52 quad)) + ) + (let ((v1-54 s3-2)) + (set! (-> v1-54 radius) 4096.0) + (set! (-> v1-54 collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-54 ignore-process0) self) + (set! (-> v1-54 ignore-process1) #f) + (set! (-> v1-54 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-54 action-mask) (collide-action solid semi-solid)) + ) + (when (>= (probe-using-line-sphere *collide-cache* s3-2) 0.0) + (let* ((s2-2 (-> s3-2 best-other-tri collide-ptr)) + (s3-3 (if (type? s2-2 collide-shape-prim-sphere) + (the-as collide-shape-prim-sphere s2-2) + ) + ) + ) + (when s3-3 + (sound-play "laser-hit") + (let ((s2-4 (get-process *default-dead-pool* lightning-tracker #x4000))) + (when s2-4 + (let ((t9-19 (method-of-type lightning-tracker activate))) + (t9-19 + (the-as lightning-tracker s2-4) + *entity-pool* + (symbol->string (-> lightning-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((s1-3 run-function-in-process) + (s0-0 s2-4) + ) + (set! sv-1696 lightning-tracker-init) + (set! sv-1712 (-> self l-spec)) + (let ((a3-3 (the int (* 3.0 (rand-vu-float-range 5.0 11.0)))) + (t0-2 #f) + (t1-2 #f) + ) + ((the-as (function object object object object object object object object none) s1-3) + s0-0 + sv-1696 + sv-1712 + a3-3 + t0-2 + t1-2 + s5-2 + s4-2 + ) + ) + ) + (-> s2-4 ppointer) + ) + ) + (let ((v1-68 (vector-reset! (new 'stack-no-clear 'vector))) + (a1-28 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-28 from) (process->ppointer self)) + (set! (-> a1-28 num-params) 2) + (set! (-> a1-28 message) 'attack) + (set! (-> a1-28 param 0) (the-as uint #f)) + (let ((a0-50 (new 'static 'attack-info :mask (attack-info-mask vector invinc-time shove-up id)))) + (set! (-> a0-50 id) (-> self attack-id)) + (set! (-> a0-50 invinc-time) (seconds 3)) + (set! (-> a0-50 vector quad) (-> v1-68 quad)) + (set! (-> a0-50 shove-up) 12288.0) + (set! (-> a1-28 param 1) (the-as uint a0-50)) + ) + (send-event-function (-> s3-3 cshape process) a1-28) + ) + ) + ) + ) + ) + (+! gp-3 1) + ) + ) + (ja-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die (fort-elec-belt-inst) + :virtual #t + :code (behavior () + (let ((v1-0 (-> self l-bolt)) + (a0-0 3) + ) + (let ((a1-1 (!= a0-0 (-> v1-0 state mode)))) + (case a0-0 + ((3) + (if a1-1 + (set! (-> v1-0 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-0 state start-color) (-> v1-0 spec start-color)) + (set! (-> v1-0 state end-color) (-> v1-0 spec end-color)) + ) + ) + ) + (set! (-> v1-0 state mode) (the-as lightning-mode a0-0)) + ) + (suspend) + (cleanup-for-death self) + (none) + ) + ) + +;; definition for method 7 of type fort-elec-belt-inst +;; WARN: Return type mismatch process-drawable vs fort-elec-belt-inst. +(defmethod relocate fort-elec-belt-inst ((obj fort-elec-belt-inst) (arg0 int)) + (if (nonzero? (-> obj l-bolt)) + (&+! (-> obj l-bolt) arg0) + ) + (the-as fort-elec-belt-inst ((method-of-type process-drawable relocate) obj arg0)) + ) + +;; definition for method 10 of type fort-elec-belt-inst +(defmethod deactivate fort-elec-belt-inst ((obj fort-elec-belt-inst)) + (sound-stop (the-as sound-id (-> obj sound-id))) + ((the-as (function process-drawable none) (find-parent-method fort-elec-belt-inst 10)) obj) + (none) + ) + +;; definition for function fort-elec-belt-inst-init-by-other +;; WARN: Return type mismatch object vs none. +(defbehavior fort-elec-belt-inst-init-by-other fort-elec-belt-inst ((arg0 quaternion) (arg1 float) (arg2 float) (arg3 lightning-spec) (arg4 uint)) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-fort-elec-belt-inst" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (quaternion-copy! (-> self root quat) arg0) + (set! (-> self path-u) arg1) + (set! (-> self path-du) arg2) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self l-bolt) (new 'process 'lightning-control arg3 self 0.0)) + (let ((v1-8 (-> self l-bolt)) + (a0-7 0) + ) + (let ((a1-7 (!= a0-7 (-> v1-8 state mode)))) + (case a0-7 + ((3) + (if a1-7 + (set! (-> v1-8 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-8 state start-color) (-> v1-8 spec start-color)) + (set! (-> v1-8 state end-color) (-> v1-8 spec end-color)) + ) + ) + ) + (set! (-> v1-8 state mode) (the-as lightning-mode a0-7)) + ) + (set! (-> self l-spec) arg3) + (set! (-> self attack-id) arg4) + (set! (-> self sound-id) (the-as uint (new-sound-id))) + (ja-no-eval :group! (-> self draw art-group data 2) :num! zero) + (ja-post) + (go-virtual idle) + (none) + ) + +;; definition of type fort-elec-belt +(deftype fort-elec-belt (process) + ((l-spec lightning-spec :offset-assert 128) + (next-spawn-time time-frame :offset-assert 136) + (path path-control :offset-assert 144) + (init-quat quaternion :inline :offset-assert 160) + (sync sync-linear :inline :offset-assert 176) + (attack-id uint32 :offset-assert 192) + (path-du float :offset-assert 196) + ) + :heap-base #x50 + :method-count-assert 16 + :size-assert #xc8 + :flag-assert #x10005000c8 + (:methods + (idle () _type_ :state 14) + (fort-elec-belt-method-15 (_type_) none 15) + ) + ) + +;; definition for method 3 of type fort-elec-belt +(defmethod inspect fort-elec-belt ((obj fort-elec-belt)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Tl-spec: ~A~%" (-> obj l-spec)) + (format #t "~2Tnext-spawn-time: ~D~%" (-> obj next-spawn-time)) + (format #t "~2Tpath: ~A~%" (-> obj path)) + (format #t "~2Tinit-quat: #~%" (-> obj init-quat)) + (format #t "~2Tsync: #~%" (-> obj sync)) + (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) + (format #t "~2Tpath-du: ~f~%" (-> obj path-du)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defstate idle (fort-elec-belt) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('get-point-norm) + (get-point-at-percent-along-path! + (-> self path) + (the-as vector (-> event param 0)) + (the-as float (-> event param 1)) + 'interp + ) + ) + ) + ) + ) + :trans (behavior () + (set-forrescb-electricity-scale! 1.0 0) + (when (>= (-> self clock frame-counter) (-> self next-spawn-time)) + (process-spawn + fort-elec-belt-inst + (-> self init-quat) + 0 + (-> self path-du) + (-> self l-spec) + (-> self attack-id) + :to self + ) + (set! (-> self next-spawn-time) (get-timeframe-offset! (-> self sync) 0)) + ) + (none) + ) + :code (the-as (function none :behavior fort-elec-belt) sleep-code) + ) + +;; definition for method 15 of type fort-elec-belt +;; WARN: Return type mismatch symbol vs none. +(defmethod fort-elec-belt-method-15 fort-elec-belt ((obj fort-elec-belt)) + (with-pp + (let* ((f28-0 (total-distance (-> obj path))) + (s5-0 (-> obj sync)) + (f26-0 81.92) + (a0-3 (- (-> pp clock frame-counter) (get-timeframe-offset! s5-0 0))) + (v1-6 (-> s5-0 period)) + (f30-0 (/ (* f26-0 (the float a0-3)) f28-0)) + (f28-1 (/ (* f26-0 (the float v1-6)) f28-0)) + ) + (while (>= 1.0 f30-0) + (if (>= f30-0 0.0) + (process-spawn + fort-elec-belt-inst + (-> obj init-quat) + f30-0 + (-> obj path-du) + (-> obj l-spec) + (-> obj attack-id) + :to obj + ) + ) + (+! f30-0 f28-1) + ) + ) + (none) + ) + ) + +;; definition for method 7 of type fort-elec-belt +;; WARN: Return type mismatch process vs fort-elec-belt. +(defmethod relocate fort-elec-belt ((obj fort-elec-belt) (arg0 int)) + (if (nonzero? (-> obj path)) + (&+! (-> obj path) arg0) + ) + (the-as fort-elec-belt ((method-of-type process relocate) obj arg0)) + ) + +;; definition for method 11 of type fort-elec-belt +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! fort-elec-belt ((obj fort-elec-belt) (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" + (local-vars (sv-64 int)) + (quaternion-copy! (-> obj init-quat) (-> arg0 quat)) + (let ((s5-0 (new 'stack-no-clear 'sync-info-params))) + (let ((s3-0 1200)) + 0.0 + (set! sv-64 0) + (let ((v1-1 (res-lump-data arg0 'sync (pointer float) :tag-ptr (the-as (pointer res-tag) (& sv-64))))) + (when v1-1 + (set! s3-0 (the int (* 300.0 (-> v1-1 0)))) + (-> v1-1 1) + ) + ) + (let ((v1-2 0)) + (if #t + (set! v1-2 (logior v1-2 1)) + ) + (set! (-> s5-0 sync-type) 'sync-linear) + (set! (-> s5-0 sync-flags) (the-as sync-flags v1-2)) + ) + (set! (-> s5-0 entity) arg0) + (set! (-> s5-0 period) (the-as uint s3-0)) + ) + (set! (-> s5-0 percent) 0.0) + (initialize! (-> obj sync) s5-0) + ) + (set! (-> obj l-spec) (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf2) + :rand-func #x2 + :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.72 + :num-points 17 + :box-size 4997.12 + :merge-factor 0.32 + :merge-count 2 + :radius 7372.8 + :duration -1.0 + :sound #f + ) + ) + (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) + (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> obj path-du) (/ 24576.0 (total-distance (-> obj path)))) + (let* ((v1-14 *game-info*) + (a0-15 (+ (-> v1-14 attack-id) 1)) + ) + (set! (-> v1-14 attack-id) a0-15) + (set! (-> obj attack-id) a0-15) + ) + (fort-elec-belt-method-15 obj) + (set! (-> obj next-spawn-time) (get-timeframe-offset! (-> obj sync) 0)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type fort-conveyor +(deftype fort-conveyor (conveyor) + () + :heap-base #x80 + :method-count-assert 28 + :size-assert #x100 + :flag-assert #x1c00800100 + ) + +;; definition for method 3 of type fort-conveyor +(defmethod inspect fort-conveyor ((obj fort-conveyor)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type conveyor inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-fort-conveyor fort-conveyor fort-conveyor-lod0-jg fort-conveyor-idle-ja + ((fort-conveyor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 16 16.5) + ) + +;; definition for method 22 of type fort-conveyor +(defmethod get-art-group fort-conveyor ((obj fort-conveyor)) + "@returns The respective [[art-group]] for the [[conveyor]]" + (art-group-get-by-name *level* "skel-fort-conveyor" (the-as (pointer uint32) #f)) + ) + +;; definition for method 23 of type fort-conveyor +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod reset-root! fort-conveyor ((obj fort-conveyor)) + "Re-initializes the `root` [[trsqv]]" + (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 65536.0 67584.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-15 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> obj root) s5-0) + ) + (none) + ) + +;; definition for method 24 of type fort-conveyor +;; WARN: Return type mismatch vector vs none. +(defmethod init! fort-conveyor ((obj fort-conveyor)) + "Initializes defaults for things like the `speed` and `belt-radius`" + (set! (-> obj speed) -47104.0) + (set! (-> obj belt-radius) 24576.0) + (set! (-> obj pull-y-threshold) 4096.0) + (if (name= (-> obj name) "fort-conveyor-4") + (set-vector! (-> obj root scale) 0.8 0.0 0.657 1.0) + ) + (none) + ) + +;; definition for method 25 of type fort-conveyor +(defmethod set-and-get-ambient-sound! fort-conveyor ((obj fort-conveyor)) + "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] +and return it as well. Otherwise, set it to `0`" + (let* ((s5-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 0.0 'interp)) + (v1-2 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 1.0 'interp)) + (a3-3 (vector+! (new 'stack-no-clear 'vector) s5-0 v1-2)) + ) + (vector-float*! a3-3 a3-3 0.5) + (let ((v0-2 (new 'process 'ambient-sound (static-sound-spec "fort-conveyor" :fo-max 50) a3-3))) + (set! (-> obj sound) v0-2) + v0-2 + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 172 + 0 + (the-as + (function object) + (lambda :behavior task-manager + () + (set-setting! 'sound-mode #f 0 1) + (set-setting! 'sound-excitement 'abs #x3f4ccccd 0) + (speech-control-method-10 + *speech-control* + 6 + (new 'static 'speech-type-info + :min-delay #x4b0 + :max-delay #x960 + :list (new 'static 'boxed-array :type string + "kg001" + "kg002" + "kg004" + "kg006" + "kg001a" + "kg013" + "kg016" + "kg018" + "kg019" + "kg023" + "kg024" + "kg002a" + "kg004a" + "kg078a" + "kg079a" + "kg080a" + "kg081a" + "kg004a" + "kg082a" + "kg083a" + "kg084a" + "kg085a" + "kg086a" + "kg087a" + "kg088a" + "kg091a" + "kg023a" + "kg006a" + "kg092a" + "kg020a" + "kg093a" + "kg094a" + "kg095a" + "kg103a" + "kg104a" + "kg112a" + "kg024a" + "kg134" + "kg136" + "kg137" + "kg138" + "kg139" + "kg140" + "kg141" + ) + ) + ) + (speech-control-method-10 + *speech-control* + 9 + (new 'static 'speech-type-info + :priority 1 + :min-delay #x12c + :max-delay #x258 + :list (new 'static 'boxed-array :type string + "kg133" + "kg142" + "kg144" + "kg145" + "kg146" + "kg147" + "kg148" + "kg149" + "kg150" + "kg138" + "kg151" + "kg152" + "kg153" + "kg154" + "kg155" + "kg159" + "kg163" + "kg164" + ) + ) + ) + (speech-control-method-10 + *speech-control* + 10 + (new 'static 'speech-type-info :priority #xa :max-delay #x12c :list (new 'static 'boxed-array :type string + "kg166" + "kg167" + "kg168" + "kg169" + "kg171" + "kg172" + "kg173" + "kg174" + "kg175" + ) + ) + ) + (none) + ) + ) + ) + +;; failed to figure out what this is: +(set-subtask-hook! + *game-info* + 172 + 1 + (the-as + (function object) + (lambda :behavior task-manager () (speech-control-method-9 *speech-control*) (none)) + ) + ) diff --git a/test/decompiler/reference/jak2/levels/hiphog/hiphog-obs_REF.gc b/test/decompiler/reference/jak2/levels/hiphog/hiphog-obs_REF.gc new file mode 100644 index 0000000000..d74a48490a --- /dev/null +++ b/test/decompiler/reference/jak2/levels/hiphog/hiphog-obs_REF.gc @@ -0,0 +1,510 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type hip-trophy-a +(deftype hip-trophy-a (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 hip-trophy-a +(defmethod inspect hip-trophy-a ((obj hip-trophy-a)) + (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-hip-trophy-a hip-trophy-a hip-trophy-a-lod0-jg hip-trophy-a-idle-ja + ((hip-trophy-a-lod0-mg (meters 999999))) + :bounds (static-spherem 1 -1 0 1.6) + ) + +;; failed to figure out what this is: +(defstate idle (hip-trophy-a) + :virtual #t + :code (the-as (function none :behavior hip-trophy-a) sleep-code) + :post (the-as (function none :behavior hip-trophy-a) ja-post) + ) + +;; definition for method 11 of type hip-trophy-a +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-trophy-a ((obj hip-trophy-a) (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-hip-trophy-a" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (if (= (the-as uint v1-5) 1) + (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + ) + ) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type hip-trophy-d +(deftype hip-trophy-d (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 hip-trophy-d +(defmethod inspect hip-trophy-d ((obj hip-trophy-d)) + (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-hip-trophy-d hip-trophy-d hip-trophy-d-lod0-jg hip-trophy-d-idle-ja + ((hip-trophy-d-lod0-mg (meters 999999))) + :bounds (static-spherem -0.2 -0.5 0 2) + ) + +;; failed to figure out what this is: +(defstate idle (hip-trophy-d) + :virtual #t + :code (the-as (function none :behavior hip-trophy-d) sleep-code) + :post (the-as (function none :behavior hip-trophy-d) ja-post) + ) + +;; definition for method 11 of type hip-trophy-d +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-trophy-d ((obj hip-trophy-d) (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-hip-trophy-d" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (if (= (the-as uint v1-5) 1) + (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + ) + ) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type hip-trophy-f +(deftype hip-trophy-f (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 hip-trophy-f +(defmethod inspect hip-trophy-f ((obj hip-trophy-f)) + (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-hip-trophy-f hip-trophy-f hip-trophy-f-lod0-jg hip-trophy-f-idle-ja + ((hip-trophy-f-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; failed to figure out what this is: +(defstate idle (hip-trophy-f) + :virtual #t + :code (the-as (function none :behavior hip-trophy-f) sleep-code) + :post (the-as (function none :behavior hip-trophy-f) ja-post) + ) + +;; definition for method 11 of type hip-trophy-f +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-trophy-f ((obj hip-trophy-f) (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-hip-trophy-f" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (if (= (the-as uint v1-5) 1) + (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + ) + ) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type hip-trophy-g +(deftype hip-trophy-g (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 hip-trophy-g +(defmethod inspect hip-trophy-g ((obj hip-trophy-g)) + (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-hip-trophy-g hip-trophy-g hip-trophy-g-lod0-jg hip-trophy-g-idle-ja + ((hip-trophy-g-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; failed to figure out what this is: +(defstate idle (hip-trophy-g) + :virtual #t + :code (the-as (function none :behavior hip-trophy-g) sleep-code) + :post (the-as (function none :behavior hip-trophy-g) ja-post) + ) + +;; definition for method 11 of type hip-trophy-g +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-trophy-g ((obj hip-trophy-g) (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-hip-trophy-g" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (if (= (the-as uint v1-5) 1) + (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + ) + ) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type hip-trophy-i +(deftype hip-trophy-i (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 hip-trophy-i +(defmethod inspect hip-trophy-i ((obj hip-trophy-i)) + (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-hip-trophy-i hip-trophy-i hip-trophy-i-lod0-jg hip-trophy-i-idle-ja + ((hip-trophy-i-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; failed to figure out what this is: +(defstate idle (hip-trophy-i) + :virtual #t + :code (the-as (function none :behavior hip-trophy-i) sleep-code) + :post (the-as (function none :behavior hip-trophy-i) ja-post) + ) + +;; definition for method 11 of type hip-trophy-i +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-trophy-i ((obj hip-trophy-i) (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-hip-trophy-i" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (if (= (the-as uint v1-5) 1) + (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + ) + ) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type hip-trophy-j +(deftype hip-trophy-j (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 hip-trophy-j +(defmethod inspect hip-trophy-j ((obj hip-trophy-j)) + (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-hip-trophy-j hip-trophy-j hip-trophy-j-lod0-jg hip-trophy-j-idle-ja + ((hip-trophy-j-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; failed to figure out what this is: +(defstate idle (hip-trophy-j) + :virtual #t + :code (the-as (function none :behavior hip-trophy-j) sleep-code) + :post (the-as (function none :behavior hip-trophy-j) ja-post) + ) + +;; definition for method 11 of type hip-trophy-j +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-trophy-j ((obj hip-trophy-j) (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-hip-trophy-j" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (if (= (the-as uint v1-5) 1) + (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + ) + ) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type hip-trophy-n +(deftype hip-trophy-n (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 hip-trophy-n +(defmethod inspect hip-trophy-n ((obj hip-trophy-n)) + (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-hip-trophy-n hip-trophy-n hip-trophy-n-lod0-jg hip-trophy-n-idle-ja + ((hip-trophy-n-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; failed to figure out what this is: +(defstate idle (hip-trophy-n) + :virtual #t + :code (the-as (function none :behavior hip-trophy-n) sleep-code) + :post (the-as (function none :behavior hip-trophy-n) ja-post) + ) + +;; definition for method 11 of type hip-trophy-n +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-trophy-n ((obj hip-trophy-n) (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-hip-trophy-n" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (if (= (the-as uint v1-5) 1) + (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + ) + ) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type hip-trophy-m +(deftype hip-trophy-m (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 hip-trophy-m +(defmethod inspect hip-trophy-m ((obj hip-trophy-m)) + (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-hip-trophy-m hip-trophy-m hip-trophy-m-lod0-jg hip-trophy-m-idle-ja + ((hip-trophy-m-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; failed to figure out what this is: +(defstate idle (hip-trophy-m) + :virtual #t + :code (the-as (function none :behavior hip-trophy-m) sleep-code) + :post (the-as (function none :behavior hip-trophy-m) ja-post) + ) + +;; definition for method 11 of type hip-trophy-m +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-trophy-m ((obj hip-trophy-m) (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-hip-trophy-m" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (if (= (the-as uint v1-5) 1) + (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + ) + ) + (go (method-of-object obj idle)) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc b/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc new file mode 100644 index 0000000000..8ab75cb356 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc @@ -0,0 +1,527 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type intro-flamer +(deftype intro-flamer (process-drawable) + ((up-dir vector :inline :offset-assert 208) + (average-dir vector :inline :offset-assert 224) + (id int32 :offset-assert 240) + (path-u float :offset-assert 244) + (path-du float :offset-assert 248) + (z-rot float :offset-assert 252) + (flit-prev-offset vector :inline :offset-assert 256) + (flit-next-offset vector :inline :offset-assert 272) + (flit-factor float :offset-assert 288) + (flit-timer uint64 :offset-assert 296) + (flit-interval uint64 :offset-assert 304) + ) + :heap-base #xc0 + :method-count-assert 23 + :size-assert #x138 + :flag-assert #x1700c00138 + (:methods + (idle () _type_ :state 20) + (die () _type_ :state 21) + (intro-flamer-method-22 (_type_) path-control 22) + ) + ) + +;; definition for method 3 of type intro-flamer +(defmethod inspect intro-flamer ((obj intro-flamer)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tup-dir: #~%" (-> obj up-dir)) + (format #t "~2Taverage-dir: #~%" (-> obj average-dir)) + (format #t "~2Tid: ~D~%" (-> obj id)) + (format #t "~2Tpath-u: ~f~%" (-> obj path-u)) + (format #t "~2Tpath-du: ~f~%" (-> obj path-du)) + (format #t "~2Tz-rot: ~f~%" (-> obj z-rot)) + (format #t "~2Tflit-prev-offset: #~%" (-> obj flit-prev-offset)) + (format #t "~2Tflit-next-offset: #~%" (-> obj flit-next-offset)) + (format #t "~2Tflit-factor: ~f~%" (-> obj flit-factor)) + (format #t "~2Tflit-timer: ~D~%" (-> obj flit-timer)) + (format #t "~2Tflit-interval: ~D~%" (-> obj flit-interval)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-intro-flamer intro-flamer intro-flamer-lod0-jg intro-flamer-fly-straight-ja + ((intro-flamer-lod0-mg (meters 20)) (intro-flamer-lod1-mg (meters 40)) (intro-flamer-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7.5) + :shadow intro-flamer-shadow-mg + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defstate idle (intro-flamer) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('die) + (go-virtual die) + ) + ) + ) + :trans (behavior () + (if (= (-> self path-u) 1.0) + (go-virtual die) + ) + (when (>= (- (-> self clock frame-counter) (the-as int (-> self flit-timer))) + (the-as time-frame (-> self flit-interval)) + ) + (let ((f28-0 (rand-vu-float-range -1.0 1.0)) + (f30-0 (rand-vu-float-range -1.0 1.0)) + (f0-1 (rand-vu-float-range 0.2 0.6)) + ) + (set! (-> self flit-prev-offset quad) (-> self flit-next-offset quad)) + (set-vector! (-> self flit-next-offset) (* 4096.0 f28-0) (* 4096.0 f30-0) 0.0 0.0) + (set! (-> self flit-factor) 0.0) + (set! (-> self flit-interval) (the-as uint (the int (* 300.0 f0-1)))) + ) + (set! (-> self flit-timer) (the-as uint (-> self clock frame-counter))) + ) + (none) + ) + :code (behavior () + (ja-channel-set! 1) + (let ((f30-0 (rand-vu-float-range 0.8 1.2))) + (until #f + (ja-no-eval :group! (-> self draw art-group data 5) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1)) + f30-0 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + (none) + ) + :post (behavior () + (seek! (-> self path-u) 1.0 (* (-> self path-du) (-> self clock seconds-per-frame))) + (let ((s3-0 (intro-flamer-method-22 self)) + (s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'quaternion)) + (f30-0 (-> self path-u)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (get-point-at-percent-along-path! s3-0 gp-0 f30-0 'interp) + (displacement-between-points-at-percent-normalized! s3-0 s4-0 (fmin 1.0 (+ 0.05 f30-0))) + (let ((t9-4 vector-normalize!) + (a0-4 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-4 x) (-> s4-0 x)) + (set! (-> a0-4 y) 0.0) + (set! (-> a0-4 z) (-> s4-0 z)) + (set! (-> a0-4 w) 1.0) + (let ((s3-1 (t9-4 a0-4 1.0)) + (t9-5 vector-normalize!) + (a0-5 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-5 x) (-> self average-dir x)) + (set! (-> a0-5 y) 0.0) + (set! (-> a0-5 z) (-> self average-dir z)) + (set! (-> a0-5 w) 1.0) + (let* ((v1-10 (t9-5 a0-5 1.0)) + (f0-15 (vector-dot (vector-cross! (new 'stack-no-clear 'vector) s3-1 v1-10) *up-vector*)) + (f0-16 (* 49152.0 f0-15)) + ) + (set! (-> self z-rot) (deg-seek + (-> self z-rot) + (fmax -15473.777 (fmin 15473.777 f0-16)) + (* 21845.334 (-> self clock seconds-per-frame)) + ) + ) + ) + ) + ) + (let ((a2-5 (vector-rotate-z! (new 'stack-no-clear 'vector) *up-vector* (-> self z-rot)))) + (forward-up->quaternion s5-0 s4-0 a2-5) + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) s5-0 (* 8.0 (-> self clock seconds-per-frame))) + (seek! (-> self flit-factor) 1.0 (* 8.0 (-> self clock seconds-per-frame))) + (let* ((v1-25 (-> self flit-prev-offset)) + (a1-10 (-> self flit-next-offset)) + (a0-14 (vector-! (new 'stack-no-clear 'vector) a1-10 v1-25)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (vector+float*! s5-1 v1-25 a0-14 (-> self flit-factor)) + (vector-orient-by-quat! s5-1 s5-1 (-> self root quat)) + (vector+! (-> self root trans) gp-0 s5-1) + ) + ) + (cond + ((logtest? (-> self draw status) (draw-control-status on-screen)) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (let ((gp-1 (new 'stack-no-clear 'collide-query))) + (set! (-> gp-1 start-pos quad) (-> self root trans quad)) + (set-vector! (-> gp-1 move-dist) 0.0 -81920.0 0.0 1.0) + (let ((v1-37 gp-1)) + (set! (-> v1-37 radius) 2048.0) + (set! (-> v1-37 collide-with) (collide-spec backgnd)) + (set! (-> v1-37 ignore-process0) self) + (set! (-> v1-37 ignore-process1) #f) + (set! (-> v1-37 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-37 action-mask) (collide-action solid)) + ) + (cond + ((>= (fill-and-probe-using-line-sphere *collide-cache* gp-1) 0.0) + (let ((v1-41 (-> self draw shadow-ctrl))) + (logclear! (-> v1-41 settings flags) (shadow-flags disable-draw)) + ) + 0 + (let ((a0-28 (-> gp-1 best-other-tri intersect))) + (let ((f0-36 (-> self root trans y))) + (let ((v1-45 (-> self draw shadow-ctrl))) + (set! (-> v1-45 settings bot-plane w) (- (+ (- -12288.0 f0-36) (-> a0-28 y)))) + ) + 0 + (let ((v1-48 (-> self draw shadow-ctrl))) + (set! (-> v1-48 settings top-plane w) (- (+ (- 12288.0 f0-36) (-> a0-28 y)))) + ) + ) + 0 + (let* ((f2-2 (vector-vector-distance a0-28 (-> self root trans))) + (f0-41 (* 0.000030517578 (fmax 0.0 (fmin 32768.0 (+ -57344.0 f2-2))))) + ) + (set! (-> self draw shadow-ctrl settings shadow-dir w) (lerp 409600.0 40960.0 f0-41)) + ) + ) + ) + (else + (let ((v1-58 (-> self draw shadow-ctrl))) + (logior! (-> v1-58 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + ) + ) + (else + (let ((v1-61 (-> self draw shadow-ctrl))) + (logior! (-> v1-61 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + (ja-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die (intro-flamer) + :virtual #t + :code (behavior () + (suspend) + (cleanup-for-death self) + (none) + ) + ) + +;; definition for method 22 of type intro-flamer +;; WARN: Return type mismatch object vs path-control. +(defmethod intro-flamer-method-22 intro-flamer ((obj intro-flamer)) + (the-as path-control (send-event (ppointer->process (-> obj parent)) 'path (-> obj id))) + ) + +;; definition for method 11 of type intro-flamer +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! intro-flamer ((obj intro-flamer) (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-intro-flamer" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (go (method-of-object obj idle)) + (none) + ) + +;; definition for function intro-flamer-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior intro-flamer-init-by-other intro-flamer ((arg0 int) (arg1 path-control) (arg2 vector)) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-intro-flamer" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> self draw force-lod) 2) + (set! (-> self id) arg0) + (set! (-> self path-u) 0.0) + (set! (-> self path-du) (rand-vu-float-range 0.15 0.32)) + (set! (-> self z-rot) 0.0) + (set! (-> self flit-timer) (the-as uint (-> self clock frame-counter))) + (set! (-> self flit-interval) (the-as uint 0)) + (vector-reset! (-> self flit-prev-offset)) + (vector-reset! (-> self flit-next-offset)) + (set! (-> self flit-factor) 0.0) + (get-point-in-path! arg1 (-> self root trans) 0.0 'interp) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (displacement-between-points-at-percent-normalized! arg1 s4-1 0.0) + (forward-up-nopitch->quaternion (-> self root quat) s4-1 *up-vector*) + ) + (set! (-> self draw shadow-ctrl) + (new 'process 'shadow-control 0.0 0.0 614400.0 (shadow-flags shdf03) 491520.0) + ) + (set! (-> self draw light-index) (the-as uint 30)) + (set! (-> self average-dir quad) (-> arg2 quad)) + (go-virtual idle) + (none) + ) + +;; definition of type metalhead-spawner +(deftype metalhead-spawner (process) + ((path-tbl path-control 19 :offset-assert 128) + (init-pos vector :inline :offset-assert 208) + (average-dir vector :inline :offset-assert 224) + ) + :heap-base #x70 + :method-count-assert 17 + :size-assert #xf0 + :flag-assert #x11007000f0 + (:methods + (idle () _type_ :state 14) + (active () _type_ :state 15) + (die () _type_ :state 16) + ) + ) + +;; definition for method 3 of type metalhead-spawner +(defmethod inspect metalhead-spawner ((obj metalhead-spawner)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Tpath-tbl[19] @ #x~X~%" (-> obj path-tbl)) + (format #t "~2Tinit-pos: #~%" (-> obj init-pos)) + (format #t "~2Taverage-dir: #~%" (-> obj average-dir)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defstate idle (metalhead-spawner) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger) + (go-virtual active) + ) + (('path) + (-> self path-tbl (-> event param 0)) + ) + ) + ) + :code (the-as (function none :behavior metalhead-spawner) sleep-code) + ) + +;; failed to figure out what this is: +(defstate active (metalhead-spawner) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('untrigger) + (go-virtual idle) + ) + (('die) + (go-virtual die) + ) + (('path) + (-> self path-tbl (-> event param 0)) + ) + ) + ) + :code (behavior () + (let ((gp-0 0)) + (until #f + (set! gp-0 (mod (+ gp-0 (rand-vu-int-range 1 6)) 19)) + (let ((s5-0 (get-process *default-dead-pool* intro-flamer #x4000))) + (when s5-0 + (let ((t9-2 (method-of-type process activate))) + (t9-2 s5-0 self (symbol->string (-> intro-flamer symbol)) (the-as pointer #x70004000)) + ) + (run-now-in-process s5-0 intro-flamer-init-by-other gp-0 (-> self path-tbl gp-0) (-> self average-dir)) + (-> s5-0 ppointer) + ) + ) + (let ((s5-1 (the int (* 300.0 (rand-vu-float-range 0.03 0.08)))) + (s4-0 (-> self clock frame-counter)) + ) + (until (>= (- (-> self clock frame-counter) s4-0) s5-1) + (suspend) + ) + ) + ) + ) + #f + (none) + ) + :post (behavior () + (dotimes (gp-0 19) + (debug-draw (-> self path-tbl gp-0)) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die (metalhead-spawner) + :virtual #t + :code (behavior () + (let ((gp-0 (-> self child))) + (while gp-0 + (send-event (ppointer->process gp-0) 'die) + (set! gp-0 (-> gp-0 0 brother)) + ) + ) + (while (-> self child) + (suspend) + ) + (process-entity-status! self (entity-perm-status dead) #t) + (none) + ) + ) + +;; definition for method 7 of type metalhead-spawner +;; WARN: Return type mismatch process vs metalhead-spawner. +(defmethod relocate metalhead-spawner ((obj metalhead-spawner) (arg0 int)) + (dotimes (v1-0 19) + (if (nonzero? (-> obj path-tbl v1-0)) + (&+! (-> obj path-tbl v1-0) arg0) + ) + ) + (the-as + metalhead-spawner + ((the-as (function process int process) (find-parent-method metalhead-spawner 7)) obj arg0) + ) + ) + +;; definition for method 11 of type metalhead-spawner +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! metalhead-spawner ((obj metalhead-spawner) (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 init-pos quad) (-> arg0 extra trans quad)) + (vector-reset! (-> obj average-dir)) + (dotimes (s5-0 19) + (let ((s4-0 (new 'process 'curve-control obj 'path (the float (+ s5-0 1))))) + (set! (-> obj path-tbl s5-0) s4-0) + (logior! (-> s4-0 flags) (path-control-flag display draw-line draw-point draw-text)) + (let* ((s3-0 (get-point-at-percent-along-path! s4-0 (new 'stack-no-clear 'vector) 0.0 'interp)) + (v1-10 (get-point-at-percent-along-path! s4-0 (new 'stack-no-clear 'vector) 1.0 'interp)) + (s4-2 (vector-! (new 'stack-no-clear 'vector) v1-10 s3-0)) + ) + (vector-normalize! s4-2 1.0) + (vector+! (-> obj average-dir) (-> obj average-dir) s4-2) + ) + ) + ) + (vector-normalize! (-> obj average-dir) 1.0) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type vil-windmill-sail +(deftype vil-windmill-sail (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 vil-windmill-sail +(defmethod inspect vil-windmill-sail ((obj vil-windmill-sail)) + (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-vil-windmill-sail vil-windmill-sail vil-windmill-sail-lod0-jg vil-windmill-sail-idle-ja + ((vil-windmill-sail-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) + +;; failed to figure out what this is: +(defstate idle (vil-windmill-sail) + :virtual #t + :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 vil-windmill-sail) ja-post) + ) + +;; definition for method 11 of type vil-windmill-sail +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! vil-windmill-sail ((obj vil-windmill-sail) (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-vil-windmill-sail" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (go (method-of-object obj idle)) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/landing_pad/castle-obs_REF.gc b/test/decompiler/reference/jak2/levels/landing_pad/castle-obs_REF.gc new file mode 100644 index 0000000000..a02ba2b3b5 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/landing_pad/castle-obs_REF.gc @@ -0,0 +1,3079 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *cas-conveyor-room-id*, type int +(define *cas-conveyor-room-id* 0) + +;; definition of type cas-conveyor +(deftype cas-conveyor (conveyor) + ((actor-group (pointer actor-group) :offset-assert 256) + (actor-group-count int32 :offset-assert 260) + (texture-anim-index uint32 :offset-assert 264) + (my-id int32 :offset-assert 268) + (sound-id uint32 :offset-assert 272) + (target-speed float :offset-assert 276) + ) + :heap-base #xa0 + :method-count-assert 28 + :size-assert #x118 + :flag-assert #x1c00a00118 + ) + +;; definition for method 3 of type cas-conveyor +(defmethod inspect cas-conveyor ((obj cas-conveyor)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type conveyor inspect))) + (t9-0 obj) + ) + (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) + (dotimes (s5-0 (-> obj actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) + (format #t "~2Ttexture-anim-index: ~D~%" (-> obj texture-anim-index)) + (format #t "~2Tmy-id: ~D~%" (-> obj my-id)) + (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Ttarget-speed: ~f~%" (-> obj target-speed)) + (label cfg-7) + obj + ) + +;; definition for method 24 of type cas-conveyor +;; WARN: Return type mismatch int vs none. +(defmethod init! cas-conveyor ((obj cas-conveyor)) + "Initializes defaults for things like the `speed` and `belt-radius`" + (let ((t9-0 (method-of-type conveyor init!))) + (t9-0 obj) + ) + (set! (-> obj speed) (res-lump-float (-> obj entity) 'speed :default 30720.0)) + (set! (-> obj belt-radius) (res-lump-float (-> obj entity) 'center-radius :default 15974.4)) + (set! (-> obj texture-anim-index) (res-lump-value (-> obj entity) 'index uint :time -1000000000.0)) + (set! (-> obj my-id) + (res-lump-value (-> obj entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) + ) + (set! (-> obj pull-y-threshold) 409.6) + 0 + (none) + ) + +;; definition for method 11 of type cas-conveyor +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-conveyor ((obj cas-conveyor) (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" + (local-vars (sv-16 res-tag)) + (reset-root! obj) + (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) + (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (< (-> obj path curve num-cverts) 2) + (go process-drawable-art-error "bad path") + ) + (init! obj) + (set! (-> obj sound-id) (the-as uint (new-sound-id))) + (set! (-> obj target-speed) (-> obj speed)) + (conveyor-method-21 obj) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-16 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-16 (nonzero? (-> sv-16 elt-count))) + (set! (-> obj actor-group) (the-as (pointer actor-group) v1-16)) + (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> obj actor-group-count) 0) + 0 + ) + ) + ) + (go (method-of-object obj idle)) + (none) + ) + +;; definition for method 10 of type cas-conveyor +(defmethod deactivate cas-conveyor ((obj cas-conveyor)) + (sound-stop (the-as sound-id (-> obj sound-id))) + ((the-as (function conveyor none) (find-parent-method cas-conveyor 10)) obj) + (none) + ) + +;; definition for function sound-update +;; WARN: Return type mismatch sound-id vs none. +(defbehavior sound-update cas-conveyor () + (when (and *target* + (and (>= 327680.0 (vector-vector-distance (-> self collide-bounds) (-> *target* control trans))) + (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + ) + ) + (let ((f0-2 (* 0.000032552085 (+ -30720.0 (fabs (-> self speed)))))) + (sound-play-by-name + (static-sound-name "castle-conveyor") + (the-as sound-id (-> self sound-id)) + 1024 + (the int (* 1524.0 f0-2)) + 0 + (sound-group sfx) + (-> self collide-bounds) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (cas-conveyor) + :virtual #t + :trans sound-update + :code (the-as (function none :behavior cas-conveyor) sleep-code) + :post (behavior () + (when (or (= (-> self my-id) -1) (= (-> self my-id) (/ *cas-conveyor-room-id* 8))) + (cond + ((zero? (-> self actor-group-count)) + (set! (-> self speed) (seek-with-smooth (-> self speed) (-> self target-speed) 61440.0 0.1 409.6)) + ) + (else + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'get-speed) + (set! (-> a1-1 param 0) (the-as uint #f)) + (let ((t9-1 send-event-function) + (v1-13 (-> self actor-group 0 data 0 actor)) + ) + (set! (-> self speed) (the-as float (t9-1 + (if v1-13 + (-> v1-13 extra process) + ) + a1-1 + ) + ) + ) + ) + ) + ) + ) + (set-conveyor-speed! (the-as int (-> self texture-anim-index)) (-> self speed)) + ) + (let ((t9-3 (-> (method-of-type conveyor idle) post))) + (if t9-3 + ((the-as (function none) t9-3)) + ) + ) + (none) + ) + ) + +;; definition of type cas-conveyor-switch +(deftype cas-conveyor-switch (process-focusable) + ((actor-group (pointer actor-group) :offset-assert 204) + (actor-group-count int32 :offset-assert 208) + (incoming-attack-id uint32 :offset-assert 212) + (quat0 quaternion :inline :offset-assert 224) + (quat180 quaternion :inline :offset-assert 240) + (red-pos vector :inline :offset-assert 256) + (blue-pos vector :inline :offset-assert 272) + (track-flag symbol :offset-assert 288) + (lightning-timer time-frame :offset-assert 296) + (speed float :offset-assert 304) + (target-speed float :offset-assert 308) + ) + :heap-base #xc0 + :method-count-assert 28 + :size-assert #x138 + :flag-assert #x1c00c00138 + (:methods + (idle () _type_ :state 27) + ) + ) + +;; definition for method 3 of type cas-conveyor-switch +(defmethod inspect cas-conveyor-switch ((obj cas-conveyor-switch)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) + (dotimes (s5-0 (-> obj actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) + (format #t "~2Tquat0: #~%" (-> obj quat0)) + (format #t "~2Tquat180: #~%" (-> obj quat180)) + (format #t "~2Tred-pos: #~%" (-> obj red-pos)) + (format #t "~2Tblue-pos: #~%" (-> obj blue-pos)) + (format #t "~2Ttrack-flag: ~A~%" (-> obj track-flag)) + (format #t "~2Tlightning-timer: ~D~%" (-> obj lightning-timer)) + (format #t "~2Tspeed: ~f~%" (-> obj speed)) + (format #t "~2Ttarget-speed: ~f~%" (-> obj target-speed)) + (label cfg-7) + obj + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 27) (new 'static 'lightning-spec + :name "lightning-cas-switch" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x83 :page #xc) + :reduction 0.42 + :num-points 6 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration 30.0 + :sound #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-cas-conveyor-switch cas-conveyor-switch cas-conveyor-switch-lod0-jg cas-conveyor-switch-idle-ja + ((cas-conveyor-switch-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0.7 0 3.5) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defstate idle (cas-conveyor-switch) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (let ((v1-1 (the-as object (-> event param 1)))) + (when (!= (-> (the-as attack-info v1-1) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> (the-as attack-info v1-1) id)) + (when (and (-> self track-flag) (= (-> self speed) (-> self target-speed))) + (set! (-> self target-speed) (- (-> self target-speed))) + (sound-play "cas-shot-switch") + ) + ) + ) + ) + (('track) + (-> self track-flag) + ) + (('get-speed) + (-> self speed) + ) + ) + ) + :trans (behavior () + (let ((f30-0 (-> self speed))) + (set! (-> self speed) (seek-with-smooth (-> self speed) (-> self target-speed) 61440.0 0.1 409.6)) + (cond + ((< f30-0 0.0) + (quaternion-smooth-seek! (-> self root-override quat) (-> self root-override quat) (-> self quat180) 0.1) + (let ((t9-2 sp-launch-particles-var) + (a0-2 *sp-particle-system-2d*) + (a1-2 (-> *part-id-table* 5119)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> self blue-pos quad)) + (t9-2 a0-2 a1-2 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + (else + (quaternion-smooth-seek! (-> self root-override quat) (-> self root-override quat) (-> self quat0) 0.1) + (let ((t9-4 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 5120)) + (a2-4 *launch-matrix*) + ) + (set! (-> a2-4 trans quad) (-> self red-pos quad)) + (t9-4 a0-4 a1-4 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + (cond + ((or (zero? (-> self actor-group-count)) + (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) + ) + (set! (-> self track-flag) #t) + ) + (else + (let ((gp-0 0)) + (dotimes (s5-0 (length (-> self actor-group 0))) + (let ((v1-16 (-> self actor-group 0 data s5-0)) + (a1-5 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-5 from) (process->ppointer self)) + (set! (-> a1-5 num-params) 0) + (set! (-> a1-5 message) 'stopped?) + (let ((t9-5 send-event-function) + (v1-17 (-> v1-16 actor)) + ) + (if (not (t9-5 + (if v1-17 + (-> v1-17 extra process) + ) + a1-5 + ) + ) + (+! gp-0 1) + ) + ) + ) + ) + (cond + ((zero? gp-0) + (set-castle-electricity-scale! 0.0) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + ) + (else + (set-castle-electricity-scale! 1.0) + ) + ) + (set! (-> self track-flag) (zero? gp-0)) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior cas-conveyor-switch) sleep-code) + :post (behavior () + (local-vars (sv-608 symbol) (sv-624 symbol) (sv-640 (function vector cspace vector)) (sv-656 vector)) + (when (and (logtest? (actor-option user17) (-> self fact options)) + (not (-> self track-flag)) + (< (-> self lightning-timer) (-> self clock frame-counter)) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> *y-vector* quad)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (vector-rotate-x! s5-0 s5-0 (* 182.04445 (rand-vu-float-range 0.0 5.0))) + (vector-rotate-y! s5-0 s5-0 (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (set! (-> gp-0 start-pos quad) (-> self root-override trans quad)) + (vector-normalize-copy! (-> gp-0 move-dist) s5-0 40960.0) + (let ((v1-11 gp-0)) + (set! (-> v1-11 radius) 409.6) + (set! (-> v1-11 collide-with) (collide-spec backgnd enemy obstacle)) + (set! (-> v1-11 ignore-process0) self) + (set! (-> v1-11 ignore-process1) #f) + (set! (-> v1-11 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-11 action-mask) (collide-action solid)) + ) + (let ((f0-5 (fill-and-probe-using-line-sphere *collide-cache* gp-0))) + (when (< 0.0 f0-5) + (let ((s5-2 (vector+float*! (new 'stack-no-clear 'vector) (-> gp-0 start-pos) (-> gp-0 move-dist) f0-5)) + (gp-1 45) + (s4-2 (get-process *default-dead-pool* lightning-tracker #x4000)) + ) + (when s4-2 + (let ((t9-7 (method-of-type lightning-tracker activate))) + (t9-7 + (the-as lightning-tracker s4-2) + *entity-pool* + (symbol->string (-> lightning-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((s3-2 run-function-in-process) + (s2-2 s4-2) + (s1-0 lightning-tracker-init) + (s0-0 (-> *lightning-spec-id-table* 27)) + ) + (set! sv-608 (the-as symbol #f)) + (set! sv-624 (the-as symbol #f)) + (set! sv-640 vector<-cspace!) + (set! sv-656 (new 'stack-no-clear 'vector)) + (let* ((a1-8 (-> self node-list data (+ (rand-vu-int-count 3) 4))) + (t2-0 (sv-640 sv-656 a1-8)) + ) + ((the-as (function object object object object object object object object none) s3-2) + s2-2 + s1-0 + s0-0 + gp-1 + sv-608 + sv-624 + t2-0 + s5-2 + ) + ) + ) + (-> s4-2 ppointer) + ) + ) + (set! (-> self lightning-timer) + (+ (-> self clock frame-counter) (the int (* 300.0 (rand-vu-float-range 0.04 0.1)))) + ) + ) + ) + ) + ) + ) + (transform-post) + (none) + ) + ) + +;; definition for method 11 of type cas-conveyor-switch +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-conveyor-switch ((obj cas-conveyor-switch) (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" + (local-vars (sv-16 res-tag)) + (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 enemy)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list 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 1228.8 0.0 14336.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-cas-conveyor-switch" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj mask) (logior (process-mask enemy) (-> obj mask))) + (set! (-> obj fact) + (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) + (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (!= (-> obj path curve num-cverts) 2) + (go process-drawable-art-error "bad path") + ) + (get-point-in-path! (-> obj path) (-> obj red-pos) 0.0 'exact) + (get-point-in-path! (-> obj path) (-> obj blue-pos) 1.0 'exact) + (set! (-> obj lightning-timer) 0) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-27 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-27 (nonzero? (-> sv-16 elt-count))) + (set! (-> obj actor-group) (the-as (pointer actor-group) v1-27)) + (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> obj actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> obj quat0 quad) (-> obj root-override quat quad)) + (quaternion-rotate-y! (-> obj quat180) (-> obj quat0) 32768.0) + (set! (-> obj speed) (res-lump-float (-> obj entity) 'speed :default 30720.0)) + (set! (-> obj target-speed) (-> obj speed)) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type cas-electric-fence +(deftype cas-electric-fence (process-focusable) + ((next-spawn-time time-frame :offset-assert 208) + (stop symbol :offset-assert 216) + ) + :heap-base #x60 + :method-count-assert 29 + :size-assert #xdc + :flag-assert #x1d006000dc + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + ) + ) + +;; definition for method 3 of type cas-electric-fence +(defmethod inspect cas-electric-fence ((obj cas-electric-fence)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (format #t "~2Tnext-spawn-time: ~D~%" (-> obj next-spawn-time)) + (format #t "~2Tstop: ~A~%" (-> obj stop)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-cas-electric-fence cas-electric-fence cas-electric-fence-lod0-jg cas-electric-fence-idle-ja + ((cas-electric-fence-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1.5 0 2) + ) + +;; failed to figure out what this is: +(defskelgroup skel-cas-electric-fence-explode cas-electric-fence cas-electric-fence-explode-lod0-jg cas-electric-fence-explode-idle-ja + ((cas-electric-fence-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4.2) + ) + +;; definition for symbol *cas-electric-fence-exploder-params*, type joint-exploder-static-params +(define *cas-electric-fence-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 3 :parent-joint-index -1) + (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 + :art-level #f + ) + ) + +;; failed to figure out what this is: +(defstate die (cas-electric-fence) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (none) + ) + :code (behavior () + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-cas-electric-fence-explode" (the-as (pointer uint32) #f)) + 5 + gp-0 + *cas-electric-fence-exploder-params* + :to self + ) + ) + (sound-play "lightning-node") + (suspend) + (logior! (-> self entity extra perm status) (entity-perm-status dead)) + (let ((gp-2 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-2) (seconds 4)) + (suspend) + ) + ) + (cleanup-for-death self) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate idle (cas-electric-fence) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('touched) + #f + ) + (('attack) + #f + ) + (('track) + #t + ) + (('stop) + (let ((v0-0 #t)) + (set! (-> self stop) v0-0) + v0-0 + ) + ) + (('stopped?) + (-> self stop) + ) + ) + ) + ) + :code (the-as (function none :behavior cas-electric-fence) sleep-code) + :post (behavior () + (when (not (-> self stop)) + (when (< (-> self next-spawn-time) (-> self clock frame-counter)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> *y-vector* quad)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (vector-rotate-x! s5-0 s5-0 (* 182.04445 (rand-vu-float-range 0.0 140.0))) + (vector-rotate-y! s5-0 s5-0 (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (set! (-> gp-0 start-pos quad) (-> self root-override trans quad)) + (set! (-> gp-0 start-pos y) (+ 15400.96 (-> gp-0 start-pos y))) + (vector-normalize-copy! (-> gp-0 move-dist) s5-0 40960.0) + (let ((v1-9 gp-0)) + (set! (-> v1-9 radius) 409.6) + (set! (-> v1-9 collide-with) (collide-spec backgnd enemy obstacle)) + (set! (-> v1-9 ignore-process0) self) + (set! (-> v1-9 ignore-process1) #f) + (set! (-> v1-9 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-9 action-mask) (collide-action solid)) + ) + (let ((f0-7 (fill-and-probe-using-line-sphere *collide-cache* gp-0))) + (when (< 0.0 f0-7) + (let ((s5-2 (vector+float*! (new 'stack-no-clear 'vector) (-> gp-0 start-pos) (-> gp-0 move-dist) f0-7))) + (let ((s4-2 120)) + (process-spawn + lightning-tracker + :init lightning-tracker-init + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x83 :page #xc) + :reduction 0.42 + :num-points 16 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "shock" :fo-min 10 :fo-max 40) + ) + s4-2 + #f + #f + (-> gp-0 start-pos) + s5-2 + :to *entity-pool* + ) + (let ((v1-22 (get-field-spec-by-id (-> *part-id-table* 166) (sp-field-id spt-timer)))) + (if v1-22 + (set! (-> v1-22 initial-valuef) (the-as float s4-2)) + ) + ) + ) + (let ((t9-10 sp-launch-particles-var) + (a0-21 *sp-particle-system-2d*) + (a1-10 (-> *part-id-table* 166)) + (a2-8 *launch-matrix*) + ) + (set! (-> a2-8 trans quad) (-> s5-2 quad)) + (t9-10 a0-21 a1-10 a2-8 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + (set! (-> self next-spawn-time) + (+ (-> self clock frame-counter) (the int (* 300.0 (rand-vu-float-range 0.07 0.4)))) + ) + ) + ) + ) + ) + ) + (let ((gp-2 *target*)) + (when (and gp-2 (zero? (logand (-> gp-2 focus-status) (focus-status disable dead ignore inactive)))) + (let ((s4-3 (get-trans gp-2 0))) + (when (< (vector-vector-distance s4-3 (-> self root-override trans)) 24576.0) + (let ((s5-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> s5-3 from) (process->ppointer self)) + (set! (-> s5-3 num-params) 2) + (set! (-> s5-3 message) 'attack) + (set! (-> s5-3 param 0) (the-as uint #f)) + (let ((s3-3 (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up control id)))) + (let* ((v1-38 *game-info*) + (a0-29 (+ (-> v1-38 attack-id) 1)) + ) + (set! (-> v1-38 attack-id) a0-29) + (set! (-> s3-3 id) a0-29) + ) + (set! (-> s3-3 vector quad) + (-> (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-3 (-> self root-override trans)) 1.0) quad) + ) + (set! (-> s3-3 shove-back) 24576.0) + (set! (-> s3-3 shove-up) 12288.0) + (set! (-> s3-3 control) (if (logtest? (focus-status board) (-> gp-2 focus-status)) + 1.0 + 0.0 + ) + ) + (set! (-> s5-3 param 1) (the-as uint s3-3)) + ) + (send-event-function gp-2 s5-3) + ) + (let ((s5-4 (new 'stack-no-clear 'vector))) + (set! (-> s5-4 quad) (-> self root-override trans quad)) + (set! (-> s5-4 y) (+ 15400.96 (-> s5-4 y))) + (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> *lightning-spec-id-table* 1) + 225 + #f + #f + s5-4 + 6 + :to gp-2 + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 11 of type cas-electric-fence +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-electric-fence ((obj cas-electric-fence) (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 ((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 hit-by-others-list player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid deadly)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 6144.0 0.0 8192.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! (-> s4-0 event-self) 'touched) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-electric-fence" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj next-spawn-time) 0) + (set! (-> obj stop) #f) + (ja-channel-set! 1) + (let ((a0-14 (-> obj skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> a0-14 frame-num) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type cas-button +(deftype cas-button (basebutton) + () + :heap-base #xa0 + :method-count-assert 40 + :size-assert #x120 + :flag-assert #x2800a00120 + (:methods + (cas-button-method-39 (_type_) none 39) + ) + ) + +;; definition for method 3 of type cas-button +(defmethod inspect cas-button ((obj cas-button)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type basebutton inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-cas-button cas-button cas-button-lod0-jg cas-button-idle-ja + ((cas-button-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.25) + ) + +;; definition for method 34 of type cas-button +;; WARN: Return type mismatch int vs none. +(defmethod basebutton-method-34 cas-button ((obj cas-button)) + "TODO - collision stuff" + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 9216.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-12 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; definition for method 35 of type cas-button +;; WARN: Return type mismatch int vs none. +(defmethod prepare-trigger-event! cas-button ((obj cas-button)) + "Sets `event-going-down` to `'trigger`" + (set! (-> obj event-down) 'shutdown) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate up-idle (cas-button) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (let ((v1-1 (the-as attack-info (-> event param 1)))) + (case (-> v1-1 mode) + (('flop) + (when (or (not (or (= (-> v1-1 mode) 'spin) (= (-> v1-1 mode) 'punch))) + (logtest? (-> self button-status) (button-status button-status-3)) + ) + (send-event! self (-> self event-going-down)) + (sound-play "big-red-button") + (go-virtual going-down) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 33 of type cas-button +;; WARN: Return type mismatch int vs none. +(defmethod basebutton-method-33 cas-button ((obj cas-button)) + "TODO - joint stuff" + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-button" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (cond + ((logtest? (-> obj button-status) (button-status pressed)) + (let ((s5-1 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-1 + (the-as art-joint-anim (-> obj draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-1 frame-num) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) frames num-frames) -1)) + ) + ) + ) + (else + (let ((s5-2 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-2 + (the-as art-joint-anim (-> obj draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-2 frame-num) 0.0) + ) + ) + ) + (set! (-> obj anim-speed) 2.0) + (transform-post) + (none) + ) + +;; definition of type cas-elevator +(deftype cas-elevator (elevator) + ((sound-id uint32 :offset-assert 368) + ) + :heap-base #x100 + :method-count-assert 50 + :size-assert #x174 + :flag-assert #x3201000174 + (:methods + (cas-elevator-method-49 (_type_) none 49) + ) + ) + +;; definition for method 3 of type cas-elevator +(defmethod inspect cas-elevator ((obj cas-elevator)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type elevator inspect))) + (t9-0 obj) + ) + (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-cas-elevator cas-elevator cas-elevator-lod0-jg cas-elevator-up-down-ja + ((cas-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 9) + ) + +;; definition for method 30 of type cas-elevator +(defmethod get-art-group cas-elevator ((obj cas-elevator)) + "@returns The associated [[art-group]]" + (art-group-get-by-name *level* "skel-cas-elevator" (the-as (pointer uint32) #f)) + ) + +;; definition for method 49 of type cas-elevator +;; WARN: Return type mismatch float vs none. +(defmethod cas-elevator-method-49 cas-elevator ((obj cas-elevator)) + (let* ((f0-1 (fmax 0.0 (- (-> obj root-override trans y) (-> obj bottom-top 0)))) + (f0-3 (* 0.001171875 (- f0-1 (* (the float (the int (/ f0-1 30720.0))) 30720.0)))) + (v1-6 (-> obj skel root-channel 0)) + ) + (set! (-> v1-6 num-func) num-func-identity) + (set! (-> v1-6 frame-num) f0-3) + ) + (none) + ) + +;; definition for method 43 of type cas-elevator +(defmethod move-between-points cas-elevator ((obj cas-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 ((s5-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) (-> s5-0 y)) (< (-> arg0 y) (+ -8192.0 (-> v1-3 y)))) + (let ((a0-8 (vector-! (new 'stack-no-clear 'vector) arg0 v1-3))) + (< (sqrtf (+ (* (-> a0-8 x) (-> a0-8 x)) (* (-> a0-8 z) (-> a0-8 z)))) 36864.0) + ) + ) + ) + ) + +;; definition for method 45 of type cas-elevator +(defmethod commited-to-ride? cas-elevator ((obj cas-elevator)) + "@returns if the target is considered within the elevator area enough to begin descending/ascending" + (let* ((s5-0 *target*) + (a0-2 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when a0-2 + (let* ((a0-3 (get-trans a0-2 0)) + (v1-2 (vector-! (new 'stack-no-clear 'vector) a0-3 (-> obj root-override trans))) + ) + (< (sqrtf (+ (* (-> v1-2 x) (-> v1-2 x)) (* (-> v1-2 z) (-> v1-2 z)))) 28672.0) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate waiting (cas-elevator) + :virtual #t + :post (behavior () + (if (-> self bouncing) + (cas-elevator-method-49 self) + ) + (let ((t9-1 (-> (method-of-type elevator waiting) post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate running (cas-elevator) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type elevator running) enter))) + (if t9-0 + (t9-0) + ) + ) + (sound-play "cas-elevate" :id (the-as sound-id (-> self sound-id)) :position (-> self root-override trans)) + (none) + ) + :post (behavior () + (cas-elevator-method-49 self) + (let ((t9-1 (-> (method-of-type elevator running) post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (when *sound-player-enable* + (let ((gp-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> gp-0 command) (sound-command set-param)) + (set! (-> gp-0 id) (the-as sound-id (-> self sound-id))) + (let ((a1-0 (-> self root-override trans))) + (let ((s5-0 self)) + (when (= a1-0 #t) + (if (and s5-0 (type? s5-0 process-drawable) (nonzero? (-> s5-0 root-override))) + (set! a1-0 (-> s5-0 root-override trans)) + (set! a1-0 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (the-as vector3w (-> gp-0 params trans)) a1-0) + ) + (set! (-> gp-0 params mask) (the-as uint 32)) + (-> gp-0 id) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate arrived (cas-elevator) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type elevator arrived) enter))) + (if t9-0 + (t9-0) + ) + ) + (sound-stop (the-as sound-id (-> self sound-id))) + (sound-play "cas-elevate-end") + (none) + ) + :post (behavior () + (if (-> self bouncing) + (cas-elevator-method-49 self) + ) + (let ((t9-1 (-> (method-of-type elevator arrived) post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (none) + ) + ) + +;; definition for method 10 of type cas-elevator +(defmethod deactivate cas-elevator ((obj cas-elevator)) + (sound-stop (the-as sound-id (-> obj sound-id))) + ((the-as (function elevator none) (find-parent-method cas-elevator 10)) obj) + (none) + ) + +;; definition for method 33 of type cas-elevator +(defmethod init-plat! cas-elevator ((obj cas-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." + (set! (-> obj sound-id) (the-as uint (new-sound-id))) + (cas-elevator-method-49 obj) + (none) + ) + +;; definition for method 31 of type cas-elevator +;; WARN: Return type mismatch int vs none. +(defmethod init-plat-collision! cas-elevator ((obj cas-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-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (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 0.0 36864.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-16 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; definition of type cas-rot-bridge +(deftype cas-rot-bridge (process-drawable) + ((index uint32 :offset-assert 200) + (anim-index uint32 :offset-assert 204) + (test-index uint32 :offset-assert 208) + (pos float :offset-assert 212) + (pos-old float :offset-assert 216) + (sound-id uint32 :offset-assert 220) + (sound-flag symbol :offset-assert 224) + ) + :heap-base #x70 + :method-count-assert 21 + :size-assert #xe4 + :flag-assert #x15007000e4 + (:methods + (idle () _type_ :state 20) + ) + ) + +;; definition for method 3 of type cas-rot-bridge +(defmethod inspect cas-rot-bridge ((obj cas-rot-bridge)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tindex: ~D~%" (-> obj index)) + (format #t "~2Tanim-index: ~D~%" (-> obj anim-index)) + (format #t "~2Ttest-index: ~D~%" (-> obj test-index)) + (format #t "~2Tpos: ~f~%" (-> obj pos)) + (format #t "~2Tpos-old: ~f~%" (-> obj pos-old)) + (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tsound-flag: ~A~%" (-> obj sound-flag)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-cas-rot-bridge cas-rot-bridge cas-rot-bridge-lod0-jg cas-rot-bridge-idle-ja + ((cas-rot-bridge-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 -8 14) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defstate idle (cas-rot-bridge) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (local-vars (v0-0 number)) + (the-as object (case event-type + (('move) + (set! (-> self anim-index) (/ (the-as int (-> event param 0)) 8)) + (set! v0-0 (logclear (-> self mask) (process-mask sleep-code))) + (set! (-> self mask) (the-as process-mask v0-0)) + v0-0 + ) + (('get-pos) + (set! (-> self test-index) (/ (the-as int (-> event param 0)) 8)) + (let ((f0-0 (ja-aframe-num 0))) + (cond + ((zero? (-> self test-index)) + (if (< f0-0 10.0) + (set! f0-0 10.0) + ) + (if (< 40.0 f0-0) + (set! f0-0 40.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -10.0 f0-0))) + ) + ((= (-> self test-index) 1) + (if (< f0-0 50.0) + (set! f0-0 50.0) + ) + (if (< 80.0 f0-0) + (set! f0-0 80.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -50.0 f0-0))) + ) + ((= (-> self test-index) 2) + (if (< f0-0 90.0) + (set! f0-0 90.0) + ) + (if (< 120.0 f0-0) + (set! f0-0 120.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -90.0 f0-0))) + ) + ((= (-> self test-index) 3) + (if (< f0-0 10.0) + (set! f0-0 10.0) + ) + (if (< 40.0 f0-0) + (set! f0-0 40.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -10.0 f0-0))) + ) + ) + ) + (-> self pos) + ) + (('reset) + (when (nonzero? (-> self anim-index)) + (ja-no-eval :group! (-> self draw art-group data 3) :num! min) + (set! (-> self anim-index) (the-as uint 0)) + (set! v0-0 (logclear (-> self mask) (process-mask sleep-code))) + (set! (-> self mask) (the-as process-mask v0-0)) + v0-0 + ) + ) + ) + ) + ) + :code (behavior () + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + (let ((f0-0 (ja-aframe-num 0))) + (cond + ((zero? (-> self anim-index)) + (when (or (= f0-0 10.0) (= f0-0 40.0) (= f0-0 50.0)) + (cond + ((= f0-0 10.0) + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 7) + :num! (seek! 0.0) + :frame-num (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) frames num-frames) -1)) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + ) + ) + ) + ((= (-> self anim-index) 1) + (when (or (= f0-0 40.0) (= f0-0 50.0) (= f0-0 80.0) (= f0-0 90.0)) + (cond + ((or (= f0-0 40.0) (= f0-0 50.0)) + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 8) + :num! (seek! 0.0) + :frame-num (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) frames num-frames) -1)) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + ) + ) + ) + ((= (-> self anim-index) 2) + (when (or (= f0-0 80.0) (= f0-0 90.0) (= f0-0 120.0)) + (cond + ((or (= f0-0 80.0) (= f0-0 90.0)) + (ja-no-eval :group! (-> self draw art-group data 5) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 9) + :num! (seek! 0.0) + :frame-num (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) frames num-frames) -1)) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + ) + ) + ) + ((= (-> self anim-index) 3) + (cond + ((= f0-0 10.0) + (ja-no-eval :group! (-> self draw art-group data 6) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 10) + :num! (seek! 0.0) + :frame-num (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) frames num-frames) -1)) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + ) + ) + ) + ) + ) + #f + (none) + ) + :post (behavior () + (let ((f0-0 (ja-aframe-num 0))) + (cond + ((zero? (-> self anim-index)) + (if (< f0-0 10.0) + (set! f0-0 10.0) + ) + (if (< 40.0 f0-0) + (set! f0-0 40.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -10.0 f0-0))) + ) + ((= (-> self anim-index) 1) + (if (< f0-0 50.0) + (set! f0-0 50.0) + ) + (if (< 80.0 f0-0) + (set! f0-0 80.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -50.0 f0-0))) + ) + ((= (-> self anim-index) 2) + (if (< f0-0 90.0) + (set! f0-0 90.0) + ) + (if (< 120.0 f0-0) + (set! f0-0 120.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -90.0 f0-0))) + ) + ((= (-> self anim-index) 3) + (if (< f0-0 10.0) + (set! f0-0 10.0) + ) + (if (< 40.0 f0-0) + (set! f0-0 40.0) + ) + (set! (-> self pos) (* 0.033333335 (+ -10.0 f0-0))) + ) + ) + ) + (let* ((f0-9 (-> self pos)) + (f1-13 (- f0-9 (-> self pos-old))) + ) + (set! (-> self pos-old) f0-9) + (when (!= f1-13 0.0) + (cond + ((< 0.0 f1-13) + (cond + ((< f0-9 1.0) + (sound-play + "track-plat-loop" + :id (the-as sound-id (-> self sound-id)) + :position (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 5)) + ) + (set! (-> self sound-flag) #t) + ) + ((-> self sound-flag) + (sound-play + "track-plat-stop" + :position (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 5)) + ) + (sound-stop (the-as sound-id (-> self sound-id))) + (set! (-> self sound-flag) #f) + ) + ) + ) + (else + (cond + ((< 0.0 f0-9) + (sound-play + "track-plat-loop" + :id (the-as sound-id (-> self sound-id)) + :position (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 5)) + ) + (set! (-> self sound-flag) #t) + ) + ((-> self sound-flag) + (sound-play + "track-plat-stop" + :position (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 5)) + ) + (sound-stop (the-as sound-id (-> self sound-id))) + (set! (-> self sound-flag) #f) + ) + ) + ) + ) + ) + ) + (transform-post) + (none) + ) + ) + +;; definition for method 11 of type cas-rot-bridge +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-rot-bridge ((obj cas-rot-bridge) (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 5) 0))) + (set! (-> s4-0 total-prims) (the-as uint 6)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 5) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 57344.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 0.0 0.0 0.0 18432.0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 4) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 5120.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 5) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 18432.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 6) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 5120.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 7) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 18432.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-20 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-20 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-20 prim-core collide-with)) + ) + (set! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-rot-bridge" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) 16384.0) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj index) (res-lump-value (-> obj entity) 'index uint :time -1000000000.0)) + (let ((v1-30 (-> obj index))) + (cond + ((zero? v1-30) + (set! (-> obj root trans x) (+ 5734.4 (-> obj root trans x))) + (let ((s5-2 (-> obj skel root-channel 0))) + (joint-control-channel-group! s5-2 (the-as art-joint-anim (-> obj draw art-group data 6)) num-func-identity) + (set! (-> s5-2 frame-num) 0.0) + ) + ) + ((= v1-30 1) + (let ((s5-3 (-> obj skel root-channel 0))) + (joint-control-channel-group! s5-3 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (set! (-> s5-3 frame-num) 0.0) + ) + ) + ) + ) + (set! (-> obj draw light-index) (the-as uint 1)) + (set! (-> obj sound-id) (the-as uint (new-sound-id))) + (set! (-> obj sound-flag) #f) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type cas-switch +(deftype cas-switch (process-drawable) + ((actor-group (pointer actor-group) :offset-assert 200) + (actor-group-count int32 :offset-assert 204) + (incoming-attack-id uint32 :offset-assert 208) + (anim-index uint32 :offset-assert 212) + (direction uint32 :offset-assert 216) + (pos-old float :offset-assert 220) + (y-start float :offset-assert 224) + (y-delta float :offset-assert 228) + (sound-id uint32 :offset-assert 232) + (sound-flag symbol :offset-assert 236) + ) + :heap-base #x70 + :method-count-assert 21 + :size-assert #xf0 + :flag-assert #x15007000f0 + (:methods + (idle () _type_ :state 20) + ) + ) + +;; definition for method 3 of type cas-switch +(defmethod inspect cas-switch ((obj cas-switch)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) + (dotimes (s5-0 (-> obj actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) + (format #t "~2Tanim-index: ~D~%" (-> obj anim-index)) + (format #t "~2Tdirection: ~D~%" (-> obj direction)) + (format #t "~2Tpos-old: ~f~%" (-> obj pos-old)) + (format #t "~2Ty-start: ~f~%" (-> obj y-start)) + (format #t "~2Ty-delta: ~f~%" (-> obj y-delta)) + (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tsound-flag: ~A~%" (-> obj sound-flag)) + (label cfg-7) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-cas-switch cas-switch 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 2.7 0 3) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defstate idle (cas-switch) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as + object + (case event-type + (('attack) + (let ((gp-0 (the-as attack-info (-> event param 1)))) + (when (or (= (-> gp-0 mode) 'spin) (= (-> gp-0 mode) 'spin-air)) + (let* ((s5-0 (the-as object (-> event param 0))) + (s4-0 (-> (the-as touching-shapes-entry s5-0) head)) + ) + (while s4-0 + (let ((a0-2 (get-touched-prim s4-0 (the-as collide-shape (-> self root)) (the-as touching-shapes-entry s5-0)))) + (when (= (-> a0-2 prim-id) 1) + (when (!= (-> gp-0 id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> gp-0 id)) + (let ((s3-0 (-> self actor-group 0))) + (dotimes (s2-0 (-> s3-0 length)) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 1) + (set! (-> a1-6 message) 'move) + (set! (-> a1-6 param 0) (* (-> self anim-index) 8)) + (let ((t9-1 send-event-function) + (v1-20 (-> s3-0 data s2-0 actor)) + ) + (t9-1 + (if v1-20 + (-> v1-20 extra process) + ) + a1-6 + ) + ) + ) + ) + ) + ) + ) + ) + (set! s4-0 (-> s4-0 next)) + ) + ) + #f + ) + ) + ) + ) + ) + ) + :trans (the-as (function none :behavior cas-switch) rider-trans) + :code (behavior () + (until #f + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'get-pos) + (set! (-> a1-0 param 0) (* (-> self anim-index) 8)) + (let* ((t9-0 send-event-function) + (v1-8 (-> self actor-group 0 data 0 actor)) + (a0-0 (if v1-8 + (-> v1-8 extra process) + ) + ) + (f30-0 (the-as float (t9-0 a0-0 a1-0))) + (f28-0 (- f30-0 (-> self pos-old))) + ) + (set! (-> self pos-old) f30-0) + (when (!= f28-0 0.0) + (set! (-> self root trans y) (+ (-> self y-start) (* f30-0 (-> self y-delta)))) + (if (< (* (-> self y-delta) f28-0) 0.0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) 1820.4445) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) -1820.4445) + ) + (cond + ((< 0.0 f28-0) + (cond + ((< f30-0 1.0) + (sound-play "cas-valve-loop" :id (the-as sound-id (-> self sound-id)) :position (-> self root trans)) + (set! (-> self sound-flag) #t) + ) + ((-> self sound-flag) + (sound-play "cas-valve-stop") + (sound-stop (the-as sound-id (-> self sound-id))) + (set! (-> self sound-flag) #f) + ) + ) + ) + (else + (cond + ((< 0.0 f30-0) + (sound-play "cas-valve-loop" :id (the-as sound-id (-> self sound-id)) :position (-> self root trans)) + (set! (-> self sound-flag) #t) + ) + ((-> self sound-flag) + (sound-play "cas-valve-stop") + (sound-stop (the-as sound-id (-> self sound-id))) + (set! (-> self sound-flag) #f) + ) + ) + ) + ) + ) + ) + ) + (suspend) + ) + #f + (none) + ) + :post (the-as (function none :behavior cas-switch) rider-post) + ) + +;; definition for method 11 of type cas-switch +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-switch ((obj cas-switch) (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" + (local-vars (sv-16 res-tag)) + (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid no-standon)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 11059.2 0.0 12288.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 0.0 11059.2 0.0 12288.0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 1)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid rideable)) + (set! (-> v1-11 transform-index) 3) + (set-vector! (-> v1-11 local-sphere) 0.0 11059.2 0.0 12288.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-switch" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-22 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-22 (nonzero? (-> sv-16 elt-count))) + (set! (-> obj actor-group) (the-as (pointer actor-group) v1-22)) + (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> obj actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> obj anim-index) (res-lump-value (-> obj entity) 'index uint :time -1000000000.0)) + (set! (-> obj direction) (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0)) + (let ((s5-2 (-> obj root trans)) + (s4-2 (-> obj root trans)) + (t9-10 (method-of-type res-lump get-property-struct)) + (a0-27 (-> obj entity)) + (a1-19 'trans-offset) + (a2-9 'interp) + (a3-7 -1000000000.0) + (t0-6 (new 'stack-no-clear 'vector)) + ) + (set! (-> t0-6 x) 0.0) + (set! (-> t0-6 y) 0.0) + (set! (-> t0-6 z) 0.0) + (set! (-> t0-6 w) 1.0) + (vector+! + s5-2 + s4-2 + (the-as vector (t9-10 a0-27 a1-19 a2-9 a3-7 t0-6 (the-as (pointer res-tag) #f) *res-static-buf*)) + ) + ) + (set! (-> obj y-start) (-> obj root trans y)) + (if (zero? (-> obj direction)) + (set! (-> obj y-delta) -12288.0) + (set! (-> obj y-delta) 12288.0) + ) + (set! (-> obj sound-id) (the-as uint (new-sound-id))) + (set! (-> obj sound-flag) #f) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type cas-trapdoor +(deftype cas-trapdoor (process-drawable) + ((root-override collide-shape :offset 128) + ) + :heap-base #x50 + :method-count-assert 22 + :size-assert #xc8 + :flag-assert #x16005000c8 + (:methods + (idle () _type_ :state 20) + (die () _type_ :state 21) + ) + ) + +;; definition for method 3 of type cas-trapdoor +(defmethod inspect cas-trapdoor ((obj cas-trapdoor)) + (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-cas-trapdoor cas-trapdoor cas-trapdoor-lod0-jg cas-trapdoor-idle-ja + ((cas-trapdoor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +;; failed to figure out what this is: +(defskelgroup skel-cas-trapdoor-explode cas-trapdoor cas-trapdoor-explode-lod0-jg cas-trapdoor-explode-idle-ja + ((cas-trapdoor-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) + +;; definition for symbol *cas-trapdoor-exploder-params*, type joint-exploder-static-params +(define *cas-trapdoor-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) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + ) + :collide-spec #x1 + ) + ) + +;; failed to figure out what this is: +(defstate idle (cas-trapdoor) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('attack) + (let ((gp-0 (the-as object (-> event param 1)))) + (when (and (not (task-node-closed? (game-task-node castle-boss-resolution))) + (logtest? (-> (the-as attack-info gp-0) penetrate-using) (penetrate flop)) + ) + (go-virtual die) + #f + ) + ) + ) + ) + ) + ) + :code (the-as (function none :behavior cas-trapdoor) sleep-code) + ) + +;; failed to figure out what this is: +(defstate die (cas-trapdoor) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (sound-play "trapdoor") + (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (let* ((s5-1 *target*) + (a0-3 (if (type? s5-1 process-focusable) + s5-1 + ) + ) + ) + (when a0-3 + (set! (-> gp-1 fountain-rand-transv-lo quad) (-> (get-trans a0-3 0) quad)) + (set! (-> gp-1 fountain-rand-transv-lo y) (+ -16384.0 (-> gp-1 fountain-rand-transv-lo y))) + ) + ) + (set! (-> gp-1 fountain-rand-transv-hi x) 24576.0) + (set! (-> gp-1 fountain-rand-transv-hi y) 81920.0) + (set! (-> gp-1 fountain-rand-transv-hi z) 12288.0) + (set! (-> gp-1 fountain-rand-transv-hi w) 32768.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-cas-trapdoor-explode" (the-as (pointer uint32) #f)) + 5 + gp-1 + *cas-trapdoor-exploder-params* + :to self + ) + ) + (none) + ) + :code (behavior () + (sound-play "trapdoor") + (suspend) + (ja-channel-set! 0) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 1)) + (suspend) + ) + ) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior cas-trapdoor) ja-post) + ) + +;; definition for method 11 of type cas-trapdoor +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-trapdoor ((obj cas-trapdoor) (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 ((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 bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 0) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (if (not (task-node-closed? (game-task-node castle-boss-resolution))) + (set! (-> obj root-override penetrated-by) (penetrate flop)) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-trapdoor" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((a0-14 (-> obj skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> a0-14 frame-num) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type cas-chain-plat +(deftype cas-chain-plat (process-focusable) + () + :heap-base #x50 + :method-count-assert 30 + :size-assert #xcc + :flag-assert #x1e005000cc + (:methods + (idle () _type_ :state 27) + (drop () _type_ :state 28) + (down () _type_ :state 29) + ) + ) + +;; definition for method 3 of type cas-chain-plat +(defmethod inspect cas-chain-plat ((obj cas-chain-plat)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-cas-chain-plat cas-chain-plat cas-chain-plat-lod0-jg cas-chain-plat-idle-ja + ((cas-chain-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3 0 6) + :origin-joint-index 4 + ) + +;; failed to figure out what this is: +(defstate idle (cas-chain-plat) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (sound-play "cas-shelf-plat") + (go-virtual drop) + ) + (('track) + #t + ) + ) + ) + :code (the-as (function none :behavior cas-chain-plat) sleep-code) + :post (the-as (function none :behavior cas-chain-plat) ja-post) + ) + +;; failed to figure out what this is: +(defstate drop (cas-chain-plat) + :virtual #t + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual down) + (none) + ) + :post (the-as (function none :behavior cas-chain-plat) transform-post) + ) + +;; failed to figure out what this is: +(defstate down (cas-chain-plat) + :virtual #t + :code (the-as (function none :behavior cas-chain-plat) sleep-code) + ) + +;; definition for method 11 of type cas-chain-plat +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-chain-plat ((obj cas-chain-plat) (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 ((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 hit-by-others-list player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 4) + (set-vector! (-> v1-2 local-sphere) 0.0 12288.0 0.0 24576.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-chain-plat" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj mask) (logior (process-mask enemy) (-> obj mask))) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type cas-rot-blade +(deftype cas-rot-blade (process-drawable) + ((sync sync-eased :inline :offset-assert 200) + (rot float :offset-assert 244) + (attack-id uint32 :offset-assert 248) + (sound-id uint32 :offset-assert 252) + ) + :heap-base #x80 + :method-count-assert 21 + :size-assert #x100 + :flag-assert #x1500800100 + (:methods + (idle () _type_ :state 20) + ) + ) + +;; definition for method 3 of type cas-rot-blade +(defmethod inspect cas-rot-blade ((obj cas-rot-blade)) + (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)) + (format #t "~2Trot: ~f~%" (-> obj rot)) + (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) + (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-cas-rot-blade cas-rot-blade cas-rot-blade-lod0-jg cas-rot-blade-idle-ja + ((cas-rot-blade-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + :shadow cas-rot-blade-shadow-mg + ) + +;; definition for symbol *cas-rot-blade-shadow-control*, type shadow-control +(define *cas-rot-blade-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :flags (shadow-flags disable-fade shdf03) + :shadow-dir (new 'static 'vector :y -1.0 :w 163840.0) + :bot-plane (new 'static 'plane :y 1.0 :w 8192.0) + :top-plane (new 'static 'plane :y 1.0 :w 2048.0) + ) + ) + ) + +;; definition for function cas-rot-blade-callback +;; WARN: Return type mismatch int vs none. +(defun cas-rot-blade-callback ((arg0 cspace) (arg1 transformq)) + (with-pp + (quaternion-rotate-local-y! + (-> arg1 quat) + (-> arg1 quat) + (* 606.8148 (the float (-> pp clock frame-counter))) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate idle (cas-rot-blade) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as + object + (case event-type + (('touched) + (let* ((s4-0 (the-as object (-> event param 0))) + (s3-0 (-> (the-as touching-shapes-entry s4-0) head)) + ) + (while s3-0 + (let ((a0-3 (get-touched-prim s3-0 (the-as collide-shape (-> self root)) (the-as touching-shapes-entry s4-0)))) + (when (= (-> a0-3 prim-id) 1) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 2) + (set! (-> a1-2 message) 'attack) + (set! (-> a1-2 param 0) (-> event param 0)) + (let ((a0-6 (new 'static 'attack-info :mask (attack-info-mask id)))) + (let* ((v1-10 *game-info*) + (a2-3 (+ (-> v1-10 attack-id) 1)) + ) + (set! (-> v1-10 attack-id) a2-3) + (set! (-> a0-6 id) a2-3) + ) + (set! (-> a1-2 param 1) (the-as uint a0-6)) + ) + (send-event-function proc a1-2) + ) + ) + ) + (set! s3-0 (-> s3-0 next)) + ) + ) + #f + ) + ) + ) + ) + :trans (behavior () + (set! (-> self rot) (+ 1820.4445 (get-scaled-val! (-> self sync) 29127.111 0))) + (quaternion-vector-angle! (-> self root quat) *y-vector* (-> self rot)) + (sound-play + "cas-arm-blade" + :id (the-as sound-id (-> self sound-id)) + :position (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4)) + ) + (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 cas-rot-blade) transform-post) + ) + +;; definition for method 11 of type cas-rot-blade +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-rot-blade ((obj cas-rot-blade) (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 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 61440.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (set! (-> s4-0 event-self) 'touched) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 0.0 0.0 0.0 49152.0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid deadly)) + (set! (-> v1-11 transform-index) 4) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 14336.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> obj root) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-rot-blade" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj draw light-index) (the-as uint 2)) + (let ((a1-10 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-20 0)) + (if #t + (set! v1-20 (logior v1-20 1)) + ) + (set! (-> a1-10 sync-type) 'sync-eased) + (set! (-> a1-10 sync-flags) (the-as sync-flags v1-20)) + ) + (set! (-> a1-10 period) (the-as uint 1800)) + (set! (-> a1-10 entity) arg0) + (set! (-> a1-10 percent) 0.0) + (set! (-> a1-10 ease-in) 0.15) + (set! (-> a1-10 ease-out) 0.15) + (set! (-> a1-10 pause-in) 0.2) + (set! (-> a1-10 pause-out) 0.0) + (initialize! (-> obj sync) a1-10) + ) + (let ((a0-26 (-> obj node-list data 4))) + (set! (-> a0-26 param0) cas-rot-blade-callback) + (set! (-> a0-26 param1) obj) + ) + (set! (-> obj sound-id) (the-as uint (new-sound-id))) + (set! (-> obj draw shadow-ctrl) *cas-rot-blade-shadow-control*) + (go (method-of-object obj idle)) + (none) + ) + +;; definition for method 10 of type cas-rot-blade +(defmethod deactivate cas-rot-blade ((obj cas-rot-blade)) + (sound-stop (the-as sound-id (-> obj sound-id))) + ((the-as (function process-drawable none) (find-parent-method cas-rot-blade 10)) obj) + (none) + ) + +;; definition of type cas-flag-a +(deftype cas-flag-a (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 cas-flag-a +(defmethod inspect cas-flag-a ((obj cas-flag-a)) + (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-cas-flag-a cas-flag-a cas-flag-a-lod0-jg cas-flag-a-idle-ja + ((cas-flag-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -8 0 8.5) + ) + +;; failed to figure out what this is: +(defstate idle (cas-flag-a) + :virtual #t + :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 cas-flag-a) ja-post) + ) + +;; definition for method 11 of type cas-flag-a +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-flag-a ((obj cas-flag-a) (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-cas-flag-a" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type cas-flag-b +(deftype cas-flag-b (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 cas-flag-b +(defmethod inspect cas-flag-b ((obj cas-flag-b)) + (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-cas-flag-b cas-flag-b cas-flag-b-lod0-jg cas-flag-b-idle-ja + ((cas-flag-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -8 0 8.5) + ) + +;; failed to figure out what this is: +(defstate idle (cas-flag-b) + :virtual #t + :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 cas-flag-b) ja-post) + ) + +;; definition for method 11 of type cas-flag-b +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-flag-b ((obj cas-flag-b) (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-cas-flag-b" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type cas-robot-door +(deftype cas-robot-door (process-drawable) + ((spawner-actor symbol :offset-assert 200) + (door-actor entity-actor 2 :offset-assert 204) + (spawn-count int32 :offset-assert 212) + (spawn-count-total int32 :offset-assert 216) + (spawn-max int32 :offset-assert 220) + (spawn-total int32 :offset-assert 224) + (notice-dist float :offset-assert 228) + (player-dist float :offset-assert 232) + (anim-index int32 :offset-assert 236) + (last-guard handle :offset-assert 240) + (actor-group (pointer actor-group) :offset-assert 248) + (actor-group-count int32 :offset-assert 252) + ) + :heap-base #x80 + :method-count-assert 23 + :size-assert #x100 + :flag-assert #x1700800100 + (:methods + (idle () _type_ :state 20) + (spawning () _type_ :state 21) + (castle-wait-end () _type_ :state 22) + ) + ) + +;; definition for method 3 of type cas-robot-door +(defmethod inspect cas-robot-door ((obj cas-robot-door)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tspawner-actor: ~A~%" (-> obj spawner-actor)) + (format #t "~2Tdoor-actor[2] @ #x~X~%" (-> obj door-actor)) + (format #t "~2Tspawn-count: ~D~%" (-> obj spawn-count)) + (format #t "~2Tspawn-count-total: ~D~%" (-> obj spawn-count-total)) + (format #t "~2Tspawn-max: ~D~%" (-> obj spawn-max)) + (format #t "~2Tspawn-total: ~D~%" (-> obj spawn-total)) + (format #t "~2Tnotice-dist: ~f~%" (-> obj notice-dist)) + (format #t "~2Tplayer-dist: ~f~%" (-> obj player-dist)) + (format #t "~2Tanim-index: ~D~%" (-> obj anim-index)) + (format #t "~2Tlast-guard: ~D~%" (-> obj last-guard)) + (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) + (dotimes (s5-0 (-> obj actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) + (label cfg-7) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-cas-robot-door cas-robot-door cas-robot-door-lod0-jg cas-robot-door-idle-ja + ((cas-robot-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +;; failed to figure out what this is: +(defstate idle (cas-robot-door) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger) + (go-virtual spawning) + ) + ) + ) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.6)) + (let ((a0-1 *target*)) + (if (and a0-1 + (not (logtest? (-> a0-1 focus-status) (focus-status disable dead))) + (< (vector-vector-distance (get-trans a0-1 0) (-> self root trans)) (-> self notice-dist)) + ) + (go-virtual spawning) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (none) + ) + :code (the-as (function none :behavior cas-robot-door) sleep-code) + ) + +;; failed to figure out what this is: +(defstate spawning (cas-robot-door) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('roboguard-die) + (let ((v0-0 (+ (-> self spawn-count) -1))) + (set! (-> self spawn-count) v0-0) + v0-0 + ) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self spawn-count) 0) + (set! (-> self spawn-count-total) 0) + (set! (-> self player-dist) (-> self notice-dist)) + (none) + ) + :trans (behavior () + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.6)) + (let ((a0-1 *target*)) + (if (and a0-1 (zero? (logand (-> a0-1 focus-status) (focus-status disable dead)))) + (set! (-> self player-dist) (vector-vector-distance (get-trans a0-1 0) (-> self root trans))) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (none) + ) + :code (behavior () + (sound-play "robo-hatch-open") + (ja-no-eval :group! (-> self draw art-group data 2) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 0.5)) + (suspend) + ) + ) + (while (or (= (-> self spawn-total) -1) (< (-> self spawn-count-total) (-> self spawn-total))) + (when (and (< (-> self player-dist) (+ 81920.0 (-> self notice-dist))) + (and (< (-> self spawn-count) (-> self spawn-max)) + (or (not (handle->process (-> self last-guard))) + (not (and (-> (handle->process (-> self last-guard)) next-state) + (= (-> (handle->process (-> self last-guard)) next-state name) ''ambush) + ) + ) + ) + ) + ) + (let ((gp-2 (new 'stack-no-clear 'enemy-init-by-other-params))) + (set! (-> gp-2 trans quad) (-> self root trans quad)) + (quaternion-copy! (-> gp-2 quat) *unity-quaternion*) + (set! (-> gp-2 entity) (the-as entity (-> self spawner-actor))) + (set! (-> gp-2 directed?) #f) + (set! (-> gp-2 no-initial-move-to-ground?) #f) + (let* ((s5-1 (get-process *default-dead-pool* roboguard-level #x4000)) + (v1-52 (when s5-1 + (let ((t9-8 (method-of-type process activate))) + (t9-8 s5-1 self (symbol->string (-> roboguard-level symbol)) (the-as pointer #x70004000)) + ) + (run-now-in-process s5-1 enemy-init-by-other self gp-2) + (-> s5-1 ppointer) + ) + ) + ) + (when v1-52 + (set! (-> self last-guard) (ppointer->handle v1-52)) + (+! (-> self spawn-count) 1) + (+! (-> self spawn-count-total) 1) + ) + ) + ) + ) + (let ((gp-3 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-3) (the int (* 300.0 (rand-vu-float-range 0.5 1.0)))) + (suspend) + ) + ) + ) + (while (> (-> self spawn-count) 0) + (let ((gp-4 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-4) (seconds 0.43)) + (suspend) + ) + ) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (cond + ((= (-> self anim-index) -1) + (cond + ((= (-> self actor-group-count) 1) + (go-virtual castle-wait-end) + ) + ((= (-> self actor-group-count) 2) + (until (process-grab? *target* #f) + (suspend) + ) + (let ((a3-4 (res-lump-struct (-> self entity) 'camera-name structure))) + (if a3-4 + (set-setting! 'entity-name a3-4 0 0) + ) + ) + (let ((gp-5 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-5) (seconds 2)) + (suspend) + ) + ) + (dotimes (gp-6 (-> self actor-group 1 length)) + (let ((a1-17 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-17 from) (process->ppointer self)) + (set! (-> a1-17 num-params) 0) + (set! (-> a1-17 message) 'stop) + (let ((t9-16 send-event-function) + (v1-102 (-> self actor-group 1 data gp-6 actor)) + ) + (t9-16 + (if v1-102 + (-> v1-102 extra process) + ) + a1-17 + ) + ) + ) + ) + ) + ) + ) + (else + (until (process-grab? *target* #f) + (suspend) + ) + (let ((a3-6 (res-lump-struct (-> self entity) 'camera-name structure))) + (if a3-6 + (set-setting! 'entity-name a3-6 0 0) + ) + ) + (let ((gp-7 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-7) (seconds 1)) + (suspend) + ) + ) + (let ((gp-8 (-> self actor-group 0))) + (dotimes (s5-3 (-> gp-8 length)) + (let ((a1-21 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-21 from) (process->ppointer self)) + (set! (-> a1-21 num-params) 1) + (set! (-> a1-21 message) 'move) + (set! (-> a1-21 param 0) (the-as uint (* (-> self anim-index) 8))) + (let ((t9-20 send-event-function) + (v1-128 (-> gp-8 data s5-3 actor)) + ) + (t9-20 + (if v1-128 + (-> v1-128 extra process) + ) + a1-21 + ) + ) + ) + ) + ) + ) + ) + (sound-play "robo-hatch-cls") + (ja-no-eval :group! (-> self draw art-group data 2) + :num! (seek! 0.0) + :frame-num (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) frames num-frames) -1)) + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek! 0.0)) + ) + (let ((gp-10 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-10) (seconds 1)) + (suspend) + ) + ) + (remove-setting! 'entity-name) + (until (process-release? *target*) + (suspend) + ) + (sleep-code) + (none) + ) + :post (behavior () + '() + (none) + ) + ) + +;; failed to figure out what this is: +(defstate castle-wait-end (cas-robot-door) + :virtual #t + :code (behavior () + (local-vars (v1-28 symbol)) + (sound-play "robo-hatch-cls") + (ja-no-eval :group! (-> self draw art-group data 2) + :num! (seek! 0.0) + :frame-num (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) frames num-frames) -1)) + ) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek! 0.0)) + ) + (while (begin + (dotimes (v1-27 (-> self actor-group 0 length)) + (when (not (logtest? (-> self actor-group 0 data v1-27 actor extra perm status) (entity-perm-status subtask-complete)) + ) + (set! v1-28 #f) + (goto cfg-14) + ) + ) + (set! v1-28 #t) + (goto cfg-14) + (label cfg-14) + (not v1-28) + ) + (let ((gp-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-1) (seconds 0.51)) + (suspend) + ) + ) + ) + (until (process-grab? *target* #f) + (suspend) + ) + (let ((a3-2 (res-lump-struct (-> self entity) 'camera-name structure))) + (if a3-2 + (set-setting! 'entity-name a3-2 0 0) + ) + ) + (let ((gp-2 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-2) (seconds 1)) + (suspend) + ) + ) + (task-node-close! (game-task-node castle-break-in-resolution)) + (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) 'open) + (set! (-> a1-7 param 0) (the-as uint 6000)) + (set! (-> a1-7 param 1) (the-as uint #f)) + (let ((t9-10 send-event-function) + (v1-47 (-> self door-actor 0)) + ) + (t9-10 + (if v1-47 + (-> v1-47 extra process) + ) + a1-7 + ) + ) + ) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) (process->ppointer self)) + (set! (-> a1-8 num-params) 2) + (set! (-> a1-8 message) 'open) + (set! (-> a1-8 param 0) (the-as uint 6000)) + (set! (-> a1-8 param 1) (the-as uint #f)) + (let ((t9-11 send-event-function) + (v1-54 (-> self door-actor 1)) + ) + (t9-11 + (if v1-54 + (-> v1-54 extra process) + ) + a1-8 + ) + ) + ) + (let ((gp-3 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) gp-3) (seconds 2.5)) + (suspend) + ) + ) + (remove-setting! 'entity-name) + (until (process-release? *target*) + (suspend) + ) + (sleep-code) + (none) + ) + ) + +;; definition for method 11 of type cas-robot-door +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! cas-robot-door ((obj cas-robot-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" + (local-vars (sv-16 res-tag) (sv-32 res-tag)) + (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 hit-by-others-list 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 0.0 0.0 20480.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) + ) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-robot-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj spawner-actor) (the-as symbol (entity-actor-lookup arg0 'alt-actor 0))) + (set! (-> obj door-actor 0) (entity-actor-lookup arg0 'alt-actor 1)) + (set! (-> obj door-actor 1) (entity-actor-lookup arg0 'alt-actor 2)) + (set! (-> obj spawn-max) 5) + (set! (-> obj spawn-total) -1) + (set! (-> obj last-guard) (the-as handle #f)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-13 (res-lump-data arg0 'extra-id (pointer int32) :tag-ptr (& sv-16)))) + (when v1-13 + (set! (-> obj spawn-max) (-> v1-13 0)) + (if (< (the-as uint 1) (-> sv-16 elt-count)) + (set! (-> obj spawn-total) (-> v1-13 1)) + ) + ) + ) + (set! (-> obj notice-dist) (res-lump-float arg0 'notice-dist :default 122880.0)) + (set! (-> obj anim-index) + (res-lump-value (-> obj entity) 'index int :default (the-as uint128 -1) :time -1000000000.0) + ) + (set! sv-32 (new 'static 'res-tag)) + (let ((v1-17 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-32)))) + (cond + ((and v1-17 (nonzero? (-> sv-32 elt-count))) + (set! (-> obj actor-group) (the-as (pointer actor-group) v1-17)) + (set! (-> obj actor-group-count) (the-as int (-> sv-32 elt-count))) + ) + (else + (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> obj actor-group-count) 0) + 0 + ) + ) + ) + (let ((a0-27 (-> obj skel root-channel 0))) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> a0-27 frame-num) 0.0) + (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type lightning-ball +(deftype lightning-ball (process-drawable) + ((root-override collide-shape :offset 128) + (timer time-frame :offset-assert 200) + ) + :heap-base #x50 + :method-count-assert 21 + :size-assert #xd0 + :flag-assert #x15005000d0 + (:methods + (idle () _type_ :state 20) + ) + ) + +;; definition for method 3 of type lightning-ball +(defmethod inspect lightning-ball ((obj lightning-ball)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Ttimer: ~D~%" (-> obj timer)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 28) (new 'static 'lightning-spec + :name "lightning-ball-shock" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 60.0 + :texture (new 'static 'texture-id :index #x83 :page #xc) + :reduction 0.42 + :num-points 16 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 8192.0 + :duration 30.0 + :sound (static-sound-spec "shock" :volume 50.0 :fo-min 10 :fo-max 30) + ) + ) + +;; failed to figure out what this is: +(defstate idle (lightning-ball) + :virtual #t + :code (the-as (function none :behavior lightning-ball) sleep-code) + :post (behavior () + (when (>= (- (-> self clock frame-counter) (-> self timer)) (seconds 0.08)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (let ((f30-1 (* 182.04445 (rand-vu-float-range -20.0 20.0))) + (f28-1 (* 182.04445 (rand-vu-float-range -180.0 180.0))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> *x-vector* quad)) + (vector-rotate-around-z! s5-0 s5-0 f30-1) + (vector-rotate-around-y! s5-0 s5-0 f28-1) + (vector+float*! (-> gp-0 start-pos) (-> self root-override trans) s5-0 56320.0) + (vector-float*! (-> gp-0 move-dist) s5-0 81920.0) + ) + (let ((v1-11 gp-0)) + (set! (-> v1-11 radius) 409.6) + (set! (-> v1-11 collide-with) (collide-spec backgnd obstacle hit-by-others-list)) + (set! (-> v1-11 ignore-process0) self) + (set! (-> v1-11 ignore-process1) #f) + (set! (-> v1-11 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-11 action-mask) (collide-action solid)) + ) + (let ((f30-2 (fill-and-probe-using-line-sphere *collide-cache* gp-0))) + (if (< 0.0 f30-2) + (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> *lightning-spec-id-table* 28) + (the int (* 300.0 (rand-vu-float-range 0.1 0.3))) + #f + #f + (-> gp-0 start-pos) + (vector+float*! (new 'stack-no-clear 'vector) (-> gp-0 start-pos) (-> gp-0 move-dist) f30-2) + :to self + ) + ) + ) + ) + (set! (-> self timer) (-> self clock frame-counter)) + ) + (none) + ) + ) + +;; definition for method 11 of type lightning-ball +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! lightning-ball ((obj lightning-ball) (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" + (with-pp + (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 56320.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> obj root-override) s4-0) + ) + (process-drawable-from-entity! obj arg0) + (set! (-> obj timer) (-> pp clock frame-counter)) + (update-transforms (-> obj root-override)) + (go (method-of-object obj idle)) + (none) + ) + ) diff --git a/test/decompiler/reference/jak2/levels/landing_pad/castle-texture_REF.gc b/test/decompiler/reference/jak2/levels/landing_pad/castle-texture_REF.gc new file mode 100644 index 0000000000..1a717041ae --- /dev/null +++ b/test/decompiler/reference/jak2/levels/landing_pad/castle-texture_REF.gc @@ -0,0 +1,496 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *slime-clut*, type clut16x16 +(define *slime-clut* (new 'static 'clut16x16 :clut (new 'static 'array rgba 256 + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x53 :g #x55 :b #x13 :a #x80) + (new 'static 'rgba :r #x55 :g #x58 :b #x13 :a #x80) + (new 'static 'rgba :r #x57 :g #x5c :b #x13 :a #x80) + (new 'static 'rgba :r #x59 :g #x5f :b #x13 :a #x80) + (new 'static 'rgba :r #x5b :g #x63 :b #x13 :a #x80) + (new 'static 'rgba :r #x5c :g #x66 :b #x13 :a #x80) + (new 'static 'rgba :r #x5e :g #x69 :b #x13 :a #x80) + (new 'static 'rgba :r #x60 :g #x6d :b #x13 :a #x80) + (new 'static 'rgba :r #x60 :g #x6d :b #x14 :a #x80) + (new 'static 'rgba :r #x5e :g #x69 :b #x13 :a #x80) + (new 'static 'rgba :r #x5c :g #x66 :b #x13 :a #x80) + (new 'static 'rgba :r #x5a :g #x62 :b #x13 :a #x80) + (new 'static 'rgba :r #x59 :g #x5f :b #x13 :a #x80) + (new 'static 'rgba :r #x57 :g #x5c :b #x13 :a #x80) + (new 'static 'rgba :r #x55 :g #x58 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x52 :b #x13 :a #x80) + (new 'static 'rgba :r #x52 :g #x53 :b #x12 :a #x80) + (new 'static 'rgba :r #x53 :g #x54 :b #x12 :a #x80) + (new 'static 'rgba :r #x54 :g #x55 :b #x12 :a #x80) + (new 'static 'rgba :r #x55 :g #x56 :b #x12 :a #x80) + (new 'static 'rgba :r #x55 :g #x58 :b #x12 :a #x80) + (new 'static 'rgba :r #x56 :g #x59 :b #x12 :a #x80) + (new 'static 'rgba :r #x57 :g #x5a :b #x12 :a #x80) + (new 'static 'rgba :r #x58 :g #x5b :b #x12 :a #x80) + (new 'static 'rgba :r #x58 :g #x5c :b #x12 :a #x80) + (new 'static 'rgba :r #x59 :g #x5e :b #x12 :a #x80) + (new 'static 'rgba :r #x5a :g #x5f :b #x12 :a #x80) + (new 'static 'rgba :r #x5b :g #x60 :b #x12 :a #x80) + (new 'static 'rgba :r #x5c :g #x61 :b #x12 :a #x80) + (new 'static 'rgba :r #x5c :g #x62 :b #x12 :a #x80) + (new 'static 'rgba :r #x5d :g #x64 :b #x12 :a #x80) + (new 'static 'rgba :r #x5e :g #x65 :b #x12 :a #x80) + (new 'static 'rgba :r #x5f :g #x66 :b #x12 :a #x80) + (new 'static 'rgba :r #x5f :g #x67 :b #x12 :a #x80) + (new 'static 'rgba :r #x60 :g #x68 :b #x12 :a #x80) + (new 'static 'rgba :r #x61 :g #x6a :b #x12 :a #x80) + (new 'static 'rgba :r #x62 :g #x6b :b #x12 :a #x80) + (new 'static 'rgba :r #x63 :g #x6c :b #x12 :a #x80) + (new 'static 'rgba :r #x63 :g #x6d :b #x12 :a #x80) + (new 'static 'rgba :r #x64 :g #x6e :b #x12 :a #x80) + (new 'static 'rgba :r #x65 :g #x70 :b #x12 :a #x80) + (new 'static 'rgba :r #x66 :g #x71 :b #x12 :a #x80) + (new 'static 'rgba :r #x66 :g #x72 :b #x12 :a #x80) + (new 'static 'rgba :r #x67 :g #x73 :b #x12 :a #x80) + (new 'static 'rgba :r #x68 :g #x74 :b #x12 :a #x80) + (new 'static 'rgba :r #x69 :g #x76 :b #x12 :a #x80) + (new 'static 'rgba :r #x69 :g #x77 :b #x12 :a #x80) + (new 'static 'rgba :r #x6c :g #x7c :b #x12 :a #x80) + (new 'static 'rgba :r #x73 :g #x86 :b #x12 :a #x80) + (new 'static 'rgba :r #x7a :g #x91 :b #x12 :a #x80) + (new 'static 'rgba :r #x81 :g #x9c :b #x11 :a #x80) + (new 'static 'rgba :r #x88 :g #xa6 :b #x11 :a #x80) + (new 'static 'rgba :r #x8f :g #xb1 :b #x11 :a #x80) + (new 'static 'rgba :r #x96 :g #xbc :b #x11 :a #x80) + (new 'static 'rgba :r #x9e :g #xc7 :b #x11 :a #x80) + (new 'static 'rgba :r #x9e :g #xc7 :b #x11 :a #x80) + (new 'static 'rgba :r #x99 :g #xc0 :b #x11 :a #x80) + (new 'static 'rgba :r #x94 :g #xb9 :b #x11 :a #x80) + (new 'static 'rgba :r #x90 :g #xb2 :b #x11 :a #x80) + (new 'static 'rgba :r #x8b :g #xab :b #x11 :a #x80) + (new 'static 'rgba :r #x87 :g #xa4 :b #x11 :a #x80) + (new 'static 'rgba :r #x82 :g #x9d :b #x12 :a #x80) + (new 'static 'rgba :r #x79 :g #x8f :b #x12 :a #x80) + (new 'static 'rgba :r #x77 :g #x8b :b #x12 :a #x80) + (new 'static 'rgba :r #x77 :g #x8d :b #x12 :a #x80) + (new 'static 'rgba :r #x78 :g #x8e :b #x12 :a #x80) + (new 'static 'rgba :r #x79 :g #x8f :b #x12 :a #x80) + (new 'static 'rgba :r #x7a :g #x90 :b #x12 :a #x80) + (new 'static 'rgba :r #x7a :g #x91 :b #x12 :a #x80) + (new 'static 'rgba :r #x7b :g #x93 :b #x12 :a #x80) + (new 'static 'rgba :r #x7c :g #x94 :b #x12 :a #x80) + (new 'static 'rgba :r #x7d :g #x95 :b #x12 :a #x80) + (new 'static 'rgba :r #x7e :g #x96 :b #x12 :a #x80) + (new 'static 'rgba :r #x7e :g #x97 :b #x12 :a #x80) + (new 'static 'rgba :r #x7f :g #x99 :b #x12 :a #x80) + (new 'static 'rgba :r #x80 :g #x9a :b #x12 :a #x80) + (new 'static 'rgba :r #x81 :g #x9b :b #x12 :a #x80) + (new 'static 'rgba :r #x81 :g #x9c :b #x12 :a #x80) + (new 'static 'rgba :r #x82 :g #x9d :b #x12 :a #x80) + (new 'static 'rgba :r #x83 :g #x9f :b #x12 :a #x80) + (new 'static 'rgba :r #x84 :g #xa0 :b #x12 :a #x80) + (new 'static 'rgba :r #x85 :g #xa1 :b #x12 :a #x80) + (new 'static 'rgba :r #x85 :g #xa2 :b #x12 :a #x80) + (new 'static 'rgba :r #x86 :g #xa3 :b #x12 :a #x80) + (new 'static 'rgba :r #x87 :g #xa5 :b #x12 :a #x80) + (new 'static 'rgba :r #x88 :g #xa6 :b #x12 :a #x80) + (new 'static 'rgba :r #x88 :g #xa7 :b #x12 :a #x80) + (new 'static 'rgba :r #x89 :g #xa8 :b #x12 :a #x80) + (new 'static 'rgba :r #x8a :g #xa9 :b #x12 :a #x80) + (new 'static 'rgba :r #x8b :g #xab :b #x12 :a #x80) + (new 'static 'rgba :r #x8b :g #xac :b #x12 :a #x80) + (new 'static 'rgba :r #x8c :g #xad :b #x12 :a #x80) + (new 'static 'rgba :r #x8d :g #xae :b #x12 :a #x80) + (new 'static 'rgba :r #x8e :g #xaf :b #x12 :a #x80) + (new 'static 'rgba :r #x8f :g #xb1 :b #x12 :a #x80) + (new 'static 'rgba :r #x8f :g #xb2 :b #x12 :a #x80) + (new 'static 'rgba :r #x92 :g #xb5 :b #x11 :a #x80) + (new 'static 'rgba :r #x94 :g #xb9 :b #x11 :a #x80) + (new 'static 'rgba :r #x96 :g #xbc :b #x11 :a #x80) + (new 'static 'rgba :r #x99 :g #xbf :b #x11 :a #x80) + (new 'static 'rgba :r #x9b :g #xc3 :b #x11 :a #x80) + (new 'static 'rgba :r #x9d :g #xc6 :b #x11 :a #x80) + (new 'static 'rgba :r #xa0 :g #xca :b #x11 :a #x80) + (new 'static 'rgba :r #xa0 :g #xca :b #x11 :a #x80) + (new 'static 'rgba :r #x9e :g #xc7 :b #x11 :a #x80) + (new 'static 'rgba :r #x9c :g #xc4 :b #x11 :a #x80) + (new 'static 'rgba :r #x9a :g #xc2 :b #x11 :a #x80) + (new 'static 'rgba :r #x98 :g #xbf :b #x11 :a #x80) + (new 'static 'rgba :r #x96 :g #xbd :b #x12 :a #x80) + (new 'static 'rgba :r #x94 :g #xba :b #x12 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x12 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x12 :a #x80) + (new 'static 'rgba :r #x8f :g #xb4 :b #x12 :a #x80) + (new 'static 'rgba :r #x8e :g #xb3 :b #x12 :a #x80) + (new 'static 'rgba :r #x8d :g #xb2 :b #x12 :a #x80) + (new 'static 'rgba :r #x8d :g #xb1 :b #x12 :a #x80) + (new 'static 'rgba :r #x8c :g #xb0 :b #x13 :a #x80) + (new 'static 'rgba :r #x8b :g #xaf :b #x13 :a #x80) + (new 'static 'rgba :r #x8a :g #xae :b #x13 :a #x80) + (new 'static 'rgba :r #x8a :g #xae :b #x13 :a #x80) + (new 'static 'rgba :r #x89 :g #xad :b #x13 :a #x80) + (new 'static 'rgba :r #x88 :g #xac :b #x13 :a #x80) + (new 'static 'rgba :r #x87 :g #xab :b #x13 :a #x80) + (new 'static 'rgba :r #x87 :g #xaa :b #x13 :a #x80) + (new 'static 'rgba :r #x86 :g #xa9 :b #x13 :a #x80) + (new 'static 'rgba :r #x85 :g #xa8 :b #x13 :a #x80) + (new 'static 'rgba :r #x84 :g #xa7 :b #x13 :a #x80) + (new 'static 'rgba :r #x84 :g #xa7 :b #x13 :a #x80) + (new 'static 'rgba :r #x83 :g #xa6 :b #x13 :a #x80) + (new 'static 'rgba :r #x82 :g #xa5 :b #x14 :a #x80) + (new 'static 'rgba :r #x81 :g #xa4 :b #x14 :a #x80) + (new 'static 'rgba :r #x81 :g #xa3 :b #x14 :a #x80) + (new 'static 'rgba :r #x80 :g #xa2 :b #x14 :a #x80) + (new 'static 'rgba :r #x7f :g #xa1 :b #x14 :a #x80) + (new 'static 'rgba :r #x7e :g #xa0 :b #x14 :a #x80) + (new 'static 'rgba :r #x7e :g #xa0 :b #x14 :a #x80) + (new 'static 'rgba :r #x7d :g #x9f :b #x14 :a #x80) + (new 'static 'rgba :r #x7c :g #x9e :b #x14 :a #x80) + (new 'static 'rgba :r #x7b :g #x9d :b #x14 :a #x80) + (new 'static 'rgba :r #x7b :g #x9c :b #x14 :a #x80) + (new 'static 'rgba :r #x7a :g #x9b :b #x14 :a #x80) + (new 'static 'rgba :r #x79 :g #x9a :b #x14 :a #x80) + (new 'static 'rgba :r #x79 :g #x9a :b #x15 :a #x80) + (new 'static 'rgba :r #x79 :g #x9a :b #x15 :a #x80) + (new 'static 'rgba :r #x7c :g #x9d :b #x14 :a #x80) + (new 'static 'rgba :r #x7f :g #xa1 :b #x14 :a #x80) + (new 'static 'rgba :r #x82 :g #xa5 :b #x14 :a #x80) + (new 'static 'rgba :r #x85 :g #xa8 :b #x13 :a #x80) + (new 'static 'rgba :r #x88 :g #xac :b #x13 :a #x80) + (new 'static 'rgba :r #x8b :g #xb0 :b #x13 :a #x80) + (new 'static 'rgba :r #x8e :g #xb3 :b #x12 :a #x80) + (new 'static 'rgba :r #x91 :g #xb7 :b #x12 :a #x80) + (new 'static 'rgba :r #x94 :g #xbb :b #x12 :a #x80) + (new 'static 'rgba :r #x97 :g #xbf :b #x12 :a #x80) + (new 'static 'rgba :r #x9a :g #xc2 :b #x11 :a #x80) + (new 'static 'rgba :r #x9d :g #xc6 :b #x11 :a #x80) + (new 'static 'rgba :r #xa0 :g #xca :b #x11 :a #x80) + (new 'static 'rgba :r #xa3 :g #xcd :b #x10 :a #x80) + (new 'static 'rgba :r #xa6 :g #xd1 :b #x10 :a #x80) + (new 'static 'rgba :r #xac :g #xd9 :b #x10 :a #x80) + (new 'static 'rgba :r #xab :g #xd8 :b #x10 :a #x80) + (new 'static 'rgba :r #xaa :g #xd7 :b #x10 :a #x80) + (new 'static 'rgba :r #xa9 :g #xd6 :b #x10 :a #x80) + (new 'static 'rgba :r #xa8 :g #xd5 :b #x10 :a #x80) + (new 'static 'rgba :r #xa8 :g #xd4 :b #x10 :a #x80) + (new 'static 'rgba :r #xa7 :g #xd3 :b #x10 :a #x80) + (new 'static 'rgba :r #xa6 :g #xd2 :b #x10 :a #x80) + (new 'static 'rgba :r #xa5 :g #xd1 :b #x10 :a #x80) + (new 'static 'rgba :r #xa4 :g #xd0 :b #x10 :a #x80) + (new 'static 'rgba :r #xa4 :g #xcf :b #x10 :a #x80) + (new 'static 'rgba :r #xa3 :g #xce :b #x10 :a #x80) + (new 'static 'rgba :r #xa2 :g #xcd :b #x11 :a #x80) + (new 'static 'rgba :r #xa1 :g #xcc :b #x11 :a #x80) + (new 'static 'rgba :r #xa0 :g #xcb :b #x11 :a #x80) + (new 'static 'rgba :r #xa0 :g #xca :b #x11 :a #x80) + (new 'static 'rgba :r #x9f :g #xc9 :b #x11 :a #x80) + (new 'static 'rgba :r #x9e :g #xc8 :b #x11 :a #x80) + (new 'static 'rgba :r #x9d :g #xc7 :b #x11 :a #x80) + (new 'static 'rgba :r #x9d :g #xc6 :b #x11 :a #x80) + (new 'static 'rgba :r #x9c :g #xc5 :b #x11 :a #x80) + (new 'static 'rgba :r #x9b :g #xc4 :b #x11 :a #x80) + (new 'static 'rgba :r #x9a :g #xc3 :b #x11 :a #x80) + (new 'static 'rgba :r #x99 :g #xc2 :b #x11 :a #x80) + (new 'static 'rgba :r #x99 :g #xc1 :b #x11 :a #x80) + (new 'static 'rgba :r #x98 :g #xc0 :b #x12 :a #x80) + (new 'static 'rgba :r #x97 :g #xbf :b #x12 :a #x80) + (new 'static 'rgba :r #x96 :g #xbe :b #x12 :a #x80) + (new 'static 'rgba :r #x95 :g #xbd :b #x12 :a #x80) + (new 'static 'rgba :r #x95 :g #xbc :b #x12 :a #x80) + (new 'static 'rgba :r #x94 :g #xbb :b #x12 :a #x80) + (new 'static 'rgba :r #x93 :g #xba :b #x12 :a #x80) + (new 'static 'rgba :r #x92 :g #xb9 :b #x12 :a #x80) + (new 'static 'rgba :r #x91 :g #xb8 :b #x12 :a #x80) + (new 'static 'rgba :r #x91 :g #xb7 :b #x12 :a #x80) + (new 'static 'rgba :r #x90 :g #xb6 :b #x12 :a #x80) + (new 'static 'rgba :r #x8f :g #xb5 :b #x12 :a #x80) + (new 'static 'rgba :r #x8e :g #xb4 :b #x12 :a #x80) + (new 'static 'rgba :r #x8e :g #xb3 :b #x13 :a #x80) + (new 'static 'rgba :r #x8c :g #xb1 :b #x13 :a #x80) + (new 'static 'rgba :r #x8c :g #xb1 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb6 :b #x12 :a #x80) + (new 'static 'rgba :r #x94 :g #xba :b #x12 :a #x80) + (new 'static 'rgba :r #x97 :g #xbf :b #x12 :a #x80) + (new 'static 'rgba :r #x9b :g #xc3 :b #x11 :a #x80) + (new 'static 'rgba :r #x9e :g #xc8 :b #x11 :a #x80) + (new 'static 'rgba :r #xa2 :g #xcc :b #x11 :a #x80) + (new 'static 'rgba :r #xa6 :g #xd1 :b #x11 :a #x80) + (new 'static 'rgba :r #xa6 :g #xd1 :b #x11 :a #x80) + (new 'static 'rgba :r #xa3 :g #xcd :b #x11 :a #x80) + (new 'static 'rgba :r #xa0 :g #xca :b #x11 :a #x80) + (new 'static 'rgba :r #x9d :g #xc6 :b #x11 :a #x80) + (new 'static 'rgba :r #x9b :g #xc3 :b #x12 :a #x80) + (new 'static 'rgba :r #x98 :g #xbf :b #x12 :a #x80) + (new 'static 'rgba :r #x95 :g #xbc :b #x12 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + (new 'static 'rgba :r #x90 :g #xb5 :b #x13 :a #x80) + ) + ) + ) + +;; definition for symbol *toxic-slime-texture-anim-array*, type (texture-anim-array texture-anim) +(define *toxic-slime-texture-anim-array* + (the-as (texture-anim-array texture-anim) + (new 'static 'texture-anim-array :type texture-anim + (new 'static 'texture-anim + :func 'texture-anim-alpha-ramp-clut-upload + :init-func 'texture-anim-alpha-ramp-clut-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 28.0) + :color (new 'static 'rgba :a #x80) + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + (new 'static 'texture-anim + :num-layers #x2 + :func 'cloud-texture-anim-func + :init-func 'dest-texture-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 16.0 :y 8.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 300.0 + :frame-mod 600.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + (new 'static 'texture-anim + :num-layers #x2 + :func 'cloud-texture-anim-func + :init-func 'dest-texture-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 32.0 :y 9.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 300.0 + :frame-mod 300.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + (new 'static 'texture-anim + :num-layers #x2 + :func 'cloud-texture-anim-func + :init-func 'dest-texture-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 64.0 :y 10.0) + :color (new 'static 'rgba :a #x80) + :frame-time 99.0 + :frame-delta 300.0 + :frame-mod 150.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + (new 'static 'texture-anim + :num-layers #x2 + :func 'cloud-texture-anim-func + :init-func 'dest-texture-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 128.0 :y 12.0) + :color (new 'static 'rgba :a #x80) + :frame-time 199.0 + :frame-delta 300.0 + :frame-mod 75.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + (new 'static 'texture-anim + :num-layers #x4 + :func #f + :init-func 'dest-texture-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 128.0 :y 20.0) + :color (new 'static 'rgba :a #x80) + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + (new 'static 'texture-anim + :num-layers #x1 + :func #f + :init-func 'texture-anim-change-mt8h-init + :tex #f + :tex-name "cas-toxic-slime-dest" + :extra (new 'static 'vector :x 28.0 :y 12.0 :z 128.0 :w 128.0) + :color (new 'static 'rgba :a #x80) + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + (new 'static 'texture-anim + :func 'texture-anim-slime-clut-upload + :init-func 'texture-anim-slime-clut-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 28.0) + :color (new 'static 'rgba :a #x80) + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + (new 'static 'texture-anim + :num-layers #x1 + :func #f + :init-func 'texture-anim-overide-size-init + :tex #f + :tex-name "cas-toxic-slime-scroll-dest" + :extra (new 'static 'vector :x 64.0 :y 64.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 300.0 + :frame-mod 1200.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + ) + ) + ) + ) + +;; definition for function set-slime-alphas +(defun set-slime-alphas ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> *toxic-slime-texture-anim-array* array-data 5 data 0 start-color w) arg0) + (set! (-> *toxic-slime-texture-anim-array* array-data 5 data 1 start-color w) arg1) + (set! (-> *toxic-slime-texture-anim-array* array-data 5 data 2 start-color w) arg2) + (set! (-> *toxic-slime-texture-anim-array* array-data 5 data 3 start-color w) arg3) + ) + +;; definition for function get-slime-alphas +;; WARN: Return type mismatch object vs none. +(defun get-slime-alphas () + (format + 0 + "~f ~f ~f ~f~%" + (-> *toxic-slime-texture-anim-array* array-data 5 data 0 start-color w) + (-> *toxic-slime-texture-anim-array* array-data 5 data 1 start-color w) + (-> *toxic-slime-texture-anim-array* array-data 5 data 2 start-color w) + (-> *toxic-slime-texture-anim-array* array-data 5 data 3 start-color w) + ) + (none) + ) + +;; definition for function set-slime-speed +(defun set-slime-speed ((arg0 float)) + (let ((v1-0 *toxic-slime-texture-anim-array*) + (f0-3 (the float (the int (* 300.0 arg0)))) + ) + (dotimes (a0-1 4) + (let ((a1-4 (-> v1-0 array-data (+ a0-1 1)))) + (set! (-> a1-4 frame-mod) f0-3) + (set! (-> a1-4 data 0 end-time) f0-3) + (set! (-> a1-4 data 1 end-time) f0-3) + ) + (set! f0-3 (* 0.5 f0-3)) + ) + ) + #f + ) + +;; definition for symbol *cas-conveyor-texture-anim-array*, type (texture-anim-array texture-anim) +(define *cas-conveyor-texture-anim-array* + (the-as (texture-anim-array texture-anim) + (new 'static 'texture-anim-array :type texture-anim + (new 'static 'texture-anim + :num-layers #x1 + :func #f + :init-func 'texture-anim-overide-size-init + :tex #f + :tex-name "cas-conveyor-dest" + :extra (new 'static 'vector :x 64.0 :y 32.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 555.0 + :frame-mod 300.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (new 'static 'texture-anim + :num-layers #x1 + :func #f + :init-func 'texture-anim-overide-size-init + :tex #f + :tex-name "cas-conveyor-dest-01" + :extra (new 'static 'vector :x 64.0 :y 32.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 555.0 + :frame-mod 300.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (new 'static 'texture-anim + :num-layers #x1 + :func #f + :init-func 'texture-anim-overide-size-init + :tex #f + :tex-name "cas-conveyor-dest-02" + :extra (new 'static 'vector :x 64.0 :y 32.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 555.0 + :frame-mod 300.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (new 'static 'texture-anim + :num-layers #x1 + :func #f + :init-func 'texture-anim-overide-size-init + :tex #f + :tex-name "cas-conveyor-dest-03" + :extra (new 'static 'vector :x 64.0 :y 32.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 555.0 + :frame-mod 300.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + ) + ) + ) + +;; definition for function set-conveyor-speed! +;; WARN: Return type mismatch int vs none. +(defun set-conveyor-speed! ((arg0 int) (arg1 float)) + (set! (-> *cas-conveyor-texture-anim-array* array-data arg0 frame-delta) (* 0.018066408 arg1)) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/landing_pad/roboguard-level_REF.gc b/test/decompiler/reference/jak2/levels/landing_pad/roboguard-level_REF.gc new file mode 100644 index 0000000000..eed4cb4b9d --- /dev/null +++ b/test/decompiler/reference/jak2/levels/landing_pad/roboguard-level_REF.gc @@ -0,0 +1,1424 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type roboguard-level +(deftype roboguard-level (nav-enemy) + ((unknown-n12kjh3n123 int32 5 :offset-assert 604) + (flags uint16 :offset-assert 624) + (roll-timer time-frame :offset-assert 632) + (roll-dir vector :inline :offset-assert 640) + (incoming-attack-id uint32 :offset-assert 656) + (turning-acc float :offset-assert 660) + (speed float :offset-assert 664) + (roll-attack-count uint32 :offset-assert 668) + (roll-sound uint32 :offset-assert 672) + ) + :heap-base #x230 + :method-count-assert 189 + :size-assert #x2a4 + :flag-assert #xbd023002a4 + (:methods + (roboguard-level-method-178 (_type_) none 178) + (roboguard-level-method-179 (_type_) none 179) + (roll-enter () _type_ :state 180) + (roll-hostile () _type_ :state 181) + (roll-to-walk () _type_ :state 182) + (idle-dizzy () _type_ :state 183) + (explode () _type_ :state 184) + (roboguard-level-method-185 (_type_ symbol) none 185) + (roboguard-level-method-186 (_type_) none 186) + (roboguard-level-method-187 (_type_) none 187) + (roboguard-level-method-188 (_type_) none 188) + ) + ) + +;; definition for method 3 of type roboguard-level +(defmethod inspect roboguard-level ((obj roboguard-level)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 obj) + ) + (format #t "~2Tmove-dest: #~%" (-> obj move-dest)) + (format #t "~2Tflags: ~D~%" (-> obj flags)) + (format #t "~2Troll-timer: ~D~%" (-> obj roll-timer)) + (format #t "~2Troll-dir: #~%" (-> obj roll-dir)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) + (format #t "~2Tturning-acc: ~f~%" (-> obj turning-acc)) + (format #t "~2Tspeed: ~f~%" (-> obj speed)) + (format #t "~2Troll-attack-count: ~D~%" (-> obj roll-attack-count)) + (format #t "~2Troll-sound: ~D~%" (-> obj roll-sound)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-roboguard-level roboguard roboguard-lod0-jg roboguard-idle0-ja + ((roboguard-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :shadow roboguard-shadow-mg + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-roboguard-level-explode roboguard roboguard-explode-lod0-jg roboguard-explode-idle-ja + ((roboguard-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +;; definition for symbol *roboguard-level-exploder-params*, type joint-exploder-static-params +(define *roboguard-level-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 8 :parent-joint-index 15) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index 11) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index 10) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index 9) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index 24) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index 27) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index 18) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index 21) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index 12) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index 8) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index 17) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index 4) + ) + :collide-spec #x1 + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 26) (new 'static 'lightning-spec + :name "lightning-roboguard-shock" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x83 :page #xc) + :reduction 0.42 + :num-points 6 + :box-size 6144.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound #f + ) + ) + +;; definition for symbol *roboguard-level-nav-enemy-info*, type nav-enemy-info +(define *roboguard-level-nav-enemy-info* (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script #f + :idle-anim 5 + :notice-anim 6 + :hostile-anim 8 + :hit-anim 5 + :knocked-anim 21 + :knocked-land-anim 22 + :die-anim 12 + :die-falling-anim 23 + :victory-anim 5 + :jump-wind-up-anim 5 + :jump-in-air-anim 5 + :jump-land-anim 5 + :neck-joint 5 + :look-at-joint 4 + :bullseye-joint 4 + :notice-distance (meters 50) + :notice-distance-delta (meters 20) + :proximity-notice-distance (meters 30) + :default-hit-points 8 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot enemy hit-by-others-list player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-giant + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + penetrate-33 + penetrate-34 + penetrate-35 + penetrate-36 + penetrate-37 + penetrate-38 + penetrate-39 + penetrate-40 + penetrate-41 + penetrate-42 + penetrate-43 + penetrate-44 + penetrate-45 + penetrate-46 + penetrate-47 + penetrate-48 + penetrate-49 + penetrate-50 + penetrate-51 + penetrate-52 + penetrate-53 + penetrate-54 + penetrate-55 + penetrate-56 + penetrate-57 + penetrate-58 + penetrate-59 + penetrate-60 + penetrate-61 + penetrate-62 + penetrate-63 + ) + :movement-gravity (meters -100) + :friction 0.5 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 20480.0 + :knocked-soft-vxz-hi 28672.0 + :knocked-soft-vy-lo 36864.0 + :knocked-soft-vy-hi 45056.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 49152.0 + :knocked-hard-vxz-hi 57344.0 + :knocked-hard-vy-lo 49152.0 + :knocked-hard-vy-hi 57344.0 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 20480.0 + :knocked-yellow-vxz-hi 28672.0 + :knocked-yellow-vy-lo 36864.0 + :knocked-yellow-vy-hi 4096.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 16384.0 + :knocked-blue-vxz-hi 20480.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 7 + :turn-anim 4 + :run-anim 8 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 2) + :run-turning-acceleration (meters 30) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 720.0) + :notice-nav-radius (meters 10) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *roboguard-level-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; failed to figure out what this is: +(defpart 5116 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x83 :page #xc)) + (sp-func spt-birth-func 'birth-func-set-quat) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1)) + (sp-flt spt-scale-y (meters 40)) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 64.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat) + ) + ) + +;; failed to figure out what this is: +(defpart 5117 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbc :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 64.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-flt spt-fade-g -1.0666667) + (sp-flt spt-fade-b -1.0666667) + (sp-flt spt-fade-a -8.533334) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 5118 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbc :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-rnd-flt spt-g 128.0 64.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-flt spt-fade-g -1.0666667) + (sp-flt spt-fade-b -1.0666667) + (sp-flt spt-fade-a -8.533334) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; definition for function roboguard-roll-travel-post +;; INFO: Used lq/sq +(defbehavior roboguard-roll-travel-post roboguard-level () + (let ((a1-0 (new 'stack-no-clear 'collide-query)) + (gp-0 (-> self root-override2)) + ) + (if (find-ground gp-0 a1-0 (-> self enemy-info-override gnd-collide-with) 8192.0 81920.0 1024.0) + (set! (-> gp-0 trans y) (-> gp-0 gspot-pos y)) + ) + ) + (let ((a0-1 (-> self nav state)) + (v1-6 (-> self roll-dir)) + ) + (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) + (set! (-> a0-1 travel quad) (-> v1-6 quad)) + ) + 0 + (nav-enemy-travel-post) + (none) + ) + +;; failed to figure out what this is: +(defstate ambush (roboguard-level) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 44)) enter))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (set! (-> self flags) (logand -9 (-> self flags))) + (logior! (-> self flags) 4) + (logior! (-> self nav flags) (nav-control-flag output-sphere-hash)) + (let ((a1-1 (new 'stack-no-clear 'collide-query))) + (enemy-method-125 self a1-1 (collide-spec backgnd) 8192.0 81920.0 1024.0) + ) + (let* ((v1-11 (-> self nav)) + (a1-2 (-> self root-override2 gspot-pos)) + (f0-0 (-> v1-11 extra-nav-sphere w)) + ) + (set! (-> v1-11 extra-nav-sphere quad) (-> a1-2 quad)) + (set! (-> v1-11 extra-nav-sphere w) f0-0) + ) + 0 + (let ((v1-14 (-> self nav))) + (set! (-> v1-14 extra-nav-sphere w) (-> self nav-radius-backup)) + ) + 0 + (let ((v1-16 (-> self nav))) + (logior! (-> v1-16 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (enemy-method-129 self) + (let ((a0-11 (handle->process (-> self focus handle)))) + (if a0-11 + (point-toward-point! (-> self root-override2) (get-trans (the-as process-focusable a0-11) 0)) + ) + ) + (none) + ) + :exit (behavior () + (logclear! (-> self nav flags) (nav-control-flag output-sphere-hash)) + (let ((v1-2 (-> self nav))) + (logclear! (-> v1-2 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (none) + ) + :code (behavior () + (let ((a0-0 (-> self skel root-channel 0))) + (set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 9))) + (set! (-> a0-0 frame-num) 3.0) + (joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-identity) + ) + (until (logtest? (-> self root-override2 status) (collide-status on-surface)) + (nav-enemy-falling-post) + (suspend) + ) + (sound-play "robo-bounce") + (go-virtual roll-hostile) + (none) + ) + :post (behavior () + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self root-override2 gspot-pos quad)) + (set! (-> a1-0 w) (-> self nav-radius-backup)) + (if (not (add-root-sphere-to-hash! (-> self nav) a1-0 32)) + (nav-enemy-falling-post) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate idle (roboguard-level) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 31)) enter))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (roboguard-level-method-185 self (the-as symbol 0)) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! 2.0 (rand-vu-float-range 0.1 0.15)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 2.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! 3.0 (rand-vu-float-range 0.1 0.15)) + :frame-num 2.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 3.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! 4.0 (rand-vu-float-range 0.1 0.15)) + :frame-num 3.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 4.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! 5.0 (rand-vu-float-range 0.1 0.15)) + :frame-num 4.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 5.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! 6.0 (rand-vu-float-range 0.1 0.15)) + :frame-num 5.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 6.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! 7.0 0.07) :frame-num 6.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 7.0 0.07)) + ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! 8.0 0.07) :frame-num 7.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 8.0 0.07)) + ) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! 9.0 0.07) :frame-num 8.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 9.0 0.07)) + ) + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! 10.0 (rand-vu-float-range 0.02 0.05)) + :frame-num 9.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 10.0 (rand-vu-float-range 0.02 0.05))) + ) + ) + #f + (none) + ) + :post (behavior () + (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) + (set! (-> self last-draw-time) (-> self clock frame-counter)) + ) + (enemy-method-129 self) + (ja-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate stare (roboguard-level) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 35)) enter))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (roboguard-level-method-185 self (the-as symbol 0)) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (get-rand-float-range self 0.9 1.1))) + (until #f + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! 10.0 (* 0.1 f30-0)) :frame-num 9.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 10.0 (* 0.1 f30-0))) + ) + ) + ) + #f + (none) + ) + ) + +;; failed to figure out what this is: +(defstate roll-enter (roboguard-level) + :virtual #t + :enter (behavior () + (logior! (-> self flags) 4) + (roboguard-level-method-185 self (the-as symbol 1)) + (set! (-> self flags) (logand -9 (-> self flags))) + (none) + ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 9) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual roll-hostile) + (none) + ) + :post (behavior () + (let ((a1-0 (new 'stack-no-clear 'collide-query)) + (gp-0 (-> self root-override2)) + ) + (if (find-ground gp-0 a1-0 (-> self enemy-info-override gnd-collide-with) 8192.0 81920.0 1024.0) + (set! (-> gp-0 trans y) (-> gp-0 gspot-pos y)) + ) + ) + (nav-enemy-simple-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate roll-hostile (roboguard-level) + :virtual #t + :event (the-as + (function process int symbol event-message-block object :behavior roboguard-level) + enemy-event-handler + ) + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> self flags) 4) + (logclear! (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> self mask) (process-mask actor-pause)) + (when (logtest? (-> self enemy-flags) (enemy-flag drawn-mirrored)) + (logclear! (-> self enemy-flags) (enemy-flag drawn-mirrored)) + (let ((gp-0 (-> self on-hostile))) + (if gp-0 + (eval! + (new 'stack 'script-context (the-as basic (process->ppointer self)) self (-> self root-override2 trans)) + (the-as pair gp-0) + ) + ) + ) + ) + (set! (-> self speed) 81920.0) + (let ((v1-20 (-> self nav))) + (set! (-> v1-20 acceleration) 16384.0) + ) + 0 + (set! (-> self turning-acc) 122880.0) + (let ((v1-23 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-23 enemy-flags))) + (set! (-> v1-23 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-23 enemy-flags)))) + ) + (set! (-> v1-23 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-23 enemy-flags)))) + (set! (-> v1-23 nav callback-info) (-> v1-23 enemy-info-override callback-info)) + ) + 0 + (let ((v1-26 self)) + (set! (-> v1-26 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-26 enemy-flags)))) + ) + 0 + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> self state-time) (-> self clock frame-counter)) + (roboguard-level-method-185 self (the-as symbol 1)) + (vector-z-quaternion! (-> self roll-dir) (-> self root-override2 quat)) + (set! (-> self roll-timer) 0) + (set! (-> self roll-attack-count) (the-as uint 0)) + 0 + (none) + ) + :exit (behavior () + (sound-stop (the-as sound-id (-> self roll-sound))) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (none) + ) + :trans (behavior () + (let ((a0-0 (static-sound-spec "robo-roll"))) + (sound-play-by-spec a0-0 (the-as sound-id (-> self roll-sound)) (-> self root-override2 trans)) + ) + (cond + ((logtest? (-> self flags) 64) + (if (not (logtest? (-> self flags) 32)) + (sound-play "robo-ball-hit") + ) + (logior! (-> self flags) 32) + ) + (else + (set! (-> self flags) (logand -33 (-> self flags))) + ) + ) + (set! (-> self flags) (logand -65 (-> self flags))) + (seek! (-> self speed) 81920.0 (* 1228800.0 (-> self clock seconds-per-frame))) + (seek! (-> self turning-acc) 4096.0 (* 1228800.0 (-> self clock seconds-per-frame))) + (let ((v1-20 (-> self nav))) + (set! (-> v1-20 target-speed) (-> self speed)) + ) + 0 + (let ((v1-22 (-> self nav))) + (set! (-> v1-22 turning-acceleration) (-> self turning-acc)) + ) + 0 + (nav-enemy-method-160 self) + (when (< (-> self roll-timer) (-> self clock frame-counter)) + (set! (-> self roll-timer) + (+ (-> self clock frame-counter) (the int (* 300.0 (get-rand-float-range self 3.0 5.0)))) + ) + (let ((gp-2 (handle->process (-> self focus handle)))) + (when (and gp-2 + (and gp-2 + (zero? (logand (-> (the-as process-focusable gp-2) focus-status) (focus-status disable dead ignore grabbed))) + ) + (< 2 (the-as int (-> self focus aware))) + ) + (let ((s5-2 (vector-! + (new 'stack-no-clear 'vector) + (get-trans (the-as process-focusable gp-2) 0) + (-> self root-override2 trans) + ) + ) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-2 y) 0.0) + (vector-xz-normalize! s5-2 (if (logtest? (-> self pid) 1) + 10240.0 + -10240.0 + ) + ) + (vector-rotate-around-y! s5-2 s5-2 16384.0) + (vector+! s4-0 (get-trans (the-as process-focusable gp-2) 0) s5-2) + (vector-! (-> self roll-dir) s4-0 (-> self root-override2 trans)) + ) + (set! (-> self roll-dir y) 0.0) + (vector-normalize! (-> self roll-dir) 1.0) + ) + ) + ) + (let ((gp-3 (new 'stack-no-clear 'vector))) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override2 quat)) + (new 'stack-no-clear 'vector) + (set! (-> gp-3 quad) (-> self roll-dir quad)) + (let ((s3-2 (new 'stack-no-clear 'vector)) + (s4-1 (new 'stack-no-clear 'vector)) + (s5-3 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (let ((s2-0 (-> self nav state current-poly))) + (vector-xz-normalize-copy! s3-2 gp-3 20480.0) + (set! (-> s4-1 quad) (-> s3-2 quad)) + (clamp-vector-to-mesh-no-gaps (-> self nav) (-> self root-override2 trans) s2-0 s4-1 s5-3) + ) + (when (-> s5-3 found-boundary) + (let ((f30-1 (vector-length gp-3))) + (vector-flatten! gp-3 gp-3 (-> s5-3 boundary-normal)) + (vector-rotate-around-y! gp-3 (-> s5-3 boundary-normal) (if (logtest? (-> self pid) 1) + 17294.223 + -17294.223 + ) + ) + (vector-normalize! gp-3 f30-1) + ) + ) + ) + (set! (-> self roll-dir quad) (-> gp-3 quad)) + ) + (if (>= (-> self roll-attack-count) (the-as uint 3)) + (go-virtual roll-to-walk) + ) + (none) + ) + :code (behavior () + (ja :group! (-> self draw art-group data 10)) + (until #f + (let ((a0-3 (-> self skel root-channel 0))) + (let ((f0-0 0.000024414063) + (a2-0 (-> self nav state)) + (v1-7 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-7 quad) (-> a2-0 velocity quad)) + (set! (-> a0-3 param 0) (* f0-0 (sqrtf (+ (* (-> v1-7 x) (-> v1-7 x)) (* (-> v1-7 z) (-> v1-7 z)))))) + ) + (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-loop!) + ) + (suspend) + ) + #f + (none) + ) + :post roboguard-roll-travel-post + ) + +;; failed to figure out what this is: +(defstate roll-to-walk (roboguard-level) + :virtual #t + :event (the-as + (function process int symbol event-message-block object :behavior roboguard-level) + enemy-event-handler + ) + :enter (behavior () + '() + (none) + ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 27) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 27)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (when (< 17.0 (ja-aframe-num 0)) + (set! (-> self flags) (logand -5 (-> self flags))) + (roboguard-level-method-185 self (the-as symbol 0)) + ) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual idle-dizzy) + (none) + ) + :post (behavior () + (let ((a1-0 (new 'stack-no-clear 'collide-query)) + (gp-0 (-> self root-override2)) + ) + (if (find-ground gp-0 a1-0 (-> self enemy-info-override gnd-collide-with) 8192.0 81920.0 1024.0) + (set! (-> gp-0 trans y) (-> gp-0 gspot-pos y)) + ) + ) + (nav-enemy-face-focus-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate idle-dizzy (roboguard-level) + :virtual #t + :event (the-as + (function process int symbol event-message-block object :behavior roboguard-level) + enemy-event-handler + ) + :enter (behavior () + (set! (-> self flags) (logand -5 (-> self flags))) + (roboguard-level-method-185 self (the-as symbol 0)) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 28) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 28)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual roll-enter) + (none) + ) + :post (behavior () + (nav-enemy-simple-post) + (none) + ) + ) + +;; definition for method 70 of type roboguard-level +;; WARN: Return type mismatch object vs none. +(defmethod go-hostile roboguard-level ((obj roboguard-level)) + (go (method-of-object obj roll-enter)) + (none) + ) + +;; failed to figure out what this is: +(defstate die (roboguard-level) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 38)) enter))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + (roboguard-level-method-185 self (the-as symbol 0)) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! (-> self draw art-group data 12) + :num! (seek! (ja-aframe 20.0 0)) + :frame-num (ja-aframe 13.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 20.0 0))) + ) + (ja-no-eval :group! (-> self draw art-group data 12) + :num! (seek! (ja-aframe 25.0 0) 0.5) + :frame-num (ja-aframe 20.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 25.0 0) 0.5)) + ) + (ja-no-eval :group! (-> self draw art-group data 12) + :num! (seek! (ja-aframe 26.0 0)) + :frame-num (ja-aframe 25.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 26.0 0))) + ) + (let ((gp-6 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set-vector! (-> gp-6 fountain-rand-transv-lo) -163840.0 0.0 -163840.0 1.0) + (set-vector! (-> gp-6 fountain-rand-transv-hi) 163840.0 409.6 163840.0 1.0) + (set! (-> gp-6 gravity) -40960.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-roboguard-level-explode" (the-as (pointer uint32) #f)) + 31 + gp-6 + *roboguard-level-exploder-params* + :to self + ) + ) + (go-virtual explode) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate explode (roboguard-level) + :virtual #t + :enter (the-as (function none :behavior roboguard-level) #f) + :exit (the-as (function none :behavior roboguard-level) #f) + :trans (the-as (function none :behavior roboguard-level) #f) + :code (behavior () + (sound-play "robo-explode") + (let ((v1-2 (-> self root-override2 root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior roboguard-level) #f) + ) + +;; definition for method 185 of type roboguard-level +;; WARN: Return type mismatch int vs none. +(defmethod roboguard-level-method-185 roboguard-level ((obj roboguard-level) (arg0 symbol)) + (let ((v1-1 (-> obj root-override2 root-prim)) + (a0-1 arg0) + ) + (cond + ((zero? a0-1) + (set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-as) (collide-spec enemy)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-with) + (collide-spec backgnd jak bot player-list) + ) + (set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-as) (collide-spec enemy)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-with) + (collide-spec backgnd jak bot player-list) + ) + (set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-as) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-with) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-as) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-with) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-as) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-with) (collide-spec)) + (set-vector! (-> v1-1 local-sphere) 0.0 8192.0 0.0 12288.0) + ) + ((= a0-1 1) + (set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-as) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-with) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-as) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-with) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-as) (collide-spec enemy)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-with) + (collide-spec jak bot enemy player-list) + ) + (set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-as) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-with) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-as) (collide-spec enemy)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-with) + (collide-spec jak bot player-list) + ) + (set-vector! (-> v1-1 local-sphere) 0.0 5734.4 0.0 7372.8) + ) + ((= a0-1 2) + (set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-as) (collide-spec enemy)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-with) + (collide-spec backgnd jak bot player-list) + ) + (set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-as) (collide-spec enemy)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-with) + (collide-spec backgnd jak bot player-list) + ) + (set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-as) (collide-spec enemy)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-with) + (collide-spec jak bot player-list) + ) + (set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-as) (collide-spec enemy)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-with) + (collide-spec jak bot player-list) + ) + (set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-as) (collide-spec)) + (set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-with) (collide-spec)) + (set-vector! (-> v1-1 local-sphere) 0.0 8192.0 0.0 24576.0) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 77 of type roboguard-level +(defmethod enemy-method-77 roboguard-level ((obj roboguard-level) (arg0 (pointer float))) + (ja-channel-push! 1 0) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-0) + (knocked-type knocked-type-1) + (knocked-type knocked-type-4) + (knocked-type knocked-type-6) + ) + (let ((a0-5 (-> obj skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 21))) + (set! (-> a0-5 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 21)) frames num-frames) -1)) + ) + (set! (-> a0-5 param 1) (-> arg0 0)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 21)) num-func-seek!) + ) + ) + (else + (let ((a0-6 (-> obj skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (set! (-> a0-6 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + ) + (set! (-> a0-6 param 1) (-> arg0 0)) + (set! (-> a0-6 frame-num) 0.0) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + ) + ) + ) + #t + ) + +;; definition for method 78 of type roboguard-level +(defmethod enemy-method-78 roboguard-level ((obj roboguard-level) (arg0 (pointer float))) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-0) + (knocked-type knocked-type-1) + (knocked-type knocked-type-4) + (knocked-type knocked-type-6) + ) + (let ((v1-4 (-> obj skel root-channel 0))) + (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (set! (-> v1-4 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + ) + (set! (-> v1-4 param 1) (-> arg0 0)) + (set! (-> v1-4 frame-num) 0.0) + (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + ) + ) + (else + (let ((v1-8 (-> obj skel root-channel 0))) + (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 24))) + (set! (-> v1-8 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 24)) frames num-frames) -1)) + ) + (set! (-> v1-8 param 1) (-> arg0 0)) + (set! (-> v1-8 frame-num) 0.0) + (joint-control-channel-group! v1-8 (the-as art-joint-anim (-> obj draw art-group data 24)) num-func-seek!) + ) + ) + ) + #t + ) + +;; definition for method 74 of type roboguard-level +;; INFO: Used lq/sq +(defmethod general-event-handler roboguard-level ((obj roboguard-level) (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 + (('attack) + (cond + ((logtest? (-> obj flags) 4) + (let ((v1-3 (the-as object (-> arg3 param 1))) + (a0-2 arg0) + ) + (cond + ((!= (-> (the-as attack-info v1-3) id) (-> obj incoming-attack-id)) + (set! (-> obj incoming-attack-id) (-> (the-as attack-info v1-3) id)) + (when (and a0-2 (zero? (logand (process-mask enemy) (-> a0-2 mask)))) + (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info v1-3)))) + (when s5-0 + (new 'stack-no-clear 'vector) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> s5-0 root-override trans quad)) + (if (< (-> obj roll-attack-count) (the-as uint 3)) + (+! (-> obj roll-attack-count) 1) + ) + (vector-! (-> obj roll-dir) (-> obj root-override2 trans) (-> s5-0 root-override trans)) + (set! (-> obj roll-dir y) 0.0) + (vector-xz-normalize! (-> obj roll-dir) 1.0) + (set! (-> obj speed) (+ 245760.0 (vector-length (-> s5-0 root-override transv)))) + (let ((a0-9 (-> obj nav state)) + (v1-19 (vector-float*! (new 'stack-no-clear 'vector) (-> obj roll-dir) (-> obj speed))) + ) + (set! (-> a0-9 velocity quad) (-> v1-19 quad)) + ) + 0 + (let ((v1-23 (-> obj nav state))) + (set! (-> v1-23 speed) (-> obj speed)) + ) + 0 + (let ((v1-25 (-> obj nav))) + (set! (-> v1-25 target-speed) (-> obj speed)) + ) + 0 + (sound-play "robo-ball-kick") + ) + ) + ) + #t + ) + (else + #f + ) + ) + ) + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) + ) + ) + (('hit 'hit-knocked 'hit-flinch) + (when (not (logtest? (-> obj flags) 4)) + (let ((s5-2 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> s5-2 fountain-rand-transv-lo quad) (-> obj incoming attacker-pos quad)) + (set! (-> s5-2 fountain-rand-transv-hi x) 4096.0) + (set! (-> s5-2 fountain-rand-transv-hi y) 122880.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-roboguard-level-explode" (the-as (pointer uint32) #f)) + 31 + s5-2 + *roboguard-level-exploder-params* + :to obj + ) + ) + (dispose! obj) + (go (method-of-object obj explode)) + ) + ) + (else + ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 76 of type roboguard-level +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs symbol. +(defmethod enemy-method-76 roboguard-level ((obj roboguard-level) (arg0 process) (arg1 event-message-block)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (the-as + symbol + (cond + ((or (= (-> arg0 type) target) (zero? (logand (-> obj flags) 4))) + ((method-of-type nav-enemy enemy-method-76) obj arg0 arg1) + ) + (else + (when (!= (-> arg0 type) target) + (-> arg1 param 0) + (let* ((s3-0 arg0) + (s1-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when (and s1-0 (logtest? (process-mask enemy) (-> s1-0 mask))) + (let ((s2-1 (vector-! + (new 'stack-no-clear 'vector) + (-> obj root-override2 trans) + (-> (the-as process-drawable s1-0) root trans) + ) + ) + ) + (new 'stack-no-clear 'vector) + 0.0 + (let ((s3-1 (new 'stack-no-clear 'vector))) + (vector-normalize! s2-1 1.0) + (let ((f0-3 + (- (vector-dot (-> obj root-override2 transv) s2-1) + (vector-dot (-> (the-as process-drawable s1-0) root transv) s2-1) + ) + ) + ) + (let ((a1-5 (-> obj nav state))) + (set! (-> s3-1 quad) (-> a1-5 velocity quad)) + ) + (let ((a0-16 s3-1)) + (let ((v1-20 s3-1)) + (let ((a1-9 (* -1.0 f0-3))) + (.mov vf7 a1-9) + ) + (.lvf vf5 (&-> s2-1 quad)) + (.lvf vf4 (&-> v1-20 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 (&-> a0-16 quad) vf6) + ) + ) + (let ((a0-17 (-> obj nav state)) + (v1-22 s3-1) + ) + (set! (-> a0-17 velocity quad) (-> v1-22 quad)) + ) + 0 + (set! (-> obj speed) (vector-length s3-1)) + (let ((v1-28 (-> obj nav state))) + (set! (-> v1-28 speed) (-> obj speed)) + ) + 0 + (let ((v1-30 (-> obj nav))) + (set! (-> v1-30 target-speed) (-> obj speed)) + ) + 0 + (set! (-> obj roll-timer) + (+ (-> pp clock frame-counter) (the int (* 300.0 (get-rand-float-range obj 3.0 5.0)))) + ) + (set! (-> obj roll-dir quad) (-> s3-1 quad)) + ) + ) + (set! (-> obj roll-dir y) 0.0) + (vector-xz-normalize! (-> obj roll-dir) 1.0) + (let ((a0-22 (-> obj nav state)) + (v1-40 (-> obj roll-dir)) + ) + (set! (-> a0-22 heading quad) (-> v1-40 quad)) + ) + 0 + (logior! (-> obj flags) 64) + ) + ) + (send-event arg0 'touch (-> arg1 param 0)) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 142 of type roboguard-level +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-142 roboguard-level ((obj roboguard-level) (arg0 nav-control)) + (with-pp + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let ((a1-1 (-> arg0 state))) + (set! (-> s3-0 quad) (-> a1-1 heading quad)) + ) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (let ((gp-0 (new 'stack-no-clear 'quaternion)) + (s5-1 (-> obj root-override2 quat)) + ) + (quaternion-set! gp-0 0.0 (-> s3-0 x) 0.0 (+ 1.0 (-> s3-0 z))) + (quaternion-normalize! gp-0) + (quaternion-pseudo-seek + s5-1 + s5-1 + gp-0 + (* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (-> pp clock seconds-per-frame)) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 176 of type roboguard-level +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-176 roboguard-level ((obj roboguard-level)) + (nav-enemy-method-177 obj) + (let ((a0-2 obj)) + (when (logtest? (enemy-flag enemy-flag36) (-> a0-2 enemy-flags)) + (cond + ((logtest? (enemy-flag enemy-flag38) (-> obj enemy-flags)) + (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag38)))) + (set! (-> obj root-override2 gspot-pos quad) (-> obj root-override2 trans quad)) + ) + (else + (nav-enemy-method-142 obj (-> obj nav)) + (nav-enemy-method-143 obj (-> obj nav)) + ) + ) + ) + ) + (track-target! obj) + (update-transforms (-> obj root-override2)) + 0 + (none) + ) + +;; definition for method 132 of type roboguard-level +(defmethod dispose! roboguard-level ((obj roboguard-level)) + "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" + (when (not (logtest? (enemy-flag recover-applied-velocity) (-> obj enemy-flags))) + (send-event (ppointer->process (-> obj parent)) 'roboguard-die) + ((method-of-type nav-enemy dispose!) obj) + ) + (none) + ) + +;; definition for method 10 of type roboguard-level +(defmethod deactivate roboguard-level ((obj roboguard-level)) + (sound-stop (the-as sound-id (-> obj roll-sound))) + ((the-as (function nav-enemy none) (find-parent-method roboguard-level 10)) obj) + (none) + ) + +;; definition for method 7 of type roboguard-level +;; WARN: Return type mismatch nav-enemy vs roboguard-level. +(defmethod relocate roboguard-level ((obj roboguard-level) (arg0 int)) + (the-as + roboguard-level + ((the-as (function nav-enemy int nav-enemy) (find-parent-method roboguard-level 7)) obj arg0) + ) + ) + +;; definition for method 114 of type roboguard-level +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! roboguard-level ((obj roboguard-level)) + "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" + (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) + (set! (-> s5-0 total-prims) (the-as uint 6)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak bot enemy hit-by-others-list player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 20480.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-12 prim-core collide-with) (collide-spec backgnd jak bot player-list)) + (set! (-> v1-12 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-12 local-sphere) 0.0 6144.0 0.0 6144.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec backgnd jak bot player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> v1-14 local-sphere) 0.0 9830.4 0.0 6144.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec backgnd enemy hit-by-others-list)) + (set! (-> v1-16 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-16 local-sphere) 0.0 5734.4 0.0 5734.4) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core action) (collide-action)) + (set! (-> v1-18 transform-index) 11) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-20 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-20 local-sphere) 0.0 5734.4 0.0 7372.8) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-22 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-22 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-22 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> obj root-override2) s5-0) + ) + 0 + (none) + ) + +;; definition for method 115 of type roboguard-level +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! roboguard-level ((obj roboguard-level)) + "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-roboguard-level" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable-backup) (-> obj enemy-flags)))) + (init-enemy-behaviour-and-stats! obj *roboguard-level-nav-enemy-info*) + (let ((v1-8 (-> obj nav))) + (set! (-> v1-8 nav-cull-radius) 81920.0) + ) + 0 + (set! (-> obj fact-info-override cam-horz) 98304.0) + (set! (-> obj fact-info-override cam-vert) 24576.0) + (set! (-> obj fact-info-override cam-notice-dist) 122880.0) + (let ((v1-16 (-> obj nav))) + (logclear! (-> v1-16 flags) (nav-control-flag limit-rotation-rate output-sphere-hash)) + (logclear! (-> obj nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag43)))) + (let ((a0-13 v1-16)) + (set! (-> a0-13 sphere-mask) (the-as uint #x800fe)) + ) + 0 + (let ((a0-15 v1-16)) + (set! (-> a0-15 nav-cull-radius) 12288.0) + ) + 0 + (logclear! (-> v1-16 flags) (nav-control-flag output-sphere-hash)) + ) + (set! (-> obj enemy-info-override callback-info) *nav-enemy-physics-callback-info*) + (let ((v1-18 obj)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-18 enemy-flags))) + (set! (-> v1-18 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-18 enemy-flags)))) + ) + (set! (-> v1-18 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-18 enemy-flags)))) + (set! (-> v1-18 nav callback-info) (-> v1-18 enemy-info-override callback-info)) + ) + 0 + (set! (-> obj roll-sound) (the-as uint (new-sound-id))) + (set! (-> obj flags) (the-as uint 0)) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak2/levels/palace/pal-obs_REF.gc b/test/decompiler/reference/jak2/levels/palace/pal-obs_REF.gc new file mode 100644 index 0000000000..4336e63fe6 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/palace/pal-obs_REF.gc @@ -0,0 +1,1287 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type pal-falling-plat +(deftype pal-falling-plat (process-drawable) + ((root-override collide-shape-moving :offset 128) + ) + :heap-base #x50 + :method-count-assert 22 + :size-assert #xc8 + :flag-assert #x16005000c8 + (:methods + (idle () _type_ :state 20) + (fall () _type_ :state 21) + ) + ) + +;; definition for method 3 of type pal-falling-plat +(defmethod inspect pal-falling-plat ((obj pal-falling-plat)) + (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-pal-falling-plat pal-falling-plat pal-falling-plat-lod0-jg pal-falling-plat-idle-ja + ((pal-falling-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.8) + ) + +;; failed to figure out what this is: +(defstate idle (pal-falling-plat) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('ridden) + (go-virtual fall) + ) + ) + ) + :enter (behavior () + (logior! (-> self root-override root-prim prim-core action) (collide-action rideable)) + (none) + ) + :trans (the-as (function none :behavior pal-falling-plat) rider-trans) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 2) :num! zero) + (transform-post) + (sleep-code) + (none) + ) + :post (the-as (function none :behavior pal-falling-plat) rider-post) + ) + +;; failed to figure out what this is: +(defstate fall (pal-falling-plat) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('touch) + (when ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> event param 0)) + (-> self root-override) + (the-as uint 8) + ) + (when (< 18.0 (ja-frame-num 0)) + (let ((v1-6 (-> self skel root-channel 0))) + (set! (-> v1-6 num-func) num-func-identity) + (set! (-> v1-6 frame-num) 18.0) + ) + ) + ) + ) + ) + ) + ) + :enter (behavior () + (sound-play "pal-fall-plat") + (none) + ) + :trans (the-as (function none :behavior pal-falling-plat) rider-trans) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (logclear! (-> self root-override root-prim prim-core action) (collide-action rideable)) + (ja-no-eval :group! (-> self draw art-group data 2) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual idle) + (none) + ) + :post (the-as (function none :behavior pal-falling-plat) rider-post) + ) + +;; definition for method 11 of type pal-falling-plat +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pal-falling-plat ((obj pal-falling-plat) (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-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0))) + (set! (-> s4-0 total-prims) (the-as uint 5)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 11059.2 20480.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle 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) 12288.0 0.0 1228.8 4096.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid rideable)) + (set! (-> v1-17 transform-index) 3) + (set-vector! (-> v1-17 local-sphere) -12288.0 0.0 1228.8 4096.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-19 prim-core action) (collide-action solid rideable)) + (set! (-> v1-19 transform-index) 4) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 8192.0 19660.8) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 8)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-21 prim-core action) (collide-action)) + (set-vector! (-> v1-21 local-sphere) -16384.0 -4096.0 0.0 16384.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-24 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-24 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-24 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-pal-falling-plat" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (go (method-of-object obj idle)) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-pal-ent-door pal-ent-door pal-ent-door-lod0-jg pal-ent-door-idle-ja + ((pal-ent-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6 0 10) + :origin-joint-index 3 + ) + +;; definition of type pal-ent-door +(deftype pal-ent-door (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + +;; definition for method 3 of type pal-ent-door +(defmethod inspect pal-ent-door ((obj pal-ent-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 pal-ent-door +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pal-ent-door ((obj pal-ent-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 ((v1-2 (new 'process 'collide-shape-prim-mesh s5-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 bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 24576.0 0.0 40960.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-ent-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj open-frame) 20.0) + (set! (-> obj sound-open-loop) (static-sound-spec "door-slide-open")) + (set! (-> obj sound-open-stop) (static-sound-spec "door-open-hit")) + (set! (-> obj sound-close-loop) (static-sound-spec "door-slide-cls")) + (set! (-> obj sound-close-stop) (static-sound-spec "door-close-hit")) + (go (method-of-object obj close) #t) + (none) + ) + +;; definition of type pal-grind-ring-center +(deftype pal-grind-ring-center (process-focusable) + ((speed-y float :offset-assert 204) + (hit-sound-played? basic :offset-assert 208) + ) + :heap-base #x60 + :method-count-assert 30 + :size-assert #xd4 + :flag-assert #x1e006000d4 + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (pal-grind-ring-center-method-29 (_type_) none 29) + ) + ) + +;; definition for method 3 of type pal-grind-ring-center +(defmethod inspect pal-grind-ring-center ((obj pal-grind-ring-center)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (format #t "~2Tspeed-y: ~f~%" (-> obj speed-y)) + (format #t "~2Thit-sound-played?: ~A~%" (-> obj hit-sound-played?)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-pal-grind-ring-center pal-grind-ring-center pal-grind-ring-center-lod0-jg pal-grind-ring-center-idle-ja + ((pal-grind-ring-center-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +;; failed to figure out what this is: +(defskelgroup skel-pal-grind-ring-center-explode pal-grind-ring-center pal-grind-ring-center-explode-lod0-jg pal-grind-ring-center-explode-idle-ja + ((pal-grind-ring-center-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +;; definition for symbol *pal-grind-ring-center-exploder-params*, type joint-exploder-static-params +(define *pal-grind-ring-center-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 3 :parent-joint-index -1) + (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) + ) + :collide-spec #x1 + ) + ) + +;; failed to figure out what this is: +(defstate idle (pal-grind-ring-center) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('track) + #t + ) + (('attack) + (go-virtual die) + ) + ) + ) + :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 () + (ja-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die (pal-grind-ring-center) + :virtual #t + :enter (behavior () + (sound-play "grind-ring-expl") + (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-1 fountain-rand-transv-lo quad) (-> self root-override trans quad)) + (set! (-> gp-1 fountain-rand-transv-hi x) 8192.0) + (set! (-> gp-1 fountain-rand-transv-hi y) 32768.0) + (set! (-> gp-1 fountain-rand-transv-hi z) 24576.0) + (set! (-> gp-1 fountain-rand-transv-hi w) 40960.0) + (set! (-> gp-1 gravity) -163840.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-pal-grind-ring-center-explode" (the-as (pointer uint32) #f)) + 5 + gp-1 + *pal-grind-ring-center-exploder-params* + :to self + ) + ) + (let ((v1-16 (-> self root-override root-prim))) + (set! (-> v1-16 prim-core collide-as) (collide-spec)) + (set! (-> v1-16 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (none) + ) + :exit (the-as (function none :behavior pal-grind-ring-center) #f) + :trans (the-as (function none :behavior pal-grind-ring-center) #f) + :code (behavior () + (send-event (ppointer->process (-> self parent)) 'fall) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior pal-grind-ring-center) #f) + ) + +;; definition for method 29 of type pal-grind-ring-center +;; WARN: Return type mismatch int vs none. +(defmethod pal-grind-ring-center-method-29 pal-grind-ring-center ((obj pal-grind-ring-center)) + (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 ((v1-6 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 16384.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type pal-grind-ring-center +;; INFO: this function exists in multiple non-identical object files +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pal-grind-ring-center ((obj pal-grind-ring-center) (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" + (pal-grind-ring-center-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-pal-grind-ring-center" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj mask) (logior (process-mask enemy) (-> obj mask))) + (set! (-> obj mask) (logior (process-mask collectable) (-> obj mask))) + (go (method-of-object obj idle)) + (none) + ) + +;; definition for method 11 of type pal-grind-ring-center +;; INFO: this function exists in multiple non-identical object files +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pal-grind-ring-center ((obj pal-grind-ring-center) (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" + (pal-grind-ring-center-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-pal-grind-ring-center" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (set! (-> obj mask) (logior (process-mask enemy) (-> obj mask))) + (set! (-> obj mask) (logior (process-mask collectable) (-> obj mask))) + (go (method-of-object obj idle)) + (none) + ) + +;; definition for function pal-grind-ring-center-init-by-other +(defbehavior pal-grind-ring-center-init-by-other pal-grind-ring-center ((arg0 entity-actor)) + (init-from-entity! self arg0) + (none) + ) + +;; definition of type pal-grind-ring +(deftype pal-grind-ring (process-focusable) + ((speed-y float :offset-assert 204) + (hit-sound-played? basic :offset-assert 208) + ) + :heap-base #x60 + :method-count-assert 30 + :size-assert #xd4 + :flag-assert #x1e006000d4 + (:methods + (idle () _type_ :state 27) + (fall () _type_ :state 28) + (pal-grind-ring-method-29 (_type_) none 29) + ) + ) + +;; definition for method 3 of type pal-grind-ring +(defmethod inspect pal-grind-ring ((obj pal-grind-ring)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (format #t "~2Tspeed-y: ~f~%" (-> obj speed-y)) + (format #t "~2Thit-sound-played?: ~A~%" (-> obj hit-sound-played?)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-pal-grind-ring pal-grind-ring pal-grind-ring-lod0-jg pal-grind-ring-idle-ja + ((pal-grind-ring-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) + +;; failed to figure out what this is: +(defstate idle (pal-grind-ring) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('track) + #t + ) + (('fall) + (go-virtual fall) + ) + ) + ) + :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 () + (spawn (-> self part) (-> self root-override trans)) + (ja-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate fall (pal-grind-ring) + :virtual #t + :enter (behavior () + (set! (-> self speed-y) 0.0) + (sound-play "grind-ring-fall") + (set! (-> self hit-sound-played?) #f) + (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-1 + (let ((t9-3 (method-of-type part-tracker activate))) + (t9-3 + (the-as part-tracker gp-1) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((t9-4 run-function-in-process) + (a0-4 gp-1) + (a1-3 part-tracker-init) + (a2-5 (-> *part-group-id-table* 1132)) + (a3-2 0) + (t0-1 #f) + (t1-1 #f) + (t2-1 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> self root-override trans quad)) + ((the-as (function object object object object object object object object none) t9-4) + a0-4 + a1-3 + a2-5 + a3-2 + t0-1 + t1-1 + t2-1 + t3-0 + ) + ) + (-> gp-1 ppointer) + ) + ) + (none) + ) + :trans (behavior () + (+! (-> self speed-y) (* -163840.0 (-> self clock seconds-per-frame))) + (+! (-> self root-override trans y) (* (-> self speed-y) (-> self clock seconds-per-frame))) + (when (< (-> self root-override trans y) 1441792.0) + (when (not (-> self hit-sound-played?)) + (sound-play "grind-ring-hit") + (set! (-> self hit-sound-played?) (the-as basic #t)) + ) + (set! (-> self root-override trans y) 1441792.0) + (set! (-> self speed-y) (* -0.3 (-> self speed-y))) + ) + (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 pal-grind-ring) transform-post) + ) + +;; definition for method 29 of type pal-grind-ring +;; WARN: Return type mismatch int vs none. +(defmethod pal-grind-ring-method-29 pal-grind-ring ((obj pal-grind-ring)) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 102400.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type pal-grind-ring +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pal-grind-ring ((obj pal-grind-ring) (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" + (pal-grind-ring-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-grind-ring" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj mask) (logior (process-mask enemy) (-> obj mask))) + (set! (-> obj mask) (logior (process-mask collectable) (-> obj mask))) + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1131) obj)) + (process-spawn pal-grind-ring-center arg0 :to obj) + (go (method-of-object obj idle)) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-pal-ent-glass pal-ent-glass pal-ent-glass-lod0-jg pal-ent-glass-idle-ja + ((pal-ent-glass-lod0-mg (meters 999999))) + :bounds (static-spherem 0 8.5 0 8.5) + ) + +;; failed to figure out what this is: +(defskelgroup skel-pal-ent-glass-explode pal-ent-glass pal-ent-glass-explode-lod0-jg pal-ent-glass-explode-idle-ja + ((pal-ent-glass-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +;; definition for symbol *pal-ent-glass-exploder-params*, type joint-exploder-static-params +(define *pal-ent-glass-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 3 :parent-joint-index -1) + (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) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + ) + :collide-spec #x1 + ) + ) + +;; definition of type pal-ent-glass +(deftype pal-ent-glass (process-focusable) + () + :heap-base #x50 + :method-count-assert 31 + :size-assert #xcc + :flag-assert #x1f005000cc + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (pal-ent-glass-method-29 (_type_) none 29) + (pal-ent-glass-method-30 (_type_) none 30) + ) + ) + +;; definition for method 3 of type pal-ent-glass +(defmethod inspect pal-ent-glass ((obj pal-ent-glass)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defstate die (pal-ent-glass) + :virtual #t + :enter (the-as (function none :behavior pal-ent-glass) #f) + :exit (the-as (function none :behavior pal-ent-glass) #f) + :trans (the-as (function none :behavior pal-ent-glass) #f) + :code (behavior () + (sound-play "glass-crash") + (let ((v1-2 (-> self root-override root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior pal-ent-glass) #f) + ) + +;; failed to figure out what this is: +(defstate idle (pal-ent-glass) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (when (not (and (-> self next-state) (= (-> self next-state name) 'die))) + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set-vector! (-> gp-0 fountain-rand-transv-lo) -8192.0 20480.0 -8192.0 1.0) + (set-vector! (-> gp-0 fountain-rand-transv-hi) 8192.0 40960.0 8192.0 1.0) + (set! (-> gp-0 rot-speed) 2.0) + (set! (-> gp-0 gravity) -163840.0) + (set! (-> gp-0 hit-y-reaction) 0.4) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-pal-ent-glass-explode" (the-as (pointer uint32) #f)) + 5 + gp-0 + *pal-ent-glass-exploder-params* + :to self + ) + ) + ) + (go-virtual die) + ) + ) + ) + :exit (behavior () + '() + (none) + ) + :code (the-as (function none :behavior pal-ent-glass) sleep-code) + :post (behavior () + '() + (none) + ) + ) + +;; definition for method 29 of type pal-ent-glass +;; WARN: Return type mismatch int vs none. +(defmethod pal-ent-glass-method-29 pal-ent-glass ((obj pal-ent-glass)) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 34816.0 0.0 34816.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; definition for method 30 of type pal-ent-glass +;; WARN: Return type mismatch int vs none. +(defmethod pal-ent-glass-method-30 pal-ent-glass ((obj pal-ent-glass)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; definition for method 11 of type pal-ent-glass +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pal-ent-glass ((obj pal-ent-glass) (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" + (pal-ent-glass-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-ent-glass" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (pal-ent-glass-method-30 obj) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +;; definition of type palent-turret-shot +(deftype palent-turret-shot (guard-shot) + () + :heap-base #x170 + :method-count-assert 40 + :size-assert #x1f0 + :flag-assert #x28017001f0 + ) + +;; definition for method 3 of type palent-turret-shot +(defmethod inspect palent-turret-shot ((obj palent-turret-shot)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type guard-shot inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 28 of type palent-turret-shot +;; WARN: Return type mismatch int vs none. +(defmethod play-impact-sound palent-turret-shot ((obj palent-turret-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "turret-gun") + ) + ((= v1-0 (projectile-options lose-altitude)) + (sound-play "turret-impact") + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-palent-turret palent-turret palent-turret-lod0-jg palent-turret-idle-ja + ((palent-turret-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 7) + ) + +;; definition of type palent-turret +(deftype palent-turret (process-focusable) + ((next-shoot uint64 :offset-assert 208) + ) + :heap-base #x60 + :method-count-assert 29 + :size-assert #xd8 + :flag-assert #x1d006000d8 + (:methods + (idle () _type_ :state 27) + (palent-turret-method-28 (_type_) none 28) + ) + ) + +;; definition for method 3 of type palent-turret +(defmethod inspect palent-turret ((obj palent-turret)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (format #t "~2Tnext-shoot: ~D~%" (-> obj next-shoot)) + (label cfg-4) + obj + ) + +;; definition for function palent-turret-callback +;; WARN: Return type mismatch int vs none. +(defun palent-turret-callback ((arg0 cspace) (arg1 transformq)) + (-> arg0 param1) + (quaternion-rotate-local-x! (-> arg1 quat) (-> arg1 quat) 910.2222) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate idle (palent-turret) + :virtual #t + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :exit (behavior () + '() + (none) + ) + :trans (behavior () + (cond + ((not (task-node-closed? (game-task-node palace-sneak-in-meeting))) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (else + (let* ((f0-0 65536.0) + (f1-0 -0.5) + (f2-0 0.16666667) + (f3-1 (* 0.0033333334 (the float (- (-> self clock frame-counter) (-> self state-time))))) + (f30-0 (* f0-0 (+ f1-0 (* f2-0 (- f3-1 (* (the float (the int (/ f3-1 6.0))) 6.0)))))) + (s4-0 (-> self node-list data 5 bone transform)) + (s5-0 (matrix->trans s4-0 (new 'stack-no-clear 'vector))) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> s4-0 vector 2 quad)) + (let ((f0-2 (* 5097.2446 (sin f30-0)))) + (quaternion-rotate-local-y! (-> self root-override quat) (-> self entity quat) f0-2) + ) + (when (< (the-as time-frame (-> self next-shoot)) (-> self clock frame-counter)) + (set-palent-turret-flash! 1.0) + (let ((a1-2 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> a1-2 ent) (-> self entity)) + (set! (-> a1-2 charge) 1.0) + (set! (-> a1-2 options) (projectile-options)) + (set! (-> a1-2 notify-handle) (process->handle self)) + (set! (-> a1-2 owner-handle) (the-as handle #f)) + (set! (-> a1-2 ignore-handle) (process->handle self)) + (let* ((v1-26 *game-info*) + (a0-17 (+ (-> v1-26 attack-id) 1)) + ) + (set! (-> v1-26 attack-id) a0-17) + (set! (-> a1-2 attack-id) a0-17) + ) + (set! (-> a1-2 timeout) (new 'static 'handle :process #x4b0 :u64 #x4b0)) + (set! (-> a1-2 pos quad) (-> s5-0 quad)) + (set! (-> a1-2 vel quad) (-> gp-0 quad)) + (spawn-projectile palent-turret-shot a1-2 self *default-dead-pool*) + ) + (set! (-> self next-shoot) (the-as uint (+ (-> self clock frame-counter) (seconds 0.1)))) + ) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior palent-turret) sleep-code) + :post (behavior () + (transform-post) + (none) + ) + ) + +;; definition for method 28 of type palent-turret +;; WARN: Return type mismatch int vs none. +(defmethod palent-turret-method-28 palent-turret ((obj palent-turret)) + (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 3) 0))) + (set! (-> s5-0 total-prims) (the-as uint 4)) + (set! (-> s4-0 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 28672.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 4) + (set-vector! (-> v1-12 local-sphere) 0.0 0.0 10240.0 8192.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 1)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 8192.0 0.0 16384.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 1)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-16 prim-core action) (collide-action solid)) + (set! (-> v1-16 transform-index) 3) + (set-vector! (-> v1-16 local-sphere) 0.0 10240.0 8192.0 14336.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-19 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-19 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-19 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type palent-turret +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! palent-turret ((obj palent-turret) (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" + (palent-turret-method-28 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-palent-turret" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (let ((a0-5 (-> obj node-list data 4))) + (set! (-> a0-5 param0) palent-turret-callback) + (set! (-> a0-5 param1) obj) + ) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-pal-breakable-window pal-breakable-window pal-breakable-window-lod0-jg pal-breakable-window-idle-ja + ((pal-breakable-window-lod0-mg (meters 999999))) + :bounds (static-spherem 0 12 0 38) + ) + +;; failed to figure out what this is: +(defskelgroup skel-pal-breakable-window-explode pal-breakable-window pal-breakable-window-explode-lod0-jg pal-breakable-window-explode-idle-ja + ((pal-breakable-window-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +;; definition for symbol *pal-breakable-window-exploder-params*, type joint-exploder-static-params +(define *pal-breakable-window-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 3 :parent-joint-index -1) + (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) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 24 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 26 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 27 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 28 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 29 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 30 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 31 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 32 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 33 :parent-joint-index -1) + ) + :collide-spec #x1 + ) + ) + +;; definition of type pal-breakable-window +(deftype pal-breakable-window (process-focusable) + () + :heap-base #x50 + :method-count-assert 31 + :size-assert #xcc + :flag-assert #x1f005000cc + (:methods + (idle () _type_ :state 27) + (die () _type_ :state 28) + (pal-breakable-window-method-29 (_type_) none 29) + (pal-breakable-window-method-30 (_type_) none 30) + ) + ) + +;; definition for method 3 of type pal-breakable-window +(defmethod inspect pal-breakable-window ((obj pal-breakable-window)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defstate die (pal-breakable-window) + :virtual #t + :enter (the-as (function none :behavior pal-breakable-window) #f) + :exit (the-as (function none :behavior pal-breakable-window) #f) + :trans (the-as (function none :behavior pal-breakable-window) #f) + :code (behavior () + (let ((v1-1 (-> self root-override root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (none) + ) + :post (the-as (function none :behavior pal-breakable-window) #f) + ) + +;; failed to figure out what this is: +(defstate idle (pal-breakable-window) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('attack) + (sound-play "glass-crash-big") + (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set-vector! (-> gp-1 fountain-rand-transv-lo) -8192.0 4096.0 -8192.0 1.0) + (set-vector! (-> gp-1 fountain-rand-transv-hi) 8192.0 40960.0 8192.0 1.0) + (set! (-> gp-1 rot-speed) 2.0) + (set! (-> gp-1 gravity) -163840.0) + (set! (-> gp-1 hit-y-reaction) 0.4) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-pal-breakable-window-explode" (the-as (pointer uint32) #f)) + 5 + gp-1 + *pal-breakable-window-exploder-params* + :to self + ) + ) + (go-virtual die) + ) + ) + ) + :exit (behavior () + '() + (none) + ) + :code (the-as (function none :behavior pal-breakable-window) sleep-code) + :post (behavior () + '() + (none) + ) + ) + +;; definition for method 29 of type pal-breakable-window +;; WARN: Return type mismatch int vs none. +(defmethod pal-breakable-window-method-29 pal-breakable-window ((obj pal-breakable-window)) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 49152.0 0.0 155648.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + 0 + (none) + ) + +;; definition for method 30 of type pal-breakable-window +;; WARN: Return type mismatch int vs none. +(defmethod pal-breakable-window-method-30 pal-breakable-window ((obj pal-breakable-window)) + (set! (-> obj mask) (logior (process-mask crate) (-> obj mask))) + 0 + (none) + ) + +;; definition for method 11 of type pal-breakable-window +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pal-breakable-window ((obj pal-breakable-window) (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" + (pal-breakable-window-method-29 obj) + (process-drawable-from-entity! obj arg0) + (initialize-skeleton + obj + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-pal-breakable-window" (the-as (pointer uint32) #f)) + ) + (the-as pair 0) + ) + (pal-breakable-window-method-30 obj) + (transform-post) + (go (method-of-object obj idle)) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/palace/roof/palroof-obs_REF.gc b/test/decompiler/reference/jak2/levels/palace/roof/palroof-obs_REF.gc new file mode 100644 index 0000000000..c17ea7599d --- /dev/null +++ b/test/decompiler/reference/jak2/levels/palace/roof/palroof-obs_REF.gc @@ -0,0 +1,279 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type pal-lowrez-throne +(deftype pal-lowrez-throne (med-res-level) + () + :heap-base #x60 + :method-count-assert 21 + :size-assert #xd4 + :flag-assert #x15006000d4 + ) + +;; definition for method 3 of type pal-lowrez-throne +(defmethod inspect pal-lowrez-throne ((obj pal-lowrez-throne)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type med-res-level inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-pal-lowrez-throne pal-lowrez-throne pal-lowrez-throne-lod0-jg pal-lowrez-throne-idle-ja + ((pal-lowrez-throne-lod0-mg (meters 999999))) + :bounds (static-spherem -5 40 -10 75) + ) + +;; failed to figure out what this is: +(defpartgroup group-pal-prong-energy + :id 1111 + :bounds (static-bspherem 0 0 0 160) + :parts ((sp-item 4762 :fade-after (meters 80) :falloff-to (meters 80)) + (sp-item 4763 :fade-after (meters 220) :flags (bit6)) + ) + ) + +;; failed to figure out what this is: +(defpart 4762 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 2.0) + (sp-flt spt-scale-x (meters 0)) + (sp-flt spt-rot-z (degrees 90.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 32.0) + (sp-flt spt-vel-y (meters -0.03)) + (sp-rnd-flt spt-scalevel-x (meters 0.005) (meters 0.005) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -0.98) + (sp-flt spt-fade-g -0.98) + (sp-flt spt-fade-a 0.19393939) + (sp-int spt-timer 250) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 165) + (sp-launcher-by-id spt-next-launcher 4764) + (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-flt spt-conerot-radius (meters 6)) + ) + ) + +;; failed to figure out what this is: +(defpart 4764 + :init-specs ((sp-flt spt-fade-a -0.7529412) (sp-flt spt-friction 0.1)) + ) + +;; failed to figure out what this is: +(defpart 4763 + :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 8)) + (sp-flt spt-rot-x 1228.8) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 64.0 1.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 64.0) + (sp-flt spt-omega 822476.8) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 8192.0) + ) + ) + +;; definition of type pal-prong +(deftype pal-prong (process-drawable) + ((root-override collide-shape :offset 128) + ) + :heap-base #x50 + :method-count-assert 23 + :size-assert #xc8 + :flag-assert #x17005000c8 + (:methods + (idle () _type_ :state 20) + (break-it () _type_ :state 21) + (broken () _type_ :state 22) + ) + ) + +;; definition for method 3 of type pal-prong +(defmethod inspect pal-prong ((obj pal-prong)) + (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-pal-prong pal-prong pal-prong-lod0-jg pal-prong-idle-ja + ((pal-prong-lod0-mg (meters 999999))) + :bounds (static-spherem 0 5 0 5.5) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-pal-prong-explode pal-prong pal-prong-explode-lod0-jg pal-prong-explode-idle-ja + ((pal-prong-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) + +;; definition for symbol *pal-prong-exploder-params*, type joint-exploder-static-params +(define *pal-prong-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 3 :parent-joint-index -1) + (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) + ) + ) + ) + +;; definition for method 11 of type pal-prong +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pal-prong ((obj pal-prong) (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 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (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 20480.0 0.0 22528.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) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 20480.0 0.0 22528.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 8192.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-13 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-13 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-pal-prong" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1111) obj)) + (if (task-node-closed? (game-task-node palace-boss-resolution)) + (go (method-of-object obj broken)) + (go (method-of-object obj idle)) + ) + (none) + ) + +;; definition for function pal-prong-small-collision +;; WARN: Return type mismatch int vs none. +(defbehavior pal-prong-small-collision pal-prong () + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) child 0))) + (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 broken (pal-prong) + :virtual #t + :enter (behavior () + (setup-masks (-> self draw) 0 1) + (pal-prong-small-collision) + (transform-post) + (none) + ) + :code (the-as (function none :behavior pal-prong) sleep-code) + ) + +;; failed to figure out what this is: +(defstate break-it (pal-prong) + :virtual #t + :enter (behavior () + (setup-masks (-> self draw) 0 1) + (pal-prong-small-collision) + (transform-post) + (sound-play "sqd-post-break") + (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-pal-prong-explode" (the-as (pointer uint32) #f)) + 5 + gp-1 + *pal-prong-exploder-params* + :to self + ) + ) + (none) + ) + :trans (behavior () + (go-virtual broken) + (none) + ) + :code (the-as (function none :behavior pal-prong) sleep-code) + ) + +;; failed to figure out what this is: +(defstate idle (pal-prong) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('trigger) + (go-virtual break-it) + ) + ) + ) + :enter (behavior () + (transform-post) + (none) + ) + :trans (behavior () + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self root-override trans quad)) + (set! (-> a1-0 y) (+ 36864.0 (-> a1-0 y))) + (spawn (-> self part) a1-0) + ) + (none) + ) + :code (the-as (function none :behavior pal-prong) sleep-code) + ) + + + + diff --git a/test/offline/config/jak2/config.jsonc b/test/offline/config/jak2/config.jsonc index 4e004cf252..90bdc9b685 100644 --- a/test/offline/config/jak2/config.jsonc +++ b/test/offline/config/jak2/config.jsonc @@ -54,12 +54,15 @@ "DGO/ONINTENT.DGO", "DGO/ORACLE.DGO", "DGO/OUTROCST.DGO", + "DGO/CAS.DGO", + "DGO/LPACKAGE.DGO", "DGO/LPOWER.DGO", "DGO/PAC.DGO", "DGO/PAE.DGO", "DGO/PALOUT.DGO", "DGO/PALBOSS.DGO", "DGO/PAR.DGO", + "DGO/DEMO.DGO", "DGO/PAS.DGO", "DGO/PRI.DGO", "DGO/RUI.DGO", @@ -291,7 +294,8 @@ "(method 3 rhino)", "(method 193 grunt-mech)", // .mula.s "(method 3 sig-path-sample)", - "debug-eyes" // unused debug function + "debug-eyes", // unused debug function + "(method 11 pal-grind-ring-center)" // same thing defined twice ], "skip_compile_states": {