diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index ca25b68b61..cdc9109506 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -44103,146 +44103,263 @@ ;; squid-setup ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype squid-whirlwind (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. +(deftype squid-whirlwind (process-drawable) + ((center vector :inline :offset-assert 208) + (center-vel vector :inline :offset-assert 224) + (current-nav-poly nav-poly :offset-assert 240) + (duration time-frame :offset-assert 248) + (whirl-sound sound-id :offset-assert 256) + (whirl-sound-playing symbol :offset-assert 260) + ) + :method-count-assert 21 + :size-assert #x108 + :flag-assert #x1500900108 + (:methods + (idle () _type_ :state 20) + ) ) -|# -#| -(deftype squid-collision (UNKNOWN) +(deftype squid-collision (process-drawable) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) ) -|# -#| -(deftype squid-driver (UNKNOWN) +(deftype squid-driver (process-drawable) + ((prefix string :offset-assert 200) + (run-free symbol :offset-assert 204) + ) + :method-count-assert 21 + :size-assert #xd0 + :flag-assert #x15005000d0 + (:methods + (idle () _type_ :state 20) + ) + ) + +(deftype squid-baron (process-drawable) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) ) -|# -#| -(deftype squid-baron (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. - ) -|# - -#| -(deftype squid-tentacle-chain (UNKNOWN) +(deftype squid-tentacle-chain (structure) ((position vector :inline :offset-assert 0) (velocity vector :inline :offset-assert 16) (old-x vector :inline :offset-assert 32) - (joint-mod basic :offset-assert 48) + (joint-mod joint-mod :offset-assert 48) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x34 + :flag-assert #x900000034 ) -|# -#| -(deftype squid-tentacle (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. +(deftype squid-tentacle (process-drawable) + ((root-override collide-shape-moving :offset 128 :score 1) + (chain-joints squid-tentacle-chain 11 :inline :offset-assert 208) + (gravity vector :inline :offset-assert 912) + (gravity-target vector :inline :offset-assert 928) + (stretch-vel float :offset-assert 944) + (center vector :inline :offset-assert 960) + (avoid-center symbol :offset-assert 976) + (wrap symbol :offset-assert 980) + (num-bg-collisions int32 :offset-assert 984) + (max-movement float :offset-assert 988) + ) + :method-count-assert 24 + :size-assert #x3e0 + :flag-assert #x18036003e0 + (:methods + (test () _type_ :state 20) + (idle () _type_ :state 21) + (joint-setup (_type_) none 22) + (squid-tentacle-method-23 (_type_) none 23) + ) ) -|# -#| -(deftype squid-grenade-holder (UNKNOWN) +(deftype squid-grenade-holder (structure) ((target-position vector :inline :offset-assert 0) - (show-it basic :offset-assert 16) - (grenade uint64 :offset-assert 24) - (marker uint64 :offset-assert 32) + (show-it symbol :offset-assert 16) + (grenade handle :offset-assert 24) + (marker handle :offset-assert 32) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 ) -|# -#| -(deftype squid-grenade (UNKNOWN) +(deftype squid-grenade (projectile) + ((traj trajectory :inline :offset-assert 480) + (traj-dest vector :inline :offset-assert 528) + (traj-timer time-frame :offset-assert 544) + (traj-duration float :offset-assert 552) + (fly-sound sound-id :offset-assert 556) + ) + :method-count-assert 40 + :size-assert #x230 + :flag-assert #x2801b00230 + ) + +(deftype squid (process-focusable) + ((quat quaternion :inline :offset-assert 208) + (trans vector :inline :offset-assert 224) + (residual-velocity vector :inline :offset-assert 240) + (residual-accumulator-1 float :offset-assert 256) + (residual-accumulator-2 float :offset-assert 260) + (force-onto-mesh symbol :offset-assert 264) + (mesh-forced symbol :offset-assert 268) + (hit-reaction oscillating-vector :inline :offset-assert 272) + (traj trajectory :inline :offset-assert 336) + (traj-src vector :inline :offset-assert 384) + (traj-dest vector :inline :offset-assert 400) + (traj-timer time-frame :offset-assert 416) + (traj-duration float :offset-assert 424) + (current-nav-poly nav-poly :offset-assert 428) + (tentacles handle 6 :offset-assert 432) + (baron squid-baron :offset-assert 480) + (driver (pointer squid-driver) :offset-assert 484) + (driver-blend cam-float-seeker :inline :offset-assert 488) + (blink-time time-frame :offset-assert 512) + (blink-mask int32 :offset-assert 520) + (thruster-part sparticle-launch-control :offset-assert 524) + (gun-tilt-left-jm joint-mod :offset-assert 528) + (gun-tilt-right-jm joint-mod :offset-assert 532) + (gun-tilt float :offset-assert 536) + (next-gun int8 :offset-assert 540) + (fire-aft symbol :offset-assert 544) + (gun-high-to-low symbol :offset-assert 548) + (grenade squid-grenade-holder 10 :inline :offset-assert 560) + (first-path path-control :offset-assert 1040) + (second-path path-control :offset-assert 1044) + (third-path path-control :offset-assert 1048) + (shield-timer time-frame :offset-assert 1056) + (shield-color vector :inline :offset-assert 1072) + (shield-shattered symbol :offset-assert 1088) + (shield-hit-points float :offset-assert 1092) + (hit-points int32 :offset-assert 1096) + (invincible-timer time-frame :offset-assert 1104) + (stage int32 :offset-assert 1112) + (collision-actor (pointer squid-collision) :offset-assert 1116) + (tentacle-base-jm joint-mod :offset-assert 1120) + (tentacle-base-rotation float :offset-assert 1124) + (tentacle-base-rotation-speed cam-float-seeker :inline :offset-assert 1128) + (stage-2-go-status int32 :offset-assert 1152) + (gate-intact symbol :offset-assert 1156) + (hud handle :offset-assert 1160) + (desired-rotate-to-vector-angle degrees :offset-assert 1168) + (allowed-rotate-to-vector-angle degrees :offset-assert 1172) + (stop-shooting symbol :offset-assert 1176) + (attack-id uint32 :offset-assert 1180) + (rush-sound sound-id :offset-assert 1184) + (rush-sound-playing symbol :offset-assert 1188) + (rush-end-time time-frame :offset-assert 1192) + (jet-sound sound-id :offset-assert 1200) + (jet-sound-playing symbol :offset-assert 1204) + (jet-pitch int64 :offset-assert 1208) + (negate-jet-pitch symbol :offset-assert 1216) + (jet-volume int64 :offset-assert 1224) + (can-play-squid-boost symbol :offset-assert 1232) + (tentacle-sound sound-id :offset-assert 1236) + (tentacle-sound-playing symbol :offset-assert 1240) + (spin-sound sound-id :offset-assert 1244) + (spin-sound-playing symbol :offset-assert 1248) + (reload-played symbol :offset-assert 1252) + (max-plane int32 :offset-assert 1256) + (debug-timer time-frame :offset-assert 1264) + (debug-on symbol :offset-assert 1272) + (last-damaged-talker int8 :offset-assert 1276) + (last-shield-hit-talker int8 :offset-assert 1277) + (last-no-energy-talker int8 :offset-assert 1278) + (last-shooting-talker int8 :offset-assert 1279) + (last-headbutting-talker int8 :offset-assert 1280) + (last-general-talker int8 :offset-assert 1281) + (last-start-recharging-talker int8 :offset-assert 1282) + (last-done-recharging-talker int8 :offset-assert 1283) + (suck float :offset-assert 1284) + ) + :method-count-assert 54 + :size-assert #x508 + :flag-assert #x3604900508 + (:methods + (test () _type_ :state 27) + (beaten () _type_ :state 28) + (wait-around-corner () _type_ :state 29) + (wait-beside-building () _type_ :state 30) + (flee () _type_ :state 31) + (pre-flee () _type_ :state 32) + (recharge () _type_ :state 33) + (fly-to-post () _type_ :state 34) + (headbut () _type_ :state 35) + (fire-whirlwind () _type_ :state 36) + (fire-grenades () _type_ :state 37) + (fire () _type_ :state 38) + (fly-to-shoot-spot () _type_ :state 39) + (idle () _type_ :state 40) + (hidden () _type_ :state 41) + (squid-method-42 (_type_ vector) vector 42) + (squid-method-43 (_type_ vector float float) none 43) + (squid-method-44 (_type_ vector vector) symbol 44) + (move-to-spot (_type_ vector symbol) none 45) + (set-traj-towards-vec "Set up the [[trajectory]] towards `dest`." (_type_ vector vector vector) none 46) + (float-sin-clamp (_type_ float) float 47) + (squid-method-48 (_type_) float 48) + (setup-part-engine (_type_ symbol) none 49) + (squid-post (_type_) none 50) + (spawn-whirlwind (_type_) (pointer squid-whirlwind) 51) + (spawn-grenade (_type_ int squid-grenade-holder float) none 52) + (squid-method-53 (_type_ int) none 53) + ) + ) + +(deftype squid-shot (guard-shot) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 40 + :size-assert #x1f0 + :flag-assert #x28017001f0 ) -|# -#| -(deftype squid (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. - ) -|# - -#| -(deftype squid-shot (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. - ) -|# - -;; (define-extern *squid-shield-exploder-params* joint-exploder-static-params) -;; (define-extern *squid-tentacle-shield-exploder-params* joint-exploder-static-params) -;; (define-extern squid-whirlwind-init-by-other function) -;; (define-extern squid-collision-init-by-other function) -;; (define-extern squid-driver-init-by-other function) -;; (define-extern squid-baron-init-by-other function) -;; (define-extern squid-tentacle-handler function) -;; (define-extern squid-tentacle-init-by-other function) -;; (define-extern squid-take-hit function) -;; (define-extern squid-increment-shield function) -;; (define-extern squid-check-hit-points function) -;; (define-extern squid-handler function) -;; (define-extern squid-num-grenades-to-shoot function) -;; (define-extern squid-shot-move function) +(define-extern *squid-shield-exploder-params* joint-exploder-static-params) +(define-extern *squid-tentacle-shield-exploder-params* joint-exploder-static-params) +(define-extern squid-whirlwind-init-by-other (function vector vector nav-mesh vector none :behavior squid-whirlwind)) +(define-extern squid-collision-init-by-other (function vector int none :behavior squid-collision)) +(define-extern squid-driver-init-by-other (function string none :behavior squid-driver)) +(define-extern squid-baron-init-by-other (function vector none :behavior squid-baron)) +(define-extern squid-tentacle-handler (function process int symbol event-message-block object :behavior squid-tentacle)) +(define-extern squid-tentacle-init-by-other (function vector int none :behavior squid-tentacle)) +(define-extern squid-take-hit (function touching-shapes-entry attack-info symbol none :behavior squid)) +(define-extern squid-increment-shield (function float none :behavior squid)) +(define-extern squid-check-hit-points (function none :behavior squid)) +(define-extern squid-handler (function process int symbol event-message-block object :behavior squid)) +(define-extern squid-num-grenades-to-shoot (function int :behavior squid)) +(define-extern squid-shot-move (function squid-shot none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; squid-extras ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern squid-grenade-move function) -;; (define-extern squid-whirlwind-move function) -;; (define-extern scene-tentacle-spawn function) +(define-extern squid-grenade-move (function squid-grenade none)) +(define-extern squid-whirlwind-move (function none :behavior squid-whirlwind)) +(define-extern scene-tentacle-spawn (function process-drawable vector cspace none :behavior squid-tentacle)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; squid-states ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern squid-talker function) -;; (define-extern *squid-first-pole* object) -;; (define-extern *squid-second-pole* object) -;; (define-extern go-through-wall function) -;; (define-extern squid-adjust-fly-anim function) -;; (define-extern squid-whirlwind-time function) -;; (define-extern setup-grenade function) +(define-extern squid-talker (function symbol int :behavior squid)) +(define-extern *squid-first-pole* vector) +(define-extern *squid-second-pole* vector) +(define-extern go-through-wall (function none :behavior squid)) +(define-extern squid-adjust-fly-anim (function none :behavior squid)) +(define-extern squid-whirlwind-time (function time-frame :behavior squid)) +(define-extern setup-grenade (function int none :behavior squid)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; fort-floor-spike ;; diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index c62a2afc16..b534352708 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -106,7 +106,6 @@ "(method 154 vehicle-racer)", "(method 228 hal-sewer)", "(method 154 vehicle-city-racer)", - "(method 53 squid)", "(method 158 vehicle-guard)", "(method 207 metalhead-predator)", "test-to-from-spr", @@ -687,7 +686,8 @@ "ripple-create-wave-table", "ripple-execute-init", "ripple-apply-wave-table", - "ripple-matrix-scale" + "ripple-matrix-scale", + "(method 53 squid)" ], "mips2c_jump_table_functions": {}, diff --git a/decompiler/config/jak2/inputs.jsonc b/decompiler/config/jak2/inputs.jsonc index 1e27682060..3d7baa291e 100644 --- a/decompiler/config/jak2/inputs.jsonc +++ b/decompiler/config/jak2/inputs.jsonc @@ -91,7 +91,7 @@ "DGO/TOMBEXT.DGO", "DGO/LCGUARD.DGO", "DGO/TOE.DGO", - // "DGO/PALBOSS.DGO", + "DGO/PALBOSS.DGO", "DGO/FRB.DGO", "DGO/PAE.DGO", "DGO/TITLE.DGO", @@ -238,17 +238,18 @@ "LSACK.DGO", "LTRNYSAM.DGO", "LWHACK.DGO", - "LWHACK.DGO", "LWIDEA.DGO", "LWIDEB.DGO", "LWIDEC.DGO", "MTN.DGO", - "MTN.DGO", "MTX.DGO", "NEB.DGO", "NES.DGO", "ONINTENT.DGO", "ORACLE.DGO", + "PAC.DGO", + "PALBOSS.DGO", + "PAR.DGO", "PAS.DGO", "PRI.DGO", "RUI.DGO", diff --git a/decompiler/config/jak2/label_types.jsonc b/decompiler/config/jak2/label_types.jsonc index 300eb56f42..44bd260a02 100644 --- a/decompiler/config/jak2/label_types.jsonc +++ b/decompiler/config/jak2/label_types.jsonc @@ -1185,5 +1185,50 @@ "under-laser": [["L46", "attack-info"]], "merc-blend-shape": [["L72", "(pointer int16)", 40]], "centipede": [["L193", "attack-info"]], - "sig5-course": [["L358", "attack-info"]] + "sig5-course": [["L358", "attack-info"]], + "squid-setup": [ + ["L645", "uint64", true], + ["L637", "uint64", true], + ["L643", "uint64", true], + ["L641", "uint64", true], + ["L638", "uint64", true], + ["L639", "uint64", true], + ["L640", "uint64", true], + ["L642", "uint64", true], + ["L644", "uint64", true], + ["L497", "uint64", true], + ["L503", "uint64", true], + ["L494", "uint64", true], + ["L498", "uint64", true], + ["L502", "uint64", true], + ["L370", "attack-info"], + ["L501", "uint64", true], + ["L364", "vector"], + ["L363", "vector"], + ["L362", "vector"], + ["L361", "vector"], + ["L360", "vector"], + ["L359", "vector"], + ["L358", "vector"], + ["L357", "vector"], + ["L356", "vector"], + ["L355", "vector"], + ["L354", "vector"], + ["L353", "vector"], + ["L352", "vector"], + ["L351", "vector"], + ["L350", "vector"], + ["L349", "vector"], + ["L348", "vector"], + ["L495", "uint64", true], + ["L500", "uint64", true], + ["L499", "uint64", true], + ["L504", "uint64", true], + ["L496", "uint64", true], + ["L374", "vector"] + ], + "squid-states": [ + ["L451", "vector"], + ["L450", "vector"] + ] } diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index 4ce337b5ce..a337e2c3f9 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -1786,5 +1786,35 @@ "merc-blend-shape": [[16, ["array", "int16", 128]]], "(method 55 centipede)": [[64, "collide-query"]], "(post hostile centipede)": [[16, "vector"]], - "(code intro-shooting sig-under)": [[16, "vector"]] + "(code intro-shooting sig-under)": [[16, "vector"]], + "(enter flee squid)": [[48, "vector"]], + "(enter fire squid)": [[48, "vector"]], + "(method 45 squid)": [ + [16, ["inline-array", "vector", 13]], + [224, "vector"], + [240, "vector"], + [576, "vector"] + ], + "(method 50 squid)": [ + [16, "script-context"], + [256, "vector"] + ], + "(method 51 squid)": [[16, "vector"]], + "(method 23 squid-tentacle)": [ + [736, "vector"], + [752, "vector"], + [768, "vector"], + [784, "vector"], + [800, "vector"], + [816, "vector"], + [832, "collide-query"], + [1376, "vector"], + [1392, "vector"], + [1408, "vector"], + [1424, "vector"], + [1440, "vector"], + [16, "collide-query"], + [560, "bounding-box"] + ], + "squid-grenade-move": [[48, "matrix"]] } diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index ed5b57717c..a860236eb3 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -8570,5 +8570,45 @@ "(anon-function 50 sig5-course)": [[15, "v1", "sigt-wait-spot"]], "(anon-function 52 sig5-course)": [[41, "v1", "sigt-wait-spot"]], "(anon-function 54 sig5-course)": [[14, "v1", "sigt-wait-spot"]], - "(anon-function 56 sig5-course)": [[116, "v1", "sigt-wait-spot"]] + "(anon-function 56 sig5-course)": [[116, "v1", "sigt-wait-spot"]], + "squid-talker": [ + [14, "v1", "float"], + [128, "v1", "float"], + [225, "v1", "float"], + [269, "v1", "float"], + [313, "v1", "float"], + [427, "v1", "float"], + [626, "v1", "float"] + ], + "go-through-wall": [ + [11, "v0", "(pointer actor-group)"], + ["_stack_", 16, "res-tag"] + ], + "(trans recharge squid)": [[201, "v1", "hud-squid"]], + "squid-tentacle-handler": [ + [59, "a0", "vector"], + [70, "a0", "vector"], + [81, "a0", "vector"], + [85, "v1", "vector"], + [92, "v1", "vector"], + [98, "v1", "float"] + ], + "squid-handler": [ + [33, "v0", "(pointer actor-group)"], + ["_stack_", 16, "res-tag"], + [122, "s4", "attack-info"], + [127, "s4", "attack-info"], + [233, "s4", "attack-info"], + [235, "s4", "attack-info"] + ], + "(method 48 squid)": [[16, "v1", "squid-grenade"]], + "(method 49 squid)": [[20, "v1", "float"]], + "(method 50 squid)": [ + [409, "v0", "float"], + [[1112, 1134], "v1", "hud-squid"] + ], + "(event idle squid-baron)": [[13, "v1", "rgbaf"]], + "(event idle squid-driver)": [[[11, 15], "v0", "matrix"]], + "(trans idle squid-baron)": [[4, "a0", "squid"]], + "(method 23 squid-tentacle)": [["_stack_", 1584, "vector"]] } diff --git a/decompiler/config/jak2/var_names.jsonc b/decompiler/config/jak2/var_names.jsonc index 05be13fcd9..d467d3ebe3 100644 --- a/decompiler/config/jak2/var_names.jsonc +++ b/decompiler/config/jak2/var_names.jsonc @@ -4090,5 +4090,8 @@ "vars": { "v0-0": ["ret", "object"] } + }, + "(method 46 squid)": { + "args": ["obj", "src", "arg2", "dest"] } } diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt index 21ca6a6946..ce19fea3fb 100644 --- a/game/CMakeLists.txt +++ b/game/CMakeLists.txt @@ -104,6 +104,7 @@ set(RUNTIME_SOURCE mips2c/jak2_functions/ocean_vu0.cpp mips2c/jak2_functions/merc_blend_shape.cpp mips2c/jak2_functions/ripple.cpp + mips2c/jak2_functions/squid.cpp overlord/dma.cpp overlord/fake_iso.cpp overlord/iso.cpp diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.cpp b/game/graphics/opengl_renderer/OpenGLRenderer.cpp index e3feef09c2..5a12a6bb17 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.cpp +++ b/game/graphics/opengl_renderer/OpenGLRenderer.cpp @@ -170,6 +170,7 @@ void OpenGLRenderer::init_bucket_renderers_jak2() { // 130 init_bucket_renderer("tex-l1-alpha", BucketCategory::TEX, BucketId::TEX_L1_ALPHA); + init_bucket_renderer("merc-l0-alpha", BucketCategory::MERC, BucketId::MERC_L0_ALPHA); init_bucket_renderer("tfrag-t-l1-alpha", BucketCategory::TFRAG, BucketId::TFRAG_T_L1_ALPHA, std::vector{tfrag3::TFragmentTreeKind::TRANS}, false, 1); diff --git a/game/graphics/opengl_renderer/buckets.h b/game/graphics/opengl_renderer/buckets.h index 83b0e178b1..d357c2b6ca 100644 --- a/game/graphics/opengl_renderer/buckets.h +++ b/game/graphics/opengl_renderer/buckets.h @@ -123,6 +123,7 @@ enum class BucketId { SHRUB_L5_SHRUB = 119, TEX_L0_ALPHA = 127, TFRAG_T_L0_ALPHA = 128, + MERC_L0_ALPHA = 131, TEX_L1_ALPHA = 137, MERC_L1_ALPHA = 141, TFRAG_T_L1_ALPHA = 138, diff --git a/game/mips2c/jak2_functions/squid.cpp b/game/mips2c/jak2_functions/squid.cpp new file mode 100644 index 0000000000..bfd0f27fb1 --- /dev/null +++ b/game/mips2c/jak2_functions/squid.cpp @@ -0,0 +1,391 @@ +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak2/kscheme.h" +using ::jak2::intern_from_c; +namespace Mips2C::jak2 { + namespace method_53_squid { + struct Cache { + void* default_dead_pool; // *default-dead-pool* + void* game_info; // *game-info* + void* rand_vu_float_range; // rand-vu-float-range + void* spawn_projectile; // spawn-projectile + void* squid_increment_shield; // squid-increment-shield + void* squid_shot; // squid-shot + void* tan; // tan + void* vector_flatten; // vector-flatten! + void* vector_normalize; // vector-normalize! + void* vector_cspace; // vector<-cspace! + } cache; + + u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + c->daddiu(sp, sp, -336); // daddiu sp, sp, -336 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s1, 224, sp); // sq s1, 224(sp) + c->sq(s2, 240, sp); // sq s2, 240(sp) + c->sq(s3, 256, sp); // sq s3, 256(sp) + c->sq(s4, 272, sp); // sq s4, 272(sp) + c->sq(s5, 288, sp); // sq s5, 288(sp) + c->sq(gp, 304, sp); // sq gp, 304(sp) + c->swc1(f24, 320, sp); // swc1 f24, 320(sp) + c->swc1(f26, 324, sp); // swc1 f26, 324(sp) + c->swc1(f28, 328, sp); // swc1 f28, 328(sp) + c->swc1(f30, 332, sp); // swc1 f30, 332(sp) + c->mov64(gp, a0); // or gp, a0, r0 + c->mov64(s4, a1); // or s4, a1, r0 + c->load_symbol2(t9, cache.squid_increment_shield);// lw t9, squid-increment-shield(s7) + c->lui(v1, -17393); // lui v1, -17393 + c->ori(a0, v1, 47140); // ori a0, v1, 47140 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->load_symbol2(t9, cache.vector_cspace); // lw t9, vector<-cspace!(s7) + c->daddiu(a0, sp, 16); // daddiu a0, sp, 16 + c->dsll(v1, s4, 5); // dsll v1, s4, 5 + c->daddiu(v1, v1, 12); // daddiu v1, v1, 12 + c->lwu(a1, 128, gp); // lwu a1, 128(gp) + c->daddu(a1, v1, a1); // daddu a1, v1, a1 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(s2, v0); // or s2, v0, r0 + c->daddiu(s5, sp, 32); // daddiu s5, sp, 32 + c->lwu(v1, 128, gp); // lwu v1, 128(gp) + c->dsll(a0, s4, 5); // dsll a0, s4, 5 + c->daddu(v1, v1, a0); // daddu v1, v1, a0 + c->lwu(v1, 28, v1); // lwu v1, 28(v1) + c->daddu(a2, r0, v1); // daddu a2, r0, v1 + c->lq(v1, 0, a2); // lq v1, 0(a2) + c->lq(a0, 16, a2); // lq a0, 16(a2) + c->lq(a1, 32, a2); // lq a1, 32(a2) + c->lq(a2, 48, a2); // lq a2, 48(a2) + c->sq(v1, 0, s5); // sq v1, 0(s5) + c->sq(a0, 16, s5); // sq a0, 16(s5) + c->sq(a1, 32, s5); // sq a1, 32(s5) + c->sq(a2, 48, s5); // sq a2, 48(s5) + c->mov64(a0, gp); // or a0, gp, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 184, v1); // lwu t9, 184(v1) + c->daddiu(a1, sp, 96); // daddiu a1, sp, 96 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(s3, v0); // or s3, v0, r0 + c->mov64(a1, s3); // or a1, s3, r0 + c->mov64(v1, s3); // or v1, s3, r0 + c->mov64(a0, s2); // or a0, s2, r0 + c->lqc2(vf4, 0, v1); // lqc2 vf4, 0(v1) + c->lqc2(vf5, 0, a0); // lqc2 vf5, 0(a0) + c->vmove(DEST::w, vf6, vf0); // vmove.w vf6, vf0 + c->vsub(DEST::xyz, vf6, vf4, vf5); // vsub.xyz vf6, vf4, vf5 + c->sqc2(vf6, 0, a1); // sqc2 vf6, 0(a1) + c->load_symbol2(t9, cache.vector_normalize); // lw t9, vector-normalize!(s7) + c->daddu(a0, r0, s5); // daddu a0, r0, s5 + c->lui(a1, 16256); // lui a1, 16256 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->load_symbol2(t9, cache.vector_normalize); // lw t9, vector-normalize!(s7) + c->daddiu(a0, s5, 16); // daddiu a0, s5, 16 + c->lui(a1, 16256); // lui a1, 16256 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->load_symbol2(t9, cache.vector_normalize); // lw t9, vector-normalize!(s7) + c->daddiu(a0, s5, 32); // daddiu a0, s5, 32 + c->lui(a1, 16256); // lui a1, 16256 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->lui(v1, 18800); // lui v1, 18800 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->lui(v1, 18176); // lui v1, 18176 + c->mtc1(f1, v1); // mtc1 f1, v1 + c->mov64(a0, s3); // or a0, s3, r0 + c->daddiu(v1, s5, 16); // daddiu v1, s5, 16 + c->lwc1(f2, 0, a0); // lwc1 f2, 0(a0) + c->lwc1(f3, 4, a0); // lwc1 f3, 4(a0) + c->lwc1(f4, 8, a0); // lwc1 f4, 8(a0) + c->lwc1(f5, 0, v1); // lwc1 f5, 0(v1) + c->lwc1(f6, 4, v1); // lwc1 f6, 4(v1) + c->lwc1(f7, 8, v1); // lwc1 f7, 8(v1) + // Unknown instr: mula.s f2, f5 + // Unknown instr: madda.s f3, f6 + // Unknown instr: madd.s f2, f4, f7 + c->fprs[f2] = (c->fprs[f4] * c->fprs[f7]) + (c->fprs[f3] * c->fprs[f6]) + (c->fprs[f2] * c->fprs[f5]); + c->mfc1(v1, f2); // mfc1 v1, f2 + c->mtc1(f2, v1); // mtc1 f2, v1 + c->maxs(f1, f1, f2); // max.s f1, f1, f2 + c->divs(f30, f0, f1); // div.s f30, f0, f1 + c->daddiu(s4, sp, 112); // daddiu s4, sp, 112 + c->lwu(v1, 52, gp); // lwu v1, 52(gp) + c->sw(v1, 0, s4); // sw v1, 0(s4) + c->lui(v1, 16256); // lui v1, 16256 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->swc1(f0, 4, s4); // swc1 f0, 4(s4) + c->addiu(v1, r0, 8192); // addiu v1, r0, 8192 + c->sd(v1, 16, s4); // sd v1, 16(s4) + c->daddiu(v1, s4, 48); // daddiu v1, s4, 48 + c->lq(a0, 0, s2); // lq a0, 0(s2) + c->sq(a0, 0, v1); // sq a0, 0(v1) + c->mov64(a0, gp); // or a0, gp, r0 + bc = c->sgpr64(s7) == c->sgpr64(a0); // beq s7, a0, L2 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_2;} // branch non-likely + + c->lwu(v1, 24, a0); // lwu v1, 24(a0) + + block_2: + bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L3 + // nop // sll r0, r0, 0 + if (bc) {goto block_4;} // branch non-likely + + c->lwu(a0, 0, v1); // lwu a0, 0(v1) + c->lw(a0, 40, a0); // lw a0, 40(a0) + c->dsll32(a0, a0, 0); // dsll32 a0, a0, 0 + //beq r0, r0, L4 // beq r0, r0, L4 + // nop // sll r0, r0, 0 + goto block_5; // branch always + + + block_4: + c->addiu(a0, r0, 0); // addiu a0, r0, 0 + + block_5: + c->sllv(v1, v1, r0); // sllv v1, v1, r0 + c->or_(v1, a0, v1); // or v1, a0, v1 + c->sd(v1, 24, s4); // sd v1, 24(s4) + c->sd(s7, 32, s4); // sd s7, 32(s4) + c->mov64(a0, gp); // or a0, gp, r0 + bc = c->sgpr64(s7) == c->sgpr64(a0); // beq s7, a0, L5 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_7;} // branch non-likely + + c->lwu(v1, 24, a0); // lwu v1, 24(a0) + + block_7: + bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L6 + // nop // sll r0, r0, 0 + if (bc) {goto block_9;} // branch non-likely + + c->lwu(a0, 0, v1); // lwu a0, 0(v1) + c->lw(a0, 40, a0); // lw a0, 40(a0) + c->dsll32(a0, a0, 0); // dsll32 a0, a0, 0 + //beq r0, r0, L7 // beq r0, r0, L7 + // nop // sll r0, r0, 0 + goto block_10; // branch always + + + block_9: + c->addiu(a0, r0, 0); // addiu a0, r0, 0 + + block_10: + c->sllv(v1, v1, r0); // sllv v1, v1, r0 + c->or_(v1, a0, v1); // or v1, a0, v1 + c->sd(v1, 40, s4); // sd v1, 40(s4) + c->load_symbol2(v1, cache.game_info); // lw v1, *game-info*(s7) + c->lwu(a0, 224, v1); // lwu a0, 224(v1) + c->daddiu(a0, a0, 1); // daddiu a0, a0, 1 + c->sw(a0, 224, v1); // sw a0, 224(v1) + c->sw(a0, 8, s4); // sw a0, 8(s4) + c->addiu(v1, r0, 1200); // addiu v1, r0, 1200 + c->sd(v1, 80, s4); // sd v1, 80(s4) + c->daddiu(v1, s4, 64); // daddiu v1, s4, 64 + c->daddiu(a0, s5, 16); // daddiu a0, s5, 16 + c->lui(a1, 18800); // lui a1, 18800 + c->mtc1(f0, a1); // mtc1 f0, a1 + c->lqc2(vf1, 0, a0); // lqc2 vf1, 0(a0) + c->mfc1(a0, f0); // mfc1 a0, f0 + c->mov128_vf_gpr(vf2, a0); // qmtc2.i vf2, a0 + c->vadd_bc(DEST::w, BC::x, vf1, vf0, vf0); // vaddx.w vf1, vf0, vf0 + c->vmul_bc(DEST::xyz, BC::x, vf1, vf1, vf2); // vmulx.xyz vf1, vf1, vf2 + c->sqc2(vf1, 0, v1); // sqc2 vf1, 0(v1) + c->load_symbol2(t9, cache.vector_flatten); // lw t9, vector-flatten!(s7) + c->daddiu(a0, sp, 208); // daddiu a0, sp, 208 + c->daddiu(a2, s5, 32); // daddiu a2, s5, 32 + c->mov64(a1, s3); // or a1, s3, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(a0, v0); // or a0, v0, r0 + c->daddu(v1, r0, s5); // daddu v1, r0, s5 + c->lwc1(f0, 0, a0); // lwc1 f0, 0(a0) + c->lwc1(f1, 4, a0); // lwc1 f1, 4(a0) + c->lwc1(f2, 8, a0); // lwc1 f2, 8(a0) + c->lwc1(f3, 0, v1); // lwc1 f3, 0(v1) + c->lwc1(f4, 4, v1); // lwc1 f4, 4(v1) + c->lwc1(f5, 8, v1); // lwc1 f5, 8(v1) + // Unknown instr: mula.s f0, f3 + // Unknown instr: madda.s f1, f4 + // Unknown instr: madd.s f0, f2, f5 + c->mfc1(v1, f0); // mfc1 v1, f0 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->mtc1(f1, r0); // mtc1 f1, r0 + cop1_bc = c->fprs[f1] < c->fprs[f0]; // c.lt.s f1, f0 + bc = !cop1_bc; // bc1f L8 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_12;} // branch non-likely + + c->addiu(v1, r0, 0); // addiu v1, r0, 0 + c->lui(a0, -14976); // lui a0, -14976 + c->mtc1(f1, a0); // mtc1 f1, a0 + c->adds(f0, f1, f0); // add.s f0, f1, f0 + c->mfc1(a0, f0); // mfc1 a0, f0 + c->mtc1(f0, a0); // mtc1 f0, a0 + c->cvtws(f0, f0); // cvt.w.s f0, f0 + c->mfc1(a1, f0); // mfc1 a1, f0 + c->slt(a1, v1, a1); // slt a1, v1, a1 + c->movn(v1, a0, a1); // movn v1, a0, a1 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->mfc1(v1, f0); // mfc1 v1, f0 + //beq r0, r0, L9 // beq r0, r0, L9 + // nop // sll r0, r0, 0 + goto block_14; // branch always + + + block_12: + c->mtc1(f1, r0); // mtc1 f1, r0 + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = !cop1_bc; // bc1f L9 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_14;} // branch non-likely + + c->addiu(v1, r0, 0); // addiu v1, r0, 0 + c->lui(a0, 17792); // lui a0, 17792 + c->mtc1(f1, a0); // mtc1 f1, a0 + c->adds(f0, f1, f0); // add.s f0, f1, f0 + c->mfc1(a0, f0); // mfc1 a0, f0 + c->mtc1(f0, a0); // mtc1 f0, a0 + c->cvtws(f0, f0); // cvt.w.s f0, f0 + c->mfc1(a1, f0); // mfc1 a1, f0 + c->slt(a1, v1, a1); // slt a1, v1, a1 + c->movz(v1, a0, a1); // movz v1, a0, a1 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->mfc1(v1, f0); // mfc1 v1, f0 + + block_14: + c->muls(f28, f0, f30); // mul.s f28, f0, f30 + c->lui(v1, 18800); // lui v1, 18800 + c->mtc1(f26, v1); // mtc1 f26, v1 + c->load_symbol2(t9, cache.tan); // lw t9, tan(s7) + c->lui(v1, 17507); // lui v1, 17507 + c->ori(a0, v1, 36409); // ori a0, v1, 36409 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mtc1(f0, v0); // mtc1 f0, v0 + c->muls(f26, f26, f0); // mul.s f26, f26, f0 + c->lui(v1, 18800); // lui v1, 18800 + c->mtc1(f24, v1); // mtc1 f24, v1 + c->load_symbol2(t9, cache.tan); // lw t9, tan(s7) + c->lui(v1, 17507); // lui v1, 17507 + c->ori(a0, v1, 36409); // ori a0, v1, 36409 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mtc1(f0, v0); // mtc1 f0, v0 + c->muls(f0, f24, f0); // mul.s f0, f24, f0 + c->negs(f0, f0); // neg.s f0, f0 + c->maxs(f0, f0, f28); // max.s f0, f0, f28 + c->mins(f0, f26, f0); // min.s f0, f26, f0 + c->daddiu(v1, s4, 64); // daddiu v1, s4, 64 + c->daddiu(a0, s4, 64); // daddiu a0, s4, 64 + c->daddu(a1, r0, s5); // daddu a1, r0, s5 + c->lqc2(vf2, 0, a1); // lqc2 vf2, 0(a1) + c->lqc2(vf1, 0, a0); // lqc2 vf1, 0(a0) + c->mfc1(a0, f0); // mfc1 a0, f0 + c->mov128_vf_gpr(vf3, a0); // qmtc2.i vf3, a0 + c->vadd_bc(DEST::w, BC::x, vf4, vf0, vf0); // vaddx.w vf4, vf0, vf0 + c->vmula_bc(DEST::xyzw, BC::x, vf2, vf3); // vmulax.xyzw acc, vf2, vf3 + c->vmadd_bc(DEST::xyz, BC::w, vf4, vf1, vf0); // vmaddw.xyz vf4, vf1, vf0 + c->sqc2(vf4, 0, v1); // sqc2 vf4, 0(v1) + c->lui(v1, 17664); // lui v1, 17664 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->muls(f30, f0, f30); // mul.s f30, f0, f30 + c->daddiu(s3, s4, 64); // daddiu s3, s4, 64 + c->daddiu(s2, s4, 64); // daddiu s2, s4, 64 + c->daddu(s1, r0, s5); // daddu s1, r0, s5 + c->load_symbol2(t9, cache.rand_vu_float_range); // lw t9, rand-vu-float-range(s7) + c->negs(f0, f30); // neg.s f0, f30 + c->mfc1(a0, f0); // mfc1 a0, f0 + c->mfc1(a1, f30); // mfc1 a1, f30 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mtc1(f0, v0); // mtc1 f0, v0 + c->lqc2(vf2, 0, s1); // lqc2 vf2, 0(s1) + c->lqc2(vf1, 0, s2); // lqc2 vf1, 0(s2) + c->mfc1(v1, f0); // mfc1 v1, f0 + c->mov128_vf_gpr(vf3, v1); // qmtc2.i vf3, v1 + c->vadd_bc(DEST::w, BC::x, vf4, vf0, vf0); // vaddx.w vf4, vf0, vf0 + c->vmula_bc(DEST::xyzw, BC::x, vf2, vf3); // vmulax.xyzw acc, vf2, vf3 + c->vmadd_bc(DEST::xyz, BC::w, vf4, vf1, vf0); // vmaddw.xyz vf4, vf1, vf0 + c->sqc2(vf4, 0, s3); // sqc2 vf4, 0(s3) + c->daddiu(s3, s4, 64); // daddiu s3, s4, 64 + c->daddiu(s2, s4, 64); // daddiu s2, s4, 64 + c->daddiu(s5, s5, 32); // daddiu s5, s5, 32 + c->load_symbol2(t9, cache.rand_vu_float_range); // lw t9, rand-vu-float-range(s7) + c->negs(f0, f30); // neg.s f0, f30 + c->mfc1(a0, f0); // mfc1 a0, f0 + c->mfc1(a1, f30); // mfc1 a1, f30 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mtc1(f0, v0); // mtc1 f0, v0 + c->lqc2(vf2, 0, s5); // lqc2 vf2, 0(s5) + c->lqc2(vf1, 0, s2); // lqc2 vf1, 0(s2) + c->mfc1(v1, f0); // mfc1 v1, f0 + c->mov128_vf_gpr(vf3, v1); // qmtc2.i vf3, v1 + c->vadd_bc(DEST::w, BC::x, vf4, vf0, vf0); // vaddx.w vf4, vf0, vf0 + c->vmula_bc(DEST::xyzw, BC::x, vf2, vf3); // vmulax.xyzw acc, vf2, vf3 + c->vmadd_bc(DEST::xyz, BC::w, vf4, vf1, vf0); // vmaddw.xyz vf4, vf1, vf0 + c->sqc2(vf4, 0, s3); // sqc2 vf4, 0(s3) + c->load_symbol2(t9, cache.spawn_projectile); // lw t9, spawn-projectile(s7) + c->load_symbol2(a0, cache.squid_shot); // lw a0, squid-shot(s7) + c->load_symbol2(a3, cache.default_dead_pool); // lw a3, *default-dead-pool*(s7) + c->mov64(a1, s4); // or a1, s4, r0 + c->mov64(a2, gp); // or a2, gp, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lwc1(f30, 332, sp); // lwc1 f30, 332(sp) + c->lwc1(f28, 328, sp); // lwc1 f28, 328(sp) + c->lwc1(f26, 324, sp); // lwc1 f26, 324(sp) + c->lwc1(f24, 320, sp); // lwc1 f24, 320(sp) + c->lq(gp, 304, sp); // lq gp, 304(sp) + c->lq(s5, 288, sp); // lq s5, 288(sp) + c->lq(s4, 272, sp); // lq s4, 272(sp) + c->lq(s3, 256, sp); // lq s3, 256(sp) + c->lq(s2, 240, sp); // lq s2, 240(sp) + c->lq(s1, 224, sp); // lq s1, 224(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 336); // daddiu sp, sp, 336 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + end_of_function: + return c->gprs[v0].du64[0]; + } + + void link() { + cache.default_dead_pool = intern_from_c("*default-dead-pool*").c(); + cache.game_info = intern_from_c("*game-info*").c(); + cache.rand_vu_float_range = intern_from_c("rand-vu-float-range").c(); + cache.spawn_projectile = intern_from_c("spawn-projectile").c(); + cache.squid_increment_shield = intern_from_c("squid-increment-shield").c(); + cache.squid_shot = intern_from_c("squid-shot").c(); + cache.tan = intern_from_c("tan").c(); + cache.vector_flatten = intern_from_c("vector-flatten!").c(); + cache.vector_normalize = intern_from_c("vector-normalize!").c(); + cache.vector_cspace = intern_from_c("vector<-cspace!").c(); + gLinkedFunctionTable.reg("(method 53 squid)", execute, 512); + } + + } // namespace method_53_squid +} // namespace Mips2C diff --git a/game/mips2c/mips2c_table.cpp b/game/mips2c/mips2c_table.cpp index 1061650f2d..d2681bb29a 100644 --- a/game/mips2c/mips2c_table.cpp +++ b/game/mips2c/mips2c_table.cpp @@ -216,6 +216,7 @@ namespace ripple_execute_init { extern void link(); } namespace ripple_create_wave_table { extern void link(); } namespace ripple_apply_wave_table { extern void link(); } namespace ripple_matrix_scale { extern void link(); } +namespace method_53_squid { extern void link(); } } // clang-format on @@ -361,8 +362,8 @@ PerGameVersion>> gMips2C {jak2::setup_blerc_chains_for_one_fragment::link, jak2::blerc_execute::link}}, {"ripple", {jak2::ripple_execute_init::link, jak2::ripple_create_wave_table::link, - jak2::ripple_apply_wave_table::link, jak2::ripple_matrix_scale::link}}}, -}; + jak2::ripple_apply_wave_table::link, jak2::ripple_matrix_scale::link}}, + {"squid-setup", {jak2::method_53_squid::link}}}}; void LinkedFunctionTable::reg(const std::string& name, u64 (*exec)(void*), u32 stack_size) { const auto& it = m_executes.insert({name, {exec, Ptr()}}); diff --git a/goal_src/jak2/game.gp b/goal_src/jak2/game.gp index 9ca47343d0..01aa9453d2 100644 --- a/goal_src/jak2/game.gp +++ b/goal_src/jak2/game.gp @@ -3722,30 +3722,32 @@ ;; ;; PALBOSS ;; ;;;;;;;;;;;;;;;;;;;;; -;; (cgo "PALBOSS.DGO" "palboss.gd") +(cgo "PALBOSS.DGO" "palboss.gd") -;; (goal-src-sequence -;; "" -;; :deps ("$OUT/obj/los-control.o") -;; "levels/palace/boss/squid-part.gc" -;; "levels/palace/boss/squid-setup.gc" -;; "levels/palace/boss/squid-extras.gc" -;; "levels/palace/boss/squid-states.gc" -;; ) +(goal-src-sequence + "" + :deps ("$OUT/obj/los-control.o") + "levels/palace/boss/squid-part.gc" + "levels/palace/boss/squid-setup.gc" + "levels/palace/boss/squid-extras.gc" + "levels/palace/boss/squid-states.gc" + ) -;; (copy-textures 2679 2680 2797 3419) +(copy-textures 2679 2680 2797 3419) -;; (copy-gos -;; "baron-squid+0-ag" -;; "daxter-highres-ag" -;; "jak-highres-ag" -;; "squid-ag" -;; "squid-break-ag" -;; "baron-highres-ag" -;; "baron-ag" -;; "squid-collision-ag" -;; "palboss" -;; ) +(copy-gos + "baron-squid+0-ag" + ;; "daxter-highres-ag" + ;; "jak-highres-ag" + "squid-ag" + "squid-break-ag" + ;; "baron-highres-ag" + ;; "baron-ag" + "squid-collision-ag" + "palboss" + ) + +(copy-strs "PAOWRB" "PABRES") ;; ;;;;;;;;;;;;;;;;;;;;; ;; ;; PALOUT diff --git a/goal_src/jak2/levels/palace/boss/squid-extras.gc b/goal_src/jak2/levels/palace/boss/squid-extras.gc index 18bcb60577..437783ec6b 100644 --- a/goal_src/jak2/levels/palace/boss/squid-extras.gc +++ b/goal_src/jak2/levels/palace/boss/squid-extras.gc @@ -7,3 +7,552 @@ ;; DECOMP BEGINS +(defstate idle (squid-driver) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('matrix) + (let ((v0-0 (the-as object (-> event param 0)))) + (let* ((a2-1 (-> self node-list data 3 bone transform)) + (v1-3 (-> a2-1 quad 0)) + (a0-2 (-> a2-1 quad 1)) + (a1-1 (-> a2-1 quad 2)) + (a2-2 (-> a2-1 trans quad)) + ) + (set! (-> (the-as matrix v0-0) quad 0) v1-3) + (set! (-> (the-as matrix v0-0) quad 1) a0-2) + (set! (-> (the-as matrix v0-0) quad 2) a1-1) + (set! (-> (the-as matrix v0-0) trans quad) a2-2) + ) + v0-0 + ) + ) + ) + ) + ) + :trans (behavior () + (ja :num! (loop!)) + (ja-post) + (none) + ) + :code (the-as (function none :behavior squid-driver) sleep-code) + ) + +(defstate idle (squid-baron) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (rlet ((vf0 :class vf)) + (init-vf0-vector) + (the-as object (case event-type + (('color) + (.svf (&-> (-> self draw color-mult) quad) vf0) + (set! (-> self draw color-mult w) 1.0) + (let ((v0-0 (-> self draw color-emissive))) + (set! (-> v0-0 quad) (-> (the-as rgbaf (-> event param 0)) quad)) + v0-0 + ) + ) + ) + ) + ) + ) + :trans (behavior () + (clone-anim-once (ppointer->handle (-> self parent)) #f "") + (none) + ) + :code (the-as (function none :behavior squid-baron) sleep-code) + ) + +(defstate test (squid-tentacle) + :virtual #t + :event squid-tentacle-handler + :enter (behavior () + (joint-setup self) + (none) + ) + :trans (behavior () + (ja :num! (loop!)) + (squid-tentacle-method-23 self) + (dotimes (v1-6 11) + ) + (none) + ) + :code (the-as (function none :behavior squid-tentacle) sleep-code) + :post (behavior () + (transform-post) + (do-push-aways (-> self root-override)) + (none) + ) + ) + +(defstate idle (squid-tentacle) + :virtual #t + :event squid-tentacle-handler + :trans (behavior () + (ja :num! (loop!)) + (ja-post) + (go-virtual test) + (none) + ) + :code (the-as (function none :behavior squid-tentacle) sleep-code) + :post (behavior () + (transform-post) + (do-push-aways (-> self root-override)) + (none) + ) + ) + +(defstate idle (squid-collision) + :virtual #t + :code (the-as (function none :behavior squid-collision) sleep-code) + ) + +(defstate impact (squid-grenade) + :virtual #t + :enter (behavior () + (sound-play "sqd-missile-hit") + (let ((t9-2 (-> (method-of-type projectile impact) enter))) + (if t9-2 + (t9-2) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self root-override trans quad)) + (quaternion-copy! (-> gp-1 spawn-quat) (-> self root-override quat)) + (set! (-> gp-1 radius) 16384.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 1121)) + (set! (-> gp-1 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-1 penetrate-using) (penetrate explode)) + (explosion-spawn (the-as process-drawable *default-pool*) explosion gp-1) + ) + (none) + ) + ) + +(defstate moving (squid-grenade) + :virtual #t + :exit (behavior () + (sound-stop (-> self fly-sound)) + (let ((t9-1 (-> (method-of-type projectile moving) exit))) + (if t9-1 + (t9-1) + ) + ) + (none) + ) + ) + +(defun squid-grenade-move ((arg0 squid-grenade)) + (local-vars (at-0 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((f28-0 (/ (the float (- (-> pp clock frame-counter) (-> arg0 traj-timer))) (-> arg0 traj-duration))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((f30-0 (compute-time-until-apex (-> arg0 traj)))) + (if (>= f28-0 1.0) + (go (method-of-object arg0 impact)) + ) + (vector-! s5-0 (-> arg0 traj-dest) (the-as vector (-> arg0 traj))) + (vector-normalize! + s5-0 + (* (lerp-scale 1.0 0.0 f28-0 (* 1.5 f30-0) 1.0) (lerp-scale 0.0 20480.0 f28-0 0.0 0.06)) + ) + (let ((f28-1 (* f28-0 f28-0))) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (compute-trans-at-time (-> arg0 traj) f28-1 s4-1) + (vector+! s5-0 s5-0 s4-1) + ) + (let ((s3-1 (new 'stack-no-clear 'matrix))) + (vector-normalize! (compute-transv-at-time (-> arg0 traj) f28-1 (-> s3-1 vector 2)) 1.0) + (vector-normalize! + (vector-cross! (the-as vector (-> s3-1 vector)) (new 'static 'vector :y 1.0) (-> s3-1 vector 2)) + 1.0 + ) + (vector-cross! (-> s3-1 vector 1) (-> s3-1 vector 2) (the-as vector (-> s3-1 vector))) + (when (>= f30-0 f28-1) + (let ((s4-3 (new 'stack-no-clear 'vector))) + (let ((f26-1 (/ 4.0 f30-0))) + (if (< 1.5 (-> arg0 charge-level)) + (vector-float*! s4-3 (the-as vector (-> s3-1 vector)) (* 8192.0 (+ -1.0 (cos (* 65536.0 f28-1 f26-1))))) + (vector-float*! s4-3 (the-as vector (-> s3-1 vector)) (* 8192.0 (- 1.0 (cos (* 65536.0 f28-1 f26-1))))) + ) + (vector+float*! s4-3 s4-3 (-> s3-1 vector 1) (* -8192.0 (sin (* 65536.0 f28-1 f26-1)))) + ) + (vector+float*! s5-0 s5-0 s4-3 (lerp-scale 1.0 0.0 f28-1 0.0 f30-0)) + ) + ) + ) + ) + ) + (vector-! (-> arg0 root-override transv) s5-0 (-> arg0 root-override trans)) + ) + (let ((v1-33 (-> arg0 root-override transv))) + (.lvf vf1 (&-> (-> arg0 root-override transv) quad)) + (let ((f0-28 (-> pp clock frames-per-second))) + (.mov at-0 f0-28) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-33 quad) vf1) + ) + (let* ((s5-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> arg0 root-override quat))) + (a2-6 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root-override transv) 1.0)) + (a1-16 (quaternion-from-two-vectors! (new 'stack-no-clear 'quaternion) (-> s5-1 vector 2) a2-6)) + ) + (quaternion-normalize! (quaternion*! (-> arg0 root-override quat) a1-16 (-> arg0 root-override quat))) + ) + (projectile-move-fill-line-sphere arg0) + (if (logtest? (-> arg0 root-override status) (collide-status touch-surface)) + (go (method-of-object arg0 impact)) + ) + (sound-play "sqd-missl-trail" :id (-> arg0 fly-sound) :position (-> arg0 root-override trans)) + 0 + (none) + ) + ) + ) + +;; WARN: Return type mismatch int vs sound-id. +(defmethod play-impact-sound! squid-grenade ((obj squid-grenade)) + "Plays impact sound" + (ja-post) + (the-as sound-id 0) + ) + +(defmethod init-proj-collision! squid-grenade ((obj squid-grenade)) + "Init the [[projectile]]'s [[collide-shape]]" + (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) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) + (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + dark-punch + dark-giant + ) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-7 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-7 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 2048.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-7) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-10 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> obj root-override) s5-0) + ) + (set! (-> obj root-override pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-squid-grenade" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj draw light-index) (the-as uint 10)) + (when (-> obj draw shadow) + (set! (-> obj draw shadow-ctrl) + (new 'process 'shadow-control -204800.0 4096.0 4096000.0 (shadow-flags) 819200.0) + ) + (let ((v1-25 (-> obj draw shadow-ctrl))) + (logclear! (-> v1-25 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + 0 + (none) + ) + +(defmethod init-proj-settings! squid-grenade ((obj squid-grenade)) + "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" + (with-pp + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1120) obj)) + (set! (-> obj attack-mode) 'squid-grenade) + (set! (-> obj max-speed) 655360.0) + (set! (-> obj move) squid-grenade-move) + (set! (-> obj timeout) (seconds 5)) + (set! (-> obj stop-speed) 4.096) + (set! (-> obj fly-sound) (new-sound-id)) + (set! (-> obj traj-timer) (-> pp clock frame-counter)) + (vector+! (-> obj traj-dest) (-> obj root-override trans) (-> obj root-override transv)) + (set! (-> obj traj-duration) + (fmax 600.0 (* 0.0018310547 (vector-vector-xz-distance (-> obj root-override trans) (-> obj traj-dest)))) + ) + (+! (-> obj traj-duration) (* 75.0 (rand-vu))) + (let ((f0-8 32768.0)) + (if (< (-> obj root-override trans y) (-> obj traj-dest y)) + (+! f0-8 (- (-> obj traj-dest y) (-> obj root-override trans y))) + ) + (setup-from-to-duration-and-height! (-> obj traj) (-> obj root-override trans) (-> obj traj-dest) 1.0 f0-8) + ) + (none) + ) + ) + +(defbehavior squid-whirlwind-move squid-whirlwind () + (vector+float*! + (-> self center) + (-> self center) + (-> self center-vel) + (* 819.2 (-> self clock time-adjust-ratio)) + ) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((f30-0 + (lerp-scale 12288.0 32768.0 (the float (- (-> self clock frame-counter) (-> self state-time))) 0.0 900.0) + ) + (f28-0 + (lerp-scale 1024.0 4096.0 (the float (- (-> self clock frame-counter) (-> self state-time))) 0.0 900.0) + ) + ) + (vector-! (-> self root transv) (-> self root trans) (-> self center)) + (set-vector! gp-0 (- (-> self root transv z)) 0.0 (-> self root transv x) 1.0) + (vector-normalize! gp-0 (* 2252.8 (-> self clock time-adjust-ratio))) + (vector+! gp-0 gp-0 (-> self root trans)) + (vector-! gp-0 gp-0 (-> self center)) + (set! (-> gp-0 y) 0.0) + (let ((f0-14 (vector-length gp-0))) + (cond + ((< f0-14 (- f30-0 f28-0)) + (vector-float*! gp-0 gp-0 (/ (- f30-0 f28-0) f0-14)) + ) + ((< (+ f30-0 f28-0) f0-14) + (vector-float*! gp-0 gp-0 (/ (+ f30-0 f28-0) f0-14)) + ) + ) + ) + ) + (vector+! gp-0 gp-0 (-> self center)) + (vector-! (-> self root transv) gp-0 (-> self root trans)) + ) + (set! (-> self root transv y) 0.0) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (gp-1 (new 'stack-no-clear 'vector)) + (f30-1 (-> self root trans y)) + ) + (when (-> self current-nav-poly) + (vector+! (-> self root trans) (-> self root trans) (-> self root transv)) + (set! (-> self current-nav-poly) + (cloest-point-on-mesh (-> self nav) (-> self root trans) (-> self root trans) (-> self current-nav-poly)) + ) + (let ((s3-0 (-> self nav)) + (a1-14 (-> self current-nav-poly)) + (s4-0 gp-1) + ) + (let ((v1-41 (-> self root trans))) + (project-point-onto-plane-of-poly-local + (-> s3-0 state mesh) + a1-14 + s4-0 + s5-0 + (vector-! (new 'stack-no-clear 'vector) v1-41 (-> s3-0 state mesh bounds)) + ) + ) + (vector+! s4-0 s4-0 (-> s3-0 state mesh bounds)) + ) + 0 + (set! (-> self root trans y) (lerp f30-1 (+ 4096.0 (-> gp-1 y)) 0.1)) + ) + ) + (ja-post) + 0 + (none) + ) + +(defstate idle (squid-whirlwind) + :virtual #t + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self duration) (the-as time-frame (+ (the int (* 150.0 (rand-vu))) 1050))) + (none) + ) + :trans (behavior () + (squid-whirlwind-move) + (ja :num! (loop!)) + (sound-play "squid-whirlwind" :id (-> self whirl-sound) :position (-> self root trans)) + (set! (-> self whirl-sound-playing) #t) + (let ((a1-2 (new 'stack-no-clear 'vector))) + (set! (-> a1-2 quad) (-> self root trans quad)) + (set! (-> a1-2 y) (+ 2048.0 (-> a1-2 y))) + (spawn (-> self part) a1-2) + ) + (when (or (>= (- (-> self clock frame-counter) (-> self state-time)) (-> self duration)) + (let ((f0-3 (vector-vector-xz-distance-squared (target-pos 0) (-> self root trans))) + (f1-1 12288.0) + ) + (< f0-3 (* f1-1 f1-1)) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (quaternion-copy! (-> gp-1 spawn-quat) (-> self root quat)) + (set! (-> gp-1 radius) 16384.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 1123)) + (set! (-> gp-1 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-1 penetrate-using) (penetrate explode)) + (explosion-spawn (the-as process-drawable *default-pool*) explosion gp-1) + ) + (sound-play "sqd-whirl-xplod") + (deactivate self) + ) + (none) + ) + :code (the-as (function none :behavior squid-whirlwind) sleep-code) + ) + +(defmethod deactivate squid-whirlwind ((obj squid-whirlwind)) + (if (-> obj whirl-sound-playing) + (sound-stop (-> obj whirl-sound)) + ) + ((method-of-type process-drawable deactivate) obj) + (none) + ) + +(defbehavior scene-tentacle-spawn squid-tentacle ((arg0 process-drawable) (arg1 vector) (arg2 cspace)) + (let ((gp-0 0)) + (case (+ (-> arg2 joint number) 1) + ((7) + (set! gp-0 0) + ) + ((8) + (set! gp-0 1) + ) + ((9) + (set! gp-0 2) + ) + ((10) + (set! gp-0 3) + ) + ((11) + (set! gp-0 4) + ) + ((12) + (set! gp-0 5) + ) + ) + (let ((s4-0 (process-spawn squid-tentacle (-> arg0 root trans) gp-0 :to arg0))) + (send-event (ppointer->process s4-0) 'set-stretch-vel #x3f428f5c) + (send-event (ppointer->process s4-0) 'set-fade 128) + ) + ) + 0 + (none) + ) + +(defmethod draw hud-squid ((obj hud-squid)) + (set-hud-piece-position! (-> obj sprites 1) (the int (+ 462.0 (* 130.0 (-> obj offset)))) 350) + (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 1)) -32 0) + (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) -96 0) + (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites 1)) -62 14) + (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites 1)) -32 14) + (let ((s5-0 (-> obj values 0 current)) + (f28-0 (* 0.01 (the float (-> obj values 1 current)))) + (f30-0 (* 0.01 (the float (-> obj values 2 current)))) + ) + (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 1)) -92 15) + (cond + ((zero? s5-0) + (set! (-> obj sprites 3 color x) 0) + (set! (-> obj sprites 3 color y) 255) + (set! f28-0 (+ 2.0 f28-0)) + ) + ((= s5-0 1) + (set! (-> obj sprites 3 color y) 255) + (set! (-> obj sprites 3 color x) 255) + (set! f28-0 (+ 1.0 f28-0)) + ) + (else + (set! (-> obj sprites 3 color x) 255) + (set! (-> obj sprites 3 color y) 0) + 0 + ) + ) + (set! (-> obj sprites 3 scale-x) (* -7.25 f28-0)) + (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites 1)) -84 4) + (cond + ((< f30-0 0.5) + (set! (-> obj sprites 4 color x) 255) + (set! (-> obj sprites 4 color y) (the int (lerp 0.0 255.0 (* 2.0 f30-0)))) + ) + (else + (set! (-> obj sprites 4 color x) (the int (lerp 255.0 0.0 (* 2.0 (+ -0.5 f30-0))))) + (set! (-> obj sprites 4 color y) 255) + ) + ) + (set! (-> obj sprites 4 scale-x) (* -18.25 f30-0)) + ) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +(defmethod init-callback hud-squid ((obj hud-squid)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (set! (-> obj values 0 target) 0) + (set! (-> obj values 1 target) 100) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) + (set! (-> obj sprites 0 flags) (the-as uint 4)) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) + (set! (-> obj sprites 1 flags) (the-as uint 4)) + (set! (-> obj sprites 2 tex) + (lookup-texture-by-name "hud-baronsymbol-01" (the-as string #f) (the-as (pointer texture-page) #f)) + ) + (set! (-> obj sprites 2 flags) (the-as uint 4)) + (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> obj sprites 5 scale-x) 0.5) + (set! (-> obj sprites 5 flags) (the-as uint 4)) + (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> obj sprites 6 scale-x) 0.5) + (set! (-> obj sprites 6 flags) (the-as uint 4)) + (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> obj sprites 3 scale-y) 3.25) + (set! (-> obj sprites 3 color z) 0) + (set! (-> obj sprites 3 flags) (the-as uint 4)) + (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> obj sprites 4 scale-y) 1.5) + (set! (-> obj sprites 4 color z) 0) + (set! (-> obj sprites 4 flags) (the-as uint 4)) + (alloc-string-if-needed obj 0) + (set! (-> obj strings 0 flags) (font-flags kerning large)) + (set! (-> obj strings 0 scale) 0.5) + 0 + (none) + ) diff --git a/goal_src/jak2/levels/palace/boss/squid-part.gc b/goal_src/jak2/levels/palace/boss/squid-part.gc index 7336112b23..068feec46c 100644 --- a/goal_src/jak2/levels/palace/boss/squid-part.gc +++ b/goal_src/jak2/levels/palace/boss/squid-part.gc @@ -7,3 +7,1111 @@ ;; DECOMP BEGINS +(defpart 4790 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0.75)) + (sp-flt spt-rot-x 40.96) + (sp-rnd-flt spt-rot-z (degrees -4.0) (degrees 8.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 16.0 5.0 1.0) + (sp-flt spt-omega 821248.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 409.6) + ) + ) + +(defpart 4791 + :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 1.5)) + (sp-flt spt-rot-x 40.96) + (sp-rnd-flt spt-rot-z (degrees -4.0) (degrees 8.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 16.0 5.0 1.0) + (sp-flt spt-omega 821248.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 409.6) + ) + ) + +(defpart 4793 + :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 0.75)) + (sp-flt spt-rot-x 81.92) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 16.0) + (sp-flt spt-omega 247808.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 409.6) + ) + ) + +(defpart 4792 + :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 1.5)) + (sp-flt spt-rot-x 81.92) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 16.0) + (sp-flt spt-omega 247808.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 409.6) + ) + ) + +(defpartgroup group-squid-thruster + :id 1118 + :duration (seconds 0.017) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4812 :fade-after (meters 120) :falloff-to (meters 120) :flags (is-3d bit7)) + (sp-item 4813 :fade-after (meters 120) :falloff-to (meters 120) :flags (bit7)) + (sp-item 4814 :fade-after (meters 120) :falloff-to (meters 120) :flags (bit7)) + (sp-item 4815 :fade-after (meters 80) :falloff-to (meters 80) :flags (bit7)) + (sp-item 4816 :fade-after (meters 80) :falloff-to (meters 80) :flags (bit7)) + ) + ) + +(defpart 4812 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x90 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 2.5) (meters 0.5) 1.0) + (sp-rnd-flt spt-scale-y (meters 4) (meters 1) 1.0) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 0.0 128.0 1.0) + (sp-flt spt-b 0.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-3) + (sp-flt spt-rotate-x (degrees -90.0)) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 4813 + :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.2)) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 409.6) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 8.0 8.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 20480.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 4814 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.0 1.0 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 0.25) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0) + (sp-rnd-int-flt spt-rot-z (degrees 0.0) 1 32768.0) + (sp-rnd-flt spt-scale-y (meters 1) (meters 0.6) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 16.0 16.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.016666668) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.033333335) (meters 0.016666668) 1.0) + (sp-rnd-flt spt-scalevel-y (meters 0.016666668) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-fade-r -1.28 -1.28 1.0) + (sp-flt spt-fade-g 1.0) + (sp-flt spt-fade-b 2.0) + (sp-rnd-flt spt-accel-x 0.0 6.826667 1.0) + (sp-rnd-flt spt-accel-y 0.68266666 2.048 1.0) + (sp-flt spt-friction 0.94) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-int spt-next-time 50) + (sp-launcher-by-id spt-next-launcher 4817) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 4817 + :init-specs ((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-fade-r 0.0) + (sp-flt spt-fade-g 0.0) + (sp-flt spt-fade-b 0.0) + (sp-rnd-flt spt-fade-a -0.128 -0.256 1.0) + ) + ) + +(defpart 4815 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-rnd-flt spt-num 0.1 0.1 1.0) + (sp-rnd-flt spt-y (meters 0.25) (meters 0.5) 1.0) + (sp-flt spt-scale-x (meters 0.05)) + (sp-flt spt-scale-y (meters 0.5)) + (sp-rnd-flt spt-r 192.0 64.0 1.0) + (sp-rnd-flt spt-g 0.0 128.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.026666667) 1.0) + (sp-flt spt-scalevel-x (meters 0.001)) + (sp-flt spt-scalevel-y (meters -0.017)) + (sp-flt spt-fade-g 0.0) + (sp-rnd-flt spt-accel-x 0.0 6.826667 1.0) + (sp-rnd-flt spt-accel-y -0.68266666 -2.048 1.0) + (sp-flt spt-friction 0.96) + (sp-int-plain-rnd spt-timer 50 74 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 sp-cpuinfo-flag-14) + (sp-int spt-next-time 30) + (sp-launcher-by-id spt-next-launcher 4818) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 4818 + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-flt spt-scalevel-y (meters 0))) + ) + +(defpart 4816 + :init-specs ((sp-flt spt-num 0.6) + (sp-int spt-rot-x 8) + (sp-flt spt-r 1638.4) + (sp-flt spt-g 1331.2) + (sp-flt spt-b 1433.6) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.016666668) 1.0) + (sp-flt spt-fade-r 32.768) + (sp-flt spt-fade-g 26.623999) + (sp-flt spt-fade-b 28.671999) + (sp-rnd-flt spt-accel-x 0.0 6.826667 1.0) + (sp-flt spt-friction 0.94) + (sp-int spt-timer 100) + (sp-cpuinfo-flags distort) + (sp-int spt-next-time 50) + (sp-launcher-by-id spt-next-launcher 4819) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 4819 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b -4.096)) + ) + +(defpartgroup group-squid-marker + :id 1119 + :duration (seconds 0.017) + :linger-duration (seconds 8) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 4820 :flags (is-3d))) + ) + +(defpart 4820 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xaba)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 3)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 0.0 32.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 0.0) + (sp-flt spt-rotvel-y (degrees 3.6)) + (sp-flt spt-fade-a 2.56) + (sp-int spt-timer 2400) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat) + (sp-int spt-next-time 25) + (sp-launcher-by-id spt-next-launcher 4821) + (sp-flt spt-rotate-y (degrees 90.0)) + ) + ) + +(defpart 4821 + :init-specs ((sp-flt spt-r 128.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-flt spt-a 128.0) + (sp-flt spt-rotvel-y (degrees 0.0)) + (sp-flt spt-fade-a 0.0) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 4822) + ) + ) + +(defpart 4822 + :init-specs ((sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 0.0 32.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-scalevel-x (meters -0.03)) + (sp-flt spt-rotvel-y (degrees -3.6)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-next-time 50) + (sp-launcher-by-id spt-next-launcher 4823) + ) + ) + +(defpart 4823 + :init-specs ((sp-flt spt-scalevel-x (meters -0.001)) + (sp-flt spt-rotvel-y (degrees 0.15)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-next-time 150) + (sp-launcher-by-id spt-next-launcher 4824) + ) + ) + +(defpart 4824 + :init-specs ((sp-flt spt-scale-x (meters 1.5)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-scalevel-x (meters -0.001)) + (sp-flt spt-rotvel-y (degrees 0.15)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 4825) + ) + ) + +(defpart 4825 + :init-specs ((sp-flt spt-r 128.0) + (sp-flt spt-a 64.0) + (sp-flt spt-scalevel-x (meters -0.001)) + (sp-flt spt-rotvel-y (degrees 0.15)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-next-time 150) + (sp-launcher-by-id spt-next-launcher 4824) + ) + ) + +(defpartgroup group-squid-grenade-trail + :id 1120 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4826 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 4827 :flags (bit6)) + (sp-item 4828 :fade-after (meters 120) :falloff-to (meters 120)) + ) + ) + +(defpart 4828 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-rnd-flt spt-num 0.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.2) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 48.0 16.0 1.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-omega 1230848.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.01) 1.0) + (sp-flt spt-fade-a -0.10666667) + (sp-rnd-flt spt-accel-y -0.13653333 -0.06826667 1.0) + (sp-flt spt-friction 0.96) + (sp-int-plain-rnd spt-timer 150 1199 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int-plain-rnd spt-next-time 5 149 1) + (sp-launcher-by-id spt-next-launcher 4829) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) + ) + ) + +(defpart 4829 + :init-specs ((sp-flt spt-r 32.0) + (sp-rnd-flt spt-g 128.0 128.0 1.0) + (sp-flt spt-b 255.0) + (sp-int spt-next-time 5) + (sp-launcher-by-id spt-next-launcher 4830) + ) + ) + +(defpart 4830 + :init-specs ((sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 48.0 16.0 1.0) + (sp-flt spt-b 64.0) + (sp-int-plain-rnd spt-next-time 5 149 1) + (sp-launcher-by-id spt-next-launcher 4829) + ) + ) + +(defpart 4827 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 2.5) (meters 0.2) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 192.0 64.0 1.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 16.0) + (sp-flt spt-omega 1230848.0) + (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 3072.0) + ) + ) + +(defpart 4826 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.5 0.5 1.0) + (sp-rnd-flt spt-scale-x (meters 0.8) (meters 0.8) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 32.0 8.0 1.0) + (sp-rnd-flt spt-vel-y (meters -0.006666667) (meters -0.006666667) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.005) (meters 0.008333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.10666667) + (sp-flt spt-fade-g -0.32) + (sp-flt spt-fade-b -0.21333334) + (sp-flt spt-fade-a -0.08888889) + (sp-rnd-flt spt-accel-y 0.4096 0.13653333 1.0) + (sp-flt spt-friction 0.97) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 300) + (sp-launcher-by-id spt-next-launcher 4831) + ) + ) + +(defpart 4831 + :init-specs ((sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g 0.0) + (sp-flt spt-fade-b 0.0) + (sp-rnd-flt spt-fade-a -0.10666667 -0.21333334 1.0) + (sp-func spt-func 'nothing) + ) + ) + +(defpartgroup group-squid-grenade-explode + :id 1121 + :duration (seconds 1) + :linger-duration (seconds 1) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4832 :flags (bit6) :period 600 :length 5) + (sp-item 4833 :flags (bit6) :period 600 :length 5) + (sp-item 4834 :period 600 :length 15) + (sp-item 4835 :fade-after (meters 60) :period 600 :length 10) + (sp-item 4836 :fade-after (meters 60) :period 600 :length 10) + ) + ) + +(defpart 4836 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 16.0) + (sp-flt spt-y (meters 0.5)) + (sp-flt spt-scale-x (meters 2.5)) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-rnd-flt spt-omega 8.192 4.096 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.2) 1.0) + (sp-rnd-flt spt-fade-r -1.7 -3.4 1.0) + (sp-flt spt-fade-g -4.0) + (sp-rnd-flt spt-fade-a -0.16 -0.16 1.0) + (sp-rnd-flt spt-accel-y -6.826667 -13.653334 1.0) + (sp-rnd-flt spt-friction 0.9 0.02 1.0) + (sp-int-plain-rnd spt-timer 50 149 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) + ) + ) + +(defpart 4833 + :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 1)) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 24.0) + (sp-flt spt-scalevel-x (meters 0.053333335)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -8.5) + (sp-flt spt-fade-g -4.266667) + (sp-flt spt-fade-b 0.0) + (sp-flt spt-fade-a 0.0) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 4837) + ) + ) + +(defpart 4837 + :init-specs ((sp-flt spt-scalevel-x (meters 0)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -1.7066667) + (sp-flt spt-fade-g -1.7066667) + (sp-flt spt-fade-b -0.85333335) + (sp-flt spt-fade-a -0.64) + ) + ) + +(defpart 4832 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 96.0) + (sp-flt spt-scalevel-x (meters 0.33333334)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -5.1) + (sp-flt spt-fade-g -1.28) + (sp-flt spt-fade-b -2.56) + (sp-flt spt-fade-a 0.0) + (sp-int spt-timer 65) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-int spt-next-time 30) + (sp-launcher-by-id spt-next-launcher 4838) + ) + ) + +(defpart 4838 + :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 4834 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 6.0 1.0 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 0.6) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (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 70.0 20.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 0.0 40.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.053333335) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.01) 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 1.18) + (sp-flt spt-fade-g 1.8) + (sp-flt spt-fade-b 3.3) + (sp-flt spt-fade-a 1.76) + (sp-flt spt-friction 0.88) + (sp-int spt-timer 710) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4839) + (sp-rnd-flt spt-conerot-x (degrees -1440.0) (degrees 2880.0) 1.0) + ) + ) + +(defpart 4839 + :init-specs ((sp-flt spt-fade-r -2.2) + (sp-flt spt-fade-g -3.0) + (sp-flt spt-fade-b -2.1333334) + (sp-flt spt-fade-a -0.41666666) + (sp-int-plain-rnd spt-next-time 45 14 1) + (sp-launcher-by-id spt-next-launcher 4840) + ) + ) + +(defpart 4840 + :init-specs ((sp-flt spt-fade-r -0.028333334) + (sp-flt spt-fade-g 0.0) + (sp-flt spt-fade-b -0.21333334) + (sp-flt spt-fade-a -0.38833332) + ) + ) + +(defpart 4835 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #xc)) + (sp-rnd-flt spt-num 8.0 2.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.2) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 96.0) + (sp-rnd-flt spt-b 128.0 128.0 1.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.13333334) (meters 0.02) 1.0) + (sp-flt spt-fade-r -0.7111111) + (sp-flt spt-fade-g -1.0666667) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + ) + ) + +(defpartgroup group-squid-whirlwind-fire + :id 1122 + :duration (seconds 0.017) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4841 :fade-after (meters 200) :falloff-to (meters 300)) + (sp-item 4842 :fade-after (meters 200) :flags (bit6)) + (sp-item 4843 :fade-after (meters 200) :flags (bit6)) + (sp-item 4844 :fade-after (meters 200)) + ) + ) + +(defpart 4844 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2.5)) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-rnd-flt spt-omega 8.192 4.096 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.05) 1.0) + (sp-rnd-flt spt-fade-g -1.7 -3.4 1.0) + (sp-flt spt-fade-b -4.0) + (sp-rnd-flt spt-fade-a -0.16 -0.16 1.0) + (sp-rnd-flt spt-accel-y -6.826667 -2.7306666 1.0) + (sp-flt spt-friction 0.92) + (sp-int-plain-rnd spt-timer 50 149 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 45.0) (degrees 90.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +(defpart 4842 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 8) (meters 0.1) 1.0) + (sp-flt spt-rot-x 1228.8) + (sp-rnd-flt spt-rot-z (degrees -4.0) (degrees 8.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 0.0 128.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 12.0 4.0 1.0) + (sp-flt spt-omega 822476.8) + (sp-flt spt-fade-a -1.0666667) + (sp-int spt-timer 15) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 6144.0) + ) + ) + +(defpart 4843 + :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)) + (sp-rnd-flt spt-scale-x (meters 1) (meters 2.25) 1.0) + (sp-flt spt-rot-x 1228.8) + (sp-rnd-flt spt-rot-z (degrees -4.0) (degrees 8.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 0.0 255.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 20.0 10.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 6144.0) + ) + ) + +(defpart 4841 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.0 2.0 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 0.25) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.6) 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.6) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 8.0 8.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-scalevel-y (meters 0.016666668) (meters 0.033333335) 1.0) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -3.0) + (sp-flt spt-fade-b 3.0) + (sp-rnd-flt spt-accel-x 0.0 6.826667 1.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-int spt-next-time 40) + (sp-launcher-by-id spt-next-launcher 4845) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 4845 + :init-specs ((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-fade-r 0.0) + (sp-flt spt-fade-g 0.0) + (sp-flt spt-fade-b 0.0) + (sp-rnd-flt spt-fade-a -0.064 -0.064 1.0) + ) + ) + +(defpartgroup group-squid-whirlwind-explode + :id 1123 + :duration (seconds 1) + :linger-duration (seconds 1) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4846 :flags (bit6) :period 600 :length 5) + (sp-item 4847 :flags (bit6) :period 600 :length 5) + (sp-item 4848 :period 600 :length 15) + (sp-item 4849 :fade-after (meters 60) :period 600 :length 10) + (sp-item 4850 :fade-after (meters 60) :period 600 :length 10) + ) + ) + +(defpart 4850 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 16.0) + (sp-flt spt-y (meters 0.5)) + (sp-flt spt-scale-x (meters 2.5)) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-rnd-flt spt-omega 8.192 4.096 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.2) 1.0) + (sp-rnd-flt spt-fade-g -1.7 -3.4 1.0) + (sp-flt spt-fade-b -4.0) + (sp-rnd-flt spt-fade-a -0.16 -0.16 1.0) + (sp-rnd-flt spt-accel-y -6.826667 -13.653334 1.0) + (sp-rnd-flt spt-friction 0.9 0.02 1.0) + (sp-int-plain-rnd spt-timer 50 149 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) + ) + ) + +(defpart 4847 + :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 1)) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 24.0) + (sp-flt spt-scalevel-x (meters 0.053333335)) + (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 -8.5) + (sp-flt spt-fade-a 0.0) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 4851) + ) + ) + +(defpart 4851 + :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 4846 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 96.0) + (sp-flt spt-scalevel-x (meters 0.33333334)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -2.56) + (sp-flt spt-fade-g -1.28) + (sp-flt spt-fade-b -5.1) + (sp-flt spt-fade-a 0.0) + (sp-int spt-timer 65) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-int spt-next-time 30) + (sp-launcher-by-id spt-next-launcher 4852) + ) + ) + +(defpart 4852 + :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 4848 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 6.0 1.0 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 0.6) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (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 70.0 20.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 0.0 40.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.053333335) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.01) 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.1) + (sp-flt spt-fade-b 0.0) + (sp-flt spt-fade-a 1.76) + (sp-flt spt-friction 0.88) + (sp-int spt-timer 710) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4853) + (sp-rnd-flt spt-conerot-x (degrees -1440.0) (degrees 2880.0) 1.0) + ) + ) + +(defpart 4853 + :init-specs ((sp-flt spt-fade-r 0.0) + (sp-rnd-flt spt-fade-g -1.6666666 -0.8333333 1.0) + (sp-flt spt-fade-b -1.5) + (sp-flt spt-fade-a -0.41666666) + (sp-int-plain-rnd spt-next-time 45 14 1) + (sp-launcher-by-id spt-next-launcher 4854) + ) + ) + +(defpart 4854 + :init-specs ((sp-flt spt-fade-r -0.425) (sp-flt spt-fade-g -0.25) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.38833332)) + ) + +(defpart 4849 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #xc)) + (sp-rnd-flt spt-num 8.0 2.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.2) 1.0) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-flt spt-g 96.0) + (sp-flt spt-b 64.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.13333334) (meters 0.02) 1.0) + (sp-flt spt-fade-g -1.0666667) + (sp-flt spt-fade-b -0.7111111) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + ) + ) + +(defpartgroup group-squid-damage + :id 1124 + :duration (seconds 0.017) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4855 :fade-after (meters 200) :falloff-to (meters 300))) + ) + +(defpart 4855 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 2.6) 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.6) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.02) (meters 0.02) 1.0) + (sp-rnd-flt spt-scalevel-y (meters 0.02) (meters 0.02) 1.0) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -3.0) + (sp-flt spt-fade-b 3.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-int spt-next-time 40) + (sp-launcher-by-id spt-next-launcher 4856) + ) + ) + +(defpart 4856 + :init-specs ((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-fade-r 0.0) + (sp-flt spt-fade-g 0.0) + (sp-flt spt-fade-b 0.0) + (sp-rnd-flt spt-fade-a -0.10666667 -0.256 1.0) + ) + ) + +(defpart 4857 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x45 :page #xc)) + (sp-func spt-birth-func 'birth-func-set-quat) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0.25)) + (sp-flt spt-scale-y (meters 20)) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-flt spt-scalevel-x (meters 0.0016666667)) + (sp-flt spt-fade-a -3.2) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat) + ) + ) + +(defpart 4858 + :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 1)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 0.0 32.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-scalevel-x (meters -0.016666668)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 25) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 4859 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x47 :page #xc)) + (sp-flt spt-num 0.0) + (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.3) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.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-14) + ) + ) + +(defpart 4860 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x14 :page #xc)) + (sp-rnd-flt spt-num 8.0 8.0 1.0) + (sp-rnd-flt spt-z (meters 0) (meters -3) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.4) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.4) (meters 0.4) 1.0) + (sp-flt spt-r 192.0) + (sp-rnd-flt spt-g 64.0 128.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-scalevel-x (meters -0.00234375)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-g -1.2 -2.4 1.0) + (sp-rnd-flt spt-fade-a -0.53333336 -2.1333334 1.0) + (sp-rnd-flt spt-accel-y -0.68266666 -0.68266666 1.0) + (sp-int spt-timer 240) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 4861 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x81 :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 4.5)) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 0.0 128.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -3.6571429) + (sp-int spt-timer 35) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat) + ) + ) + +(defpart 4862 + :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 3) (meters 1) 1.0) + (sp-flt spt-rot-x 819.2) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 255.0) + (sp-flt spt-omega 822067.2) + (sp-flt spt-scalevel-x (meters 0.053333335)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -3.6571429) + (sp-flt spt-fade-a -7.285714) + (sp-int spt-timer 35) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 1024.0) + ) + ) + +(defpartgroup group-squid-shot-hit + :id 1125 + :duration (seconds 1) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4863 :flags (bit6) :period 600 :length 5) + (sp-item 4864 :flags (bit6) :period 600 :length 5) + (sp-item 4865 :flags (bit6) :period 600 :length 5) + (sp-item 4866 :period 600 :length 5) + ) + ) + +(defpart 4865 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x33 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2)) + (sp-flt spt-rot-x 204.8) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 0.0 128.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-scalevel-x (meters 0.075)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -1.8285714) + (sp-int spt-timer 40) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 4096.0) + ) + ) + +(defpart 4866 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 6.0 2.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.75) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 0.0 128.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 24.0 48.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.026666667) (meters 0.026666667) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.0016666667) (meters 0.006666667) 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.42666668) + (sp-flt spt-fade-g -0.21333334) + (sp-flt spt-fade-a -0.21333334) + (sp-rnd-flt spt-accel-y -0.68266666 -0.68266666 1.0) + (sp-flt spt-friction 0.9) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (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) + ) + ) + +(defpart 4864 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2)) + (sp-flt spt-rot-x 819.2) + (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-rnd-flt spt-g 128.0 128.0 1.0) + (sp-rnd-flt spt-b 0.0 64.0 1.0) + (sp-flt spt-a 48.0) + (sp-flt spt-scalevel-x (meters 0.125)) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -1.6) + (sp-flt spt-fade-b -1.6) + (sp-int spt-timer 80) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 glow) + (sp-flt spt-userdata -4096.0) + (sp-int spt-next-time 20) + (sp-launcher-by-id spt-next-launcher 616) + ) + ) + +(defpart 4863 + :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 1)) + (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-flt spt-a 96.0) + (sp-flt spt-scalevel-x (meters 0.1)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-timer 55) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 617) + ) + ) diff --git a/goal_src/jak2/levels/palace/boss/squid-setup.gc b/goal_src/jak2/levels/palace/boss/squid-setup.gc index 34234579a1..d26127f7fd 100644 --- a/goal_src/jak2/levels/palace/boss/squid-setup.gc +++ b/goal_src/jak2/levels/palace/boss/squid-setup.gc @@ -5,5 +5,2987 @@ ;; name in dgo: squid-setup ;; dgos: PALBOSS +(declare-type squid process-focusable) +(define-extern squid-talker (function symbol int :behavior squid)) + +(define-extern set-shield-color! (function vector vector)) +(define-extern set-shield-flash! (function vector vector)) + ;; DECOMP BEGINS +(deftype squid-whirlwind (process-drawable) + ((center vector :inline :offset-assert 208) + (center-vel vector :inline :offset-assert 224) + (current-nav-poly nav-poly :offset-assert 240) + (duration time-frame :offset-assert 248) + (whirl-sound sound-id :offset-assert 256) + (whirl-sound-playing symbol :offset-assert 260) + ) + :heap-base #x90 + :method-count-assert 21 + :size-assert #x108 + :flag-assert #x1500900108 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(deftype squid-collision (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(deftype squid-driver (process-drawable) + ((prefix string :offset-assert 200) + (run-free symbol :offset-assert 204) + ) + :heap-base #x50 + :method-count-assert 21 + :size-assert #xd0 + :flag-assert #x15005000d0 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(deftype squid-baron (process-drawable) + () + :heap-base #x50 + :method-count-assert 21 + :size-assert #xc8 + :flag-assert #x15005000c8 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(deftype squid-tentacle-chain (structure) + ((position vector :inline :offset-assert 0) + (velocity vector :inline :offset-assert 16) + (old-x vector :inline :offset-assert 32) + (joint-mod joint-mod :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x34 + :flag-assert #x900000034 + ) + + +(deftype squid-tentacle (process-drawable) + ((root-override collide-shape-moving :offset 128) + (chain-joints squid-tentacle-chain 11 :inline :offset-assert 208) + (gravity vector :inline :offset-assert 912) + (gravity-target vector :inline :offset-assert 928) + (stretch-vel float :offset-assert 944) + (center vector :inline :offset-assert 960) + (avoid-center symbol :offset-assert 976) + (wrap symbol :offset-assert 980) + (num-bg-collisions int32 :offset-assert 984) + (max-movement float :offset-assert 988) + ) + :heap-base #x360 + :method-count-assert 24 + :size-assert #x3e0 + :flag-assert #x18036003e0 + (:methods + (test () _type_ :state 20) + (idle () _type_ :state 21) + (joint-setup (_type_) none 22) + (squid-tentacle-method-23 (_type_) none 23) + ) + ) + + +(deftype squid-grenade-holder (structure) + ((target-position vector :inline :offset-assert 0) + (show-it symbol :offset-assert 16) + (grenade handle :offset-assert 24) + (marker handle :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + + +(deftype squid-grenade (projectile) + ((traj trajectory :inline :offset-assert 480) + (traj-dest vector :inline :offset-assert 528) + (traj-timer time-frame :offset-assert 544) + (traj-duration float :offset-assert 552) + (fly-sound sound-id :offset-assert 556) + ) + :heap-base #x1b0 + :method-count-assert 40 + :size-assert #x230 + :flag-assert #x2801b00230 + ) + + +(deftype squid (process-focusable) + ((quat quaternion :inline :offset-assert 208) + (trans vector :inline :offset-assert 224) + (residual-velocity vector :inline :offset-assert 240) + (residual-accumulator-1 float :offset-assert 256) + (residual-accumulator-2 float :offset-assert 260) + (force-onto-mesh symbol :offset-assert 264) + (mesh-forced symbol :offset-assert 268) + (hit-reaction oscillating-vector :inline :offset-assert 272) + (traj trajectory :inline :offset-assert 336) + (traj-src vector :inline :offset-assert 384) + (traj-dest vector :inline :offset-assert 400) + (traj-timer time-frame :offset-assert 416) + (traj-duration float :offset-assert 424) + (current-nav-poly nav-poly :offset-assert 428) + (tentacles handle 6 :offset-assert 432) + (baron squid-baron :offset-assert 480) + (driver (pointer squid-driver) :offset-assert 484) + (driver-blend cam-float-seeker :inline :offset-assert 488) + (blink-time time-frame :offset-assert 512) + (blink-mask int32 :offset-assert 520) + (thruster-part sparticle-launch-control :offset-assert 524) + (gun-tilt-left-jm joint-mod :offset-assert 528) + (gun-tilt-right-jm joint-mod :offset-assert 532) + (gun-tilt float :offset-assert 536) + (next-gun int8 :offset-assert 540) + (fire-aft symbol :offset-assert 544) + (gun-high-to-low symbol :offset-assert 548) + (grenade squid-grenade-holder 10 :inline :offset-assert 560) + (first-path path-control :offset-assert 1040) + (second-path path-control :offset-assert 1044) + (third-path path-control :offset-assert 1048) + (shield-timer time-frame :offset-assert 1056) + (shield-color vector :inline :offset-assert 1072) + (shield-shattered symbol :offset-assert 1088) + (shield-hit-points float :offset-assert 1092) + (hit-points int32 :offset-assert 1096) + (invincible-timer time-frame :offset-assert 1104) + (stage int32 :offset-assert 1112) + (collision-actor (pointer squid-collision) :offset-assert 1116) + (tentacle-base-jm joint-mod :offset-assert 1120) + (tentacle-base-rotation float :offset-assert 1124) + (tentacle-base-rotation-speed cam-float-seeker :inline :offset-assert 1128) + (stage-2-go-status int32 :offset-assert 1152) + (gate-intact symbol :offset-assert 1156) + (hud handle :offset-assert 1160) + (desired-rotate-to-vector-angle degrees :offset-assert 1168) + (allowed-rotate-to-vector-angle degrees :offset-assert 1172) + (stop-shooting symbol :offset-assert 1176) + (attack-id uint32 :offset-assert 1180) + (rush-sound sound-id :offset-assert 1184) + (rush-sound-playing symbol :offset-assert 1188) + (rush-end-time time-frame :offset-assert 1192) + (jet-sound sound-id :offset-assert 1200) + (jet-sound-playing symbol :offset-assert 1204) + (jet-pitch int64 :offset-assert 1208) + (negate-jet-pitch symbol :offset-assert 1216) + (jet-volume int64 :offset-assert 1224) + (can-play-squid-boost symbol :offset-assert 1232) + (tentacle-sound sound-id :offset-assert 1236) + (tentacle-sound-playing symbol :offset-assert 1240) + (spin-sound sound-id :offset-assert 1244) + (spin-sound-playing symbol :offset-assert 1248) + (reload-played symbol :offset-assert 1252) + (max-plane int32 :offset-assert 1256) + (debug-timer time-frame :offset-assert 1264) + (debug-on symbol :offset-assert 1272) + (last-damaged-talker int8 :offset-assert 1276) + (last-shield-hit-talker int8 :offset-assert 1277) + (last-no-energy-talker int8 :offset-assert 1278) + (last-shooting-talker int8 :offset-assert 1279) + (last-headbutting-talker int8 :offset-assert 1280) + (last-general-talker int8 :offset-assert 1281) + (last-start-recharging-talker int8 :offset-assert 1282) + (last-done-recharging-talker int8 :offset-assert 1283) + (suck float :offset-assert 1284) + ) + :heap-base #x490 + :method-count-assert 54 + :size-assert #x508 + :flag-assert #x3604900508 + (:methods + (test () _type_ :state 27) + (beaten () _type_ :state 28) + (wait-around-corner () _type_ :state 29) + (wait-beside-building () _type_ :state 30) + (flee () _type_ :state 31) + (pre-flee () _type_ :state 32) + (recharge () _type_ :state 33) + (fly-to-post () _type_ :state 34) + (headbut () _type_ :state 35) + (fire-whirlwind () _type_ :state 36) + (fire-grenades () _type_ :state 37) + (fire () _type_ :state 38) + (fly-to-shoot-spot () _type_ :state 39) + (idle () _type_ :state 40) + (hidden () _type_ :state 41) + (squid-method-42 (_type_ vector) vector 42) + (squid-method-43 (_type_ vector float float) none 43) + (squid-method-44 (_type_ vector vector) symbol 44) + (move-to-spot (_type_ vector symbol) none 45) + (set-traj-towards-vec (_type_ vector vector vector) none 46) + (float-sin-clamp (_type_ float) float 47) + (squid-method-48 (_type_) float 48) + (setup-part-engine (_type_ symbol) none 49) + (squid-post (_type_) none 50) + (spawn-whirlwind (_type_) (pointer squid-whirlwind) 51) + (spawn-grenade (_type_ int squid-grenade-holder float) none 52) + (squid-method-53 (_type_ int) none 53) + ) + ) + + +(defskelgroup skel-squid squid squid-lod0-jg 3 + ((squid-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + :shadow squid-shadow-mg + :origin-joint-index 3 + ) + +(defskelgroup skel-squid-shield squid squid-squid-shield-lod0-jg squid-squid-shield-idle-ja + ((squid-squid-shield-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) + +(defskelgroup skel-squid-tentacle squid squid-tentacle-lod0-jg squid-tentacle-idle-ja + ((squid-tentacle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + :shadow squid-tentacle-shadow-mg + ) + +(defskelgroup skel-squid-tentacle-shield squid squid-tentacle-shield-lod0-jg squid-tentacle-shield-idle-ja + ((squid-tentacle-shield-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) + +(defskelgroup skel-squid-driver squid squid-driver-lod0-jg 55 + ((squid-driver-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + ) + +(defskelgroup skel-squid-grenade squid squid-grenade-lod0-jg squid-grenade-idle-ja + ((squid-grenade-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :shadow squid-grenade-shadow-mg + ) + +(defskelgroup skel-squid-firepool squid squid-firepool-lod0-jg squid-firepool-idle-ja + ((squid-firepool-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +(defskelgroup skel-squid-collision squid-collision squid-collision-lod0-jg squid-collision-idle-ja + ((squid-collision-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100) + ) + +(defskelgroup skel-squid-collision-b squid-collision squid-collision-b-lod0-jg squid-collision-idle-ja + ((squid-collision-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100) + ) + +(defskelgroup skel-squid-collision-c squid-collision squid-collision-c-lod0-jg squid-collision-idle-ja + ((squid-collision-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100) + ) + +(define *squid-shield-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 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index 41) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index 41) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index 48) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index 48) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index 38) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index 38) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index 45) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index 45) + (new 'static 'joint-exploder-static-joint-params :joint-index 24 :parent-joint-index 15) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index 15) + (new 'static 'joint-exploder-static-joint-params :joint-index 26 :parent-joint-index 15) + (new 'static 'joint-exploder-static-joint-params :joint-index 27 :parent-joint-index 15) + (new 'static 'joint-exploder-static-joint-params :joint-index 28 :parent-joint-index 50) + (new 'static 'joint-exploder-static-joint-params :joint-index 29 :parent-joint-index 50) + (new 'static 'joint-exploder-static-joint-params :joint-index 30 :parent-joint-index 50) + (new 'static 'joint-exploder-static-joint-params :joint-index 31 :parent-joint-index 55) + (new 'static 'joint-exploder-static-joint-params :joint-index 32 :parent-joint-index 55) + (new 'static 'joint-exploder-static-joint-params :joint-index 33 :parent-joint-index 55) + (new 'static 'joint-exploder-static-joint-params :joint-index 34 :parent-joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 35 :parent-joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 36 :parent-joint-index 16) + (new 'static 'joint-exploder-static-joint-params :joint-index 37 :parent-joint-index 16) + (new 'static 'joint-exploder-static-joint-params :joint-index 38 :parent-joint-index 16) + (new 'static 'joint-exploder-static-joint-params :joint-index 39 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 40 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 41 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 42 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 43 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 44 :parent-joint-index 21) + (new 'static 'joint-exploder-static-joint-params :joint-index 45 :parent-joint-index 21) + (new 'static 'joint-exploder-static-joint-params :joint-index 46 :parent-joint-index 29) + (new 'static 'joint-exploder-static-joint-params :joint-index 47 :parent-joint-index 30) + (new 'static 'joint-exploder-static-joint-params :joint-index 48 :parent-joint-index 20) + (new 'static 'joint-exploder-static-joint-params :joint-index 49 :parent-joint-index 28) + (new 'static 'joint-exploder-static-joint-params :joint-index 50 :parent-joint-index 17) + (new 'static 'joint-exploder-static-joint-params :joint-index 51 :parent-joint-index 17) + (new 'static 'joint-exploder-static-joint-params :joint-index 52 :parent-joint-index 17) + (new 'static 'joint-exploder-static-joint-params :joint-index 53 :parent-joint-index 17) + (new 'static 'joint-exploder-static-joint-params :joint-index 54 :parent-joint-index 23) + (new 'static 'joint-exploder-static-joint-params :joint-index 55 :parent-joint-index 23) + (new 'static 'joint-exploder-static-joint-params :joint-index 56 :parent-joint-index 23) + (new 'static 'joint-exploder-static-joint-params :joint-index 57 :parent-joint-index 23) + (new 'static 'joint-exploder-static-joint-params :joint-index 58 :parent-joint-index 23) + (new 'static 'joint-exploder-static-joint-params :joint-index 59 :parent-joint-index 18) + (new 'static 'joint-exploder-static-joint-params :joint-index 60 :parent-joint-index 18) + (new 'static 'joint-exploder-static-joint-params :joint-index 61 :parent-joint-index 26) + (new 'static 'joint-exploder-static-joint-params :joint-index 62 :parent-joint-index 26) + (new 'static 'joint-exploder-static-joint-params :joint-index 63 :parent-joint-index 31) + (new 'static 'joint-exploder-static-joint-params :joint-index 64 :parent-joint-index 31) + (new 'static 'joint-exploder-static-joint-params :joint-index 65 :parent-joint-index 31) + (new 'static 'joint-exploder-static-joint-params :joint-index 66 :parent-joint-index 31) + ) + ) + ) + +(define *squid-tentacle-shield-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 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index 4) + (new 'static 'joint-exploder-static-joint-params :joint-index 29 :parent-joint-index 4) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 27 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index 7) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index 8) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index 9) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index 9) + (new 'static 'joint-exploder-static-joint-params :joint-index 26 :parent-joint-index 9) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index 10) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index 11) + (new 'static 'joint-exploder-static-joint-params :joint-index 24 :parent-joint-index 11) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index 12) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index 12) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index 12) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index 14) + ) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior squid-whirlwind-init-by-other squid-whirlwind ((arg0 vector) (arg1 vector) (arg2 nav-mesh) (arg3 vector)) + (let ((s2-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s2-0 (the-as uint 0)))) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s2-0 total-prims) (the-as uint 1)) + (set! (-> s2-0 root-prim) v1-2) + ) + (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) + (let ((v1-5 (-> s2-0 root-prim))) + (set! (-> s2-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s2-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> self root) s2-0) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-squid-firepool" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self center quad) (-> arg1 quad)) + (set! (-> self center-vel quad) (-> arg3 quad)) + (change-to arg2 self) + (set! (-> self current-nav-poly) + (cloest-point-on-mesh (-> self nav) (-> self root trans) (-> self root trans) (the-as nav-poly #f)) + ) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1122) self)) + (set! (-> self whirl-sound) (new-sound-id)) + (set! (-> self whirl-sound-playing) #f) + (go-virtual idle) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior squid-collision-init-by-other squid-collision ((arg0 vector) (arg1 int)) + (let ((v1-0 arg1)) + (cond + ((zero? v1-0) + (let ((s5-0 (new 'process 'collide-shape self (collide-list-enum hit-by-others)))) + (let ((v1-3 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-3 prim-core collide-as) (collide-spec special-obstacle)) + (set! (-> v1-3 prim-core action) (collide-action solid)) + (set! (-> v1-3 transform-index) 3) + (set-vector! (-> v1-3 local-sphere) 0.0 0.0 0.0 245760.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-3) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-6 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-6 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-6 prim-core collide-with)) + ) + (set! (-> self root) s5-0) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-squid-collision" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + ) + ((= v1-0 1) + (let ((s5-2 (new 'process 'collide-shape self (collide-list-enum hit-by-others)))) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-2 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec special-obstacle)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 163840.0 0.0 204800.0 245760.0) + (set! (-> s5-2 total-prims) (the-as uint 1)) + (set! (-> s5-2 root-prim) v1-15) + ) + (set! (-> s5-2 nav-radius) (* 0.75 (-> s5-2 root-prim local-sphere w))) + (let ((v1-18 (-> s5-2 root-prim))) + (set! (-> s5-2 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-2 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> self root) s5-2) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-squid-collision-b" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + ) + ((= v1-0 2) + (let ((s5-4 (new 'process 'collide-shape self (collide-list-enum hit-by-others)))) + (let ((v1-28 (new 'process 'collide-shape-prim-mesh s5-4 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec special-obstacle)) + (set! (-> v1-28 prim-core action) (collide-action solid)) + (set! (-> v1-28 transform-index) 3) + (set-vector! (-> v1-28 local-sphere) 40960.0 0.0 491520.0 327680.0) + (set! (-> s5-4 total-prims) (the-as uint 1)) + (set! (-> s5-4 root-prim) v1-28) + ) + (set! (-> s5-4 nav-radius) (* 0.75 (-> s5-4 root-prim local-sphere w))) + (let ((v1-31 (-> s5-4 root-prim))) + (set! (-> s5-4 backup-collide-as) (-> v1-31 prim-core collide-as)) + (set! (-> s5-4 backup-collide-with) (-> v1-31 prim-core collide-with)) + ) + (set! (-> self root) s5-4) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-squid-collision-c" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + ) + ) + ) + (transform-post) + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (go-virtual idle) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior squid-driver-init-by-other squid-driver ((arg0 string)) + (set! (-> self prefix) arg0) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> (new 'static 'vector) quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-squid-driver" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (set! (-> self run-free) #f) + (go-virtual idle) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior squid-baron-init-by-other squid-baron ((arg0 vector)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-baron" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> self draw light-index) (the-as uint 10)) + (let ((v1-8 (-> self node-list data))) + (set! (-> v1-8 0 param0) (the-as (function cspace transformq none) cspace<-parent-joint!)) + (set! (-> v1-8 0 param1) (the-as basic (-> self parent))) + (set! (-> v1-8 0 param2) (the-as basic 5)) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (logior! (-> self draw global-effect) (draw-control-global-effect disable-envmap)) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (go-virtual idle) + (none) + ) + +(defbehavior squid-tentacle-handler squid-tentacle ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('get-max-movement) + (-> self max-movement) + ) + (('get-num-bg-collisions) + (-> self num-bg-collisions) + ) + (('set-anim) + (let ((gp-0 (-> self draw art-group data (-> arg3 param 0))) + (v1-6 (ja-group)) + ) + (when (not (and v1-6 (= v1-6 gp-0))) + (ja-channel-push! 1 (seconds 0.1)) + (let ((s5-0 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! s5-0 (the-as art-joint-anim gp-0) num-func-identity) + (set! (-> s5-0 frame-num) 0.0) + ) + ) + ) + ) + (('get-joint-pos) + (vector<-cspace! (the-as vector (-> arg3 param 1)) (-> self node-list data (-> arg3 param 0))) + ) + (('wrap) + (set! (-> self center quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (set! (-> self wrap) #t) + (set! (-> self avoid-center) #f) + #f + ) + (('avoid-center) + (set! (-> self center quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (set! (-> self avoid-center) #t) + (set! (-> self wrap) #f) + #f + ) + (('set-gravity) + (set! (-> self gravity quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (set! v0-0 (-> self gravity-target)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> arg3 param 0)) quad)) + v0-0 + ) + (('set-gravity-slow) + (set! v0-0 (-> self gravity-target)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> arg3 param 0)) quad)) + v0-0 + ) + (('set-stretch-vel) + (set! (-> self stretch-vel) (the-as float (-> arg3 param 0))) + ) + (('set-fade) + (set! (-> self draw force-fade) (-> arg3 param 0)) + (cond + ((>= (-> self draw force-fade) (the-as uint 128)) + (setup-masks (-> self draw) 0 64) + (set! v0-0 (logclear (-> self draw status) (draw-control-status warp-cross-fade))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + ) + (else + (setup-masks (-> self draw) 64 0) + (set! v0-0 (logior (-> self draw status) (draw-control-status warp-cross-fade))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + ) + ) + v0-0 + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod joint-setup squid-tentacle ((obj squid-tentacle)) + (dotimes (s5-0 11) + (let ((s4-0 (-> obj chain-joints s5-0))) + (vector<-cspace! (-> s4-0 position) (-> s4-0 joint-mod joint)) + (set! (-> s4-0 position quad) (-> s4-0 joint-mod joint bone transform quad 0)) + (vector-reset! (-> s4-0 velocity)) + (mode-set! (-> s4-0 joint-mod) (joint-mod-mode joint-set-world)) + ) + ) + (none) + ) + +(defmethod squid-tentacle-method-23 squid-tentacle ((obj squid-tentacle)) + (local-vars + (v1-134 float) + (v1-162 float) + (f0-51 float) + (sv-1456 squid-tentacle-chain) + (sv-1472 vector) + (sv-1488 vector) + (sv-1504 vector) + (sv-1520 vector) + (sv-1536 (function vector float vector)) + (sv-1552 vector) + (sv-1568 vector) + (sv-1584 vector) + (sv-1600 vector) + (sv-1616 vector) + (sv-1632 vector) + (sv-1648 (function vector float vector)) + (sv-1664 vector) + (sv-1680 vector) + (sv-1696 vector) + (sv-1712 vector) + (sv-1728 vector) + (sv-1744 collide-query) + (sv-1760 int) + (sv-1776 vector) + (sv-1792 vector) + (sv-1808 vector) + (sv-1824 (inline-array vector)) + (sv-1840 (inline-array vector)) + (sv-1856 (inline-array vector)) + (sv-1872 vector) + (sv-1888 (inline-array vector)) + (sv-1904 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) + ) + (init-vf0-vector) + (vector-seek-3d-smooth! (-> obj gravity) (-> obj gravity-target) 0.05 0.1) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (let ((s4-0 (new 'stack-no-clear 'bounding-box))) + (let ((s3-0 (new 'stack-no-clear 'sphere))) + (vector<-cspace! s3-0 (-> obj node-list data 7)) + (set! (-> s3-0 r) 61440.0) + (set-from-sphere! s4-0 s3-0) + ) + (set! (-> s5-0 collide-with) (collide-spec player-list special-obstacle)) + (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)) + (set! (-> s5-0 action-mask) (collide-action solid)) + (mem-copy! (the-as pointer (-> s5-0 bbox)) (the-as pointer s4-0) 32) + ) + (fill-using-bounding-box *collide-cache* s5-0) + ) + (let ((s5-1 (new 'stack-no-clear 'matrix)) + (s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 3))) + (s3-1 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj node-list data 3 bone transform vector 2) 1.0) + ) + (s2-0 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj node-list data 3 bone transform vector 1) 1.0) + ) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> obj num-bg-collisions) 0) + (set! (-> obj max-movement) 0.0) + (dotimes (s0-0 11) + (set! sv-1456 (-> obj chain-joints s0-0)) + (set! sv-1904 (new 'stack-no-clear 'vector)) + (let ((v1-19 (-> sv-1456 position quad))) + (set! (-> sv-1904 quad) v1-19) + ) + (cond + ((-> obj wrap) + (set! (-> sv-1904 y) (+ -409.6 (-> sv-1904 y))) + (set! sv-1472 (new 'stack-no-clear 'vector)) + (let ((v1-25 sv-1904) + (a0-10 (-> obj center)) + ) + (.lvf vf4 (&-> v1-25 quad)) + (.lvf vf5 (&-> a0-10 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-1472 quad) vf6) + (set! (-> sv-1472 y) 0.0) + (vector-normalize! sv-1472 409.6) + (+! (-> sv-1904 x) (-> sv-1472 z)) + (set! (-> sv-1904 z) (- (-> sv-1904 z) (-> sv-1472 x))) + ) + (else + (set! sv-1520 sv-1904) + (set! sv-1488 sv-1904) + (set! sv-1504 (-> obj gravity)) + (let ((f0-14 (* 4096.0 (-> pp clock time-adjust-ratio) (fmax 0.2 (lerp-scale 0.38 0.18 (the float s0-0) 0.0 5.0)))) + ) + (.lvf vf2 (&-> sv-1504 quad)) + (.lvf vf1 (&-> sv-1488 quad)) + (let ((v1-43 f0-14)) + (.mov vf3 v1-43) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> sv-1520 quad) vf4) + (when (-> obj avoid-center) + (vector-! s1-0 (-> sv-1456 position) (-> obj center)) + (set! sv-1536 vector-normalize!) + (set! sv-1552 s1-0) + (let ((a1-13 (* 4096.0 (-> pp clock time-adjust-ratio) (fmax 0.0 (lerp-scale 0.4 0.6 (the float s0-0) 0.0 8.0))))) + (sv-1536 sv-1552 a1-13) + ) + (vector+! sv-1904 sv-1904 s1-0) + ) + ) + ) + (when (< s0-0 10) + (set! sv-1600 sv-1904) + (set! sv-1568 sv-1904) + (set! sv-1584 (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* (+ s0-0 1) 64)))) + (let ((f0-24 (fmin 0.9 (lerp-scale 0.2 1.0 (the float s0-0) 0.0 4.0)))) + (.lvf vf2 (&-> sv-1584 quad)) + (.lvf vf1 (&-> sv-1568 quad)) + (let ((v1-60 f0-24)) + (.mov vf3 v1-60) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> sv-1600 quad) vf4) + ) + (vector-! s1-0 sv-1904 s4-1) + (if (= s0-0 10) + (vector-normalize! s1-0 7102.464) + (vector-normalize! s1-0 4096.0) + ) + (vector+! sv-1904 s1-0 s4-1) + (let ((v0-15 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 3)))) + (set! sv-1616 (new 'stack-no-clear 'vector)) + (set! (-> v0-15 y) (+ 31744.0 (-> v0-15 y))) + (vector-! sv-1616 sv-1904 v0-15) + ) + (let ((f0-27 (vector-normalize-ret-len! sv-1616 1.0))) + (when (< f0-27 32768.0) + (vector+float*! sv-1904 sv-1904 sv-1616 (- 32768.0 f0-27)) + (vector-normalize-copy! + sv-1616 + (-> obj node-list data 3 bone transform vector 2) + (* 2048.0 (-> pp clock time-adjust-ratio)) + ) + (let ((v1-77 sv-1904)) + (let ((a0-31 sv-1904)) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> a0-31 quad)) + ) + (.lvf vf5 (&-> sv-1616 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-77 quad) vf6) + ) + ) + ) + (set! sv-1632 (new 'stack-no-clear 'vector)) + (let ((v1-79 sv-1904) + (a0-33 (-> obj center)) + ) + (.lvf vf4 (&-> v1-79 quad)) + (.lvf vf5 (&-> a0-33 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-1632 quad) vf6) + (set! (-> sv-1632 y) 0.0) + (let ((f0-32 (vector-normalize-ret-len! sv-1632 1.0))) + (when (< f0-32 4096.0) + (let ((v1-84 sv-1904) + (a0-35 sv-1904) + (f0-33 (- 4096.0 f0-32)) + ) + (vector+float*! v1-84 a0-35 sv-1632 f0-33) + ) + ) + ) + (set! sv-1728 (new 'stack-no-clear 'vector)) + (let ((v1-87 sv-1904) + (a0-36 s4-1) + ) + (.lvf vf4 (&-> v1-87 quad)) + (.lvf vf5 (&-> a0-36 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-1728 quad) vf6) + (let ((f30-3 (vector-normalize-ret-len! sv-1728 1.0)) + (f28-2 (vector-dot sv-1728 s2-0)) + (f26-0 (lerp-scale 5461.3335 10922.667 (the float s0-0) 0.0 8.0)) + ) + (when (< f28-2 (cos f26-0)) + (vector--float*! sv-1728 sv-1728 s2-0 f28-2) + (set! sv-1648 vector-normalize!) + (set! sv-1664 sv-1728) + (let ((a1-34 (sin f26-0))) + (sv-1648 sv-1664 a1-34) + ) + (set! sv-1712 sv-1728) + (set! sv-1680 sv-1728) + (set! sv-1696 s2-0) + (let ((f0-38 (cos f26-0))) + (.lvf vf2 (&-> sv-1696 quad)) + (.lvf vf1 (&-> sv-1680 quad)) + (let ((v1-98 f0-38)) + (.mov vf3 v1-98) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> sv-1712 quad) vf4) + (vector+float*! sv-1904 s4-1 sv-1728 f30-3) + ) + ) + (set! sv-1744 (new 'stack-no-clear 'collide-query)) + (set! sv-1776 (new 'stack-no-clear 'vector)) + (let ((v1-104 sv-1904) + (a0-47 (-> sv-1456 position)) + ) + (.lvf vf4 (&-> v1-104 quad)) + (.lvf vf5 (&-> a0-47 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-1776 quad) vf6) + (set! sv-1760 0) + (set! (-> sv-1904 quad) (-> sv-1456 position quad)) + (until (or (< 6 sv-1760) + (begin + (.lvf vf1 (&-> sv-1776 quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-134 vf1) + (let ((f0-46 v1-134) + (f1-16 409.6) + ) + (< f0-46 (* f1-16 f1-16)) + ) + ) + ) + (set! sv-1760 (+ sv-1760 1)) + (set! (-> sv-1744 start-pos quad) (-> sv-1904 quad)) + (set! (-> sv-1744 move-dist quad) (-> sv-1776 quad)) + (let ((v1-114 sv-1744)) + (set! (-> v1-114 radius) 4096.0) + (set! (-> v1-114 collide-with) (collide-spec player-list special-obstacle)) + (set! (-> v1-114 ignore-process0) obj) + (set! (-> v1-114 ignore-process1) #f) + (set! (-> v1-114 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1) + ) + (set! (-> v1-114 action-mask) (collide-action solid)) + ) + (set! (-> sv-1744 num-spheres) (the-as uint #f)) + (let ((f0-40 (probe-using-line-sphere *collide-cache* sv-1744))) + (cond + ((>= f0-40 0.0) + (let ((f0-41 (fmin 1.0 f0-40))) + (vector+float*! sv-1904 sv-1904 sv-1776 f0-41) + (vector-float*! sv-1776 sv-1776 (- 1.0 f0-41)) + ) + (let ((f0-44 (vector-dot sv-1776 (-> sv-1744 best-other-tri normal)))) + (vector--float*! sv-1776 sv-1776 (-> sv-1744 best-other-tri normal) (* 1.2 f0-44)) + ) + ) + (else + (let ((v1-128 sv-1904)) + (let ((a0-64 sv-1904)) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> a0-64 quad)) + ) + (.lvf vf5 (&-> sv-1776 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-128 quad) vf6) + ) + (goto cfg-27) + ) + ) + ) + ) + (label cfg-27) + (if (< 1 sv-1760) + (+! (-> obj num-bg-collisions) 1) + ) + (set! sv-1808 (new 'stack-no-clear 'vector)) + (let ((v1-143 s4-1) + (a0-69 sv-1904) + ) + (.lvf vf4 (&-> v1-143 quad)) + (.lvf vf5 (&-> a0-69 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-1808 quad) vf6) + (vector-normalize-ret-len! sv-1808 1.0) + (set! sv-1792 (new 'stack-no-clear 'vector)) + (let ((v1-146 sv-1904) + (a0-72 (-> sv-1456 position)) + ) + (.lvf vf4 (&-> v1-146 quad)) + (.lvf vf5 (&-> a0-72 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-1792 quad) vf6) + (let ((f30-4 (vector-dot sv-1808 sv-1792))) + (vector--float*! sv-1792 sv-1792 sv-1808 f30-4) + (cond + ((< f30-4 0.0) + (set! f0-51 (* 0.75 f30-4)) + (vector-float*! sv-1792 sv-1792 0.85) + ) + (else + (set! f0-51 (* 0.8 f30-4)) + (vector-float*! sv-1792 sv-1792 (-> obj stretch-vel)) + ) + ) + ) + (let ((v1-157 (-> sv-1456 velocity))) + (.lvf vf2 (&-> sv-1808 quad)) + (.lvf vf1 (&-> sv-1792 quad)) + (let ((a0-79 f0-51)) + (.mov vf3 a0-79) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-157 quad) vf4) + ) + (vector+! sv-1904 (-> sv-1456 position) (-> sv-1456 velocity)) + (let ((a2-14 (vector-! (new 'stack-no-clear 'vector) s4-1 sv-1904))) + (.lvf vf1 (&-> a2-14 quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-162 vf1) + (let* ((f0-53 v1-162) + (f1-21 (if (= s0-0 10) + 9830.4 + 6144.0 + ) + ) + (f2-0 f1-21) + ) + (if (< (* f2-0 f2-0) f0-53) + (vector--float*! sv-1904 s4-1 a2-14 (/ f1-21 (sqrtf f0-53))) + ) + ) + ) + (set! (-> obj max-movement) + (fmax (vector-vector-distance (-> sv-1456 position) sv-1904) (-> obj max-movement)) + ) + (set! (-> sv-1456 position quad) (-> sv-1904 quad)) + (if (-> sv-1456 joint-mod) + (set! (-> sv-1456 joint-mod trans quad) (-> sv-1904 quad)) + ) + (when (< s0-0 11) + (vector-! (-> s5-1 vector 1) sv-1904 s4-1) + (vector-normalize! (-> s5-1 vector 1) 1.0) + (vector-cross! (the-as vector (-> s5-1 vector)) (-> s5-1 vector 1) s3-1) + (vector-normalize! (the-as vector (-> s5-1 vector)) 1.0) + (set! sv-1872 (new 'stack-no-clear 'vector)) + (let ((v1-182 (-> sv-1456 old-x)) + (a0-93 (-> s5-1 vector)) + ) + (.lvf vf1 (&-> v1-182 quad)) + (.lvf vf2 (&-> a0-93 0 quad)) + ) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> sv-1872 quad) vf3) + (vector-flatten! sv-1872 (-> sv-1456 old-x) (-> s5-1 vector 1)) + (vector-normalize! sv-1872 1.0) + (cond + ((< (vector-dot (the-as vector (-> s5-1 vector)) sv-1872) (cos 3640.889)) + (vector-cross! sv-1872 sv-1872 (the-as vector (-> s5-1 vector))) + (vector-cross! sv-1872 (the-as vector (-> s5-1 vector)) sv-1872) + (vector-normalize! sv-1872 1.0) + (set! sv-1840 (-> s5-1 vector)) + (set! sv-1824 (-> s5-1 vector)) + (let ((f0-60 (cos 3640.889))) + (.lvf vf1 (&-> sv-1824 0 quad)) + (let ((v1-192 f0-60)) + (.mov vf2 v1-192) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> sv-1840 0 quad) vf1) + (set! sv-1888 (-> s5-1 vector)) + (set! sv-1856 (-> s5-1 vector)) + (let ((f0-61 (sin 3640.889))) + (.lvf vf2 (&-> sv-1872 quad)) + (.lvf vf1 (&-> sv-1856 0 quad)) + (let ((v1-198 f0-61)) + (.mov vf3 v1-198) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> sv-1888 0 quad) vf4) + (set! (-> sv-1456 old-x quad) (-> s5-1 vector 0 quad)) + ) + (else + (set! (-> s5-1 vector 0 quad) (-> sv-1872 quad)) + (set! (-> sv-1456 old-x quad) (-> s5-1 vector 0 quad)) + ) + ) + (vector-cross! (-> s5-1 vector 2) (the-as vector (-> s5-1 vector)) (-> s5-1 vector 1)) + (matrix->quaternion (-> sv-1456 joint-mod quat) s5-1) + (set! (-> s2-0 quad) (-> s5-1 vector 1 quad)) + (set! (-> s3-1 quad) (-> s5-1 vector 2 quad)) + 0 + ) + (set! (-> s4-1 quad) (-> sv-1904 quad)) + 0 + ) + ) + (set! (-> obj avoid-center) #f) + (set! (-> obj wrap) #f) + 0 + (none) + ) + ) + ) + +;; WARN: Return type mismatch process-drawable vs squid-tentacle. +(defmethod relocate squid-tentacle ((obj squid-tentacle) (arg0 int)) + (dotimes (v1-0 11) + (if (nonzero? (-> obj chain-joints v1-0 joint-mod)) + (&+! (-> obj chain-joints v1-0 joint-mod) arg0) + ) + ) + (the-as squid-tentacle ((method-of-type process-drawable relocate) obj arg0)) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior squid-tentacle-init-by-other squid-tentacle ((arg0 vector) (arg1 int)) + (let ((s4-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) + (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + dark-punch + dark-giant + ) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 10) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 0.0 0.0 8192.0) + ) + (set! (-> s4-0 nav-radius) 8192.0) + (let ((v1-12 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> self root-override) (the-as collide-shape-moving s4-0)) + ) + (set! (-> self root-override trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-squid-tentacle" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> self draw light-index) (the-as uint 10)) + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((a0-16 12) + (v1-22 36) + ) + (let ((a1-7 arg1)) + (cond + ((zero? a1-7) + (set! a0-16 7) + (set! v1-22 14) + ) + ((= a1-7 1) + (set! a0-16 8) + (set! v1-22 18) + ) + ((= a1-7 2) + (set! a0-16 9) + (set! v1-22 36) + ) + ((= a1-7 3) + (set! a0-16 10) + (set! v1-22 14) + ) + ((= a1-7 4) + (set! a0-16 11) + (set! v1-22 18) + ) + ) + ) + (let ((a1-15 (-> self node-list data))) + (set! (-> a1-15 0 param0) (the-as (function cspace transformq none) cspace<-parent-joint!)) + (set! (-> a1-15 0 param1) (the-as basic (-> self parent))) + (set! (-> a1-15 0 param2) (the-as basic a0-16)) + ) + (setup-masks (-> self draw) 0 (lognot v1-22)) + ) + (ja :num-func num-func-identity :frame-num (the float (* 10 arg1))) + (when (-> self draw shadow) + (set! (-> self draw shadow-ctrl) + (new 'process 'shadow-control -122880.0 4096.0 4096000.0 (shadow-flags) 819200.0) + ) + (let ((v1-34 (-> self draw shadow-ctrl))) + (logclear! (-> v1-34 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + (dotimes (gp-1 11) + (set! (-> self chain-joints gp-1 joint-mod) + (new 'process 'joint-mod (joint-mod-mode flex-blend) self (+ gp-1 4)) + ) + (set! (-> self chain-joints gp-1 joint-mod track-mode) (track-mode no-scale)) + ) + (set-vector! (-> self gravity) 0.0 -1.0 0.0 1.0) + (set! (-> self gravity-target quad) (-> self gravity quad)) + (vector-reset! (-> self center)) + (set! (-> self avoid-center) #f) + (set! (-> self wrap) #f) + (set! (-> self num-bg-collisions) 0) + (set! (-> self max-movement) 0.0) + (set! (-> self stretch-vel) 0.7) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (go-virtual idle) + (none) + ) + +;; WARN: Return type mismatch vector vs none. +(defbehavior squid-take-hit squid ((arg0 touching-shapes-entry) (arg1 attack-info) (arg2 symbol)) + (when #t + (let ((gp-0 (new 'stack-no-clear 'vector))) + (when arg0 + (let ((a1-1 (-> arg0 head))) + (get-intersect-point gp-0 a1-1 (-> self root-override) arg0) + ) + ) + (when arg2 + (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when s4-1 + (let ((t9-2 (method-of-type part-tracker activate))) + (t9-2 (the-as part-tracker s4-1) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-3 run-function-in-process) + (a0-4 s4-1) + (a1-4 part-tracker-init) + (a2-6 (-> *part-group-id-table* 1121)) + (a3-2 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> gp-0 quad)) + ((the-as (function object object object object object object object object none) t9-3) + a0-4 + a1-4 + a2-6 + a3-2 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> s4-1 ppointer) + ) + ) + (sound-play "hit-squid") + ) + (if (logtest? (attack-info-mask attacker-velocity) (-> arg1 mask)) + (set! (-> gp-0 quad) (-> arg1 attacker-velocity quad)) + (vector-! gp-0 (-> self root-override trans) gp-0) + ) + (vector-normalize-copy! (-> self hit-reaction vel) gp-0 1.0) + ) + ) + (none) + ) + +;; WARN: Return type mismatch vector vs none. +(defbehavior squid-increment-shield squid ((arg0 float)) + (set! (-> self shield-hit-points) (fmin 1.0 (fmax 0.0 (+ (-> self shield-hit-points) arg0)))) + (set! (-> self shield-timer) (+ (-> self clock frame-counter) (seconds -0.125))) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (cond + ((< (-> self shield-hit-points) 0.5) + (set! (-> gp-0 x) 1.0) + (set! (-> gp-0 y) (lerp-scale 1.0 0.0 (-> self shield-hit-points) 0.5 0.0)) + ) + (else + (set! (-> gp-0 x) (lerp-scale 0.0 1.0 (-> self shield-hit-points) 1.0 0.5)) + (set! (-> gp-0 y) 1.0) + ) + ) + (set! (-> gp-0 z) 0.0) + (set! (-> gp-0 w) 1.0) + (set-shield-color! gp-0) + (set-shield-flash! gp-0) + (set! (-> self shield-color quad) (-> gp-0 quad)) + ) + (none) + ) + +;; WARN: Return type mismatch (pointer process) vs none. +(defbehavior squid-check-hit-points squid () + (local-vars + (sv-48 symbol) + (sv-64 symbol) + (sv-80 vector) + (sv-96 matrix) + (sv-112 symbol) + (sv-128 symbol) + (sv-144 vector) + (sv-160 matrix) + ) + (when (zero? (-> self hit-points)) + (set! (-> self shield-hit-points) 0.0) + (cond + ((zero? (-> self stage)) + (setup-masks (-> self draw) 320 160) + (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-0 + (let ((t9-2 (method-of-type part-tracker activate))) + (t9-2 (the-as part-tracker gp-0) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((s5-0 run-function-in-process) + (s4-0 gp-0) + (s3-0 part-tracker-init) + (s2-0 (-> *part-group-id-table* 1121)) + (s1-0 0) + (s0-0 #f) + ) + (set! sv-48 (the-as symbol #f)) + (set! sv-64 (the-as symbol #f)) + (set! sv-96 *launch-matrix*) + (set! sv-80 (-> sv-96 trans)) + (let ((v1-13 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 36)) quad))) + (set! (-> sv-80 quad) v1-13) + ) + ((the-as (function object object object object object object object object none) s5-0) + s4-0 + s3-0 + s2-0 + s1-0 + s0-0 + sv-48 + sv-64 + sv-96 + ) + ) + (-> gp-0 ppointer) + ) + ) + ) + ((= (-> self stage) 1) + (setup-masks (-> self draw) 5120 2590) + (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-1 + (let ((t9-7 (method-of-type part-tracker activate))) + (t9-7 (the-as part-tracker gp-1) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((s5-1 run-function-in-process) + (s4-1 gp-1) + (s3-1 part-tracker-init) + (s2-1 (-> *part-group-id-table* 1121)) + (s1-1 0) + (s0-1 #f) + ) + (set! sv-112 (the-as symbol #f)) + (set! sv-128 (the-as symbol #f)) + (set! sv-160 *launch-matrix*) + (set! sv-144 (-> sv-160 trans)) + (let ((v1-25 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 50)) quad))) + (set! (-> sv-144 quad) v1-25) + ) + ((the-as (function object object object object object object object object none) s5-1) + s4-1 + s3-1 + s2-1 + s1-1 + s0-1 + sv-112 + sv-128 + sv-160 + ) + ) + (-> gp-1 ppointer) + ) + ) + ) + ) + ) + (none) + ) + +(defbehavior squid-handler squid ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (sv-16 res-tag)) + (case arg2 + (('plane) + (set! (-> self max-plane) (max (-> self max-plane) (the-as int (-> arg3 param 0)))) + (let ((s5-1 0)) + (case (-> arg3 param 0) + ((8) + (set! s5-1 3) + ) + ((24) + (set! s5-1 4) + ) + ) + (when (nonzero? s5-1) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-9 (res-lump-data (-> self entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when (and v1-9 (< (the-as uint s5-1) (-> sv-16 elt-count))) + (let ((gp-1 (-> v1-9 s5-1))) + (dotimes (s5-2 (-> gp-1 length)) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-15 (-> gp-1 data s5-2 actor)) + ) + (t9-1 + (if v1-15 + (-> v1-15 extra process) + ) + a1-2 + ) + ) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (('skip) + (set! (-> self shield-hit-points) 0.0) + (go-virtual pre-flee) + ) + (('track) + #t + ) + (('attack) + (let ((s4-0 (the-as object (-> arg3 param 1)))) + (cond + ((and (-> self next-state) (let ((v1-25 (-> self next-state name))) + (or (= v1-25 'flee) + (= v1-25 'pre-flee) + (= v1-25 'hidden) + (= v1-25 'test) + (= v1-25 'beaten) + (= v1-25 'wait-around-corner) + (= v1-25 'wait-beside-building) + ) + ) + ) + ) + ((and (logtest? (attack-info-mask penetrate-using) (-> (the-as attack-info s4-0) mask)) + (logtest? (penetrate dark-bomb) (-> (the-as attack-info s4-0) penetrate-using)) + (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + ) + (set! (-> self hit-points) 0) + (squid-check-hit-points) + (go-virtual pre-flee) + ) + ((let ((v1-41 (ja-group))) + (or (and (and v1-41 (= v1-41 (-> self draw art-group data 4))) (< 16.0 (ja-aframe-num 0))) + (let ((v1-49 (ja-group))) + (or (and v1-49 (= v1-49 (-> self draw art-group data 5))) + (let ((v1-54 (ja-group))) + (and (and v1-54 (= v1-54 (-> self draw art-group data 6))) (< (ja-aframe-num 0) 105.0)) + ) + ) + ) + ) + ) + (sound-play "hit-squid-ricco") + ) + ((= arg0 *target*) + (when (!= (-> (the-as attack-info s4-0) id) (-> self attack-id)) + (set! (-> self attack-id) (-> (the-as attack-info s4-0) id)) + (set! (-> self stop-shooting) #t) + (squid-take-hit (the-as touching-shapes-entry (-> arg3 param 0)) (the-as attack-info (-> arg3 param 1)) #f) + ) + ) + ((>= (- (-> self clock frame-counter) (-> self invincible-timer)) (seconds 3)) + (cond + ((and (= (-> self shield-hit-points) 0.0) + (not (and (-> self next-state) (= (-> self next-state name) 'recharge))) + ) + (set! (-> self hit-points) (max 0 (+ (-> self hit-points) -2))) + (squid-talker 'damaged) + ) + (else + (set! (-> self hit-points) (max 0 (+ (-> self hit-points) -1))) + (squid-talker 'shield-hit) + ) + ) + (squid-take-hit (the-as touching-shapes-entry (-> arg3 param 0)) (the-as attack-info (-> arg3 param 1)) #t) + (set! (-> self invincible-timer) (-> self clock frame-counter)) + (squid-check-hit-points) + ) + ((or (!= (-> self shield-hit-points) 0.0) (and (-> self next-state) (= (-> self next-state name) 'recharge))) + (squid-talker 'shield-hit) + ) + ) + ) + #t + ) + (('touched) + (-> arg3 param 0) + (when #t + (let ((a0-66 (if (type? arg0 process-focusable) + arg0 + ) + ) + ) + (when a0-66 + (let ((a1-13 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-13 from) (process->ppointer self)) + (set! (-> a1-13 num-params) 2) + (set! (-> a1-13 message) 'attack) + (set! (-> a1-13 param 0) (-> arg3 param 0)) + (let ((v1-101 (new 'static 'attack-info :mask (attack-info-mask shove-back shove-up id)))) + (let* ((a2-6 *game-info*) + (a3-4 (+ (-> a2-6 attack-id) 1)) + ) + (set! (-> a2-6 attack-id) a3-4) + (set! (-> v1-101 id) a3-4) + ) + (set! (-> v1-101 shove-back) 24576.0) + (set! (-> v1-101 shove-up) 12288.0) + (set! (-> a1-13 param 1) (the-as uint v1-101)) + ) + (if (send-event-function a0-66 a1-13) + #f + ) + ) + ) + ) + ) + ) + ) + ) + +(defmethod deactivate squid ((obj squid)) + (if (nonzero? (-> obj thruster-part)) + (kill-and-free-particles (-> obj thruster-part)) + ) + (if (-> obj rush-sound-playing) + (sound-stop (-> obj rush-sound)) + ) + (if (-> obj jet-sound-playing) + (sound-stop (-> obj jet-sound)) + ) + (if (-> obj spin-sound-playing) + (sound-stop (-> obj spin-sound)) + ) + (if (-> obj tentacle-sound-playing) + (sound-stop (-> obj tentacle-sound)) + ) + ((method-of-type process-drawable deactivate) obj) + (none) + ) + +;; WARN: Return type mismatch process-drawable vs squid. +(defmethod relocate squid ((obj squid) (arg0 int)) + (if (nonzero? (-> obj thruster-part)) + (&+! (-> obj thruster-part) arg0) + ) + (if (nonzero? (-> obj first-path)) + (&+! (-> obj first-path) arg0) + ) + (if (nonzero? (-> obj second-path)) + (&+! (-> obj second-path) arg0) + ) + (if (nonzero? (-> obj third-path)) + (&+! (-> obj third-path) arg0) + ) + (if (nonzero? (-> obj gun-tilt-left-jm)) + (&+! (-> obj gun-tilt-left-jm) arg0) + ) + (if (nonzero? (-> obj gun-tilt-right-jm)) + (&+! (-> obj gun-tilt-right-jm) arg0) + ) + (if (nonzero? (-> obj tentacle-base-jm)) + (&+! (-> obj tentacle-base-jm) arg0) + ) + (the-as squid ((method-of-type process-drawable relocate) obj arg0)) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! squid ((obj squid) (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)))) + (set! (-> s4-0 penetrated-by) + (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + dark-punch + dark-giant + ) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 23) 0))) + (set! (-> s4-0 total-prims) (the-as uint 24)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action deadly)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 -4096.0 0.0 32768.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 -12288.0 0.0 12288.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-sphere s4-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 bot player-list)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) 0.0 -24576.0 0.0 12288.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 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 bot player-list)) + (set! (-> v1-14 prim-core action) (collide-action deadly)) + (set! (-> v1-14 transform-index) 6) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 12288.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-16 prim-core action) (collide-action deadly)) + (set! (-> v1-16 transform-index) 15) + (set-vector! (-> v1-16 local-sphere) 0.0 7168.0 0.0 10240.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-18 prim-core action) (collide-action deadly)) + (set! (-> v1-18 transform-index) 13) + (set-vector! (-> v1-18 local-sphere) 0.0 8192.0 6144.0 12288.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (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! (-> v1-20 transform-index) 23) + (set-vector! (-> v1-20 local-sphere) 0.0 1024.0 -2048.0 8192.0) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-22 prim-core action) (collide-action deadly)) + (set! (-> v1-22 transform-index) 22) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 5) (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-24 prim-core action) (collide-action deadly)) + (set! (-> v1-24 transform-index) 21) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 6) (the-as uint 0)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-26 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-26 prim-core action) (collide-action deadly)) + (set! (-> v1-26 transform-index) 20) + (set-vector! (-> v1-26 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-28 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 7) (the-as uint 0)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-28 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-28 prim-core action) (collide-action deadly)) + (set! (-> v1-28 transform-index) 19) + (set-vector! (-> v1-28 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-30 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 8) (the-as uint 0)))) + (set! (-> v1-30 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-30 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-30 prim-core action) (collide-action deadly)) + (set! (-> v1-30 transform-index) 18) + (set-vector! (-> v1-30 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-32 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 9) (the-as uint 0)))) + (set! (-> v1-32 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-32 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-32 prim-core action) (collide-action deadly)) + (set! (-> v1-32 transform-index) 31) + (set-vector! (-> v1-32 local-sphere) 0.0 1024.0 -2048.0 8192.0) + ) + (let ((v1-34 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 10) (the-as uint 0)))) + (set! (-> v1-34 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-34 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-34 prim-core action) (collide-action deadly)) + (set! (-> v1-34 transform-index) 30) + (set-vector! (-> v1-34 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-36 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 11) (the-as uint 0)))) + (set! (-> v1-36 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-36 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-36 prim-core action) (collide-action deadly)) + (set! (-> v1-36 transform-index) 29) + (set-vector! (-> v1-36 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-38 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 12) (the-as uint 0)))) + (set! (-> v1-38 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-38 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-38 prim-core action) (collide-action deadly)) + (set! (-> v1-38 transform-index) 28) + (set-vector! (-> v1-38 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-40 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 13) (the-as uint 0)))) + (set! (-> v1-40 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-40 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-40 prim-core action) (collide-action deadly)) + (set! (-> v1-40 transform-index) 27) + (set-vector! (-> v1-40 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-42 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 14) (the-as uint 0)))) + (set! (-> v1-42 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-42 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-42 prim-core action) (collide-action deadly)) + (set! (-> v1-42 transform-index) 26) + (set-vector! (-> v1-42 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-44 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 15) (the-as uint 0)))) + (set! (-> v1-44 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-44 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-44 prim-core action) (collide-action deadly)) + (set! (-> v1-44 transform-index) 17) + (set-vector! (-> v1-44 local-sphere) 0.0 0.0 4096.0 10240.0) + ) + (let ((v1-46 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 16) (the-as uint 0)))) + (set! (-> v1-46 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-46 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-46 prim-core action) (collide-action deadly)) + (set! (-> v1-46 transform-index) 5) + (set-vector! (-> v1-46 local-sphere) 0.0 0.0 -2048.0 22528.0) + ) + (let ((v1-48 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 17) (the-as uint 0)))) + (set! (-> v1-48 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-48 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-48 prim-core action) (collide-action deadly)) + (set! (-> v1-48 transform-index) 36) + (set-vector! (-> v1-48 local-sphere) 0.0 -3686.4 0.0 11264.0) + ) + (let ((v1-50 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 18) (the-as uint 0)))) + (set! (-> v1-50 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-50 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-50 prim-core action) (collide-action deadly)) + (set! (-> v1-50 transform-index) 43) + (set-vector! (-> v1-50 local-sphere) 0.0 3686.4 0.0 11264.0) + ) + (let ((v1-52 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 19) (the-as uint 0)))) + (set! (-> v1-52 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-52 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-52 prim-core action) (collide-action deadly)) + (set! (-> v1-52 transform-index) 50) + (set-vector! (-> v1-52 local-sphere) 0.0 0.0 -3072.0 13312.0) + ) + (let ((v1-54 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 20) (the-as uint 0)))) + (set! (-> v1-54 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-54 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-54 prim-core action) (collide-action deadly)) + (set! (-> v1-54 transform-index) 55) + (set-vector! (-> v1-54 local-sphere) 0.0 0.0 -3072.0 13312.0) + ) + (set! (-> s4-0 nav-radius) 8192.0) + (let ((v1-56 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-56 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-56 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-squid" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj draw light-index) (the-as uint 10)) + (logior! (-> obj skel status) (joint-control-status sync-math)) + (set! (-> obj mask) (logior (process-mask enemy) (-> obj mask))) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj trans quad) (-> obj root-override trans quad)) + (set! (-> obj force-onto-mesh) #t) + (set! (-> obj mesh-forced) #f) + (quaternion-copy! (-> obj quat) (-> obj root-override quat)) + (dotimes (s5-2 6) + (set! (-> obj tentacles s5-2) + (ppointer->handle (process-spawn squid-tentacle (-> obj root-override trans) s5-2 :to obj)) + ) + ) + (set! (-> obj baron) (the-as squid-baron (process-spawn squid-baron (-> obj root-override trans) :to obj))) + (set! (-> obj driver) (process-spawn squid-driver "driver-" :to obj)) + (init (-> obj driver-blend) 0.0 0.0025 0.025 0.5) + (set-params! (-> obj hit-reaction) (the-as vector #f) 0.2 1.0 0.5) + (let ((s5-6 (vector+! + (new 'stack-no-clear 'vector) + (-> obj root-override trans) + (new 'static 'vector :x -20480.0 :y 23388.16 :z 143360.0) + ) + ) + ) + (set! (-> obj collision-actor) (process-spawn squid-collision s5-6 0 :to obj)) + ) + (set! (-> obj blink-time) 0) + (setup-part-engine obj #t) + (set! (-> obj thruster-part) (create-launch-control (-> *part-group-id-table* 1118) obj)) + (dotimes (v1-110 10) + (set! (-> obj grenade v1-110 grenade) (the-as handle #f)) + (set! (-> obj grenade v1-110 marker) (the-as handle #f)) + (set! (-> obj grenade v1-110 show-it) #f) + ) + (set! (-> obj gun-tilt-left-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 36)) + (set! (-> obj gun-tilt-right-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 43)) + (set! (-> obj gun-tilt) 0.0) + (set! (-> obj tentacle-base-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 6)) + (init (-> obj tentacle-base-rotation-speed) 0.0 0.01 0.1 0.9) + (set! (-> obj tentacle-base-rotation) 0.0) + (set! (-> obj first-path) (new 'process 'curve-control obj 'first -1000000000.0)) + (logior! (-> obj first-path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> obj second-path) (new 'process 'curve-control obj 'second -1000000000.0)) + (logior! (-> obj second-path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> obj third-path) (new 'process 'curve-control obj 'third -1000000000.0)) + (logior! (-> obj third-path flags) (path-control-flag display draw-line draw-point draw-text)) + (change-to (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor 0) obj) + (set! (-> obj current-nav-poly) #f) + (set! (-> obj shield-timer) 0) + (set! (-> obj shield-hit-points) 1.0) + (set! (-> obj shield-shattered) #f) + (set! (-> obj hit-points) 10) + (set! (-> obj invincible-timer) 0) + (set! (-> obj stage) 0) + (set! (-> obj stage-2-go-status) 0) + (set! (-> obj debug-on) #f) + (when (-> obj draw shadow) + (set! (-> obj draw shadow-ctrl) + (new 'process 'shadow-control -122880.0 4096.0 4096000.0 (shadow-flags) 819200.0) + ) + (let ((v1-141 (-> obj draw shadow-ctrl))) + (logclear! (-> v1-141 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + (set! (-> obj hud) (the-as handle #f)) + (setup-masks (-> obj draw) 0 5440) + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1124) obj)) + (set! (-> obj desired-rotate-to-vector-angle) 0.0) + (set! (-> obj allowed-rotate-to-vector-angle) 0.0) + (set! (-> obj rush-sound) (new-sound-id)) + (set! (-> obj rush-sound-playing) #f) + (set! (-> obj rush-end-time) 0) + (set! (-> obj jet-sound) (new-sound-id)) + (set! (-> obj jet-sound-playing) #f) + (set! (-> obj jet-pitch) 0) + (set! (-> obj jet-volume) 0) + (set! (-> obj tentacle-sound) (new-sound-id)) + (set! (-> obj tentacle-sound-playing) #f) + (set! (-> obj spin-sound) (new-sound-id)) + (set! (-> obj spin-sound-playing) #f) + (set! (-> obj max-plane) -1) + (set! (-> obj last-damaged-talker) 0) + (set! (-> obj last-shield-hit-talker) 0) + (set! (-> obj last-no-energy-talker) 0) + (set! (-> obj last-shooting-talker) 0) + (set! (-> obj last-headbutting-talker) 0) + (set! (-> obj last-general-talker) 0) + (set! (-> obj last-start-recharging-talker) -1) + (set! (-> obj last-done-recharging-talker) -1) + (set! (-> obj suck) (you-suck-scale *game-info* #f)) + (if (task-node-closed? (game-task-node palace-boss-resolution)) + (go (method-of-object obj beaten)) + (go (method-of-object obj hidden)) + ) + (none) + ) + +(defmethod squid-method-42 squid ((obj squid) (arg0 vector)) + (set! (-> arg0 quad) (-> (if *target* + (get-trans *target* 3) + (-> obj nav state mesh bounds) + ) + quad + ) + ) + arg0 + ) + +(defmethod squid-method-43 squid ((obj squid) (arg0 vector) (arg1 float) (arg2 float)) + (let ((s4-0 (new 'stack-no-clear 'matrix)) + (s5-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> obj quat))) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-! s3-0 arg0 (-> obj trans)) + (vector-flatten! s3-0 s3-0 (-> s5-0 vector 1)) + (vector-normalize! s3-0 1.0) + (matrix-from-two-vectors-max-angle-partial! + s4-0 + (-> s5-0 vector 2) + s3-0 + (fmin (-> obj allowed-rotate-to-vector-angle) arg1) + arg2 + ) + (let* ((v1-2 (vector-cross! (new 'stack-no-clear 'vector) s3-0 (-> s5-0 vector 2))) + (f0-2 (vector-length v1-2)) + ) + (if (< (vector-dot v1-2 (-> s5-0 vector 1)) 0.0) + (set! f0-2 (- f0-2)) + ) + (set! (-> obj desired-rotate-to-vector-angle) (asin f0-2)) + ) + ) + (matrix*! s5-0 s5-0 s4-0) + (matrix-remove-z-rot s5-0 (new 'static 'vector :y -1.0)) + (matrix->quaternion (-> obj quat) s5-0) + ) + (quaternion-normalize! (-> obj quat)) + 0 + (none) + ) + +(defmethod squid-method-44 squid ((obj squid) (arg0 vector) (arg1 vector)) + (let ((v1-0 (new 'stack-no-clear 'collide-query))) + (set! (-> v1-0 start-pos quad) (-> arg0 quad)) + (vector-! (-> v1-0 move-dist) arg1 arg0) + (let ((a1-1 v1-0)) + (set! (-> a1-1 radius) 409.6) + (set! (-> a1-1 collide-with) (collide-spec player-list special-obstacle)) + (set! (-> a1-1 ignore-process0) obj) + (set! (-> a1-1 ignore-process1) #f) + (set! (-> a1-1 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> a1-1 action-mask) (collide-action solid)) + ) + (< (fill-and-probe-using-line-sphere *collide-cache* v1-0) 0.0) + ) + ) + +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 310] +(defmethod move-to-spot squid ((obj squid) (arg0 vector) (arg1 symbol)) + (local-vars + (sv-656 vector) + (sv-672 vector) + (sv-688 matrix) + (sv-704 clamp-travel-vector-to-mesh-return-info) + (sv-720 int) + (sv-736 nav-control) + (sv-752 vector) + (sv-768 nav-control) + (sv-784 vector) + ) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 13))) + (dotimes (v1-0 13) + (set! (-> s5-0 v1-0 quad) (the-as uint128 0)) + ) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (f30-0 0.0) + ) + (set! sv-656 (new 'stack-no-clear 'vector)) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s0-0 0) + ) + (set! sv-672 (squid-method-42 obj (new 'stack-no-clear 'vector))) + (set! (-> sv-672 y) (+ 8192.0 (-> sv-672 y))) + (set! (-> s3-0 quad) (-> arg0 quad)) + (set! (-> s3-0 y) (-> obj nav state mesh bounds y)) + (set! (-> obj current-nav-poly) (cloest-point-on-mesh (-> obj nav) s3-0 s3-0 (-> obj current-nav-poly))) + (cond + ((-> obj current-nav-poly) + (vector-! sv-656 (-> obj nav state mesh bounds) s3-0) + (set! (-> sv-656 y) 0.0) + (vector-normalize! sv-656 614400.0) + (let ((a2-2 (matrix-rotate-y! (new 'stack-no-clear 'matrix) -19114.668))) + (vector-matrix*! sv-656 sv-656 a2-2) + ) + (set! sv-688 (matrix-rotate-y! (new 'stack-no-clear 'matrix) 2730.6667)) + (set! sv-704 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + (set! sv-720 0) + (while (< sv-720 13) + (vector-matrix*! sv-656 sv-656 sv-688) + (set! (-> s5-0 s0-0 quad) (-> sv-656 quad)) + (set! (-> sv-704 poly) #f) + (clamp-vector-to-mesh-cross-gaps + (-> obj nav) + s3-0 + (-> obj current-nav-poly) + (-> s5-0 s0-0) + 614400.0 + #f + sv-704 + ) + (set! (-> s5-0 s0-0 quad) (-> sv-704 intersection quad)) + (set! (-> s5-0 s0-0 y) (+ 20480.0 (-> obj nav state mesh bounds y))) + (cond + ((not (-> sv-704 found-boundary)) + ) + ((let ((f0-6 (vector-vector-distance-squared sv-672 (-> s5-0 s0-0))) + (f1-2 102400.0) + ) + (< f0-6 (* f1-2 f1-2)) + ) + ) + ((not (squid-method-44 obj (-> s5-0 s0-0) sv-672)) + ) + ((let ((f0-7 (vector-vector-distance-squared s3-0 (-> s5-0 s0-0))) + (f1-5 81920.0) + ) + (< f0-7 (* f1-5 f1-5)) + ) + (let ((f28-0 (vector-vector-distance-squared s3-0 (-> s5-0 s0-0)))) + (new 'stack-no-clear 'vector) + (when (< f30-0 f28-0) + (set! (-> s1-0 quad) (-> s5-0 s0-0 quad)) + (when (-> sv-704 poly) + (let ((a3-2 (new 'stack-no-clear 'vector))) + (set! sv-736 (-> obj nav)) + (let ((a1-15 (-> sv-704 poly))) + (set! sv-752 s1-0) + (let ((v1-53 (-> s5-0 s0-0))) + (project-point-onto-plane-of-poly-local + (-> sv-736 state mesh) + a1-15 + sv-752 + a3-2 + (vector-! (new 'stack-no-clear 'vector) v1-53 (-> sv-736 state mesh bounds)) + ) + ) + ) + ) + (let ((v1-54 sv-752)) + (let ((a0-33 (-> sv-736 state mesh bounds))) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> sv-752 quad)) + (.lvf vf5 (&-> a0-33 quad)) + ) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-54 quad) vf6) + ) + 0 + (set! (-> s1-0 y) (+ 32768.0 (-> s1-0 y))) + ) + (set! f30-0 f28-0) + ) + ) + ) + (else + (when (-> sv-704 poly) + (let ((a3-3 (new 'stack-no-clear 'vector))) + (set! sv-768 (-> obj nav)) + (let ((a1-17 (-> sv-704 poly))) + (set! sv-784 (-> s5-0 s0-0)) + (let ((v1-67 (-> s5-0 s0-0))) + (project-point-onto-plane-of-poly-local + (-> sv-768 state mesh) + a1-17 + sv-784 + a3-3 + (vector-! (new 'stack-no-clear 'vector) v1-67 (-> sv-768 state mesh bounds)) + ) + ) + ) + ) + (let ((v1-68 sv-784)) + (let ((a0-38 (-> sv-768 state mesh bounds))) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> sv-784 quad)) + (.lvf vf5 (&-> a0-38 quad)) + ) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-68 quad) vf6) + ) + 0 + (set! (-> s5-0 s0-0 y) (+ 32768.0 (-> s5-0 s0-0 y))) + ) + (+! s0-0 1) + ) + ) + (set! sv-720 (+ sv-720 1)) + ) + (when arg1 + (cond + ((and (zero? s0-0) (!= f30-0 0.0)) + (set! (-> s5-0 0 quad) (-> s1-0 quad)) + ) + ((zero? s0-0) + ) + (else + (set! (-> s5-0 0 quad) (-> s5-0 (rand-vu-int-count s0-0) quad)) + ) + ) + (set! (-> s3-0 y) (-> arg0 y)) + (set-traj-towards-vec obj arg0 s3-0 (-> s5-0 0)) + ) + ) + (else + (format 0 "~A bad current poly~%" (-> obj name)) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod set-traj-towards-vec squid ((obj squid) (src vector) (arg2 vector) (dest vector)) + "Set up the [[trajectory]] towards `dest`." + (with-pp + (set! (-> obj traj-timer) (-> pp clock frame-counter)) + (set! (-> obj traj-src quad) (-> src quad)) + (set! (-> obj traj-dest quad) (-> dest quad)) + (set! (-> obj traj-duration) (* 0.00091552734 (vector-vector-xz-distance arg2 dest))) + (set! (-> obj traj-duration) (fmax 480.0 (-> obj traj-duration))) + (let ((f0-4 49152.0)) + (if (< (-> arg2 y) (-> dest y)) + (+! f0-4 (- (-> dest y) (-> arg2 y))) + ) + (setup-from-to-duration-and-height! (-> obj traj) arg2 dest 1.0 f0-4) + ) + (set! (-> obj residual-accumulator-1) 1.0) + (set! (-> obj residual-accumulator-2) 0.0) + 0 + (none) + ) + ) + +(defmethod float-sin-clamp squid ((obj squid) (arg0 float)) + (parameter-ease-sin-clamp (* 0.6366198 arg0)) + ) + +(defmethod squid-method-48 squid ((obj squid)) + (with-pp + (when (< 0.00001 (-> obj residual-accumulator-1)) + (set! (-> obj residual-accumulator-1) (* 0.95 (-> obj residual-accumulator-1))) + (+! (-> obj residual-accumulator-2) (-> obj residual-accumulator-1)) + ) + (let* ((f28-0 ((method-of-type trajectory compute-time-until-apex) + (the-as trajectory (&-> (the-as squid-grenade (-> obj self)) ignore-handle)) + ) + ) + (s3-0 (compute-trans-at-time (-> obj traj) f28-0 (new 'stack-no-clear 'vector))) + (s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (f30-0 (/ (the float (- (-> pp clock frame-counter) (-> obj traj-timer))) (-> obj traj-duration))) + ) + (let ((f26-0 (float-sin-clamp obj f30-0))) + (when (and (-> obj can-play-squid-boost) (< 0.125 f30-0)) + (set! (-> obj can-play-squid-boost) #f) + (sound-play "squid-boost") + ) + (cond + ((< f26-0 1.0) + (compute-trans-at-time (-> obj traj) f26-0 s5-0) + (set! (-> s4-0 quad) (-> obj traj-src quad)) + (+! (-> s4-0 y) (* 204.8 (the float (- (-> pp clock frame-counter) (-> obj traj-timer))) (/ f26-0 f30-0))) + (vector+float*! s4-0 s4-0 (-> obj residual-velocity) (-> obj residual-accumulator-2)) + (vector-lerp! s5-0 s4-0 s5-0 f26-0) + (cond + ((< f28-0 f26-0) + (let ((f28-1 (/ (- f26-0 f28-0) (- 1.0 f28-0)))) + (vector-lerp! s4-0 s3-0 (-> obj traj-dest) f28-1) + (vector-lerp! s5-0 s5-0 s4-0 f28-1) + ) + (squid-method-43 obj (squid-method-42 obj (new 'stack-no-clear 'vector)) 1092.2667 0.05) + (vector-! s4-0 (-> obj traj-dest) (-> obj trans)) + (vector-normalize! s4-0 1.75) + (dotimes (s3-2 6) + (send-event (handle->process (-> obj tentacles s3-2)) 'set-gravity s4-0) + ) + ) + (else + (squid-method-43 obj (-> obj traj-dest) 546.13336 0.005) + ) + ) + (set! (-> obj trans quad) (-> s5-0 quad)) + ) + (else + (dotimes (s5-1 6) + (send-event (handle->process (-> obj tentacles s5-1)) 'set-gravity-slow (new 'static 'vector :y -1.0)) + ) + (set! (-> obj trans quad) (-> obj traj-dest quad)) + ) + ) + ) + f30-0 + ) + ) + ) + +(defmethod setup-part-engine squid ((obj squid) (arg0 symbol)) + (with-pp + (when (>= (- (-> pp clock frame-counter) (-> obj blink-time)) 0) + (set! (-> obj blink-mask) 0) + (dotimes (s5-0 10) + (let* ((f30-0 0.5) + (v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-7 (the-as number (logior #x3f800000 v1-6))) + ) + (if (< f30-0 (+ -1.0 (the-as float v1-7))) + (logior! (-> obj blink-mask) (ash 1 s5-0)) + ) + ) + ) + (set! (-> obj blink-time) (+ (-> pp clock frame-counter) (the int (* 300.0 (rand-vu-float-range 0.25 0.75))))) + (set! arg0 #t) + ) + (when arg0 + (remove-from-process *part-engine* obj) + (add-connection + *part-engine* + obj + 5 + obj + 4790 + (new 'static 'vector :x -5906.432 :y 3317.76 :z -409.6 :w 819200.0) + ) + (add-connection + *part-engine* + obj + 5 + obj + 4790 + (new 'static 'vector :x 5906.432 :y 3317.76 :z -409.6 :w 819200.0) + ) + (add-connection *part-engine* obj 6 obj 4791 (new 'static 'vector :y 3366.912 :w 819200.0)) + (add-connection *part-engine* obj 13 obj 4791 (new 'static 'vector :y 11993.088 :z 5255.168 :w 819200.0)) + (add-connection + *part-engine* + obj + 5 + obj + 4792 + (new 'static 'vector :x 5439.488 :y -1794.048 :z 11444.224 :w 819200.0) + ) + (add-connection + *part-engine* + obj + 5 + obj + 4792 + (new 'static 'vector :x -5439.488 :y -1794.048 :z 11444.224 :w 819200.0) + ) + (let ((s5-2 (-> obj blink-mask))) + (if (logtest? s5-2 1) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x -4128.768 :y 2355.2 :z 3653.632 :w 819200.0) + ) + ) + (if (logtest? s5-2 2) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x -4554.752 :y 2449.408 :z 2359.296 :w 819200.0) + ) + ) + (if (logtest? s5-2 4) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x -4386.816 :y 2191.36 :z 528.384 :w 819200.0) + ) + ) + (if (logtest? s5-2 8) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x -5832.704 :y 2945.024 :z 1691.648 :w 819200.0) + ) + ) + (if (logtest? s5-2 16) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x -5861.376 :y 2920.448 :z 1118.208 :w 819200.0) + ) + ) + (if (logtest? s5-2 32) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x 4128.768 :y 2355.2 :z 3653.632 :w 819200.0) + ) + ) + (if (logtest? s5-2 64) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x 4554.752 :y 2449.408 :z 2359.296 :w 819200.0) + ) + ) + (if (logtest? s5-2 128) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x 4386.816 :y 2191.36 :z -528.384 :w 819200.0) + ) + ) + (if (logtest? s5-2 256) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x 5832.704 :y 2945.024 :z 1691.648 :w 819200.0) + ) + ) + (if (logtest? s5-2 512) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x 5861.376 :y 2920.448 :z 1118.208 :w 819200.0) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod squid-post squid ((obj squid)) + (local-vars + (v0-33 object) + (s5-9 int) + (sv-496 + (function skeleton-group int joint-exploder-tuning joint-exploder-static-params none :behavior joint-exploder) + ) + ) + (with-pp + (if (= (-> obj stage) 2) + (eval! + (new 'stack 'script-context (the-as basic (process->ppointer pp)) pp (the-as vector #f)) + '(want-anim "palace-boss-res") + ) + ) + (when (-> obj force-onto-mesh) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> obj trans quad)) + (set! (-> obj trans y) (-> obj nav state mesh bounds y)) + (set! (-> obj current-nav-poly) + (cloest-point-on-mesh (-> obj nav) (-> obj trans) (-> obj trans) (-> obj current-nav-poly)) + ) + (set! (-> obj trans y) (-> s5-0 y)) + (let ((f0-2 409.6)) + (set! (-> obj mesh-forced) (< (* f0-2 f0-2) (vector-vector-distance-squared (-> obj trans) s5-0))) + ) + ) + ) + (setup-part-engine obj #f) + (update! (-> obj driver-blend) 0.0) + (let ((s4-0 (new 'stack-no-clear 'matrix)) + (s5-1 (new 'stack-no-clear 'vector)) + (f30-1 (parameter-ease-sin-clamp (-> obj driver-blend value))) + ) + (matrix-identity! s4-0) + (send-event (ppointer->process (-> obj driver)) 'matrix s4-0) + (vector+float*! (-> obj root-override trans) (-> obj trans) (-> s4-0 trans) f30-1) + (matrix->quaternion (the-as quaternion s5-1) s4-0) + (cond + ((< (-> s5-1 w) (cos 1.8204443)) + (let* ((f28-1 (acos (-> s5-1 w))) + (f30-2 (* f30-1 f28-1)) + ) + (vector-float*! s5-1 s5-1 (/ (sin f30-2) (sin f28-1))) + (set! (-> s5-1 w) (cos f30-2)) + ) + (quaternion-normalize! (quaternion*! (-> obj root-override quat) (the-as quaternion s5-1) (-> obj quat))) + ) + (else + (quaternion-copy! (-> obj root-override quat) (-> obj quat)) + ) + ) + ) + (update! (-> obj hit-reaction) (the-as vector #f)) + (vector+float*! + (-> obj root-override trans) + (-> obj root-override trans) + (the-as vector (-> obj hit-reaction)) + 4096.0 + ) + (update! (-> obj tentacle-base-rotation-speed) 0.0) + (let ((f0-14 (+ (-> obj tentacle-base-rotation) (* 910.2222 (-> obj tentacle-base-rotation-speed value))))) + (set! (-> obj tentacle-base-rotation) (- f0-14 (* (the float (the int (/ f0-14 65536.0))) 65536.0))) + ) + (quaternion-set! + (-> obj tentacle-base-jm quat) + 0.0 + (sin (-> obj tentacle-base-rotation)) + 0.0 + (cos (-> obj tentacle-base-rotation)) + ) + (when (< 0.5 (-> obj tentacle-base-rotation-speed value)) + (let ((s5-3 (new 'stack-no-clear 'vector))) + (let ((s4-5 (new 'stack-no-clear 'vector))) + (vector<-cspace! s5-3 (-> obj node-list data 6)) + (vector-normalize-copy! s4-5 (-> obj node-list data 6 bone transform vector 1) 16384.0) + (vector+! s5-3 s5-3 s4-5) + ) + (dotimes (s4-6 6) + (send-event (handle->process (-> obj tentacles s4-6)) 'avoid-center s5-3) + ) + ) + ) + (if (or (zero? (-> obj stage)) (or (and (= (-> obj stage) 1) (>= (-> obj max-plane) 8)) + (and (= (-> obj stage) 2) + (>= (-> obj max-plane) 24) + (not (and (-> obj next-state) (= (-> obj next-state name) 'flee))) + ) + ) + ) + (set-setting! 'point-of-interest 'abs (-> obj trans) 0) + (remove-setting! 'point-of-interest) + ) + (transform-post) + (do-push-aways (-> obj root-override)) + (dotimes (s5-4 10) + (let ((a0-46 (handle->process (-> obj grenade s5-4 marker)))) + (when a0-46 + (if (and (not (-> obj grenade s5-4 show-it)) (not (handle->process (-> obj grenade s5-4 grenade)))) + (deactivate a0-46) + ) + ) + ) + ) + (let ((s5-5 0) + (f30-3 0.0) + ) + (dotimes (s4-7 6) + (let ((s5-6 s5-5) + (a1-25 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-25 from) (process->ppointer pp)) + (set! (-> a1-25 num-params) 0) + (set! (-> a1-25 message) 'get-num-bg-collisions) + (set! s5-5 (max s5-6 (the-as int (send-event-function (handle->process (-> obj tentacles s4-7)) a1-25)))) + ) + (let ((a1-26 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-26 from) (process->ppointer pp)) + (set! (-> a1-26 num-params) 0) + (set! (-> a1-26 message) 'get-max-movement) + (set! f30-3 (fmax f30-3 (the-as float (send-event-function (handle->process (-> obj tentacles s4-7)) a1-26)))) + ) + ) + (set! v0-33 (cond + ((or (and (not (-> obj tentacle-sound-playing)) (>= s5-5 5) (>= f30-3 1638.4)) + (or (and (-> obj next-state) (= (-> obj next-state name) 'recharge)) + (let ((v1-123 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (and v1-123 (= v1-123 (-> obj draw art-group data 5))) + ) + ) + ) + (sound-play "tentacles1" :id (-> obj tentacle-sound) :position (-> obj root-override trans)) + (set! v0-33 #t) + (set! (-> obj tentacle-sound-playing) (the-as symbol v0-33)) + v0-33 + ) + ((and (-> obj tentacle-sound-playing) (< s5-5 3)) + (sound-stop (-> obj tentacle-sound)) + (set! (-> obj tentacle-sound-playing) #f) + (sound-play "tentacles-up") + ) + ((-> obj tentacle-sound-playing) + (sound-play "tentacles1" :id (-> obj tentacle-sound) :position (-> obj root-override trans)) + ) + ) + ) + ) + (when (-> obj rush-sound-playing) + (cond + ((or (zero? (-> obj rush-end-time)) (< (- (-> pp clock frame-counter) (-> obj rush-end-time)) (seconds 0.1))) + (the-as int (sound-play "squid-rush" :id (-> obj rush-sound) :position (-> obj root-override trans))) + ) + (else + (sound-stop (-> obj rush-sound)) + (set! (-> obj rush-sound-playing) #f) + (set! (-> obj rush-end-time) 0) + 0 + ) + ) + ) + (let ((v1-149 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((or (and v1-149 (= v1-149 (-> obj draw art-group data 33))) + (let ((v1-155 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (or (and (and v1-155 (= v1-155 (-> obj draw art-group data 35))) (< -11.0 (ja-aframe-num 0))) + (and (-> obj next-state) (= (-> obj next-state name) 'pre-flee)) + ) + ) + ) + (when (-> obj jet-sound-playing) + (sound-stop (-> obj jet-sound)) + (set! (-> obj jet-sound-playing) #f) + ) + ) + (else + (let* ((f0-23 + (fmin 1.0 (* 0.0011111111 (the float (- (-> pp clock frame-counter) (the-as time-frame (-> obj jet-pitch)))))) + ) + (f28-2 + (fmin 1.0 (* 0.006666667 (the float (- (-> pp clock frame-counter) (the-as time-frame (-> obj jet-volume)))))) + ) + (f30-6 (* 0.2 (- 1.0 f0-23) (sin (* 32768.0 f0-23)))) + (f0-31 (+ 1.0 (* 5.0 (- 1.0 f28-2) (sin (* 32768.0 f30-6))))) + ) + (if (-> obj negate-jet-pitch) + (set! f30-6 (- f30-6)) + ) + (sound-play-by-name + (static-sound-name "squid-jets") + (-> obj jet-sound) + (the int (* 1024.0 f0-31)) + (the int (* 1524.0 f30-6)) + 0 + (sound-group sfx) + (-> obj root-override trans) + ) + ) + (set! (-> obj jet-sound-playing) #t) + ) + ) + ) + (let ((v1-193 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (when (and (not (and v1-193 (= v1-193 (-> obj draw art-group data 33)))) + (let ((v1-199 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (not (and (and v1-199 (= v1-199 (-> obj draw art-group data 35))) (< -11.0 (ja-aframe-num 0)))) + ) + ) + (set! (-> *part-id-table* 4812 init-specs 12 initial-valuef) 0.0) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 24)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 25)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 32)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 33)) + (set! (-> *part-id-table* 4812 init-specs 12 initial-valuef) 10922.667) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 24)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 25)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 32)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 33)) + (set! (-> *part-id-table* 4812 init-specs 12 initial-valuef) 21845.334) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 24)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 25)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 32)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 33)) + ) + ) + (when (not (and (-> obj next-state) (= (-> obj next-state name) 'recharge))) + (let ((v1-249 + (the int (lerp-scale 0.0 128.0 (the float (- (-> pp clock frame-counter) (-> obj shield-timer))) 0.0 600.0)) + ) + ) + (cond + ((< 0.0 (-> obj shield-hit-points)) + (set! s5-9 (min 100 v1-249)) + (set! (-> obj shield-shattered) #f) + ) + ((< 16 v1-249) + (set! s5-9 128) + (when (not (-> obj shield-shattered)) + (set! (-> obj shield-shattered) #t) + (sound-play "sqd-shield-brk") + (let ((s4-10 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> s4-10 fountain-rand-transv-lo quad) (-> obj root-override trans quad)) + (set! (-> s4-10 fountain-rand-transv-lo y) (+ -12288.0 (-> s4-10 fountain-rand-transv-lo y))) + (set! (-> s4-10 fountain-rand-transv-hi x) 16424.96) + (set! (-> s4-10 fountain-rand-transv-hi y) 32808.96) + (set! (-> s4-10 fountain-rand-transv-hi z) -32808.96) + (set! (-> s4-10 fountain-rand-transv-hi w) -32808.96) + (set! (-> s4-10 rot-speed) 0.0001) + (set! (-> s4-10 gravity) -32768.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-squid-shield" (the-as (pointer uint32) #f)) + 70 + s4-10 + *squid-shield-exploder-params* + :to obj + :stack-size #x8000 + ) + (dotimes (s3-4 6) + (let ((s1-2 (handle->process (-> obj tentacles s3-4)))) + (when s1-2 + (let ((s2-2 (get-process *default-dead-pool* joint-exploder #x4000))) + (when s2-2 + (let ((t9-67 (method-of-type joint-exploder activate))) + (t9-67 + (the-as joint-exploder s2-2) + s1-2 + (symbol->string (-> joint-exploder symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((s1-3 run-function-in-process) + (s0-1 s2-2) + ) + (set! sv-496 joint-exploder-init-by-other) + (let ((a2-30 (art-group-get-by-name *level* "skel-squid-tentacle-shield" (the-as (pointer uint32) #f))) + (a3-14 67) + (t0-11 s4-10) + (t1-8 *squid-tentacle-shield-exploder-params*) + ) + ((the-as (function object object object object object object none) s1-3) s0-1 sv-496 a2-30 a3-14 t0-11 t1-8) + ) + ) + (-> s2-2 ppointer) + ) + ) + ) + ) + ) + ) + ) + ) + (else + (set! s5-9 (- 16 v1-249)) + ) + ) + ) + (set! (-> obj draw force-fade) (the-as uint s5-9)) + (dotimes (s4-11 6) + (send-event (handle->process (-> obj tentacles s4-11)) 'set-fade s5-9) + ) + (let* ((f0-56 (lerp-scale 0.5 0.0 (the float (- (-> pp clock frame-counter) (-> obj shield-timer))) 0.0 75.0)) + (a0-147 + (vector-float*! (new 'stack-no-clear 'vector) (-> obj shield-color) (if (< 0.0 (-> obj shield-hit-points)) + f0-56 + (- 1.0 f0-56) + ) + ) + ) + ) + (set! (-> a0-147 w) 1.0) + (set-shield-flash! a0-147) + ) + (cond + ((>= (-> obj draw force-fade) (the-as uint 128)) + (setup-masks (-> obj draw) 0 8192) + (logclear! (-> obj draw status) (draw-control-status warp-cross-fade)) + ) + (else + (setup-masks (-> obj draw) 8192 0) + (logior! (-> obj draw status) (draw-control-status warp-cross-fade)) + ) + ) + ) + (let ((v1-316 (handle->process (-> obj hud)))) + (when v1-316 + (if (not (and (-> obj next-state) (= (-> obj next-state name) 'recharge))) + (set! (-> (the-as hud-squid v1-316) values 2 target) (the int (* 100.0 (-> obj shield-hit-points)))) + ) + (cond + ((and (zero? (-> obj hit-points)) (< (-> obj stage) 2)) + (set! (-> (the-as hud-squid v1-316) values 0 target) (+ (-> obj stage) 1)) + (set! (-> (the-as hud-squid v1-316) values 1 target) 100) + ) + (else + (set! (-> (the-as hud-squid v1-316) values 0 target) (-> obj stage)) + (set! (-> (the-as hud-squid v1-316) values 1 target) (/ (* 100 (-> obj hit-points)) 10)) + ) + ) + ) + ) + (set! (-> obj allowed-rotate-to-vector-angle) (fabs (-> obj desired-rotate-to-vector-angle))) + (none) + ) + ) + +(defmethod spawn-whirlwind squid ((obj squid)) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (s4-0 (squid-method-42 obj (new 'stack-no-clear 'vector))) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (send-event (handle->process (-> obj tentacles 0)) 'get-joint-pos 13 gp-0) + (vector-! s4-0 s4-0 (-> obj root-override trans)) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (vector+float*! s3-0 (-> obj root-override trans) s4-0 16384.0) + ) + (process-spawn squid-whirlwind gp-0 (-> obj root-override trans) (-> obj nav state mesh) s4-0 :to obj) + ) + ) + +(defbehavior squid-num-grenades-to-shoot squid () + (cond + ((>= 0.4 (-> self suck)) + 5 + ) + ((>= 0.7 (-> self suck)) + 4 + ) + (else + 3 + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod spawn-grenade squid ((obj squid) (arg0 int) (arg1 squid-grenade-holder) (arg2 float)) + (squid-increment-shield (+ -0.001 (/ -1.0 (* 2.0 (the float (* (squid-num-grenades-to-shoot) 2)))))) + (let ((s4-1 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data arg0))) + (v1-6 (-> arg1 target-position)) + ) + (set! (-> s4-1 ent) (-> obj entity)) + (set! (-> s4-1 charge) arg2) + (set! (-> s4-1 options) (projectile-options)) + (set! (-> s4-1 pos quad) (-> a0-3 quad)) + (set! (-> s4-1 notify-handle) (process->handle obj)) + (set! (-> s4-1 owner-handle) (the-as handle #f)) + (set! (-> s4-1 ignore-handle) (process->handle obj)) + (let* ((a1-11 *game-info*) + (a2-12 (+ (-> a1-11 attack-id) 1)) + ) + (set! (-> a1-11 attack-id) a2-12) + (set! (-> s4-1 attack-id) a2-12) + ) + (set! (-> s4-1 timeout) (new 'static 'handle :process #x4b0 :u64 #x4b0)) + (vector-! (-> s4-1 vel) v1-6 a0-3) + ) + (set! (-> arg1 grenade) (ppointer->handle (spawn-projectile squid-grenade s4-1 obj *default-dead-pool*))) + ) + (set! (-> arg1 show-it) #f) + (none) + ) + +(deftype squid-shot (guard-shot) + () + :heap-base #x170 + :method-count-assert 40 + :size-assert #x1f0 + :flag-assert #x28017001f0 + ) + + +(defmethod play-impact-sound squid-shot ((obj squid-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "guard-shot-fire") + ) + ((= v1-0 (projectile-options lose-altitude)) + (sound-play "sqd-shot-hit") + ) + ) + ) + 0 + (none) + ) + +(defun squid-shot-move ((arg0 squid-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root-override))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 81920.0 f0-0) + (vector-normalize! s4-0 81920.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (if (logtest? (-> arg0 root-override status) (collide-status touch-actor)) + (set! (-> arg0 hit-actor?) #t) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +(defmethod init-proj-settings! squid-shot ((obj squid-shot)) + "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" + (set! (-> obj hit-actor?) #f) + (set! (-> obj tail-pos quad) (-> obj root-override trans quad)) + (set! (-> obj attack-mode) 'squid-shot) + (set! (-> obj max-speed) 983040.0) + (set! (-> obj move) squid-shot-move) + (set! (-> obj update-velocity) projectile-update-velocity-space-wars) + (set! (-> obj timeout) (seconds 0.417)) + (logior! (-> obj options) (projectile-options account-for-target-velocity)) + (set-gravity-length (-> obj root-override dynam) 573440.0) + (set! (-> obj options) (logior (projectile-options respect-invinc-time) (-> obj options))) + (set! (-> obj invinc-time) (seconds 3.5)) + (none) + ) + +(defmethod draw-laser-sight squid-shot ((obj squid-shot)) + "TODO - confirm If applicable, draw the laser sight particles" + (draw-beam (-> *part-id-table* 4861) (-> obj tail-pos) (-> obj starting-dir) #f #t) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> obj tail-pos) a0-3)) + (t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 4862)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 + (none) + ) + +(defmethod spawn-impact-particles squid-shot ((obj squid-shot)) + "Spawns associated particles with the projectile if applicable" + (let* ((gp-0 (-> obj root-override trans)) + (a1-0 (-> obj tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) + (f30-0 (vector-length s5-1)) + ) + (let ((s4-1 (vector+float*! (new 'stack-no-clear 'vector) a1-0 s5-1 0.8))) + (set! (-> *part-id-table* 4857 init-specs 4 initial-valuef) f30-0) + (set! (-> *part-id-table* 4857 init-specs 11 initial-valuef) (the-as float #x5)) + (set! (-> *part-id-table* 4857 init-specs 10 initial-valuef) 0.0) + (draw-beam (-> *part-id-table* 4857) a1-0 s5-1 #f #t) + (vector-normalize! s5-1 1.0) + (let ((t9-2 sp-launch-particles-var) + (a0-8 *sp-particle-system-2d*) + (a1-2 (-> *part-id-table* 4858)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> s4-1 quad)) + (t9-2 a0-8 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-9 *sp-particle-system-2d*) + (a1-3 (-> *part-id-table* 4859)) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> s4-1 quad)) + (t9-3 a0-9 a1-3 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + (let ((s4-2 (new 'stack-no-clear 'matrix)) + (f26-0 (* 0.000012207031 f30-0)) + (f30-1 (-> *part-id-table* 4860 init-specs 3 initial-valuef)) + (f28-0 (-> *part-id-table* 4860 init-specs 4 initial-valuef)) + ) + (forward-up->inv-matrix s4-2 s5-1 *up-vector*) + (set! (-> s4-2 trans quad) (-> gp-0 quad)) + (set! (-> *part-id-table* 4860 init-specs 3 initial-valuef) (* f26-0 f30-1)) + (set! (-> *part-id-table* 4860 init-specs 4 initial-valuef) (* f26-0 f28-0)) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 4860) + s4-2 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + (set! (-> *part-id-table* 4860 init-specs 3 initial-valuef) f30-1) + (set! (-> *part-id-table* 4860 init-specs 4 initial-valuef) f28-0) + ) + ) + 0 + (none) + ) + +(defmethod spawn-shell-particles squid-shot ((obj squid-shot)) + "TODO - confirm" + (let* ((s3-0 (-> obj root-override)) + (s4-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj tail-pos) (-> s3-0 trans)) 2048.0)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> s3-0 trans quad)) + (let ((a2-1 (vector-! (new 'stack-no-clear 'vector) (-> s3-0 trans) (-> obj tail-pos)))) + (set! (-> *part-id-table* 4857 init-specs 4 initial-valuef) (vector-length a2-1)) + (set! (-> *part-id-table* 4857 init-specs 11 initial-valuef) (the-as float #x28)) + (set! (-> *part-id-table* 4857 init-specs 10 initial-valuef) -3.2) + (draw-beam (-> *part-id-table* 4857) (-> obj tail-pos) a2-1 #f #t) + ) + (vector+! gp-0 gp-0 s4-0) + (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when s5-1 + (let ((t9-3 (method-of-type part-tracker activate))) + (t9-3 + (the-as part-tracker s5-1) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((t9-4 run-function-in-process) + (a0-12 s5-1) + (a1-5 part-tracker-init) + (a2-6 (-> *part-group-id-table* 1125)) + (a3-2 0) + (t0-1 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> gp-0 quad)) + ((the-as (function object object object object object object object object none) t9-4) + a0-12 + a1-5 + a2-6 + a3-2 + t0-1 + t1-0 + t2-0 + t3-0 + ) + ) + (-> s5-1 ppointer) + ) + ) + ) + 0 + (none) + ) + +(defmethod-mips2c "(method 53 squid)" 53 squid) diff --git a/goal_src/jak2/levels/palace/boss/squid-states.gc b/goal_src/jak2/levels/palace/boss/squid-states.gc index ddc1ecb08a..ffccf494bd 100644 --- a/goal_src/jak2/levels/palace/boss/squid-states.gc +++ b/goal_src/jak2/levels/palace/boss/squid-states.gc @@ -7,3 +7,1745 @@ ;; DECOMP BEGINS +(defbehavior squid-talker squid ((arg0 symbol)) + (case arg0 + (('damaged) + (let* ((f30-0 0.2) + (v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + ) + (if (< f30-0 (+ -1.0 (the-as float v1-4))) + (return (the-as int #f)) + ) + ) + (let ((v1-8 (rand-vu-int-count 4))) + (if (>= v1-8 (-> self last-damaged-talker)) + (+! v1-8 1) + ) + (set! (-> self last-damaged-talker) v1-8) + (cond + ((zero? v1-8) + (talker-spawn-func (-> *talker-speech* 229) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-8 1) + (talker-spawn-func (-> *talker-speech* 230) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-8 2) + (talker-spawn-func (-> *talker-speech* 231) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-8 3) + (talker-spawn-func (-> *talker-speech* 233) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-8 4) + (talker-spawn-func (-> *talker-speech* 238) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + ) + (('shield-hit) + (let* ((f30-1 0.15) + (v1-22 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-23 (the-as number (logior #x3f800000 v1-22))) + ) + (if (< f30-1 (+ -1.0 (the-as float v1-23))) + (return (the-as int #f)) + ) + ) + (let ((v1-27 (rand-vu-int-count 3))) + (if (>= v1-27 (-> self last-shield-hit-talker)) + (+! v1-27 1) + ) + (set! (-> self last-shield-hit-talker) v1-27) + (cond + ((zero? v1-27) + (talker-spawn-func (-> *talker-speech* 209) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-27 1) + (talker-spawn-func (-> *talker-speech* 205) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-27 2) + (talker-spawn-func (-> *talker-speech* 207) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-27 3) + (talker-spawn-func (-> *talker-speech* 208) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + ) + (('start-recharging) + (let* ((f30-2 0.05) + (v1-39 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-40 (the-as number (logior #x3f800000 v1-39))) + ) + (if (and (< f30-2 (+ -1.0 (the-as float v1-40))) (!= (-> self last-start-recharging-talker) -1)) + (return (the-as int #f)) + ) + ) + (set! (-> self last-start-recharging-talker) 0) + (talker-spawn-func (-> *talker-speech* 228) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (('done-recharging) + (let* ((f30-3 0.05) + (v1-51 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-52 (the-as number (logior #x3f800000 v1-51))) + ) + (when (or (< f30-3 (+ -1.0 (the-as float v1-52))) (= (-> self last-done-recharging-talker) -1)) + (set! (-> self last-done-recharging-talker) 0) + (return (the-as int #f)) + ) + ) + (talker-spawn-func (-> *talker-speech* 224) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (('shooting) + (let* ((f30-4 0.1) + (v1-63 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-64 (the-as number (logior #x3f800000 v1-63))) + ) + (if (< f30-4 (+ -1.0 (the-as float v1-64))) + (return (the-as int #f)) + ) + ) + (let ((v1-68 (rand-vu-int-count 4))) + (if (>= v1-68 (-> self last-shooting-talker)) + (+! v1-68 1) + ) + (set! (-> self last-shooting-talker) v1-68) + (cond + ((zero? v1-68) + (talker-spawn-func (-> *talker-speech* 225) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-68 1) + (talker-spawn-func (-> *talker-speech* 215) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-68 2) + (talker-spawn-func (-> *talker-speech* 218) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-68 3) + (talker-spawn-func (-> *talker-speech* 232) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-68 4) + (talker-spawn-func (-> *talker-speech* 240) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + ) + (('headbutting) + (let* ((f30-5 0.2) + (v1-82 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-83 (the-as number (logior #x3f800000 v1-82))) + ) + (if (< f30-5 (+ -1.0 (the-as float v1-83))) + (return (the-as int #f)) + ) + ) + (let ((v1-87 (rand-vu-int-count 9))) + (if (>= v1-87 (-> self last-headbutting-talker)) + (+! v1-87 1) + ) + (set! (-> self last-headbutting-talker) v1-87) + (cond + ((zero? v1-87) + (talker-spawn-func (-> *talker-speech* 212) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 1) + (talker-spawn-func (-> *talker-speech* 214) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 2) + (talker-spawn-func (-> *talker-speech* 217) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 3) + (talker-spawn-func (-> *talker-speech* 219) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 4) + (talker-spawn-func (-> *talker-speech* 223) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 5) + (talker-spawn-func (-> *talker-speech* 216) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 6) + (talker-spawn-func (-> *talker-speech* 227) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 7) + (talker-spawn-func (-> *talker-speech* 232) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 8) + (talker-spawn-func (-> *talker-speech* 240) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 9) + (talker-spawn-func (-> *talker-speech* 237) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + ) + (('general) + (let* ((f30-6 0.0002) + (v1-112 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-113 (the-as number (logior #x3f800000 v1-112))) + ) + (if (< f30-6 (+ -1.0 (the-as float v1-113))) + (return (the-as int #f)) + ) + ) + (let ((v1-117 (rand-vu-int-count 7))) + (if (>= v1-117 (-> self last-general-talker)) + (+! v1-117 1) + ) + (set! (-> self last-general-talker) v1-117) + (cond + ((zero? v1-117) + (talker-spawn-func (-> *talker-speech* 210) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-117 1) + (talker-spawn-func (-> *talker-speech* 211) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-117 2) + (talker-spawn-func (-> *talker-speech* 213) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-117 3) + (talker-spawn-func (-> *talker-speech* 220) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-117 4) + (talker-spawn-func (-> *talker-speech* 222) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-117 5) + (talker-spawn-func (-> *talker-speech* 226) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-117 6) + (talker-spawn-func (-> *talker-speech* 235) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-117 7) + (talker-spawn-func (-> *talker-speech* 239) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + ) + ) + 0 + ) + +(defstate test (squid) + :virtual #t + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (ja :num! (loop!)) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (set! (-> self driver-blend target) (- 1.0 (-> self driver-blend target))) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (debug-draw (-> self first-path)) + (debug-draw (-> self second-path)) + (debug-draw (-> self third-path)) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +(define *squid-first-pole* (new 'static 'vector :x 1087078.4 :y 1725235.2 :z 2165145.5)) + +(define *squid-second-pole* (new 'static 'vector :x 1257472.0 :y 1725644.8 :z 2468249.5)) + +;; WARN: Check prologue - tricky store of r0 +;; WARN: Return type mismatch symbol vs none. +(defbehavior go-through-wall squid () + (local-vars (sv-16 res-tag)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-1 (res-lump-data (-> self entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when (and v1-1 (< (the-as uint (-> self stage)) (-> sv-16 elt-count))) + (let ((gp-0 (-> v1-1 (-> self stage)))) + (dotimes (s5-0 (-> gp-0 length)) + (let ((v1-3 s5-0)) + (cond + ((zero? v1-3) + (let ((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) 'shutdown) + (let ((t9-1 send-event-function) + (v1-8 (-> gp-0 data s5-0 actor)) + ) + (t9-1 + (if v1-8 + (-> v1-8 extra process) + ) + a1-5 + ) + ) + ) + ) + ((= v1-3 3) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 0) + (set! (-> a1-6 message) 'trigger) + (let ((t9-2 send-event-function) + (v1-15 (-> gp-0 data s5-0 actor)) + ) + (t9-2 + (if v1-15 + (-> v1-15 extra process) + ) + a1-6 + ) + ) + ) + ) + (else + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer self)) + (set! (-> a1-7 num-params) 0) + (set! (-> a1-7 message) 'stop) + (let ((t9-3 send-event-function) + (v1-22 (-> gp-0 data s5-0 actor)) + ) + (t9-3 + (if v1-22 + (-> v1-22 extra process) + ) + a1-7 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! (-> self gate-intact) #f) + (none) + ) + +(defstate beaten (squid) + :virtual #t + :enter (behavior () + (ja-channel-set! 0) + (ja-post) + (dotimes (gp-0 6) + (let ((a0-2 (handle->process (-> self tentacles gp-0)))) + (if a0-2 + (deactivate a0-2) + ) + ) + ) + (dotimes (gp-1 3) + (set! (-> self stage) gp-1) + (go-through-wall) + ) + (send-event (handle->process (-> self hud)) 'hide-and-die) + (set! (-> self hud) (the-as handle #f)) + (when (-> self jet-sound-playing) + (sound-stop (-> self jet-sound)) + (set! (-> self jet-sound-playing) #f) + ) + (when (-> self tentacle-sound-playing) + (sound-stop (-> self tentacle-sound)) + (set! (-> self tentacle-sound-playing) #f) + ) + (remove-setting! 'point-of-interest) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + ) + +(defstate wait-around-corner (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (remove-setting! 'point-of-interest) + (none) + ) + :trans (behavior () + (let ((v1-1 (squid-method-42 self (new 'stack-no-clear 'vector)))) + (when (< 2560000.0 (-> v1-1 z)) + (vector-reset! (-> self residual-velocity)) + (set! (-> self stage-2-go-status) 2) + (go-virtual fire-whirlwind) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + ) + +(defstate wait-beside-building (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (remove-setting! 'point-of-interest) + (none) + ) + :trans (behavior () + (vector-reset! (-> self residual-velocity)) + (if (>= (-> self max-plane) 8) + (go-virtual fly-to-post) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + ) + +(defstate flee (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (set! (-> self can-play-squid-boost) #f) + (set! (-> self invincible-timer) 0) + (let ((v1-0 (-> self stage))) + (cond + ((zero? v1-0) + (let ((gp-1 (vector+! + (new 'stack-no-clear 'vector) + (-> self entity trans) + (new 'static 'vector :x 131072.0 :y -3235.84 :z 225280.0) + ) + ) + ) + (deactivate (-> self collision-actor 0)) + (set! (-> self collision-actor) (process-spawn squid-collision gp-1 1 :to self)) + ) + ) + ((= v1-0 1) + (let ((gp-3 (vector+! + (new 'stack-no-clear 'vector) + (-> self entity trans) + (new 'static 'vector :x 135168.0 :y -655.36 :z 217088.0) + ) + ) + ) + (deactivate (-> self collision-actor 0)) + (set! (-> self collision-actor) (process-spawn squid-collision gp-3 2 :to self)) + ) + ) + (else + (process-spawn scene-player :init scene-player-init "palace-boss-res" #t #f) + (remove-setting! 'music) + (go-virtual beaten) + ) + ) + ) + (let ((a3-6 (new 'stack-no-clear 'vector))) + (set! (-> a3-6 quad) (-> self nav state mesh bounds quad)) + (set! (-> a3-6 y) (+ 16384.0 (-> a3-6 y))) + (set-traj-towards-vec self (-> self trans) (-> self trans) a3-6) + ) + (set! (-> self gate-intact) #t) + (set! (-> self force-onto-mesh) #f) + (none) + ) + :exit (behavior () + (set! (-> self hit-points) 10) + (set! (-> self stage) (min 2 (+ (-> self stage) 1))) + (change-to (nav-mesh-from-res-tag (-> self entity) 'nav-mesh-actor (-> self stage)) self) + (set! (-> self current-nav-poly) #f) + (none) + ) + :trans (behavior () + (ja :num! (loop!)) + (let* ((f0-1 (squid-method-48 self)) + (f30-0 (float-sin-clamp self f0-1)) + ) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((v1-8 (-> self stage))) + (cond + ((zero? v1-8) + (get-point-at-percent-along-path! (-> self first-path) gp-0 f30-0 'interp) + (if (and (-> self gate-intact) + (< (+ -2895.872 (-> *squid-first-pole* x)) (-> self root-override trans x)) + (< (+ -2895.872 (-> *squid-first-pole* z)) (-> self root-override trans z)) + ) + (go-through-wall) + ) + ) + ((= v1-8 1) + (get-point-at-percent-along-path! (-> self second-path) gp-0 f30-0 'interp) + (if (and (-> self gate-intact) (< (+ -4096.0 (-> *squid-second-pole* z)) (-> self root-override trans z))) + (go-through-wall) + ) + ) + (else + (get-point-at-percent-along-path! (-> self first-path) gp-0 f30-0 'interp) + ) + ) + ) + (set! (-> self trans quad) (-> gp-0 quad)) + ) + (when (>= f30-0 1.0) + (let ((v1-35 (-> self stage))) + (cond + ((zero? v1-35) + (go-virtual wait-beside-building) + ) + ((= v1-35 1) + (go-virtual wait-around-corner) + ) + (else + (vector-reset! (-> self residual-velocity)) + (go-virtual fly-to-shoot-spot) + ) + ) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +(defstate pre-flee (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self traj-timer) + (+ (-> self clock frame-counter) (the int (* 300.0 (rand-vu-float-range 0.25 0.5)))) + ) + (set! (-> self traj initial-position quad) (-> self trans quad)) + (let ((v1-7 (-> self stage))) + (cond + ((zero? v1-7) + (get-point-at-percent-along-path! (-> self first-path) (-> self traj-dest) 0.0 'interp) + ) + ((= v1-7 1) + (get-point-at-percent-along-path! (-> self second-path) (-> self traj-dest) 0.0 'interp) + ) + (else + (set-setting! 'music #f 0 0) + (process-grab? *target* #f) + (get-point-at-percent-along-path! (-> self third-path) (-> self traj-dest) 0.0 'interp) + (send-event (handle->process (-> self hud)) 'hide-and-die) + ) + ) + ) + (set! (-> self tentacle-base-rotation-speed target) 1.0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 36) :num! min) + (none) + ) + :exit (behavior () + (process-release? *target*) + (set! (-> self tentacle-base-rotation-speed target) 0.0) + (when (-> self spin-sound-playing) + (sound-stop (-> self spin-sound)) + (set! (-> self spin-sound-playing) #f) + ) + (none) + ) + :trans (behavior () + (local-vars + (sv-80 symbol) + (sv-96 symbol) + (sv-112 vector) + (sv-128 matrix) + (sv-144 symbol) + (sv-160 symbol) + (sv-176 vector) + (sv-192 matrix) + (sv-208 symbol) + (sv-224 symbol) + (sv-240 vector) + (sv-256 matrix) + ) + (quaternion-rotate-y! (-> self quat) (-> self quat) 5461.3335) + (vector-lerp! + (-> self trans) + (the-as vector (-> self traj)) + (-> self traj-dest) + (parameter-ease-sqr-clamp (* 0.0011111111 (the float (- (-> self clock frame-counter) (-> self state-time))))) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 3)) + (go-virtual flee) + ) + (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 55))) + (when (>= (- (-> self clock frame-counter) (-> self traj-timer)) 0) + (sound-play "squid-explosion") + (set! (-> self traj-timer) + (+ (-> self clock frame-counter) (the int (* 300.0 (rand-vu-float-range 0.25 0.5)))) + ) + (cond + ((zero? (-> self stage)) + (setup-masks (-> self draw) 320 160) + (let ((gp-4 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-4 + (let ((t9-11 (method-of-type part-tracker activate))) + (t9-11 (the-as part-tracker gp-4) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((s5-3 run-function-in-process) + (s4-1 gp-4) + (s3-1 part-tracker-init) + (s2-0 (-> *part-group-id-table* 1123)) + (s1-0 0) + (s0-0 #f) + ) + (set! sv-80 (the-as symbol #f)) + (set! sv-96 (the-as symbol #f)) + (set! sv-128 *launch-matrix*) + (set! sv-112 (-> sv-128 trans)) + (let ((v1-33 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 43)) quad))) + (set! (-> sv-112 quad) v1-33) + ) + ((the-as (function object object object object object object object object none) s5-3) + s4-1 + s3-1 + s2-0 + s1-0 + s0-0 + sv-80 + sv-96 + sv-128 + ) + ) + (-> gp-4 ppointer) + ) + ) + ) + ((= (-> self stage) 1) + (setup-masks (-> self draw) 5120 2590) + (let ((gp-5 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-5 + (let ((t9-16 (method-of-type part-tracker activate))) + (t9-16 (the-as part-tracker gp-5) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((s5-4 run-function-in-process) + (s4-2 gp-5) + (s3-2 part-tracker-init) + (s2-1 (-> *part-group-id-table* 1123)) + (s1-1 0) + (s0-1 #f) + ) + (set! sv-144 (the-as symbol #f)) + (set! sv-160 (the-as symbol #f)) + (set! sv-192 *launch-matrix*) + (set! sv-176 (-> sv-192 trans)) + (let ((v1-47 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 55)) quad))) + (set! (-> sv-176 quad) v1-47) + ) + ((the-as (function object object object object object object object object none) s5-4) + s4-2 + s3-2 + s2-1 + s1-1 + s0-1 + sv-144 + sv-160 + sv-192 + ) + ) + (-> gp-5 ppointer) + ) + ) + ) + (else + (let ((gp-6 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-6 + (let ((t9-20 (method-of-type part-tracker activate))) + (t9-20 (the-as part-tracker gp-6) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((s5-5 run-function-in-process) + (s4-3 gp-6) + (s3-3 part-tracker-init) + (s2-2 (-> *part-group-id-table* 1123)) + (s1-2 0) + (s0-2 #f) + ) + (set! sv-208 (the-as symbol #f)) + (set! sv-224 (the-as symbol #f)) + (set! sv-256 *launch-matrix*) + (set! sv-240 (-> sv-256 trans)) + (let ((v1-59 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 55)) quad))) + (set! (-> sv-240 quad) v1-59) + ) + ((the-as (function object object object object object object object object none) s5-5) + s4-3 + s3-3 + s2-2 + s1-2 + s0-2 + sv-208 + sv-224 + sv-256 + ) + ) + (-> gp-6 ppointer) + ) + ) + ) + ) + ) + (sound-play "squid-spin" :id (-> self spin-sound) :position (-> self root-override trans)) + (set! (-> self spin-sound-playing) #t) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +(defstate recharge (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (squid-talker 'start-recharging) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self invincible-timer) 0) + (setup-masks (-> self draw) 8192 0) + (logior! (-> self draw status) (draw-control-status warp-cross-fade)) + (dotimes (gp-0 6) + (send-event (handle->process (-> self tentacles gp-0)) 'set-anim 47) + ) + (set! (-> self driver-blend target) 0.0) + (ja-channel-push! 1 (seconds 0.5)) + (ja :group! (-> self draw art-group data 33) :num! min) + (none) + ) + :exit (behavior () + (squid-talker 'done-recharging) + (dotimes (gp-0 6) + (send-event (handle->process (-> self tentacles gp-0)) 'set-anim 45) + ) + (none) + ) + :trans (behavior () + (if (and (zero? (-> self hit-points)) + (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + ) + (go-virtual pre-flee) + ) + (let ((v1-10 (ja-group))) + (cond + ((and v1-10 (= v1-10 (-> self draw art-group data 34))) + (ja :num! (seek!)) + (when (ja-done? 0) + (vector-reset! (-> self residual-velocity)) + (go-virtual fly-to-shoot-spot) + ) + ) + ((>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (set! (-> self driver-blend target) 1.0) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 34) :num! min) + ) + ((let ((v1-37 (ja-group))) + (and v1-37 (= v1-37 (-> self draw art-group data 35))) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.25)) + (ja :group! (-> self draw art-group data 35) :num! min) + ) + ) + (else + (ja :num! (seek!)) + (if (ja-done? 0) + (ja :group! (-> self draw art-group data 35) :num! min) + ) + ) + ) + ) + (set! (-> self shield-hit-points) 1.0) + (let ((v1-70 (handle->process (-> self hud)))) + (if v1-70 + (set! (-> (the-as hud-squid v1-70) values 2 target) + (min 100 (/ (* 100 (- (-> self clock frame-counter) (-> self state-time))) 600)) + ) + ) + ) + (let ((gp-3 (new 'stack-no-clear 'vector))) + (let ((f30-0 + (* 16384.0 (fmin 1.0 (* 0.0016666667 (the float (- (-> self clock frame-counter) (-> self state-time)))))) + ) + ) + (let* ((f0-16 (* 164.25063 (the float (- (-> self clock frame-counter) (-> self state-time))))) + (f0-19 (lerp-scale 70.0 120.0 (fabs (cos f0-16)) 1.0 0.0)) + ) + (set! (-> self draw force-fade) + (the-as + uint + (the int (lerp-scale 128.0 f0-19 (the float (- (-> self clock frame-counter) (-> self state-time))) 0.0 37.5)) + ) + ) + ) + (set! (-> self shield-timer) + (- (-> self clock frame-counter) + (the-as time-frame (the int (lerp-scale 0.0 600.0 (the float (-> self draw force-fade)) 0.0 128.0))) + ) + ) + (set! (-> gp-3 x) (fabs (cos f30-0))) + (set! (-> gp-3 y) (fabs (sin f30-0))) + ) + (set! (-> gp-3 z) 0.0) + (set! (-> gp-3 w) 1.0) + (set-shield-color! gp-3) + (set! (-> self shield-color quad) (-> gp-3 quad)) + (vector-float*! gp-3 gp-3 0.5) + (set-shield-flash! gp-3) + (set! (-> gp-3 w) 1.0) + ) + (dotimes (gp-4 6) + (send-event (handle->process (-> self tentacles gp-4)) 'set-fade (-> self draw force-fade)) + (when (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (case (-> self stage) + ((1) + (send-event (handle->process (-> self tentacles gp-4)) 'wrap *squid-second-pole*) + ) + (else + (send-event (handle->process (-> self tentacles gp-4)) 'wrap *squid-first-pole*) + ) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +;; WARN: Return type mismatch number vs none. +(defbehavior squid-adjust-fly-anim squid () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 (-> self draw art-group data 21))) + (ja :num! (seek!)) + (if (>= 5.0 (ja-frame-num 0)) + (set! (-> self allowed-rotate-to-vector-angle) 0.0) + ) + (when (or (ja-done? 0) (< -364.0889 (-> self desired-rotate-to-vector-angle))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 23) + :num! (identity (the float (max 0 (- 20 (the int (ja-aframe-num 0)))))) + ) + ) + ) + ((let ((v1-26 (ja-group))) + (and (and v1-26 (= v1-26 (-> self draw art-group data 23))) (< (-> self desired-rotate-to-vector-angle) 0.0)) + ) + (ja :num! (seek!)) + (if (ja-done? 0) + (ja :group! (-> self draw art-group data 3) :num! min) + ) + ) + ((let ((v1-44 (ja-group))) + (and v1-44 (= v1-44 (-> self draw art-group data 24))) + ) + (ja :num! (seek!)) + (if (>= 5.0 (ja-frame-num 0)) + (set! (-> self allowed-rotate-to-vector-angle) 0.0) + ) + (when (or (ja-done? 0) (< (-> self desired-rotate-to-vector-angle) 364.0889)) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 26) + :num! (identity (the float (max 0 (- 105 (the int (ja-aframe-num 0)))))) + ) + ) + ) + (else + (let ((v1-68 (ja-group))) + (cond + ((and (and v1-68 (= v1-68 (-> self draw art-group data 26))) (< 0.0 (-> self desired-rotate-to-vector-angle))) + (ja :num! (seek!)) + (if (ja-done? 0) + (ja :group! (-> self draw art-group data 3) :num! min) + ) + ) + ((< (-> self desired-rotate-to-vector-angle) -910.2222) + (set! (-> self allowed-rotate-to-vector-angle) 0.0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 21) :num! min) + (set! (-> self jet-volume) (the-as int (-> self clock frame-counter))) + (set! (-> self jet-pitch) (the-as int (-> self clock frame-counter))) + (set! (-> self negate-jet-pitch) #f) + ) + ((< 910.2222 (-> self desired-rotate-to-vector-angle)) + (set! (-> self allowed-rotate-to-vector-angle) 0.0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 24) :num! min) + (set! (-> self jet-volume) (the-as int (-> self clock frame-counter))) + (set! (-> self jet-pitch) (the-as int (-> self clock frame-counter))) + (set! (-> self negate-jet-pitch) #f) + ) + ((let ((v1-106 (ja-group))) + (and v1-106 (= v1-106 (-> self draw art-group data 3))) + ) + (ja :num! (loop!)) + ) + (else + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 3) :num! min) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +(defstate fly-to-post (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (squid-talker 'no-energy) + (set! (-> self can-play-squid-boost) #t) + (case (-> self stage) + ((1) + (set-traj-towards-vec self (-> self trans) (-> self trans) *squid-second-pole*) + ) + (else + (set-traj-towards-vec self (-> self trans) (-> self trans) *squid-first-pole*) + ) + ) + (none) + ) + :trans (behavior () + (if (and (zero? (-> self hit-points)) + (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + ) + (go-virtual pre-flee) + ) + (squid-adjust-fly-anim) + (let ((f0-0 (float-sin-clamp self (squid-method-48 self)))) + (if (< 0.5 f0-0) + (set! (-> self force-onto-mesh) #f) + ) + (if (>= f0-0 1.0) + (go-virtual recharge) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +(defstate headbut (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (squid-talker 'headbutting) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self traj-timer) (-> self clock frame-counter)) + (vector-reset! (-> self residual-velocity)) + (set! (-> self can-play-squid-boost) #t) + (none) + ) + :exit (behavior () + (sound-play "squid-rush-end") + (set! (-> self rush-end-time) (-> self clock frame-counter)) + (let ((v1-5 (ja-group))) + (when (and v1-5 (= v1-5 (-> self draw art-group data 5))) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 6) :num! min) + (sound-play "sqd-shield-down") + (set! (-> self jet-volume) (the-as int (-> self clock frame-counter))) + (set! (-> self jet-pitch) (the-as int (-> self clock frame-counter))) + (set! (-> self negate-jet-pitch) #t) + ) + ) + (none) + ) + :trans (behavior () + (if (and (zero? (-> self hit-points)) + (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + ) + (go-virtual pre-flee) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 3)) + (go-virtual fly-to-shoot-spot) + ) + (let ((v1-17 (ja-group))) + (cond + ((and v1-17 (= v1-17 (-> self draw art-group data 4))) + (ja :num! (seek!)) + (when (and (-> self can-play-squid-boost) (< 30.0 (ja-aframe-num 0))) + (sound-play "squid-boost") + (set! (-> self can-play-squid-boost) #f) + (set! (-> self jet-volume) (the-as int (-> self clock frame-counter))) + (set! (-> self jet-pitch) (the-as int (-> self clock frame-counter))) + (set! (-> self negate-jet-pitch) #f) + (set! (-> self rush-sound-playing) #t) + (set! (-> self rush-end-time) 0) + 0 + ) + (if (ja-done? 0) + (ja :group! (-> self draw art-group data 5) :num! min) + ) + (if (< (ja-aframe-num 0) 20.0) + (squid-method-42 self (-> self traj-dest)) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (else + (let ((v1-53 (ja-group))) + (cond + ((and v1-53 (= v1-53 (-> self draw art-group data 5))) + (ja :num! (loop!)) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 4) :num! min) + ) + ) + ) + ) + ) + ) + (squid-method-43 self (-> self traj-dest) 22.755556 0.75) + (let ((gp-3 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.017)) + (let ((f0-8 (vector-vector-xz-distance-squared (-> self traj-dest) (-> self trans))) + (f1-1 8192.0) + ) + (< f0-8 (* f1-1 f1-1)) + ) + ) + (go-virtual fly-to-shoot-spot) + ) + (when (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.017)) (-> self mesh-forced)) + (vector-reset! (-> self residual-velocity)) + (go-virtual fly-to-shoot-spot) + ) + (let ((v1-89 (ja-group))) + (when (and v1-89 (or (= v1-89 (-> self draw art-group data 4)) (= v1-89 (-> self draw art-group data 5)))) + (set! (-> gp-3 quad) (-> self traj-dest quad)) + (set! (-> s3-0 quad) (-> self traj-dest quad)) + (clamp-vector-to-mesh-cross-gaps (-> self nav) gp-3 (-> self current-nav-poly) s3-0 409600.0 #f s2-0) + (set! (-> self residual-velocity quad) (-> self trans quad)) + (let ((f30-1 + (lerp-scale 0.01 1.0 (+ -375.0 (the float (- (-> self clock frame-counter) (-> self traj-timer)))) 0.0 150.0) + ) + ) + (set! (-> gp-3 y) (-> self trans y)) + (vector-seek-3d-smooth! (-> self trans) gp-3 (* 4096.0 f30-1) 0.5) + (set! (-> gp-3 quad) (-> self trans quad)) + (set! (-> self current-nav-poly) + (cloest-point-on-mesh (-> self nav) gp-3 (-> self trans) (-> self current-nav-poly)) + ) + (let ((s2-1 (-> self nav)) + (a1-15 (-> self current-nav-poly)) + (s3-1 s5-1) + ) + (let ((v1-105 gp-3)) + (project-point-onto-plane-of-poly-local + (-> s2-1 state mesh) + a1-15 + s3-1 + s4-0 + (vector-! (new 'stack-no-clear 'vector) v1-105 (-> s2-1 state mesh bounds)) + ) + ) + (vector+! s3-1 s3-1 (-> s2-1 state mesh bounds)) + ) + 0 + (set! (-> s5-1 y) (+ 20480.0 (-> s5-1 y))) + (set! (-> self trans y) (lerp (-> self trans y) (-> s5-1 y) (* 0.4 f30-1))) + ) + (set! (-> self trans y) (fmax (-> self trans y) (fmin (-> s5-1 y) (-> gp-3 y)))) + (vector-! (-> self residual-velocity) (-> self trans) (-> self residual-velocity)) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +;; WARN: Return type mismatch int vs time-frame. +(defbehavior squid-whirlwind-time squid () + (the-as time-frame (cond + ((>= 0.4 (-> self suck)) + 900 + ) + ((>= 0.7 (-> self suck)) + 780 + ) + (else + 570 + ) + ) + ) + ) + +(defstate fire-whirlwind (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (squid-talker 'shooting) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self stop-shooting) #f) + (set! (-> self traj-timer) 0) + (set! (-> self tentacle-base-rotation-speed target) 1.0) + (dotimes (gp-0 6) + (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel #x3f428f5c) + ) + (none) + ) + :exit (behavior () + (set! (-> self tentacle-base-rotation-speed target) 0.0) + (dotimes (gp-0 6) + (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel #x3f333333) + ) + (none) + ) + :trans (behavior () + (if (and (zero? (-> self hit-points)) + (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + ) + (go-virtual pre-flee) + ) + (let ((v1-10 (ja-group))) + (cond + ((not (and v1-10 (= v1-10 (-> self draw art-group data 3)))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 3) :num! min) + ) + (else + (ja :num! (loop!)) + ) + ) + ) + (squid-method-43 self (squid-method-42 self (new 'stack-no-clear 'vector)) 9.102222 0.75) + (when (or (>= (- (-> self clock frame-counter) (-> self state-time)) (squid-whirlwind-time)) + (-> self stop-shooting) + ) + (vector-reset! (-> self residual-velocity)) + (go-virtual fly-to-shoot-spot) + ) + (when (>= (- (-> self clock frame-counter) (-> self traj-timer)) (seconds 0.7)) + (spawn-whirlwind self) + (set! (-> self traj-timer) (-> self clock frame-counter)) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defbehavior setup-grenade squid ((arg0 int)) + (let ((s5-0 (squid-method-42 self (new 'stack-no-clear 'vector))) + (f28-0 (rand-vu-float-range 0.0 3276.8)) + (f30-0 (rand-vu-float-range 8192.0 24576.0)) + (gp-0 (-> self grenade arg0)) + ) + (let ((f28-1 (+ f28-0 (* 6553.6 (the float arg0))))) + (set! (-> gp-0 target-position quad) (-> s5-0 quad)) + (set-vector! (-> gp-0 target-position) (sin f28-1) 0.0 (cos f28-1) 1.0) + ) + (vector+float*! s5-0 s5-0 (-> gp-0 target-position) f30-0) + (set! (-> s5-0 y) (-> self nav state mesh bounds y)) + (set! (-> gp-0 target-position quad) (-> s5-0 quad)) + (let ((a1-5 (cloest-point-on-mesh (-> self nav) s5-0 s5-0 (the-as nav-poly #f))) + (a3-1 (new 'stack-no-clear 'vector)) + (s3-0 (-> self nav)) + (s4-2 s5-0) + ) + (let ((v1-13 s5-0)) + (project-point-onto-plane-of-poly-local + (-> s3-0 state mesh) + a1-5 + s4-2 + a3-1 + (vector-! (new 'stack-no-clear 'vector) v1-13 (-> s3-0 state mesh bounds)) + ) + ) + (vector+! s4-2 s4-2 (-> s3-0 state mesh bounds)) + ) + 0 + (set! (-> s5-0 y) (+ 409.6 (-> s5-0 y))) + (set! (-> gp-0 target-position y) (-> s5-0 y)) + (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) + (set! (-> gp-0 marker) + (ppointer->handle + (when s5-1 + (let ((t9-8 (method-of-type part-tracker activate))) + (t9-8 (the-as part-tracker s5-1) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-9 run-function-in-process) + (a0-17 s5-1) + (a1-8 part-tracker-init) + (a2-7 (-> *part-group-id-table* 1119)) + (a3-3 0) + (t0-2 #f) + (t1-2 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> gp-0 target-position quad)) + ((the-as (function object object object object object object object object none) t9-9) + a0-17 + a1-8 + a2-7 + a3-3 + t0-2 + t1-2 + t2-0 + t3-0 + ) + ) + (-> s5-1 ppointer) + ) + ) + ) + ) + (set! (-> gp-0 show-it) #t) + ) + (none) + ) + +(defstate fire-grenades (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (squid-talker 'shooting) + (set! (-> self state-time) 0) + (set! (-> self stop-shooting) #f) + (setup-masks (-> self draw) 30 0) + (dotimes (gp-0 6) + (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel #x3f428f5c) + ) + (none) + ) + :exit (behavior () + (dotimes (gp-0 6) + (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel #x3f333333) + ) + (none) + ) + :trans (behavior () + (if (and (zero? (-> self hit-points)) + (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + ) + (go-virtual pre-flee) + ) + (squid-method-43 self (squid-method-42 self (new 'stack-no-clear 'vector)) 22.755556 0.75) + (let ((v1-13 (ja-group))) + (cond + ((and v1-13 (= v1-13 (-> self draw art-group data 7))) + (ja :num! (seek!)) + (when (ja-done? 0) + (cond + ((or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) + (ja :group! (-> self draw art-group data 15) :num! min) + ) + ((-> self fire-aft) + (ja :group! (-> self draw art-group data 11) :num! min) + (set! (-> self fire-aft) #f) + ) + (else + (ja :group! (-> self draw art-group data 8) :num! min) + (set! (-> self fire-aft) #t) + ) + ) + ) + ) + ((let ((v1-44 (ja-group))) + (and v1-44 (= v1-44 (-> self draw art-group data 8))) + ) + (ja :num! (seek!)) + (cond + ((not (ja-done? 0)) + ) + ((or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) + (ja :group! (-> self draw art-group data 10) :num! min) + ) + (else + (ja :group! (-> self draw art-group data 9) :num! min) + (setup-grenade 0) + (setup-grenade 5) + (spawn-grenade self 51 (the-as squid-grenade-holder (-> self grenade)) 2.0) + (spawn-grenade self 56 (-> self grenade 5) 1.0) + (setup-masks (-> self draw) 0 2) + (set! (-> self next-gun) 1) + ) + ) + ) + ((let ((v1-75 (ja-group))) + (and v1-75 (= v1-75 (-> self draw art-group data 9))) + ) + (ja :num! (seek!)) + (cond + ((or (and (= (-> self next-gun) 5) (not (ja-done? 0))) + (and (< (-> self next-gun) 5) (< (ja-aframe-num 0) 65.0)) + ) + ) + ((or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) + (set! (-> self next-gun) 0) + (ja :group! (-> self draw art-group data 10) :num! min) + ) + ((< (-> self next-gun) (squid-num-grenades-to-shoot)) + (setup-grenade (-> self next-gun)) + (setup-grenade (+ (-> self next-gun) 5)) + (spawn-grenade self 52 (-> self grenade (-> self next-gun)) 2.0) + (spawn-grenade self 57 (-> self grenade (+ (-> self next-gun) 5)) 1.0) + (setup-masks (-> self draw) 0 4) + (+! (-> self next-gun) 1) + (ja :group! (-> self draw art-group data 9) :num! min) + ) + (else + (set! (-> self next-gun) 0) + (ja :group! (-> self draw art-group data 10) :num! min) + ) + ) + ) + ((let ((v1-124 (ja-group))) + (and v1-124 (= v1-124 (-> self draw art-group data 10))) + ) + (ja :num! (seek!)) + (if (ja-done? 0) + (ja :group! (-> self draw art-group data 15) :num! min) + ) + ) + ((let ((v1-141 (ja-group))) + (and v1-141 (= v1-141 (-> self draw art-group data 11))) + ) + (ja :num! (seek!)) + (cond + ((not (ja-done? 0)) + ) + ((or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) + (ja :group! (-> self draw art-group data 13) :num! min) + ) + (else + (ja :group! (-> self draw art-group data 12) :num! min) + (setup-grenade 0) + (setup-grenade 5) + (spawn-grenade self 53 (the-as squid-grenade-holder (-> self grenade)) 2.0) + (spawn-grenade self 58 (-> self grenade 5) 1.0) + (setup-masks (-> self draw) 0 8) + (set! (-> self next-gun) 1) + ) + ) + ) + ((let ((v1-172 (ja-group))) + (and v1-172 (= v1-172 (-> self draw art-group data 12))) + ) + (ja :num! (seek!)) + (cond + ((or (and (= (-> self next-gun) 5) (not (ja-done? 0))) + (and (< (-> self next-gun) 5) (< (ja-aframe-num 0) 165.0)) + ) + ) + ((or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) + (set! (-> self next-gun) 0) + (ja :group! (-> self draw art-group data 13) :num! min) + ) + ((< (-> self next-gun) (squid-num-grenades-to-shoot)) + (setup-grenade (-> self next-gun)) + (setup-grenade (+ (-> self next-gun) 5)) + (spawn-grenade self 54 (-> self grenade (-> self next-gun)) 2.0) + (spawn-grenade self 59 (-> self grenade (+ (-> self next-gun) 5)) 1.0) + (setup-masks (-> self draw) 0 16) + (+! (-> self next-gun) 1) + (ja :group! (-> self draw art-group data 12) :num! min) + ) + (else + (set! (-> self next-gun) 0) + (ja :group! (-> self draw art-group data 13) :num! min) + ) + ) + ) + ((let ((v1-221 (ja-group))) + (and v1-221 (= v1-221 (-> self draw art-group data 13))) + ) + (ja :num! (seek!)) + (if (ja-done? 0) + (ja :group! (-> self draw art-group data 15) :num! min) + ) + ) + ((let ((v1-238 (ja-group))) + (and v1-238 (= v1-238 (-> self draw art-group data 15))) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 3) :num! min) + (cond + ((= (-> self shield-hit-points) 0.0) + (go-virtual fly-to-post) + ) + (else + (vector-reset! (-> self residual-velocity)) + (go-virtual fly-to-shoot-spot) + ) + ) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.15)) + (ja :group! (-> self draw art-group data 7) :num! min) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +(defstate fire (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (squid-talker 'shooting) + (set! (-> self state-time) 0) + (set! (-> self stop-shooting) #f) + (let ((s4-0 (squid-method-42 self (new 'stack-no-clear 'vector))) + (gp-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-! gp-0 s4-0 (-> self trans)) + (set! (-> gp-0 y) 0.0) + (if (< (vector-normalize-ret-len! gp-0 49152.0) 49152.0) + (set! (-> gp-0 quad) (-> s4-0 quad)) + (vector+! gp-0 gp-0 (-> self trans)) + ) + (set! (-> gp-0 y) (+ 8192.0 (-> self nav state mesh bounds y))) + (set! (-> s5-0 quad) (-> gp-0 quad)) + (set! (-> s5-0 y) (+ -40960.0 (-> s5-0 y))) + (set! (-> self gun-high-to-low) (squid-method-44 self gp-0 s5-0)) + ) + (dotimes (gp-1 6) + (send-event (handle->process (-> self tentacles gp-1)) 'set-stretch-vel #x3f428f5c) + ) + (none) + ) + :exit (behavior () + (dotimes (gp-0 6) + (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel #x3f333333) + ) + (none) + ) + :trans (behavior () + (if (and (zero? (-> self hit-points)) + (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + ) + (go-virtual pre-flee) + ) + (let ((s5-0 (squid-method-42 self (new 'stack-no-clear 'vector)))) + (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self quat)) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (f30-0 0.0) + ) + (vector-! s5-0 s5-0 (-> self trans)) + (squid-method-43 + self + (squid-method-42 self (new 'stack-no-clear 'vector)) + (lerp-scale 18.204445 9.102222 (-> self suck) 0.0 1.0) + 0.75 + ) + (when #t + (vector-flatten! gp-0 s5-0 (the-as vector (-> self node-list data 36 bone transform))) + (vector-normalize-copy! gp-0 gp-0 1.0) + (let ((f30-1 (- (asin (vector-dot gp-0 (-> self node-list data 36 bone transform vector 2)))))) + (set! f30-0 + (cond + ((and (zero? (-> self state-time)) (not (-> self gun-high-to-low))) + (+ 3640.889 f30-1) + ) + ((zero? (-> self state-time)) + (+ -3640.889 f30-1) + ) + ((-> self gun-high-to-low) + (+ f30-1 + (lerp-scale -1820.4445 910.2222 (the float (- (-> self clock frame-counter) (-> self state-time))) 0.0 900.0) + ) + ) + (else + (+ f30-1 + (lerp-scale 3640.889 -910.2222 (the float (- (-> self clock frame-counter) (-> self state-time))) 0.0 900.0) + ) + ) + ) + ) + ) + ) + (+! (-> self gun-tilt) (fmin 364.0889 (fmax -364.0889 (* 0.3 f30-0)))) + ) + ) + (set! (-> self gun-tilt) (fmin 8192.0 (fmax -8192.0 (-> self gun-tilt)))) + (let ((f30-2 (* 0.5 (-> self gun-tilt)))) + (quaternion-set! (-> self gun-tilt-left-jm quat) (sin f30-2) 0.0 0.0 (cos f30-2)) + ) + (quaternion-copy! (-> self gun-tilt-right-jm quat) (-> self gun-tilt-left-jm quat)) + (let ((v1-50 (ja-group))) + (cond + ((and v1-50 (= v1-50 (-> self draw art-group data 16))) + (ja :num! (seek!)) + (when (and (= (-> self next-gun) 1) (>= (ja-aframe-num 0) 250.0)) + (squid-method-53 self 39) + (squid-method-53 self 46) + (set! (-> self next-gun) 0) + 0 + ) + (if (ja-done? 0) + (ja :group! (-> self draw art-group data 17) :num! min) + ) + ) + ((let ((v1-77 (ja-group))) + (and v1-77 (= v1-77 (-> self draw art-group data 17))) + ) + (if (or (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 3)) + (or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) + ) + (ja :num! (seek!)) + (ja :num! (loop!)) + ) + (cond + ((and (zero? (-> self next-gun)) (>= (ja-aframe-num 0) 254.0) (< (ja-aframe-num 0) 258.0)) + (squid-method-53 self 42) + (squid-method-53 self 49) + (set! (-> self next-gun) 1) + ) + ((and (= (-> self next-gun) 1) (>= (ja-aframe-num 0) 258.0)) + (squid-method-53 self 39) + (squid-method-53 self 46) + (set! (-> self next-gun) 0) + 0 + ) + ) + (if (and (or (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 3)) + (or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) + ) + (ja-done? 0) + ) + (ja :group! (-> self draw art-group data 18) :num! min) + ) + ) + ((let ((v1-132 (ja-group))) + (and v1-132 (= v1-132 (-> self draw art-group data 18))) + ) + (ja :num! (seek!)) + (when (and (zero? (-> self next-gun)) (>= (ja-aframe-num 0) 262.0)) + (squid-method-53 self 42) + (squid-method-53 self 49) + (set! (-> self next-gun) 1) + ) + (if (ja-done? 0) + (ja :group! (-> self draw art-group data 19) :num! min) + ) + ) + (else + (let ((v1-158 (ja-group))) + (cond + ((and v1-158 (= v1-158 (-> self draw art-group data 19))) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 3) :num! min) + (cond + ((= (-> self shield-hit-points) 0.0) + (go-virtual fly-to-post) + ) + (else + (vector-reset! (-> self residual-velocity)) + (go-virtual fly-to-shoot-spot) + ) + ) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 16) :num! min) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self next-gun) 1) + ) + ) + ) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +(defstate fly-to-shoot-spot (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (set! (-> self can-play-squid-boost) #t) + (move-to-spot self (-> self trans) #t) + (dotimes (gp-0 6) + (send-event (handle->process (-> self tentacles gp-0)) 'set-gravity-slow (new 'static 'vector :y -1.0)) + ) + (set! (-> self reload-played) #f) + (none) + ) + :exit (behavior () + (set! (-> self force-onto-mesh) #t) + (none) + ) + :trans (behavior () + (squid-talker 'general) + (cond + ((and (zero? (-> self hit-points)) + (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + ) + (go-virtual pre-flee) + ) + ((and (= (-> self shield-hit-points) 0.0) (< (-> self stage) 2)) + (go-virtual fly-to-post) + ) + ) + (squid-adjust-fly-anim) + (when (and (zero? (-> self stage)) + (not (-> self reload-played)) + (< (- (-> self traj-duration) (the float (- (-> self clock frame-counter) (-> self traj-timer)))) -210.0) + ) + (sound-play "squid-reload") + (set! (-> self reload-played) #t) + ) + (when (>= (float-sin-clamp self (squid-method-48 self)) 1.0) + (dotimes (gp-2 6) + (send-event (handle->process (-> self tentacles gp-2)) 'set-gravity-slow (new 'static 'vector :y -1.0)) + ) + (case (-> self stage) + ((2) + (cond + ((or (>= (-> self stage-2-go-status) 2) (and (< -2 (-> self stage-2-go-status)) (< (rand-vu) 0.5))) + (set! (-> self stage-2-go-status) (min -1 (+ (-> self stage-2-go-status) -1))) + (go-virtual fire-whirlwind) + ) + (else + (set! (-> self stage-2-go-status) (max 1 (+ (-> self stage-2-go-status) 1))) + (go-virtual headbut) + ) + ) + ) + ((1) + (go-virtual fire-grenades) + ) + (else + (if (not (-> self reload-played)) + (sound-play "squid-reload") + ) + (go-virtual fire) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +(defstate idle (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (set-setting! 'music 'danger4 0 0) + (set! (-> self driver-blend target) 1.0) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self hud) (ppointer->handle (process-spawn hud-squid :init hud-init-by-other :to self))) + (vector+! (-> self trans) (-> self trans) (new 'static 'vector :x 101171.2 :y 45056.0 :z 31047.68)) + (let ((v1-14 (squid-method-42 self (new 'stack-no-clear 'vector)))) + (vector-! v1-14 v1-14 (-> self trans)) + (let ((f30-1 (* 0.5 (atan (-> v1-14 x) (-> v1-14 z))))) + (set! (-> self quat x) 0.0) + (set! (-> self quat y) (sin f30-1)) + (set! (-> self quat z) 0.0) + (set! (-> self quat w) (cos f30-1)) + ) + ) + (sound-play "squid-reload") + (go-virtual fire) + (none) + ) + :trans (behavior () + (ja :num! (loop!)) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 3)) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +(defstate hidden (squid) + :virtual #t + :enter (behavior () + (ja-channel-set! 0) + (ja-post) + (none) + ) + :exit (behavior () + (ja-channel-push! 1 0) + (ja :group! (-> self draw art-group data 3) :num! min) + (none) + ) + :trans (behavior () + (cond + ((< (fabs (-> (squid-method-42 self (new 'stack-no-clear 'vector)) x)) 4096.0) + ) + (else + (when (task-node-closed? (game-task-node palace-boss-introduction)) + (let ((f0-2 (vector-vector-xz-distance-squared (-> self trans) (target-pos 0))) + (f1-1 217088.0) + ) + (cond + ((< f0-2 (* f1-1 f1-1)) + (set! (-> self allowed-rotate-to-vector-angle) 32768.0) + (squid-method-43 self (squid-method-42 self (new 'stack-no-clear 'vector)) 32585.955 0.999) + (go-virtual idle) + ) + ((let ((f1-4 286720.0)) + (< f0-2 (* f1-4 f1-4)) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + ) diff --git a/goal_src/jak2/levels/palace/roof/palboss-texture.gc b/goal_src/jak2/levels/palace/roof/palboss-texture.gc index fd50d32475..ddcdf6c552 100644 --- a/goal_src/jak2/levels/palace/roof/palboss-texture.gc +++ b/goal_src/jak2/levels/palace/roof/palboss-texture.gc @@ -26,27 +26,31 @@ ) (defun set-shield-color! ((arg0 vector)) - (let ((v1-1 (-> *shield-texture-anim-array* array-data 0))) - (set! (-> v1-1 data 1 start-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 1 end-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 2 start-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 2 end-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 3 start-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 3 end-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 4 start-color quad) (-> arg0 quad)) - (let ((v0-0 (-> v1-1 data 4 end-color))) - (set! (-> v0-0 quad) (-> arg0 quad)) - v0-0 - ) - ) + ;; TODO - Underlying color vectors don't seem to set up properly yet! + ;; (let ((v1-1 (-> *shield-texture-anim-array* array-data 0))) + ;; (set! (-> v1-1 data 1 start-color quad) (-> arg0 quad)) + ;; (set! (-> v1-1 data 1 end-color quad) (-> arg0 quad)) + ;; (set! (-> v1-1 data 2 start-color quad) (-> arg0 quad)) + ;; (set! (-> v1-1 data 2 end-color quad) (-> arg0 quad)) + ;; (set! (-> v1-1 data 3 start-color quad) (-> arg0 quad)) + ;; (set! (-> v1-1 data 3 end-color quad) (-> arg0 quad)) + ;; (set! (-> v1-1 data 4 start-color quad) (-> arg0 quad)) + ;; (let ((v0-0 (-> v1-1 data 4 end-color))) + ;; (set! (-> v0-0 quad) (-> arg0 quad)) + ;; v0-0 + ;; ) + ;; ) + arg0 ) (defun set-shield-flash! ((arg0 vector)) - (let ((v1-1 (-> *shield-texture-anim-array* array-data 0))) - (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) - (let ((v0-0 (-> v1-1 data 0 end-color))) - (set! (-> v0-0 quad) (-> arg0 quad)) - v0-0 - ) - ) + ;; TODO - Underlying color vectors don't seem to set up properly yet! + ;; (let ((v1-1 (-> *shield-texture-anim-array* array-data 0))) + ;; (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) + ;; (let ((v0-0 (-> v1-1 data 0 end-color))) + ;; (set! (-> v0-0 quad) (-> arg0 quad)) + ;; v0-0 + ;; ) + ;; ) + arg0 ) diff --git a/test/decompiler/reference/jak2/levels/palace/boss/squid-extras_REF.gc b/test/decompiler/reference/jak2/levels/palace/boss/squid-extras_REF.gc new file mode 100644 index 0000000000..d0d6921339 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/palace/boss/squid-extras_REF.gc @@ -0,0 +1,579 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defstate idle (squid-driver) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('matrix) + (let ((v0-0 (the-as object (-> event param 0)))) + (let* ((a2-1 (-> self node-list data 3 bone transform)) + (v1-3 (-> a2-1 quad 0)) + (a0-2 (-> a2-1 quad 1)) + (a1-1 (-> a2-1 quad 2)) + (a2-2 (-> a2-1 trans quad)) + ) + (set! (-> (the-as matrix v0-0) quad 0) v1-3) + (set! (-> (the-as matrix v0-0) quad 1) a0-2) + (set! (-> (the-as matrix v0-0) quad 2) a1-1) + (set! (-> (the-as matrix v0-0) trans quad) a2-2) + ) + v0-0 + ) + ) + ) + ) + ) + :trans (behavior () + (ja :num! (loop!)) + (ja-post) + (none) + ) + :code (the-as (function none :behavior squid-driver) sleep-code) + ) + +;; failed to figure out what this is: +(defstate idle (squid-baron) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (rlet ((vf0 :class vf)) + (init-vf0-vector) + (the-as object (case event-type + (('color) + (.svf (&-> (-> self draw color-mult) quad) vf0) + (set! (-> self draw color-mult w) 1.0) + (let ((v0-0 (-> self draw color-emissive))) + (set! (-> v0-0 quad) (-> (the-as rgbaf (-> event param 0)) quad)) + v0-0 + ) + ) + ) + ) + ) + ) + :trans (behavior () + (clone-anim-once (ppointer->handle (-> self parent)) #f "") + (none) + ) + :code (the-as (function none :behavior squid-baron) sleep-code) + ) + +;; failed to figure out what this is: +(defstate test (squid-tentacle) + :virtual #t + :event squid-tentacle-handler + :enter (behavior () + (joint-setup self) + (none) + ) + :trans (behavior () + (ja :num! (loop!)) + (squid-tentacle-method-23 self) + (dotimes (v1-6 11) + ) + (none) + ) + :code (the-as (function none :behavior squid-tentacle) sleep-code) + :post (behavior () + (transform-post) + (do-push-aways (-> self root-override)) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate idle (squid-tentacle) + :virtual #t + :event squid-tentacle-handler + :trans (behavior () + (ja :num! (loop!)) + (ja-post) + (go-virtual test) + (none) + ) + :code (the-as (function none :behavior squid-tentacle) sleep-code) + :post (behavior () + (transform-post) + (do-push-aways (-> self root-override)) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate idle (squid-collision) + :virtual #t + :code (the-as (function none :behavior squid-collision) sleep-code) + ) + +;; failed to figure out what this is: +(defstate impact (squid-grenade) + :virtual #t + :enter (behavior () + (sound-play "sqd-missile-hit") + (let ((t9-2 (-> (method-of-type projectile impact) enter))) + (if t9-2 + (t9-2) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self root-override trans quad)) + (quaternion-copy! (-> gp-1 spawn-quat) (-> self root-override quat)) + (set! (-> gp-1 radius) 16384.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 1121)) + (set! (-> gp-1 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-1 penetrate-using) (penetrate explode)) + (explosion-spawn (the-as process-drawable *default-pool*) explosion gp-1) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate moving (squid-grenade) + :virtual #t + :exit (behavior () + (sound-stop (-> self fly-sound)) + (let ((t9-1 (-> (method-of-type projectile moving) exit))) + (if t9-1 + (t9-1) + ) + ) + (none) + ) + ) + +;; definition for function squid-grenade-move +;; WARN: Return type mismatch int vs none. +(defun squid-grenade-move ((arg0 squid-grenade)) + (local-vars (at-0 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((f28-0 (/ (the float (- (-> pp clock frame-counter) (-> arg0 traj-timer))) (-> arg0 traj-duration))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((f30-0 (compute-time-until-apex (-> arg0 traj)))) + (if (>= f28-0 1.0) + (go (method-of-object arg0 impact)) + ) + (vector-! s5-0 (-> arg0 traj-dest) (the-as vector (-> arg0 traj))) + (vector-normalize! + s5-0 + (* (lerp-scale 1.0 0.0 f28-0 (* 1.5 f30-0) 1.0) (lerp-scale 0.0 20480.0 f28-0 0.0 0.06)) + ) + (let ((f28-1 (* f28-0 f28-0))) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (compute-trans-at-time (-> arg0 traj) f28-1 s4-1) + (vector+! s5-0 s5-0 s4-1) + ) + (let ((s3-1 (new 'stack-no-clear 'matrix))) + (vector-normalize! (compute-transv-at-time (-> arg0 traj) f28-1 (-> s3-1 vector 2)) 1.0) + (vector-normalize! + (vector-cross! (the-as vector (-> s3-1 vector)) (new 'static 'vector :y 1.0) (-> s3-1 vector 2)) + 1.0 + ) + (vector-cross! (-> s3-1 vector 1) (-> s3-1 vector 2) (the-as vector (-> s3-1 vector))) + (when (>= f30-0 f28-1) + (let ((s4-3 (new 'stack-no-clear 'vector))) + (let ((f26-1 (/ 4.0 f30-0))) + (if (< 1.5 (-> arg0 charge-level)) + (vector-float*! s4-3 (the-as vector (-> s3-1 vector)) (* 8192.0 (+ -1.0 (cos (* 65536.0 f28-1 f26-1))))) + (vector-float*! s4-3 (the-as vector (-> s3-1 vector)) (* 8192.0 (- 1.0 (cos (* 65536.0 f28-1 f26-1))))) + ) + (vector+float*! s4-3 s4-3 (-> s3-1 vector 1) (* -8192.0 (sin (* 65536.0 f28-1 f26-1)))) + ) + (vector+float*! s5-0 s5-0 s4-3 (lerp-scale 1.0 0.0 f28-1 0.0 f30-0)) + ) + ) + ) + ) + ) + (vector-! (-> arg0 root-override transv) s5-0 (-> arg0 root-override trans)) + ) + (let ((v1-33 (-> arg0 root-override transv))) + (.lvf vf1 (&-> (-> arg0 root-override transv) quad)) + (let ((f0-28 (-> pp clock frames-per-second))) + (.mov at-0 f0-28) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-33 quad) vf1) + ) + (let* ((s5-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> arg0 root-override quat))) + (a2-6 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root-override transv) 1.0)) + (a1-16 (quaternion-from-two-vectors! (new 'stack-no-clear 'quaternion) (-> s5-1 vector 2) a2-6)) + ) + (quaternion-normalize! (quaternion*! (-> arg0 root-override quat) a1-16 (-> arg0 root-override quat))) + ) + (projectile-move-fill-line-sphere arg0) + (if (logtest? (-> arg0 root-override status) (collide-status touch-surface)) + (go (method-of-object arg0 impact)) + ) + (sound-play "sqd-missl-trail" :id (-> arg0 fly-sound) :position (-> arg0 root-override trans)) + 0 + (none) + ) + ) + ) + +;; definition for method 39 of type squid-grenade +;; WARN: Return type mismatch int vs sound-id. +(defmethod play-impact-sound! squid-grenade ((obj squid-grenade)) + "Plays impact sound" + (ja-post) + (the-as sound-id 0) + ) + +;; definition for method 30 of type squid-grenade +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-collision! squid-grenade ((obj squid-grenade)) + "Init the [[projectile]]'s [[collide-shape]]" + (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) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) + (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + dark-punch + dark-giant + ) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-7 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-7 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 2048.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-7) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-10 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> obj root-override) s5-0) + ) + (set! (-> obj root-override pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-squid-grenade" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj draw light-index) (the-as uint 10)) + (when (-> obj draw shadow) + (set! (-> obj draw shadow-ctrl) + (new 'process 'shadow-control -204800.0 4096.0 4096000.0 (shadow-flags) 819200.0) + ) + (let ((v1-25 (-> obj draw shadow-ctrl))) + (logclear! (-> v1-25 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + 0 + (none) + ) + +;; definition for method 31 of type squid-grenade +(defmethod init-proj-settings! squid-grenade ((obj squid-grenade)) + "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" + (with-pp + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1120) obj)) + (set! (-> obj attack-mode) 'squid-grenade) + (set! (-> obj max-speed) 655360.0) + (set! (-> obj move) squid-grenade-move) + (set! (-> obj timeout) (seconds 5)) + (set! (-> obj stop-speed) 4.096) + (set! (-> obj fly-sound) (new-sound-id)) + (set! (-> obj traj-timer) (-> pp clock frame-counter)) + (vector+! (-> obj traj-dest) (-> obj root-override trans) (-> obj root-override transv)) + (set! (-> obj traj-duration) + (fmax 600.0 (* 0.0018310547 (vector-vector-xz-distance (-> obj root-override trans) (-> obj traj-dest)))) + ) + (+! (-> obj traj-duration) (* 75.0 (rand-vu))) + (let ((f0-8 32768.0)) + (if (< (-> obj root-override trans y) (-> obj traj-dest y)) + (+! f0-8 (- (-> obj traj-dest y) (-> obj root-override trans y))) + ) + (setup-from-to-duration-and-height! (-> obj traj) (-> obj root-override trans) (-> obj traj-dest) 1.0 f0-8) + ) + (none) + ) + ) + +;; definition for function squid-whirlwind-move +;; WARN: Return type mismatch int vs none. +(defbehavior squid-whirlwind-move squid-whirlwind () + (vector+float*! + (-> self center) + (-> self center) + (-> self center-vel) + (* 819.2 (-> self clock time-adjust-ratio)) + ) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((f30-0 + (lerp-scale 12288.0 32768.0 (the float (- (-> self clock frame-counter) (-> self state-time))) 0.0 900.0) + ) + (f28-0 + (lerp-scale 1024.0 4096.0 (the float (- (-> self clock frame-counter) (-> self state-time))) 0.0 900.0) + ) + ) + (vector-! (-> self root transv) (-> self root trans) (-> self center)) + (set-vector! gp-0 (- (-> self root transv z)) 0.0 (-> self root transv x) 1.0) + (vector-normalize! gp-0 (* 2252.8 (-> self clock time-adjust-ratio))) + (vector+! gp-0 gp-0 (-> self root trans)) + (vector-! gp-0 gp-0 (-> self center)) + (set! (-> gp-0 y) 0.0) + (let ((f0-14 (vector-length gp-0))) + (cond + ((< f0-14 (- f30-0 f28-0)) + (vector-float*! gp-0 gp-0 (/ (- f30-0 f28-0) f0-14)) + ) + ((< (+ f30-0 f28-0) f0-14) + (vector-float*! gp-0 gp-0 (/ (+ f30-0 f28-0) f0-14)) + ) + ) + ) + ) + (vector+! gp-0 gp-0 (-> self center)) + (vector-! (-> self root transv) gp-0 (-> self root trans)) + ) + (set! (-> self root transv y) 0.0) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (gp-1 (new 'stack-no-clear 'vector)) + (f30-1 (-> self root trans y)) + ) + (when (-> self current-nav-poly) + (vector+! (-> self root trans) (-> self root trans) (-> self root transv)) + (set! (-> self current-nav-poly) + (cloest-point-on-mesh (-> self nav) (-> self root trans) (-> self root trans) (-> self current-nav-poly)) + ) + (let ((s3-0 (-> self nav)) + (a1-14 (-> self current-nav-poly)) + (s4-0 gp-1) + ) + (let ((v1-41 (-> self root trans))) + (project-point-onto-plane-of-poly-local + (-> s3-0 state mesh) + a1-14 + s4-0 + s5-0 + (vector-! (new 'stack-no-clear 'vector) v1-41 (-> s3-0 state mesh bounds)) + ) + ) + (vector+! s4-0 s4-0 (-> s3-0 state mesh bounds)) + ) + 0 + (set! (-> self root trans y) (lerp f30-1 (+ 4096.0 (-> gp-1 y)) 0.1)) + ) + ) + (ja-post) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate idle (squid-whirlwind) + :virtual #t + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self duration) (the-as time-frame (+ (the int (* 150.0 (rand-vu))) 1050))) + (none) + ) + :trans (behavior () + (squid-whirlwind-move) + (ja :num! (loop!)) + (sound-play "squid-whirlwind" :id (-> self whirl-sound) :position (-> self root trans)) + (set! (-> self whirl-sound-playing) #t) + (let ((a1-2 (new 'stack-no-clear 'vector))) + (set! (-> a1-2 quad) (-> self root trans quad)) + (set! (-> a1-2 y) (+ 2048.0 (-> a1-2 y))) + (spawn (-> self part) a1-2) + ) + (when (or (>= (- (-> self clock frame-counter) (-> self state-time)) (-> self duration)) + (let ((f0-3 (vector-vector-xz-distance-squared (target-pos 0) (-> self root trans))) + (f1-1 12288.0) + ) + (< f0-3 (* f1-1 f1-1)) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (quaternion-copy! (-> gp-1 spawn-quat) (-> self root quat)) + (set! (-> gp-1 radius) 16384.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 1123)) + (set! (-> gp-1 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-1 penetrate-using) (penetrate explode)) + (explosion-spawn (the-as process-drawable *default-pool*) explosion gp-1) + ) + (sound-play "sqd-whirl-xplod") + (deactivate self) + ) + (none) + ) + :code (the-as (function none :behavior squid-whirlwind) sleep-code) + ) + +;; definition for method 10 of type squid-whirlwind +(defmethod deactivate squid-whirlwind ((obj squid-whirlwind)) + (if (-> obj whirl-sound-playing) + (sound-stop (-> obj whirl-sound)) + ) + ((method-of-type process-drawable deactivate) obj) + (none) + ) + +;; definition for function scene-tentacle-spawn +;; WARN: Return type mismatch int vs none. +(defbehavior scene-tentacle-spawn squid-tentacle ((arg0 process-drawable) (arg1 vector) (arg2 cspace)) + (let ((gp-0 0)) + (case (+ (-> arg2 joint number) 1) + ((7) + (set! gp-0 0) + ) + ((8) + (set! gp-0 1) + ) + ((9) + (set! gp-0 2) + ) + ((10) + (set! gp-0 3) + ) + ((11) + (set! gp-0 4) + ) + ((12) + (set! gp-0 5) + ) + ) + (let ((s4-0 (process-spawn squid-tentacle (-> arg0 root trans) gp-0 :to arg0))) + (send-event (ppointer->process s4-0) 'set-stretch-vel #x3f428f5c) + (send-event (ppointer->process s4-0) 'set-fade 128) + ) + ) + 0 + (none) + ) + +;; definition for method 15 of type hud-squid +;; WARN: Return type mismatch int vs none. +(defmethod draw hud-squid ((obj hud-squid)) + (set-hud-piece-position! (-> obj sprites 1) (the int (+ 462.0 (* 130.0 (-> obj offset)))) 350) + (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 1)) -32 0) + (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) -96 0) + (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites 1)) -62 14) + (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites 1)) -32 14) + (let ((s5-0 (-> obj values 0 current)) + (f28-0 (* 0.01 (the float (-> obj values 1 current)))) + (f30-0 (* 0.01 (the float (-> obj values 2 current)))) + ) + (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 1)) -92 15) + (cond + ((zero? s5-0) + (set! (-> obj sprites 3 color x) 0) + (set! (-> obj sprites 3 color y) 255) + (set! f28-0 (+ 2.0 f28-0)) + ) + ((= s5-0 1) + (set! (-> obj sprites 3 color y) 255) + (set! (-> obj sprites 3 color x) 255) + (set! f28-0 (+ 1.0 f28-0)) + ) + (else + (set! (-> obj sprites 3 color x) 255) + (set! (-> obj sprites 3 color y) 0) + 0 + ) + ) + (set! (-> obj sprites 3 scale-x) (* -7.25 f28-0)) + (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites 1)) -84 4) + (cond + ((< f30-0 0.5) + (set! (-> obj sprites 4 color x) 255) + (set! (-> obj sprites 4 color y) (the int (lerp 0.0 255.0 (* 2.0 f30-0)))) + ) + (else + (set! (-> obj sprites 4 color x) (the int (lerp 255.0 0.0 (* 2.0 (+ -0.5 f30-0))))) + (set! (-> obj sprites 4 color y) 255) + ) + ) + (set! (-> obj sprites 4 scale-x) (* -18.25 f30-0)) + ) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +;; definition for method 17 of type hud-squid +;; WARN: Return type mismatch int vs none. +(defmethod init-callback hud-squid ((obj hud-squid)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (set! (-> obj values 0 target) 0) + (set! (-> obj values 1 target) 100) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) + (set! (-> obj sprites 0 flags) (the-as uint 4)) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) + (set! (-> obj sprites 1 flags) (the-as uint 4)) + (set! (-> obj sprites 2 tex) + (lookup-texture-by-name "hud-baronsymbol-01" (the-as string #f) (the-as (pointer texture-page) #f)) + ) + (set! (-> obj sprites 2 flags) (the-as uint 4)) + (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> obj sprites 5 scale-x) 0.5) + (set! (-> obj sprites 5 flags) (the-as uint 4)) + (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> obj sprites 6 scale-x) 0.5) + (set! (-> obj sprites 6 flags) (the-as uint 4)) + (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> obj sprites 3 scale-y) 3.25) + (set! (-> obj sprites 3 color z) 0) + (set! (-> obj sprites 3 flags) (the-as uint 4)) + (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> obj sprites 4 scale-y) 1.5) + (set! (-> obj sprites 4 color z) 0) + (set! (-> obj sprites 4 flags) (the-as uint 4)) + (alloc-string-if-needed obj 0) + (set! (-> obj strings 0 flags) (font-flags kerning large)) + (set! (-> obj strings 0 scale) 0.5) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/palace/boss/squid-part_REF.gc b/test/decompiler/reference/jak2/levels/palace/boss/squid-part_REF.gc new file mode 100644 index 0000000000..63a7ba9561 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/palace/boss/squid-part_REF.gc @@ -0,0 +1,1182 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpart 4790 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0.75)) + (sp-flt spt-rot-x 40.96) + (sp-rnd-flt spt-rot-z (degrees -4.0) (degrees 8.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 16.0 5.0 1.0) + (sp-flt spt-omega 821248.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpart 4791 + :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 1.5)) + (sp-flt spt-rot-x 40.96) + (sp-rnd-flt spt-rot-z (degrees -4.0) (degrees 8.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 16.0 5.0 1.0) + (sp-flt spt-omega 821248.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpart 4793 + :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 0.75)) + (sp-flt spt-rot-x 81.92) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 16.0) + (sp-flt spt-omega 247808.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpart 4792 + :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 1.5)) + (sp-flt spt-rot-x 81.92) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 16.0) + (sp-flt spt-omega 247808.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-squid-thruster + :id 1118 + :duration (seconds 0.017) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4812 :fade-after (meters 120) :falloff-to (meters 120) :flags (is-3d bit7)) + (sp-item 4813 :fade-after (meters 120) :falloff-to (meters 120) :flags (bit7)) + (sp-item 4814 :fade-after (meters 120) :falloff-to (meters 120) :flags (bit7)) + (sp-item 4815 :fade-after (meters 80) :falloff-to (meters 80) :flags (bit7)) + (sp-item 4816 :fade-after (meters 80) :falloff-to (meters 80) :flags (bit7)) + ) + ) + +;; failed to figure out what this is: +(defpart 4812 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x90 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 2.5) (meters 0.5) 1.0) + (sp-rnd-flt spt-scale-y (meters 4) (meters 1) 1.0) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 0.0 128.0 1.0) + (sp-flt spt-b 0.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-3) + (sp-flt spt-rotate-x (degrees -90.0)) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4813 + :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.2)) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.1) 1.0) + (sp-flt spt-rot-x 409.6) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 8.0 8.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 20480.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4814 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.0 1.0 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 0.25) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0) + (sp-rnd-int-flt spt-rot-z (degrees 0.0) 1 32768.0) + (sp-rnd-flt spt-scale-y (meters 1) (meters 0.6) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 16.0 16.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.016666668) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.033333335) (meters 0.016666668) 1.0) + (sp-rnd-flt spt-scalevel-y (meters 0.016666668) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-fade-r -1.28 -1.28 1.0) + (sp-flt spt-fade-g 1.0) + (sp-flt spt-fade-b 2.0) + (sp-rnd-flt spt-accel-x 0.0 6.826667 1.0) + (sp-rnd-flt spt-accel-y 0.68266666 2.048 1.0) + (sp-flt spt-friction 0.94) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-int spt-next-time 50) + (sp-launcher-by-id spt-next-launcher 4817) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4817 + :init-specs ((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-fade-r 0.0) + (sp-flt spt-fade-g 0.0) + (sp-flt spt-fade-b 0.0) + (sp-rnd-flt spt-fade-a -0.128 -0.256 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4815 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-rnd-flt spt-num 0.1 0.1 1.0) + (sp-rnd-flt spt-y (meters 0.25) (meters 0.5) 1.0) + (sp-flt spt-scale-x (meters 0.05)) + (sp-flt spt-scale-y (meters 0.5)) + (sp-rnd-flt spt-r 192.0 64.0 1.0) + (sp-rnd-flt spt-g 0.0 128.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.026666667) 1.0) + (sp-flt spt-scalevel-x (meters 0.001)) + (sp-flt spt-scalevel-y (meters -0.017)) + (sp-flt spt-fade-g 0.0) + (sp-rnd-flt spt-accel-x 0.0 6.826667 1.0) + (sp-rnd-flt spt-accel-y -0.68266666 -2.048 1.0) + (sp-flt spt-friction 0.96) + (sp-int-plain-rnd spt-timer 50 74 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 sp-cpuinfo-flag-14) + (sp-int spt-next-time 30) + (sp-launcher-by-id spt-next-launcher 4818) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4818 + :init-specs ((sp-flt spt-scalevel-x (meters 0)) (sp-flt spt-scalevel-y (meters 0))) + ) + +;; failed to figure out what this is: +(defpart 4816 + :init-specs ((sp-flt spt-num 0.6) + (sp-int spt-rot-x 8) + (sp-flt spt-r 1638.4) + (sp-flt spt-g 1331.2) + (sp-flt spt-b 1433.6) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.016666668) 1.0) + (sp-flt spt-fade-r 32.768) + (sp-flt spt-fade-g 26.623999) + (sp-flt spt-fade-b 28.671999) + (sp-rnd-flt spt-accel-x 0.0 6.826667 1.0) + (sp-flt spt-friction 0.94) + (sp-int spt-timer 100) + (sp-cpuinfo-flags distort) + (sp-int spt-next-time 50) + (sp-launcher-by-id spt-next-launcher 4819) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4819 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b -4.096)) + ) + +;; failed to figure out what this is: +(defpartgroup group-squid-marker + :id 1119 + :duration (seconds 0.017) + :linger-duration (seconds 8) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 4820 :flags (is-3d))) + ) + +;; failed to figure out what this is: +(defpart 4820 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xaba)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 3)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 0.0 32.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 0.0) + (sp-flt spt-rotvel-y (degrees 3.6)) + (sp-flt spt-fade-a 2.56) + (sp-int spt-timer 2400) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat) + (sp-int spt-next-time 25) + (sp-launcher-by-id spt-next-launcher 4821) + (sp-flt spt-rotate-y (degrees 90.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4821 + :init-specs ((sp-flt spt-r 128.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-flt spt-a 128.0) + (sp-flt spt-rotvel-y (degrees 0.0)) + (sp-flt spt-fade-a 0.0) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 4822) + ) + ) + +;; failed to figure out what this is: +(defpart 4822 + :init-specs ((sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 0.0 32.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-scalevel-x (meters -0.03)) + (sp-flt spt-rotvel-y (degrees -3.6)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-next-time 50) + (sp-launcher-by-id spt-next-launcher 4823) + ) + ) + +;; failed to figure out what this is: +(defpart 4823 + :init-specs ((sp-flt spt-scalevel-x (meters -0.001)) + (sp-flt spt-rotvel-y (degrees 0.15)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-next-time 150) + (sp-launcher-by-id spt-next-launcher 4824) + ) + ) + +;; failed to figure out what this is: +(defpart 4824 + :init-specs ((sp-flt spt-scale-x (meters 1.5)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-scalevel-x (meters -0.001)) + (sp-flt spt-rotvel-y (degrees 0.15)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 4825) + ) + ) + +;; failed to figure out what this is: +(defpart 4825 + :init-specs ((sp-flt spt-r 128.0) + (sp-flt spt-a 64.0) + (sp-flt spt-scalevel-x (meters -0.001)) + (sp-flt spt-rotvel-y (degrees 0.15)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-next-time 150) + (sp-launcher-by-id spt-next-launcher 4824) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-squid-grenade-trail + :id 1120 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4826 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 4827 :flags (bit6)) + (sp-item 4828 :fade-after (meters 120) :falloff-to (meters 120)) + ) + ) + +;; failed to figure out what this is: +(defpart 4828 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-rnd-flt spt-num 0.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.2) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 48.0 16.0 1.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-omega 1230848.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.01) 1.0) + (sp-flt spt-fade-a -0.10666667) + (sp-rnd-flt spt-accel-y -0.13653333 -0.06826667 1.0) + (sp-flt spt-friction 0.96) + (sp-int-plain-rnd spt-timer 150 1199 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int-plain-rnd spt-next-time 5 149 1) + (sp-launcher-by-id spt-next-launcher 4829) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4829 + :init-specs ((sp-flt spt-r 32.0) + (sp-rnd-flt spt-g 128.0 128.0 1.0) + (sp-flt spt-b 255.0) + (sp-int spt-next-time 5) + (sp-launcher-by-id spt-next-launcher 4830) + ) + ) + +;; failed to figure out what this is: +(defpart 4830 + :init-specs ((sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 48.0 16.0 1.0) + (sp-flt spt-b 64.0) + (sp-int-plain-rnd spt-next-time 5 149 1) + (sp-launcher-by-id spt-next-launcher 4829) + ) + ) + +;; failed to figure out what this is: +(defpart 4827 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 2.5) (meters 0.2) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 192.0 64.0 1.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 16.0) + (sp-flt spt-omega 1230848.0) + (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 3072.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4826 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.5 0.5 1.0) + (sp-rnd-flt spt-scale-x (meters 0.8) (meters 0.8) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 32.0 8.0 1.0) + (sp-rnd-flt spt-vel-y (meters -0.006666667) (meters -0.006666667) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.005) (meters 0.008333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r 0.10666667) + (sp-flt spt-fade-g -0.32) + (sp-flt spt-fade-b -0.21333334) + (sp-flt spt-fade-a -0.08888889) + (sp-rnd-flt spt-accel-y 0.4096 0.13653333 1.0) + (sp-flt spt-friction 0.97) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 300) + (sp-launcher-by-id spt-next-launcher 4831) + ) + ) + +;; failed to figure out what this is: +(defpart 4831 + :init-specs ((sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g 0.0) + (sp-flt spt-fade-b 0.0) + (sp-rnd-flt spt-fade-a -0.10666667 -0.21333334 1.0) + (sp-func spt-func 'nothing) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-squid-grenade-explode + :id 1121 + :duration (seconds 1) + :linger-duration (seconds 1) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4832 :flags (bit6) :period 600 :length 5) + (sp-item 4833 :flags (bit6) :period 600 :length 5) + (sp-item 4834 :period 600 :length 15) + (sp-item 4835 :fade-after (meters 60) :period 600 :length 10) + (sp-item 4836 :fade-after (meters 60) :period 600 :length 10) + ) + ) + +;; failed to figure out what this is: +(defpart 4836 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 16.0) + (sp-flt spt-y (meters 0.5)) + (sp-flt spt-scale-x (meters 2.5)) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-rnd-flt spt-omega 8.192 4.096 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.2) 1.0) + (sp-rnd-flt spt-fade-r -1.7 -3.4 1.0) + (sp-flt spt-fade-g -4.0) + (sp-rnd-flt spt-fade-a -0.16 -0.16 1.0) + (sp-rnd-flt spt-accel-y -6.826667 -13.653334 1.0) + (sp-rnd-flt spt-friction 0.9 0.02 1.0) + (sp-int-plain-rnd spt-timer 50 149 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) + ) + ) + +;; failed to figure out what this is: +(defpart 4833 + :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 1)) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 24.0) + (sp-flt spt-scalevel-x (meters 0.053333335)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -8.5) + (sp-flt spt-fade-g -4.266667) + (sp-flt spt-fade-b 0.0) + (sp-flt spt-fade-a 0.0) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 4837) + ) + ) + +;; failed to figure out what this is: +(defpart 4837 + :init-specs ((sp-flt spt-scalevel-x (meters 0)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -1.7066667) + (sp-flt spt-fade-g -1.7066667) + (sp-flt spt-fade-b -0.85333335) + (sp-flt spt-fade-a -0.64) + ) + ) + +;; failed to figure out what this is: +(defpart 4832 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 96.0) + (sp-flt spt-scalevel-x (meters 0.33333334)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -5.1) + (sp-flt spt-fade-g -1.28) + (sp-flt spt-fade-b -2.56) + (sp-flt spt-fade-a 0.0) + (sp-int spt-timer 65) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-int spt-next-time 30) + (sp-launcher-by-id spt-next-launcher 4838) + ) + ) + +;; failed to figure out what this is: +(defpart 4838 + :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 4834 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 6.0 1.0 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 0.6) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (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 70.0 20.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 0.0 40.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.053333335) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.01) 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 1.18) + (sp-flt spt-fade-g 1.8) + (sp-flt spt-fade-b 3.3) + (sp-flt spt-fade-a 1.76) + (sp-flt spt-friction 0.88) + (sp-int spt-timer 710) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4839) + (sp-rnd-flt spt-conerot-x (degrees -1440.0) (degrees 2880.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4839 + :init-specs ((sp-flt spt-fade-r -2.2) + (sp-flt spt-fade-g -3.0) + (sp-flt spt-fade-b -2.1333334) + (sp-flt spt-fade-a -0.41666666) + (sp-int-plain-rnd spt-next-time 45 14 1) + (sp-launcher-by-id spt-next-launcher 4840) + ) + ) + +;; failed to figure out what this is: +(defpart 4840 + :init-specs ((sp-flt spt-fade-r -0.028333334) + (sp-flt spt-fade-g 0.0) + (sp-flt spt-fade-b -0.21333334) + (sp-flt spt-fade-a -0.38833332) + ) + ) + +;; failed to figure out what this is: +(defpart 4835 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #xc)) + (sp-rnd-flt spt-num 8.0 2.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.2) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 96.0) + (sp-rnd-flt spt-b 128.0 128.0 1.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.13333334) (meters 0.02) 1.0) + (sp-flt spt-fade-r -0.7111111) + (sp-flt spt-fade-g -1.0666667) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-squid-whirlwind-fire + :id 1122 + :duration (seconds 0.017) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4841 :fade-after (meters 200) :falloff-to (meters 300)) + (sp-item 4842 :fade-after (meters 200) :flags (bit6)) + (sp-item 4843 :fade-after (meters 200) :flags (bit6)) + (sp-item 4844 :fade-after (meters 200)) + ) + ) + +;; failed to figure out what this is: +(defpart 4844 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2.5)) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-rnd-flt spt-omega 8.192 4.096 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.05) 1.0) + (sp-rnd-flt spt-fade-g -1.7 -3.4 1.0) + (sp-flt spt-fade-b -4.0) + (sp-rnd-flt spt-fade-a -0.16 -0.16 1.0) + (sp-rnd-flt spt-accel-y -6.826667 -2.7306666 1.0) + (sp-flt spt-friction 0.92) + (sp-int-plain-rnd spt-timer 50 149 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 45.0) (degrees 90.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4842 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 8) (meters 0.1) 1.0) + (sp-flt spt-rot-x 1228.8) + (sp-rnd-flt spt-rot-z (degrees -4.0) (degrees 8.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 0.0 128.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 12.0 4.0 1.0) + (sp-flt spt-omega 822476.8) + (sp-flt spt-fade-a -1.0666667) + (sp-int spt-timer 15) + (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 4843 + :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)) + (sp-rnd-flt spt-scale-x (meters 1) (meters 2.25) 1.0) + (sp-flt spt-rot-x 1228.8) + (sp-rnd-flt spt-rot-z (degrees -4.0) (degrees 8.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 0.0 255.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 20.0 10.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 6144.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4841 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.0 2.0 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 0.25) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.6) 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.6) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 8.0 8.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-scalevel-y (meters 0.016666668) (meters 0.033333335) 1.0) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -3.0) + (sp-flt spt-fade-b 3.0) + (sp-rnd-flt spt-accel-x 0.0 6.826667 1.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-int spt-next-time 40) + (sp-launcher-by-id spt-next-launcher 4845) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4845 + :init-specs ((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-fade-r 0.0) + (sp-flt spt-fade-g 0.0) + (sp-flt spt-fade-b 0.0) + (sp-rnd-flt spt-fade-a -0.064 -0.064 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-squid-whirlwind-explode + :id 1123 + :duration (seconds 1) + :linger-duration (seconds 1) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4846 :flags (bit6) :period 600 :length 5) + (sp-item 4847 :flags (bit6) :period 600 :length 5) + (sp-item 4848 :period 600 :length 15) + (sp-item 4849 :fade-after (meters 60) :period 600 :length 10) + (sp-item 4850 :fade-after (meters 60) :period 600 :length 10) + ) + ) + +;; failed to figure out what this is: +(defpart 4850 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 16.0) + (sp-flt spt-y (meters 0.5)) + (sp-flt spt-scale-x (meters 2.5)) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-rnd-flt spt-omega 8.192 4.096 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.2) 1.0) + (sp-rnd-flt spt-fade-g -1.7 -3.4 1.0) + (sp-flt spt-fade-b -4.0) + (sp-rnd-flt spt-fade-a -0.16 -0.16 1.0) + (sp-rnd-flt spt-accel-y -6.826667 -13.653334 1.0) + (sp-rnd-flt spt-friction 0.9 0.02 1.0) + (sp-int-plain-rnd spt-timer 50 149 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) + ) + ) + +;; failed to figure out what this is: +(defpart 4847 + :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 1)) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 24.0) + (sp-flt spt-scalevel-x (meters 0.053333335)) + (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 -8.5) + (sp-flt spt-fade-a 0.0) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 4851) + ) + ) + +;; failed to figure out what this is: +(defpart 4851 + :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 4846 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-flt spt-rot-x 2048.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 96.0) + (sp-flt spt-scalevel-x (meters 0.33333334)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -2.56) + (sp-flt spt-fade-g -1.28) + (sp-flt spt-fade-b -5.1) + (sp-flt spt-fade-a 0.0) + (sp-int spt-timer 65) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-int spt-next-time 30) + (sp-launcher-by-id spt-next-launcher 4852) + ) + ) + +;; failed to figure out what this is: +(defpart 4852 + :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 4848 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 6.0 1.0 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 0.6) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (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 70.0 20.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 0.0 40.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0) (meters 0.053333335) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.01) 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.1) + (sp-flt spt-fade-b 0.0) + (sp-flt spt-fade-a 1.76) + (sp-flt spt-friction 0.88) + (sp-int spt-timer 710) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int-plain-rnd spt-next-time 35 14 1) + (sp-launcher-by-id spt-next-launcher 4853) + (sp-rnd-flt spt-conerot-x (degrees -1440.0) (degrees 2880.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4853 + :init-specs ((sp-flt spt-fade-r 0.0) + (sp-rnd-flt spt-fade-g -1.6666666 -0.8333333 1.0) + (sp-flt spt-fade-b -1.5) + (sp-flt spt-fade-a -0.41666666) + (sp-int-plain-rnd spt-next-time 45 14 1) + (sp-launcher-by-id spt-next-launcher 4854) + ) + ) + +;; failed to figure out what this is: +(defpart 4854 + :init-specs ((sp-flt spt-fade-r -0.425) (sp-flt spt-fade-g -0.25) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -0.38833332)) + ) + +;; failed to figure out what this is: +(defpart 4849 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x31 :page #xc)) + (sp-rnd-flt spt-num 8.0 2.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.2) 1.0) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-flt spt-g 96.0) + (sp-flt spt-b 64.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.13333334) (meters 0.02) 1.0) + (sp-flt spt-fade-g -1.0666667) + (sp-flt spt-fade-b -0.7111111) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-squid-damage + :id 1124 + :duration (seconds 0.017) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 4855 :fade-after (meters 200) :falloff-to (meters 300))) + ) + +;; failed to figure out what this is: +(defpart 4855 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 2.6) 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.6) 1.0) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.02) (meters 0.02) 1.0) + (sp-rnd-flt spt-scalevel-y (meters 0.02) (meters 0.02) 1.0) + (sp-flt spt-fade-r 0.0) + (sp-flt spt-fade-g -3.0) + (sp-flt spt-fade-b 3.0) + (sp-int spt-timer 600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + (sp-int spt-next-time 40) + (sp-launcher-by-id spt-next-launcher 4856) + ) + ) + +;; failed to figure out what this is: +(defpart 4856 + :init-specs ((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-fade-r 0.0) + (sp-flt spt-fade-g 0.0) + (sp-flt spt-fade-b 0.0) + (sp-rnd-flt spt-fade-a -0.10666667 -0.256 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4857 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x45 :page #xc)) + (sp-func spt-birth-func 'birth-func-set-quat) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0.25)) + (sp-flt spt-scale-y (meters 20)) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-flt spt-scalevel-x (meters 0.0016666667)) + (sp-flt spt-fade-a -3.2) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat) + ) + ) + +;; failed to figure out what this is: +(defpart 4858 + :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 1)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 0.0 32.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-scalevel-x (meters -0.016666668)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 25) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 4859 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x47 :page #xc)) + (sp-flt spt-num 0.0) + (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.3) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.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-14) + ) + ) + +;; failed to figure out what this is: +(defpart 4860 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x14 :page #xc)) + (sp-rnd-flt spt-num 8.0 8.0 1.0) + (sp-rnd-flt spt-z (meters 0) (meters -3) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.4) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.4) (meters 0.4) 1.0) + (sp-flt spt-r 192.0) + (sp-rnd-flt spt-g 64.0 128.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-scalevel-x (meters -0.00234375)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-fade-g -1.2 -2.4 1.0) + (sp-rnd-flt spt-fade-a -0.53333336 -2.1333334 1.0) + (sp-rnd-flt spt-accel-y -0.68266666 -0.68266666 1.0) + (sp-int spt-timer 240) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4861 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x81 :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 4.5)) + (sp-flt spt-r 128.0) + (sp-rnd-flt spt-g 0.0 128.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -3.6571429) + (sp-int spt-timer 35) + (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 4862 + :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 3) (meters 1) 1.0) + (sp-flt spt-rot-x 819.2) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 255.0) + (sp-flt spt-omega 822067.2) + (sp-flt spt-scalevel-x (meters 0.053333335)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -3.6571429) + (sp-flt spt-fade-a -7.285714) + (sp-int spt-timer 35) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-squid-shot-hit + :id 1125 + :duration (seconds 1) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4863 :flags (bit6) :period 600 :length 5) + (sp-item 4864 :flags (bit6) :period 600 :length 5) + (sp-item 4865 :flags (bit6) :period 600 :length 5) + (sp-item 4866 :period 600 :length 5) + ) + ) + +;; failed to figure out what this is: +(defpart 4865 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x33 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2)) + (sp-flt spt-rot-x 204.8) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 0.0 128.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-scalevel-x (meters 0.075)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -1.8285714) + (sp-int spt-timer 40) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4866 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 6.0 2.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.75) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 0.0 128.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 24.0 48.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.026666667) (meters 0.026666667) 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.0016666667) (meters 0.006666667) 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.42666668) + (sp-flt spt-fade-g -0.21333334) + (sp-flt spt-fade-a -0.21333334) + (sp-rnd-flt spt-accel-y -0.68266666 -0.68266666 1.0) + (sp-flt spt-friction 0.9) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 3600.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4864 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2)) + (sp-flt spt-rot-x 819.2) + (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-rnd-flt spt-g 128.0 128.0 1.0) + (sp-rnd-flt spt-b 0.0 64.0 1.0) + (sp-flt spt-a 48.0) + (sp-flt spt-scalevel-x (meters 0.125)) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -1.6) + (sp-flt spt-fade-b -1.6) + (sp-int spt-timer 80) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 glow) + (sp-flt spt-userdata -4096.0) + (sp-int spt-next-time 20) + (sp-launcher-by-id spt-next-launcher 616) + ) + ) + +;; failed to figure out what this is: +(defpart 4863 + :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 1)) + (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-flt spt-a 96.0) + (sp-flt spt-scalevel-x (meters 0.1)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-timer 55) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 617) + ) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc b/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc new file mode 100644 index 0000000000..5dc7eb073f --- /dev/null +++ b/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc @@ -0,0 +1,3302 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type squid-whirlwind +(deftype squid-whirlwind (process-drawable) + ((center vector :inline :offset-assert 208) + (center-vel vector :inline :offset-assert 224) + (current-nav-poly nav-poly :offset-assert 240) + (duration time-frame :offset-assert 248) + (whirl-sound sound-id :offset-assert 256) + (whirl-sound-playing symbol :offset-assert 260) + ) + :heap-base #x90 + :method-count-assert 21 + :size-assert #x108 + :flag-assert #x1500900108 + (:methods + (idle () _type_ :state 20) + ) + ) + +;; definition for method 3 of type squid-whirlwind +(defmethod inspect squid-whirlwind ((obj squid-whirlwind)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tcenter: #~%" (-> obj center)) + (format #t "~2Tcenter-vel: #~%" (-> obj center-vel)) + (format #t "~2Tcurrent-nav-poly: #~%" (-> obj current-nav-poly)) + (format #t "~2Tduration: ~D~%" (-> obj duration)) + (format #t "~2Twhirl-sound: ~D~%" (-> obj whirl-sound)) + (format #t "~2Twhirl-sound-playing: ~A~%" (-> obj whirl-sound-playing)) + (label cfg-4) + obj + ) + +;; definition of type squid-collision +(deftype squid-collision (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 squid-collision +(defmethod inspect squid-collision ((obj squid-collision)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type squid-driver +(deftype squid-driver (process-drawable) + ((prefix string :offset-assert 200) + (run-free symbol :offset-assert 204) + ) + :heap-base #x50 + :method-count-assert 21 + :size-assert #xd0 + :flag-assert #x15005000d0 + (:methods + (idle () _type_ :state 20) + ) + ) + +;; definition for method 3 of type squid-driver +(defmethod inspect squid-driver ((obj squid-driver)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tprefix: ~A~%" (-> obj prefix)) + (format #t "~2Trun-free: ~A~%" (-> obj run-free)) + (label cfg-4) + obj + ) + +;; definition of type squid-baron +(deftype squid-baron (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 squid-baron +(defmethod inspect squid-baron ((obj squid-baron)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type squid-tentacle-chain +(deftype squid-tentacle-chain (structure) + ((position vector :inline :offset-assert 0) + (velocity vector :inline :offset-assert 16) + (old-x vector :inline :offset-assert 32) + (joint-mod joint-mod :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x34 + :flag-assert #x900000034 + ) + +;; definition for method 3 of type squid-tentacle-chain +(defmethod inspect squid-tentacle-chain ((obj squid-tentacle-chain)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'squid-tentacle-chain) + (format #t "~1Tposition: #~%" (-> obj position)) + (format #t "~1Tvelocity: #~%" (-> obj velocity)) + (format #t "~1Told-x: #~%" (-> obj old-x)) + (format #t "~1Tjoint-mod: ~A~%" (-> obj joint-mod)) + (label cfg-4) + obj + ) + +;; definition of type squid-tentacle +(deftype squid-tentacle (process-drawable) + ((root-override collide-shape-moving :offset 128) + (chain-joints squid-tentacle-chain 11 :inline :offset-assert 208) + (gravity vector :inline :offset-assert 912) + (gravity-target vector :inline :offset-assert 928) + (stretch-vel float :offset-assert 944) + (center vector :inline :offset-assert 960) + (avoid-center symbol :offset-assert 976) + (wrap symbol :offset-assert 980) + (num-bg-collisions int32 :offset-assert 984) + (max-movement float :offset-assert 988) + ) + :heap-base #x360 + :method-count-assert 24 + :size-assert #x3e0 + :flag-assert #x18036003e0 + (:methods + (test () _type_ :state 20) + (idle () _type_ :state 21) + (joint-setup (_type_) none 22) + (squid-tentacle-method-23 (_type_) none 23) + ) + ) + +;; definition for method 3 of type squid-tentacle +(defmethod inspect squid-tentacle ((obj squid-tentacle)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tchain-joints[11] @ #x~X~%" (-> obj chain-joints)) + (format #t "~2Tgravity: #~%" (-> obj gravity)) + (format #t "~2Tgravity-target: #~%" (-> obj gravity-target)) + (format #t "~2Tstretch-vel: ~f~%" (-> obj stretch-vel)) + (format #t "~2Tcenter: #~%" (-> obj center)) + (format #t "~2Tavoid-center: ~A~%" (-> obj avoid-center)) + (format #t "~2Twrap: ~A~%" (-> obj wrap)) + (format #t "~2Tnum-bg-collisions: ~D~%" (-> obj num-bg-collisions)) + (format #t "~2Tmax-movement: ~f~%" (-> obj max-movement)) + (label cfg-4) + obj + ) + +;; definition of type squid-grenade-holder +(deftype squid-grenade-holder (structure) + ((target-position vector :inline :offset-assert 0) + (show-it symbol :offset-assert 16) + (grenade handle :offset-assert 24) + (marker handle :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + +;; definition for method 3 of type squid-grenade-holder +(defmethod inspect squid-grenade-holder ((obj squid-grenade-holder)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'squid-grenade-holder) + (format #t "~1Ttarget-position: #~%" (-> obj target-position)) + (format #t "~1Tshow-it: ~A~%" (-> obj show-it)) + (format #t "~1Tgrenade: ~D~%" (-> obj grenade)) + (format #t "~1Tmarker: ~D~%" (-> obj marker)) + (label cfg-4) + obj + ) + +;; definition of type squid-grenade +(deftype squid-grenade (projectile) + ((traj trajectory :inline :offset-assert 480) + (traj-dest vector :inline :offset-assert 528) + (traj-timer time-frame :offset-assert 544) + (traj-duration float :offset-assert 552) + (fly-sound sound-id :offset-assert 556) + ) + :heap-base #x1b0 + :method-count-assert 40 + :size-assert #x230 + :flag-assert #x2801b00230 + ) + +;; definition for method 3 of type squid-grenade +(defmethod inspect squid-grenade ((obj squid-grenade)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 obj) + ) + (format #t "~2Ttraj: #~%" (-> obj traj)) + (format #t "~2Ttraj-dest: #~%" (-> obj traj-dest)) + (format #t "~2Ttraj-timer: ~D~%" (-> obj traj-timer)) + (format #t "~2Ttraj-duration: ~f~%" (-> obj traj-duration)) + (format #t "~2Tfly-sound: ~D~%" (-> obj fly-sound)) + (label cfg-4) + obj + ) + +;; definition of type squid +(deftype squid (process-focusable) + ((quat quaternion :inline :offset-assert 208) + (trans vector :inline :offset-assert 224) + (residual-velocity vector :inline :offset-assert 240) + (residual-accumulator-1 float :offset-assert 256) + (residual-accumulator-2 float :offset-assert 260) + (force-onto-mesh symbol :offset-assert 264) + (mesh-forced symbol :offset-assert 268) + (hit-reaction oscillating-vector :inline :offset-assert 272) + (traj trajectory :inline :offset-assert 336) + (traj-src vector :inline :offset-assert 384) + (traj-dest vector :inline :offset-assert 400) + (traj-timer time-frame :offset-assert 416) + (traj-duration float :offset-assert 424) + (current-nav-poly nav-poly :offset-assert 428) + (tentacles handle 6 :offset-assert 432) + (baron squid-baron :offset-assert 480) + (driver (pointer squid-driver) :offset-assert 484) + (driver-blend cam-float-seeker :inline :offset-assert 488) + (blink-time time-frame :offset-assert 512) + (blink-mask int32 :offset-assert 520) + (thruster-part sparticle-launch-control :offset-assert 524) + (gun-tilt-left-jm joint-mod :offset-assert 528) + (gun-tilt-right-jm joint-mod :offset-assert 532) + (gun-tilt float :offset-assert 536) + (next-gun int8 :offset-assert 540) + (fire-aft symbol :offset-assert 544) + (gun-high-to-low symbol :offset-assert 548) + (grenade squid-grenade-holder 10 :inline :offset-assert 560) + (first-path path-control :offset-assert 1040) + (second-path path-control :offset-assert 1044) + (third-path path-control :offset-assert 1048) + (shield-timer time-frame :offset-assert 1056) + (shield-color vector :inline :offset-assert 1072) + (shield-shattered symbol :offset-assert 1088) + (shield-hit-points float :offset-assert 1092) + (hit-points int32 :offset-assert 1096) + (invincible-timer time-frame :offset-assert 1104) + (stage int32 :offset-assert 1112) + (collision-actor (pointer squid-collision) :offset-assert 1116) + (tentacle-base-jm joint-mod :offset-assert 1120) + (tentacle-base-rotation float :offset-assert 1124) + (tentacle-base-rotation-speed cam-float-seeker :inline :offset-assert 1128) + (stage-2-go-status int32 :offset-assert 1152) + (gate-intact symbol :offset-assert 1156) + (hud handle :offset-assert 1160) + (desired-rotate-to-vector-angle degrees :offset-assert 1168) + (allowed-rotate-to-vector-angle degrees :offset-assert 1172) + (stop-shooting symbol :offset-assert 1176) + (attack-id uint32 :offset-assert 1180) + (rush-sound sound-id :offset-assert 1184) + (rush-sound-playing symbol :offset-assert 1188) + (rush-end-time time-frame :offset-assert 1192) + (jet-sound sound-id :offset-assert 1200) + (jet-sound-playing symbol :offset-assert 1204) + (jet-pitch int64 :offset-assert 1208) + (negate-jet-pitch symbol :offset-assert 1216) + (jet-volume int64 :offset-assert 1224) + (can-play-squid-boost symbol :offset-assert 1232) + (tentacle-sound sound-id :offset-assert 1236) + (tentacle-sound-playing symbol :offset-assert 1240) + (spin-sound sound-id :offset-assert 1244) + (spin-sound-playing symbol :offset-assert 1248) + (reload-played symbol :offset-assert 1252) + (max-plane int32 :offset-assert 1256) + (debug-timer time-frame :offset-assert 1264) + (debug-on symbol :offset-assert 1272) + (last-damaged-talker int8 :offset-assert 1276) + (last-shield-hit-talker int8 :offset-assert 1277) + (last-no-energy-talker int8 :offset-assert 1278) + (last-shooting-talker int8 :offset-assert 1279) + (last-headbutting-talker int8 :offset-assert 1280) + (last-general-talker int8 :offset-assert 1281) + (last-start-recharging-talker int8 :offset-assert 1282) + (last-done-recharging-talker int8 :offset-assert 1283) + (suck float :offset-assert 1284) + ) + :heap-base #x490 + :method-count-assert 54 + :size-assert #x508 + :flag-assert #x3604900508 + (:methods + (test () _type_ :state 27) + (beaten () _type_ :state 28) + (wait-around-corner () _type_ :state 29) + (wait-beside-building () _type_ :state 30) + (flee () _type_ :state 31) + (pre-flee () _type_ :state 32) + (recharge () _type_ :state 33) + (fly-to-post () _type_ :state 34) + (headbut () _type_ :state 35) + (fire-whirlwind () _type_ :state 36) + (fire-grenades () _type_ :state 37) + (fire () _type_ :state 38) + (fly-to-shoot-spot () _type_ :state 39) + (idle () _type_ :state 40) + (hidden () _type_ :state 41) + (squid-method-42 (_type_ vector) vector 42) + (squid-method-43 (_type_ vector float float) none 43) + (squid-method-44 (_type_ vector vector) symbol 44) + (move-to-spot (_type_ vector symbol) none 45) + (set-traj-towards-vec (_type_ vector vector vector) none 46) + (float-sin-clamp (_type_ float) float 47) + (squid-method-48 (_type_) float 48) + (setup-part-engine (_type_ symbol) none 49) + (squid-post (_type_) none 50) + (spawn-whirlwind (_type_) (pointer squid-whirlwind) 51) + (spawn-grenade (_type_ int squid-grenade-holder float) none 52) + (squid-method-53 (_type_ int) none 53) + ) + ) + +;; definition for method 3 of type squid +(defmethod inspect squid ((obj squid)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (format #t "~2Tquat: #~%" (-> obj quat)) + (format #t "~2Ttrans: #~%" (-> obj trans)) + (format #t "~2Tresidual-velocity: #~%" (-> obj residual-velocity)) + (format #t "~2Tresidual-accumulator-1: ~f~%" (-> obj residual-accumulator-1)) + (format #t "~2Tresidual-accumulator-2: ~f~%" (-> obj residual-accumulator-2)) + (format #t "~2Tforce-onto-mesh: ~A~%" (-> obj force-onto-mesh)) + (format #t "~2Tmesh-forced: ~A~%" (-> obj mesh-forced)) + (format #t "~2Thit-reaction: #~%" (-> obj hit-reaction)) + (format #t "~2Ttraj: #~%" (-> obj traj)) + (format #t "~2Ttraj-src: #~%" (-> obj traj-src)) + (format #t "~2Ttraj-dest: #~%" (-> obj traj-dest)) + (format #t "~2Ttraj-timer: ~D~%" (-> obj traj-timer)) + (format #t "~2Ttraj-duration: ~f~%" (-> obj traj-duration)) + (format #t "~2Tcurrent-nav-poly: #~%" (-> obj current-nav-poly)) + (format #t "~2Ttentacles[6] @ #x~X~%" (-> obj tentacles)) + (format #t "~2Tbaron: #x~X~%" (-> obj baron)) + (format #t "~2Tdriver: #x~X~%" (-> obj driver)) + (format #t "~2Tdriver-blend: #~%" (-> obj driver-blend)) + (format #t "~2Tblink-time: ~D~%" (-> obj blink-time)) + (format #t "~2Tblink-mask: ~D~%" (-> obj blink-mask)) + (format #t "~2Tthruster-part: ~A~%" (-> obj thruster-part)) + (format #t "~2Tgun-tilt-left-jm: ~A~%" (-> obj gun-tilt-left-jm)) + (format #t "~2Tgun-tilt-right-jm: ~A~%" (-> obj gun-tilt-right-jm)) + (format #t "~2Tgun-tilt: ~f~%" (-> obj gun-tilt)) + (format #t "~2Tnext-gun: ~D~%" (-> obj next-gun)) + (format #t "~2Tfire-aft: ~A~%" (-> obj fire-aft)) + (format #t "~2Tgun-high-to-low: ~A~%" (-> obj gun-high-to-low)) + (format #t "~2Tgrenade[10] @ #x~X~%" (-> obj grenade)) + (format #t "~2Tfirst-path: ~A~%" (-> obj first-path)) + (format #t "~2Tsecond-path: ~A~%" (-> obj second-path)) + (format #t "~2Tthird-path: ~A~%" (-> obj third-path)) + (format #t "~2Tshield-timer: ~D~%" (-> obj shield-timer)) + (format #t "~2Tshield-color: #~%" (-> obj shield-color)) + (format #t "~2Tshield-shattered: ~A~%" (-> obj shield-shattered)) + (format #t "~2Tshield-hit-points: ~f~%" (-> obj shield-hit-points)) + (format #t "~2Thit-points: ~D~%" (-> obj hit-points)) + (format #t "~2Tinvincible-timer: ~D~%" (-> obj invincible-timer)) + (format #t "~2Tstage: ~D~%" (-> obj stage)) + (format #t "~2Tcollision-actor: #x~X~%" (-> obj collision-actor)) + (format #t "~2Ttentacle-base-jm: ~A~%" (-> obj tentacle-base-jm)) + (format #t "~2Ttentacle-base-rotation: ~f~%" (-> obj tentacle-base-rotation)) + (format + #t + "~2Ttentacle-base-rotation-speed: #~%" + (-> obj tentacle-base-rotation-speed) + ) + (format #t "~2Tstage-2-go-status: ~D~%" (-> obj stage-2-go-status)) + (format #t "~2Tgate-intact: ~A~%" (-> obj gate-intact)) + (format #t "~2Thud: ~D~%" (-> obj hud)) + (format #t "~2Tdesired-rotate-to-vector-angle: ~f~%" (-> obj desired-rotate-to-vector-angle)) + (format #t "~2Tallowed-rotate-to-vector-angle: ~f~%" (-> obj allowed-rotate-to-vector-angle)) + (format #t "~2Tstop-shooting: ~A~%" (-> obj stop-shooting)) + (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) + (format #t "~2Trush-sound: ~D~%" (-> obj rush-sound)) + (format #t "~2Trush-sound-playing: ~A~%" (-> obj rush-sound-playing)) + (format #t "~2Trush-end-time: ~D~%" (-> obj rush-end-time)) + (format #t "~2Tjet-sound: ~D~%" (-> obj jet-sound)) + (format #t "~2Tjet-sound-playing: ~A~%" (-> obj jet-sound-playing)) + (format #t "~2Tjet-pitch: ~D~%" (-> obj jet-pitch)) + (format #t "~2Tnegate-jet-pitch: ~A~%" (-> obj negate-jet-pitch)) + (format #t "~2Tjet-volume: ~D~%" (-> obj jet-volume)) + (format #t "~2Tcan-play-squid-boost: ~A~%" (-> obj can-play-squid-boost)) + (format #t "~2Ttentacle-sound: ~D~%" (-> obj tentacle-sound)) + (format #t "~2Ttentacle-sound-playing: ~A~%" (-> obj tentacle-sound-playing)) + (format #t "~2Tspin-sound: ~D~%" (-> obj spin-sound)) + (format #t "~2Tspin-sound-playing: ~A~%" (-> obj spin-sound-playing)) + (format #t "~2Treload-played: ~A~%" (-> obj reload-played)) + (format #t "~2Tmax-plane: ~D~%" (-> obj max-plane)) + (format #t "~2Tdebug-timer: ~D~%" (-> obj debug-timer)) + (format #t "~2Tdebug-on: ~A~%" (-> obj debug-on)) + (format #t "~2Tlast-damaged-talker: ~D~%" (-> obj last-damaged-talker)) + (format #t "~2Tlast-shield-hit-talker: ~D~%" (-> obj last-shield-hit-talker)) + (format #t "~2Tlast-no-energy-talker: ~D~%" (-> obj last-no-energy-talker)) + (format #t "~2Tlast-shooting-talker: ~D~%" (-> obj last-shooting-talker)) + (format #t "~2Tlast-headbutting-talker: ~D~%" (-> obj last-headbutting-talker)) + (format #t "~2Tlast-general-talker: ~D~%" (-> obj last-general-talker)) + (format #t "~2Tlast-start-recharging-talker: ~D~%" (-> obj last-start-recharging-talker)) + (format #t "~2Tlast-done-recharging-talker: ~D~%" (-> obj last-done-recharging-talker)) + (format #t "~2Tsuck: ~f~%" (-> obj suck)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-squid squid squid-lod0-jg 3 + ((squid-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + :shadow squid-shadow-mg + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-squid-shield squid squid-squid-shield-lod0-jg squid-squid-shield-idle-ja + ((squid-squid-shield-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) + +;; failed to figure out what this is: +(defskelgroup skel-squid-tentacle squid squid-tentacle-lod0-jg squid-tentacle-idle-ja + ((squid-tentacle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + :shadow squid-tentacle-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-squid-tentacle-shield squid squid-tentacle-shield-lod0-jg squid-tentacle-shield-idle-ja + ((squid-tentacle-shield-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) + +;; failed to figure out what this is: +(defskelgroup skel-squid-driver squid squid-driver-lod0-jg 55 + ((squid-driver-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + ) + +;; failed to figure out what this is: +(defskelgroup skel-squid-grenade squid squid-grenade-lod0-jg squid-grenade-idle-ja + ((squid-grenade-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + :shadow squid-grenade-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-squid-firepool squid squid-firepool-lod0-jg squid-firepool-idle-ja + ((squid-firepool-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +;; failed to figure out what this is: +(defskelgroup skel-squid-collision squid-collision squid-collision-lod0-jg squid-collision-idle-ja + ((squid-collision-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100) + ) + +;; failed to figure out what this is: +(defskelgroup skel-squid-collision-b squid-collision squid-collision-b-lod0-jg squid-collision-idle-ja + ((squid-collision-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100) + ) + +;; failed to figure out what this is: +(defskelgroup skel-squid-collision-c squid-collision squid-collision-c-lod0-jg squid-collision-idle-ja + ((squid-collision-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100) + ) + +;; definition for symbol *squid-shield-exploder-params*, type joint-exploder-static-params +(define *squid-shield-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 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index 41) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index 41) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index 48) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index 48) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index 38) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index 38) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index 45) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index 45) + (new 'static 'joint-exploder-static-joint-params :joint-index 24 :parent-joint-index 15) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index 15) + (new 'static 'joint-exploder-static-joint-params :joint-index 26 :parent-joint-index 15) + (new 'static 'joint-exploder-static-joint-params :joint-index 27 :parent-joint-index 15) + (new 'static 'joint-exploder-static-joint-params :joint-index 28 :parent-joint-index 50) + (new 'static 'joint-exploder-static-joint-params :joint-index 29 :parent-joint-index 50) + (new 'static 'joint-exploder-static-joint-params :joint-index 30 :parent-joint-index 50) + (new 'static 'joint-exploder-static-joint-params :joint-index 31 :parent-joint-index 55) + (new 'static 'joint-exploder-static-joint-params :joint-index 32 :parent-joint-index 55) + (new 'static 'joint-exploder-static-joint-params :joint-index 33 :parent-joint-index 55) + (new 'static 'joint-exploder-static-joint-params :joint-index 34 :parent-joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 35 :parent-joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 36 :parent-joint-index 16) + (new 'static 'joint-exploder-static-joint-params :joint-index 37 :parent-joint-index 16) + (new 'static 'joint-exploder-static-joint-params :joint-index 38 :parent-joint-index 16) + (new 'static 'joint-exploder-static-joint-params :joint-index 39 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 40 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 41 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 42 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 43 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 44 :parent-joint-index 21) + (new 'static 'joint-exploder-static-joint-params :joint-index 45 :parent-joint-index 21) + (new 'static 'joint-exploder-static-joint-params :joint-index 46 :parent-joint-index 29) + (new 'static 'joint-exploder-static-joint-params :joint-index 47 :parent-joint-index 30) + (new 'static 'joint-exploder-static-joint-params :joint-index 48 :parent-joint-index 20) + (new 'static 'joint-exploder-static-joint-params :joint-index 49 :parent-joint-index 28) + (new 'static 'joint-exploder-static-joint-params :joint-index 50 :parent-joint-index 17) + (new 'static 'joint-exploder-static-joint-params :joint-index 51 :parent-joint-index 17) + (new 'static 'joint-exploder-static-joint-params :joint-index 52 :parent-joint-index 17) + (new 'static 'joint-exploder-static-joint-params :joint-index 53 :parent-joint-index 17) + (new 'static 'joint-exploder-static-joint-params :joint-index 54 :parent-joint-index 23) + (new 'static 'joint-exploder-static-joint-params :joint-index 55 :parent-joint-index 23) + (new 'static 'joint-exploder-static-joint-params :joint-index 56 :parent-joint-index 23) + (new 'static 'joint-exploder-static-joint-params :joint-index 57 :parent-joint-index 23) + (new 'static 'joint-exploder-static-joint-params :joint-index 58 :parent-joint-index 23) + (new 'static 'joint-exploder-static-joint-params :joint-index 59 :parent-joint-index 18) + (new 'static 'joint-exploder-static-joint-params :joint-index 60 :parent-joint-index 18) + (new 'static 'joint-exploder-static-joint-params :joint-index 61 :parent-joint-index 26) + (new 'static 'joint-exploder-static-joint-params :joint-index 62 :parent-joint-index 26) + (new 'static 'joint-exploder-static-joint-params :joint-index 63 :parent-joint-index 31) + (new 'static 'joint-exploder-static-joint-params :joint-index 64 :parent-joint-index 31) + (new 'static 'joint-exploder-static-joint-params :joint-index 65 :parent-joint-index 31) + (new 'static 'joint-exploder-static-joint-params :joint-index 66 :parent-joint-index 31) + ) + ) + ) + +;; definition for symbol *squid-tentacle-shield-exploder-params*, type joint-exploder-static-params +(define *squid-tentacle-shield-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 3) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index 4) + (new 'static 'joint-exploder-static-joint-params :joint-index 29 :parent-joint-index 4) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index 5) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 27 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index 7) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index 8) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index 9) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index 9) + (new 'static 'joint-exploder-static-joint-params :joint-index 26 :parent-joint-index 9) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index 10) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index 11) + (new 'static 'joint-exploder-static-joint-params :joint-index 24 :parent-joint-index 11) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index 12) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index 12) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index 12) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index 14) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index 14) + ) + ) + ) + +;; definition for function squid-whirlwind-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior squid-whirlwind-init-by-other squid-whirlwind ((arg0 vector) (arg1 vector) (arg2 nav-mesh) (arg3 vector)) + (let ((s2-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s2-0 (the-as uint 0)))) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s2-0 total-prims) (the-as uint 1)) + (set! (-> s2-0 root-prim) v1-2) + ) + (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) + (let ((v1-5 (-> s2-0 root-prim))) + (set! (-> s2-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s2-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> self root) s2-0) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-squid-firepool" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self center quad) (-> arg1 quad)) + (set! (-> self center-vel quad) (-> arg3 quad)) + (change-to arg2 self) + (set! (-> self current-nav-poly) + (cloest-point-on-mesh (-> self nav) (-> self root trans) (-> self root trans) (the-as nav-poly #f)) + ) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1122) self)) + (set! (-> self whirl-sound) (new-sound-id)) + (set! (-> self whirl-sound-playing) #f) + (go-virtual idle) + (none) + ) + +;; definition for function squid-collision-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior squid-collision-init-by-other squid-collision ((arg0 vector) (arg1 int)) + (let ((v1-0 arg1)) + (cond + ((zero? v1-0) + (let ((s5-0 (new 'process 'collide-shape self (collide-list-enum hit-by-others)))) + (let ((v1-3 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-3 prim-core collide-as) (collide-spec special-obstacle)) + (set! (-> v1-3 prim-core action) (collide-action solid)) + (set! (-> v1-3 transform-index) 3) + (set-vector! (-> v1-3 local-sphere) 0.0 0.0 0.0 245760.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-3) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-6 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-6 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-6 prim-core collide-with)) + ) + (set! (-> self root) s5-0) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-squid-collision" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + ) + ((= v1-0 1) + (let ((s5-2 (new 'process 'collide-shape self (collide-list-enum hit-by-others)))) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-2 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec special-obstacle)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 163840.0 0.0 204800.0 245760.0) + (set! (-> s5-2 total-prims) (the-as uint 1)) + (set! (-> s5-2 root-prim) v1-15) + ) + (set! (-> s5-2 nav-radius) (* 0.75 (-> s5-2 root-prim local-sphere w))) + (let ((v1-18 (-> s5-2 root-prim))) + (set! (-> s5-2 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-2 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> self root) s5-2) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-squid-collision-b" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + ) + ((= v1-0 2) + (let ((s5-4 (new 'process 'collide-shape self (collide-list-enum hit-by-others)))) + (let ((v1-28 (new 'process 'collide-shape-prim-mesh s5-4 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec special-obstacle)) + (set! (-> v1-28 prim-core action) (collide-action solid)) + (set! (-> v1-28 transform-index) 3) + (set-vector! (-> v1-28 local-sphere) 40960.0 0.0 491520.0 327680.0) + (set! (-> s5-4 total-prims) (the-as uint 1)) + (set! (-> s5-4 root-prim) v1-28) + ) + (set! (-> s5-4 nav-radius) (* 0.75 (-> s5-4 root-prim local-sphere w))) + (let ((v1-31 (-> s5-4 root-prim))) + (set! (-> s5-4 backup-collide-as) (-> v1-31 prim-core collide-as)) + (set! (-> s5-4 backup-collide-with) (-> v1-31 prim-core collide-with)) + ) + (set! (-> self root) s5-4) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-squid-collision-c" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + ) + ) + ) + (transform-post) + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (go-virtual idle) + (none) + ) + +;; definition for function squid-driver-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior squid-driver-init-by-other squid-driver ((arg0 string)) + (set! (-> self prefix) arg0) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> (new 'static 'vector) quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-squid-driver" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (set! (-> self run-free) #f) + (go-virtual idle) + (none) + ) + +;; definition for function squid-baron-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior squid-baron-init-by-other squid-baron ((arg0 vector)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-baron" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> self draw light-index) (the-as uint 10)) + (let ((v1-8 (-> self node-list data))) + (set! (-> v1-8 0 param0) (the-as (function cspace transformq none) cspace<-parent-joint!)) + (set! (-> v1-8 0 param1) (the-as basic (-> self parent))) + (set! (-> v1-8 0 param2) (the-as basic 5)) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (logior! (-> self draw global-effect) (draw-control-global-effect disable-envmap)) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (go-virtual idle) + (none) + ) + +;; definition for function squid-tentacle-handler +;; INFO: Used lq/sq +(defbehavior squid-tentacle-handler squid-tentacle ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('get-max-movement) + (-> self max-movement) + ) + (('get-num-bg-collisions) + (-> self num-bg-collisions) + ) + (('set-anim) + (let ((gp-0 (-> self draw art-group data (-> arg3 param 0))) + (v1-6 (ja-group)) + ) + (when (not (and v1-6 (= v1-6 gp-0))) + (ja-channel-push! 1 (seconds 0.1)) + (let ((s5-0 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! s5-0 (the-as art-joint-anim gp-0) num-func-identity) + (set! (-> s5-0 frame-num) 0.0) + ) + ) + ) + ) + (('get-joint-pos) + (vector<-cspace! (the-as vector (-> arg3 param 1)) (-> self node-list data (-> arg3 param 0))) + ) + (('wrap) + (set! (-> self center quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (set! (-> self wrap) #t) + (set! (-> self avoid-center) #f) + #f + ) + (('avoid-center) + (set! (-> self center quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (set! (-> self avoid-center) #t) + (set! (-> self wrap) #f) + #f + ) + (('set-gravity) + (set! (-> self gravity quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (set! v0-0 (-> self gravity-target)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> arg3 param 0)) quad)) + v0-0 + ) + (('set-gravity-slow) + (set! v0-0 (-> self gravity-target)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> arg3 param 0)) quad)) + v0-0 + ) + (('set-stretch-vel) + (set! (-> self stretch-vel) (the-as float (-> arg3 param 0))) + ) + (('set-fade) + (set! (-> self draw force-fade) (-> arg3 param 0)) + (cond + ((>= (-> self draw force-fade) (the-as uint 128)) + (setup-masks (-> self draw) 0 64) + (set! v0-0 (logclear (-> self draw status) (draw-control-status warp-cross-fade))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + ) + (else + (setup-masks (-> self draw) 64 0) + (set! v0-0 (logior (-> self draw status) (draw-control-status warp-cross-fade))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + ) + ) + v0-0 + ) + ) + ) + +;; definition for method 22 of type squid-tentacle +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defmethod joint-setup squid-tentacle ((obj squid-tentacle)) + (dotimes (s5-0 11) + (let ((s4-0 (-> obj chain-joints s5-0))) + (vector<-cspace! (-> s4-0 position) (-> s4-0 joint-mod joint)) + (set! (-> s4-0 position quad) (-> s4-0 joint-mod joint bone transform quad 0)) + (vector-reset! (-> s4-0 velocity)) + (mode-set! (-> s4-0 joint-mod) (joint-mod-mode joint-set-world)) + ) + ) + (none) + ) + +;; definition for method 23 of type squid-tentacle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod squid-tentacle-method-23 squid-tentacle ((obj squid-tentacle)) + (local-vars + (v1-134 float) + (v1-162 float) + (f0-51 float) + (sv-1456 squid-tentacle-chain) + (sv-1472 vector) + (sv-1488 vector) + (sv-1504 vector) + (sv-1520 vector) + (sv-1536 (function vector float vector)) + (sv-1552 vector) + (sv-1568 vector) + (sv-1584 vector) + (sv-1600 vector) + (sv-1616 vector) + (sv-1632 vector) + (sv-1648 (function vector float vector)) + (sv-1664 vector) + (sv-1680 vector) + (sv-1696 vector) + (sv-1712 vector) + (sv-1728 vector) + (sv-1744 collide-query) + (sv-1760 int) + (sv-1776 vector) + (sv-1792 vector) + (sv-1808 vector) + (sv-1824 (inline-array vector)) + (sv-1840 (inline-array vector)) + (sv-1856 (inline-array vector)) + (sv-1872 vector) + (sv-1888 (inline-array vector)) + (sv-1904 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) + ) + (init-vf0-vector) + (vector-seek-3d-smooth! (-> obj gravity) (-> obj gravity-target) 0.05 0.1) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (let ((s4-0 (new 'stack-no-clear 'bounding-box))) + (let ((s3-0 (new 'stack-no-clear 'sphere))) + (vector<-cspace! s3-0 (-> obj node-list data 7)) + (set! (-> s3-0 r) 61440.0) + (set-from-sphere! s4-0 s3-0) + ) + (set! (-> s5-0 collide-with) (collide-spec player-list special-obstacle)) + (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)) + (set! (-> s5-0 action-mask) (collide-action solid)) + (mem-copy! (the-as pointer (-> s5-0 bbox)) (the-as pointer s4-0) 32) + ) + (fill-using-bounding-box *collide-cache* s5-0) + ) + (let ((s5-1 (new 'stack-no-clear 'matrix)) + (s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 3))) + (s3-1 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj node-list data 3 bone transform vector 2) 1.0) + ) + (s2-0 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj node-list data 3 bone transform vector 1) 1.0) + ) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> obj num-bg-collisions) 0) + (set! (-> obj max-movement) 0.0) + (dotimes (s0-0 11) + (set! sv-1456 (-> obj chain-joints s0-0)) + (set! sv-1904 (new 'stack-no-clear 'vector)) + (let ((v1-19 (-> sv-1456 position quad))) + (set! (-> sv-1904 quad) v1-19) + ) + (cond + ((-> obj wrap) + (set! (-> sv-1904 y) (+ -409.6 (-> sv-1904 y))) + (set! sv-1472 (new 'stack-no-clear 'vector)) + (let ((v1-25 sv-1904) + (a0-10 (-> obj center)) + ) + (.lvf vf4 (&-> v1-25 quad)) + (.lvf vf5 (&-> a0-10 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-1472 quad) vf6) + (set! (-> sv-1472 y) 0.0) + (vector-normalize! sv-1472 409.6) + (+! (-> sv-1904 x) (-> sv-1472 z)) + (set! (-> sv-1904 z) (- (-> sv-1904 z) (-> sv-1472 x))) + ) + (else + (set! sv-1520 sv-1904) + (set! sv-1488 sv-1904) + (set! sv-1504 (-> obj gravity)) + (let ((f0-14 (* 4096.0 (-> pp clock time-adjust-ratio) (fmax 0.2 (lerp-scale 0.38 0.18 (the float s0-0) 0.0 5.0)))) + ) + (.lvf vf2 (&-> sv-1504 quad)) + (.lvf vf1 (&-> sv-1488 quad)) + (let ((v1-43 f0-14)) + (.mov vf3 v1-43) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> sv-1520 quad) vf4) + (when (-> obj avoid-center) + (vector-! s1-0 (-> sv-1456 position) (-> obj center)) + (set! sv-1536 vector-normalize!) + (set! sv-1552 s1-0) + (let ((a1-13 (* 4096.0 (-> pp clock time-adjust-ratio) (fmax 0.0 (lerp-scale 0.4 0.6 (the float s0-0) 0.0 8.0))))) + (sv-1536 sv-1552 a1-13) + ) + (vector+! sv-1904 sv-1904 s1-0) + ) + ) + ) + (when (< s0-0 10) + (set! sv-1600 sv-1904) + (set! sv-1568 sv-1904) + (set! sv-1584 (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* (+ s0-0 1) 64)))) + (let ((f0-24 (fmin 0.9 (lerp-scale 0.2 1.0 (the float s0-0) 0.0 4.0)))) + (.lvf vf2 (&-> sv-1584 quad)) + (.lvf vf1 (&-> sv-1568 quad)) + (let ((v1-60 f0-24)) + (.mov vf3 v1-60) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> sv-1600 quad) vf4) + ) + (vector-! s1-0 sv-1904 s4-1) + (if (= s0-0 10) + (vector-normalize! s1-0 7102.464) + (vector-normalize! s1-0 4096.0) + ) + (vector+! sv-1904 s1-0 s4-1) + (let ((v0-15 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 3)))) + (set! sv-1616 (new 'stack-no-clear 'vector)) + (set! (-> v0-15 y) (+ 31744.0 (-> v0-15 y))) + (vector-! sv-1616 sv-1904 v0-15) + ) + (let ((f0-27 (vector-normalize-ret-len! sv-1616 1.0))) + (when (< f0-27 32768.0) + (vector+float*! sv-1904 sv-1904 sv-1616 (- 32768.0 f0-27)) + (vector-normalize-copy! + sv-1616 + (-> obj node-list data 3 bone transform vector 2) + (* 2048.0 (-> pp clock time-adjust-ratio)) + ) + (let ((v1-77 sv-1904)) + (let ((a0-31 sv-1904)) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> a0-31 quad)) + ) + (.lvf vf5 (&-> sv-1616 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-77 quad) vf6) + ) + ) + ) + (set! sv-1632 (new 'stack-no-clear 'vector)) + (let ((v1-79 sv-1904) + (a0-33 (-> obj center)) + ) + (.lvf vf4 (&-> v1-79 quad)) + (.lvf vf5 (&-> a0-33 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-1632 quad) vf6) + (set! (-> sv-1632 y) 0.0) + (let ((f0-32 (vector-normalize-ret-len! sv-1632 1.0))) + (when (< f0-32 4096.0) + (let ((v1-84 sv-1904) + (a0-35 sv-1904) + (f0-33 (- 4096.0 f0-32)) + ) + (vector+float*! v1-84 a0-35 sv-1632 f0-33) + ) + ) + ) + (set! sv-1728 (new 'stack-no-clear 'vector)) + (let ((v1-87 sv-1904) + (a0-36 s4-1) + ) + (.lvf vf4 (&-> v1-87 quad)) + (.lvf vf5 (&-> a0-36 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-1728 quad) vf6) + (let ((f30-3 (vector-normalize-ret-len! sv-1728 1.0)) + (f28-2 (vector-dot sv-1728 s2-0)) + (f26-0 (lerp-scale 5461.3335 10922.667 (the float s0-0) 0.0 8.0)) + ) + (when (< f28-2 (cos f26-0)) + (vector--float*! sv-1728 sv-1728 s2-0 f28-2) + (set! sv-1648 vector-normalize!) + (set! sv-1664 sv-1728) + (let ((a1-34 (sin f26-0))) + (sv-1648 sv-1664 a1-34) + ) + (set! sv-1712 sv-1728) + (set! sv-1680 sv-1728) + (set! sv-1696 s2-0) + (let ((f0-38 (cos f26-0))) + (.lvf vf2 (&-> sv-1696 quad)) + (.lvf vf1 (&-> sv-1680 quad)) + (let ((v1-98 f0-38)) + (.mov vf3 v1-98) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> sv-1712 quad) vf4) + (vector+float*! sv-1904 s4-1 sv-1728 f30-3) + ) + ) + (set! sv-1744 (new 'stack-no-clear 'collide-query)) + (set! sv-1776 (new 'stack-no-clear 'vector)) + (let ((v1-104 sv-1904) + (a0-47 (-> sv-1456 position)) + ) + (.lvf vf4 (&-> v1-104 quad)) + (.lvf vf5 (&-> a0-47 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-1776 quad) vf6) + (set! sv-1760 0) + (set! (-> sv-1904 quad) (-> sv-1456 position quad)) + (until (or (< 6 sv-1760) + (begin + (.lvf vf1 (&-> sv-1776 quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-134 vf1) + (let ((f0-46 v1-134) + (f1-16 409.6) + ) + (< f0-46 (* f1-16 f1-16)) + ) + ) + ) + (set! sv-1760 (+ sv-1760 1)) + (set! (-> sv-1744 start-pos quad) (-> sv-1904 quad)) + (set! (-> sv-1744 move-dist quad) (-> sv-1776 quad)) + (let ((v1-114 sv-1744)) + (set! (-> v1-114 radius) 4096.0) + (set! (-> v1-114 collide-with) (collide-spec player-list special-obstacle)) + (set! (-> v1-114 ignore-process0) obj) + (set! (-> v1-114 ignore-process1) #f) + (set! (-> v1-114 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1) + ) + (set! (-> v1-114 action-mask) (collide-action solid)) + ) + (set! (-> sv-1744 num-spheres) (the-as uint #f)) + (let ((f0-40 (probe-using-line-sphere *collide-cache* sv-1744))) + (cond + ((>= f0-40 0.0) + (let ((f0-41 (fmin 1.0 f0-40))) + (vector+float*! sv-1904 sv-1904 sv-1776 f0-41) + (vector-float*! sv-1776 sv-1776 (- 1.0 f0-41)) + ) + (let ((f0-44 (vector-dot sv-1776 (-> sv-1744 best-other-tri normal)))) + (vector--float*! sv-1776 sv-1776 (-> sv-1744 best-other-tri normal) (* 1.2 f0-44)) + ) + ) + (else + (let ((v1-128 sv-1904)) + (let ((a0-64 sv-1904)) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> a0-64 quad)) + ) + (.lvf vf5 (&-> sv-1776 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-128 quad) vf6) + ) + (goto cfg-27) + ) + ) + ) + ) + (label cfg-27) + (if (< 1 sv-1760) + (+! (-> obj num-bg-collisions) 1) + ) + (set! sv-1808 (new 'stack-no-clear 'vector)) + (let ((v1-143 s4-1) + (a0-69 sv-1904) + ) + (.lvf vf4 (&-> v1-143 quad)) + (.lvf vf5 (&-> a0-69 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-1808 quad) vf6) + (vector-normalize-ret-len! sv-1808 1.0) + (set! sv-1792 (new 'stack-no-clear 'vector)) + (let ((v1-146 sv-1904) + (a0-72 (-> sv-1456 position)) + ) + (.lvf vf4 (&-> v1-146 quad)) + (.lvf vf5 (&-> a0-72 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-1792 quad) vf6) + (let ((f30-4 (vector-dot sv-1808 sv-1792))) + (vector--float*! sv-1792 sv-1792 sv-1808 f30-4) + (cond + ((< f30-4 0.0) + (set! f0-51 (* 0.75 f30-4)) + (vector-float*! sv-1792 sv-1792 0.85) + ) + (else + (set! f0-51 (* 0.8 f30-4)) + (vector-float*! sv-1792 sv-1792 (-> obj stretch-vel)) + ) + ) + ) + (let ((v1-157 (-> sv-1456 velocity))) + (.lvf vf2 (&-> sv-1808 quad)) + (.lvf vf1 (&-> sv-1792 quad)) + (let ((a0-79 f0-51)) + (.mov vf3 a0-79) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-157 quad) vf4) + ) + (vector+! sv-1904 (-> sv-1456 position) (-> sv-1456 velocity)) + (let ((a2-14 (vector-! (new 'stack-no-clear 'vector) s4-1 sv-1904))) + (.lvf vf1 (&-> a2-14 quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-162 vf1) + (let* ((f0-53 v1-162) + (f1-21 (if (= s0-0 10) + 9830.4 + 6144.0 + ) + ) + (f2-0 f1-21) + ) + (if (< (* f2-0 f2-0) f0-53) + (vector--float*! sv-1904 s4-1 a2-14 (/ f1-21 (sqrtf f0-53))) + ) + ) + ) + (set! (-> obj max-movement) + (fmax (vector-vector-distance (-> sv-1456 position) sv-1904) (-> obj max-movement)) + ) + (set! (-> sv-1456 position quad) (-> sv-1904 quad)) + (if (-> sv-1456 joint-mod) + (set! (-> sv-1456 joint-mod trans quad) (-> sv-1904 quad)) + ) + (when (< s0-0 11) + (vector-! (-> s5-1 vector 1) sv-1904 s4-1) + (vector-normalize! (-> s5-1 vector 1) 1.0) + (vector-cross! (the-as vector (-> s5-1 vector)) (-> s5-1 vector 1) s3-1) + (vector-normalize! (the-as vector (-> s5-1 vector)) 1.0) + (set! sv-1872 (new 'stack-no-clear 'vector)) + (let ((v1-182 (-> sv-1456 old-x)) + (a0-93 (-> s5-1 vector)) + ) + (.lvf vf1 (&-> v1-182 quad)) + (.lvf vf2 (&-> a0-93 0 quad)) + ) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> sv-1872 quad) vf3) + (vector-flatten! sv-1872 (-> sv-1456 old-x) (-> s5-1 vector 1)) + (vector-normalize! sv-1872 1.0) + (cond + ((< (vector-dot (the-as vector (-> s5-1 vector)) sv-1872) (cos 3640.889)) + (vector-cross! sv-1872 sv-1872 (the-as vector (-> s5-1 vector))) + (vector-cross! sv-1872 (the-as vector (-> s5-1 vector)) sv-1872) + (vector-normalize! sv-1872 1.0) + (set! sv-1840 (-> s5-1 vector)) + (set! sv-1824 (-> s5-1 vector)) + (let ((f0-60 (cos 3640.889))) + (.lvf vf1 (&-> sv-1824 0 quad)) + (let ((v1-192 f0-60)) + (.mov vf2 v1-192) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> sv-1840 0 quad) vf1) + (set! sv-1888 (-> s5-1 vector)) + (set! sv-1856 (-> s5-1 vector)) + (let ((f0-61 (sin 3640.889))) + (.lvf vf2 (&-> sv-1872 quad)) + (.lvf vf1 (&-> sv-1856 0 quad)) + (let ((v1-198 f0-61)) + (.mov vf3 v1-198) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> sv-1888 0 quad) vf4) + (set! (-> sv-1456 old-x quad) (-> s5-1 vector 0 quad)) + ) + (else + (set! (-> s5-1 vector 0 quad) (-> sv-1872 quad)) + (set! (-> sv-1456 old-x quad) (-> s5-1 vector 0 quad)) + ) + ) + (vector-cross! (-> s5-1 vector 2) (the-as vector (-> s5-1 vector)) (-> s5-1 vector 1)) + (matrix->quaternion (-> sv-1456 joint-mod quat) s5-1) + (set! (-> s2-0 quad) (-> s5-1 vector 1 quad)) + (set! (-> s3-1 quad) (-> s5-1 vector 2 quad)) + 0 + ) + (set! (-> s4-1 quad) (-> sv-1904 quad)) + 0 + ) + ) + (set! (-> obj avoid-center) #f) + (set! (-> obj wrap) #f) + 0 + (none) + ) + ) + ) + +;; definition for method 7 of type squid-tentacle +;; WARN: Return type mismatch process-drawable vs squid-tentacle. +(defmethod relocate squid-tentacle ((obj squid-tentacle) (arg0 int)) + (dotimes (v1-0 11) + (if (nonzero? (-> obj chain-joints v1-0 joint-mod)) + (&+! (-> obj chain-joints v1-0 joint-mod) arg0) + ) + ) + (the-as squid-tentacle ((method-of-type process-drawable relocate) obj arg0)) + ) + +;; definition for function squid-tentacle-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior squid-tentacle-init-by-other squid-tentacle ((arg0 vector) (arg1 int)) + (let ((s4-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) + (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + dark-punch + dark-giant + ) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 10) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 0.0 0.0 8192.0) + ) + (set! (-> s4-0 nav-radius) 8192.0) + (let ((v1-12 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> self root-override) (the-as collide-shape-moving s4-0)) + ) + (set! (-> self root-override trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-squid-tentacle" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> self draw light-index) (the-as uint 10)) + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((a0-16 12) + (v1-22 36) + ) + (let ((a1-7 arg1)) + (cond + ((zero? a1-7) + (set! a0-16 7) + (set! v1-22 14) + ) + ((= a1-7 1) + (set! a0-16 8) + (set! v1-22 18) + ) + ((= a1-7 2) + (set! a0-16 9) + (set! v1-22 36) + ) + ((= a1-7 3) + (set! a0-16 10) + (set! v1-22 14) + ) + ((= a1-7 4) + (set! a0-16 11) + (set! v1-22 18) + ) + ) + ) + (let ((a1-15 (-> self node-list data))) + (set! (-> a1-15 0 param0) (the-as (function cspace transformq none) cspace<-parent-joint!)) + (set! (-> a1-15 0 param1) (the-as basic (-> self parent))) + (set! (-> a1-15 0 param2) (the-as basic a0-16)) + ) + (setup-masks (-> self draw) 0 (lognot v1-22)) + ) + (ja :num-func num-func-identity :frame-num (the float (* 10 arg1))) + (when (-> self draw shadow) + (set! (-> self draw shadow-ctrl) + (new 'process 'shadow-control -122880.0 4096.0 4096000.0 (shadow-flags) 819200.0) + ) + (let ((v1-34 (-> self draw shadow-ctrl))) + (logclear! (-> v1-34 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + (dotimes (gp-1 11) + (set! (-> self chain-joints gp-1 joint-mod) + (new 'process 'joint-mod (joint-mod-mode flex-blend) self (+ gp-1 4)) + ) + (set! (-> self chain-joints gp-1 joint-mod track-mode) (track-mode no-scale)) + ) + (set-vector! (-> self gravity) 0.0 -1.0 0.0 1.0) + (set! (-> self gravity-target quad) (-> self gravity quad)) + (vector-reset! (-> self center)) + (set! (-> self avoid-center) #f) + (set! (-> self wrap) #f) + (set! (-> self num-bg-collisions) 0) + (set! (-> self max-movement) 0.0) + (set! (-> self stretch-vel) 0.7) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (go-virtual idle) + (none) + ) + +;; definition for function squid-take-hit +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defbehavior squid-take-hit squid ((arg0 touching-shapes-entry) (arg1 attack-info) (arg2 symbol)) + (when #t + (let ((gp-0 (new 'stack-no-clear 'vector))) + (when arg0 + (let ((a1-1 (-> arg0 head))) + (get-intersect-point gp-0 a1-1 (-> self root-override) arg0) + ) + ) + (when arg2 + (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when s4-1 + (let ((t9-2 (method-of-type part-tracker activate))) + (t9-2 (the-as part-tracker s4-1) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-3 run-function-in-process) + (a0-4 s4-1) + (a1-4 part-tracker-init) + (a2-6 (-> *part-group-id-table* 1121)) + (a3-2 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> gp-0 quad)) + ((the-as (function object object object object object object object object none) t9-3) + a0-4 + a1-4 + a2-6 + a3-2 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> s4-1 ppointer) + ) + ) + (sound-play "hit-squid") + ) + (if (logtest? (attack-info-mask attacker-velocity) (-> arg1 mask)) + (set! (-> gp-0 quad) (-> arg1 attacker-velocity quad)) + (vector-! gp-0 (-> self root-override trans) gp-0) + ) + (vector-normalize-copy! (-> self hit-reaction vel) gp-0 1.0) + ) + ) + (none) + ) + +;; definition for function squid-increment-shield +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defbehavior squid-increment-shield squid ((arg0 float)) + (set! (-> self shield-hit-points) (fmin 1.0 (fmax 0.0 (+ (-> self shield-hit-points) arg0)))) + (set! (-> self shield-timer) (+ (-> self clock frame-counter) (seconds -0.125))) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (cond + ((< (-> self shield-hit-points) 0.5) + (set! (-> gp-0 x) 1.0) + (set! (-> gp-0 y) (lerp-scale 1.0 0.0 (-> self shield-hit-points) 0.5 0.0)) + ) + (else + (set! (-> gp-0 x) (lerp-scale 0.0 1.0 (-> self shield-hit-points) 1.0 0.5)) + (set! (-> gp-0 y) 1.0) + ) + ) + (set! (-> gp-0 z) 0.0) + (set! (-> gp-0 w) 1.0) + (set-shield-color! gp-0) + (set-shield-flash! gp-0) + (set! (-> self shield-color quad) (-> gp-0 quad)) + ) + (none) + ) + +;; definition for function squid-check-hit-points +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs none. +(defbehavior squid-check-hit-points squid () + (local-vars + (sv-48 symbol) + (sv-64 symbol) + (sv-80 vector) + (sv-96 matrix) + (sv-112 symbol) + (sv-128 symbol) + (sv-144 vector) + (sv-160 matrix) + ) + (when (zero? (-> self hit-points)) + (set! (-> self shield-hit-points) 0.0) + (cond + ((zero? (-> self stage)) + (setup-masks (-> self draw) 320 160) + (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-0 + (let ((t9-2 (method-of-type part-tracker activate))) + (t9-2 (the-as part-tracker gp-0) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((s5-0 run-function-in-process) + (s4-0 gp-0) + (s3-0 part-tracker-init) + (s2-0 (-> *part-group-id-table* 1121)) + (s1-0 0) + (s0-0 #f) + ) + (set! sv-48 (the-as symbol #f)) + (set! sv-64 (the-as symbol #f)) + (set! sv-96 *launch-matrix*) + (set! sv-80 (-> sv-96 trans)) + (let ((v1-13 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 36)) quad))) + (set! (-> sv-80 quad) v1-13) + ) + ((the-as (function object object object object object object object object none) s5-0) + s4-0 + s3-0 + s2-0 + s1-0 + s0-0 + sv-48 + sv-64 + sv-96 + ) + ) + (-> gp-0 ppointer) + ) + ) + ) + ((= (-> self stage) 1) + (setup-masks (-> self draw) 5120 2590) + (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-1 + (let ((t9-7 (method-of-type part-tracker activate))) + (t9-7 (the-as part-tracker gp-1) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((s5-1 run-function-in-process) + (s4-1 gp-1) + (s3-1 part-tracker-init) + (s2-1 (-> *part-group-id-table* 1121)) + (s1-1 0) + (s0-1 #f) + ) + (set! sv-112 (the-as symbol #f)) + (set! sv-128 (the-as symbol #f)) + (set! sv-160 *launch-matrix*) + (set! sv-144 (-> sv-160 trans)) + (let ((v1-25 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 50)) quad))) + (set! (-> sv-144 quad) v1-25) + ) + ((the-as (function object object object object object object object object none) s5-1) + s4-1 + s3-1 + s2-1 + s1-1 + s0-1 + sv-112 + sv-128 + sv-160 + ) + ) + (-> gp-1 ppointer) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for function squid-handler +;; INFO: Used lq/sq +(defbehavior squid-handler squid ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (sv-16 res-tag)) + (case arg2 + (('plane) + (set! (-> self max-plane) (max (-> self max-plane) (the-as int (-> arg3 param 0)))) + (let ((s5-1 0)) + (case (-> arg3 param 0) + ((8) + (set! s5-1 3) + ) + ((24) + (set! s5-1 4) + ) + ) + (when (nonzero? s5-1) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-9 (res-lump-data (-> self entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when (and v1-9 (< (the-as uint s5-1) (-> sv-16 elt-count))) + (let ((gp-1 (-> v1-9 s5-1))) + (dotimes (s5-2 (-> gp-1 length)) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-15 (-> gp-1 data s5-2 actor)) + ) + (t9-1 + (if v1-15 + (-> v1-15 extra process) + ) + a1-2 + ) + ) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (('skip) + (set! (-> self shield-hit-points) 0.0) + (go-virtual pre-flee) + ) + (('track) + #t + ) + (('attack) + (let ((s4-0 (the-as object (-> arg3 param 1)))) + (cond + ((and (-> self next-state) (let ((v1-25 (-> self next-state name))) + (or (= v1-25 'flee) + (= v1-25 'pre-flee) + (= v1-25 'hidden) + (= v1-25 'test) + (= v1-25 'beaten) + (= v1-25 'wait-around-corner) + (= v1-25 'wait-beside-building) + ) + ) + ) + ) + ((and (logtest? (attack-info-mask penetrate-using) (-> (the-as attack-info s4-0) mask)) + (logtest? (penetrate dark-bomb) (-> (the-as attack-info s4-0) penetrate-using)) + (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + ) + (set! (-> self hit-points) 0) + (squid-check-hit-points) + (go-virtual pre-flee) + ) + ((let ((v1-41 (ja-group))) + (or (and (and v1-41 (= v1-41 (-> self draw art-group data 4))) (< 16.0 (ja-aframe-num 0))) + (let ((v1-49 (ja-group))) + (or (and v1-49 (= v1-49 (-> self draw art-group data 5))) + (let ((v1-54 (ja-group))) + (and (and v1-54 (= v1-54 (-> self draw art-group data 6))) (< (ja-aframe-num 0) 105.0)) + ) + ) + ) + ) + ) + (sound-play "hit-squid-ricco") + ) + ((= arg0 *target*) + (when (!= (-> (the-as attack-info s4-0) id) (-> self attack-id)) + (set! (-> self attack-id) (-> (the-as attack-info s4-0) id)) + (set! (-> self stop-shooting) #t) + (squid-take-hit (the-as touching-shapes-entry (-> arg3 param 0)) (the-as attack-info (-> arg3 param 1)) #f) + ) + ) + ((>= (- (-> self clock frame-counter) (-> self invincible-timer)) (seconds 3)) + (cond + ((and (= (-> self shield-hit-points) 0.0) + (not (and (-> self next-state) (= (-> self next-state name) 'recharge))) + ) + (set! (-> self hit-points) (max 0 (+ (-> self hit-points) -2))) + (squid-talker 'damaged) + ) + (else + (set! (-> self hit-points) (max 0 (+ (-> self hit-points) -1))) + (squid-talker 'shield-hit) + ) + ) + (squid-take-hit (the-as touching-shapes-entry (-> arg3 param 0)) (the-as attack-info (-> arg3 param 1)) #t) + (set! (-> self invincible-timer) (-> self clock frame-counter)) + (squid-check-hit-points) + ) + ((or (!= (-> self shield-hit-points) 0.0) (and (-> self next-state) (= (-> self next-state name) 'recharge))) + (squid-talker 'shield-hit) + ) + ) + ) + #t + ) + (('touched) + (-> arg3 param 0) + (when #t + (let ((a0-66 (if (type? arg0 process-focusable) + arg0 + ) + ) + ) + (when a0-66 + (let ((a1-13 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-13 from) (process->ppointer self)) + (set! (-> a1-13 num-params) 2) + (set! (-> a1-13 message) 'attack) + (set! (-> a1-13 param 0) (-> arg3 param 0)) + (let ((v1-101 (new 'static 'attack-info :mask (attack-info-mask shove-back shove-up id)))) + (let* ((a2-6 *game-info*) + (a3-4 (+ (-> a2-6 attack-id) 1)) + ) + (set! (-> a2-6 attack-id) a3-4) + (set! (-> v1-101 id) a3-4) + ) + (set! (-> v1-101 shove-back) 24576.0) + (set! (-> v1-101 shove-up) 12288.0) + (set! (-> a1-13 param 1) (the-as uint v1-101)) + ) + (if (send-event-function a0-66 a1-13) + #f + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 10 of type squid +(defmethod deactivate squid ((obj squid)) + (if (nonzero? (-> obj thruster-part)) + (kill-and-free-particles (-> obj thruster-part)) + ) + (if (-> obj rush-sound-playing) + (sound-stop (-> obj rush-sound)) + ) + (if (-> obj jet-sound-playing) + (sound-stop (-> obj jet-sound)) + ) + (if (-> obj spin-sound-playing) + (sound-stop (-> obj spin-sound)) + ) + (if (-> obj tentacle-sound-playing) + (sound-stop (-> obj tentacle-sound)) + ) + ((method-of-type process-drawable deactivate) obj) + (none) + ) + +;; definition for method 7 of type squid +;; WARN: Return type mismatch process-drawable vs squid. +(defmethod relocate squid ((obj squid) (arg0 int)) + (if (nonzero? (-> obj thruster-part)) + (&+! (-> obj thruster-part) arg0) + ) + (if (nonzero? (-> obj first-path)) + (&+! (-> obj first-path) arg0) + ) + (if (nonzero? (-> obj second-path)) + (&+! (-> obj second-path) arg0) + ) + (if (nonzero? (-> obj third-path)) + (&+! (-> obj third-path) arg0) + ) + (if (nonzero? (-> obj gun-tilt-left-jm)) + (&+! (-> obj gun-tilt-left-jm) arg0) + ) + (if (nonzero? (-> obj gun-tilt-right-jm)) + (&+! (-> obj gun-tilt-right-jm) arg0) + ) + (if (nonzero? (-> obj tentacle-base-jm)) + (&+! (-> obj tentacle-base-jm) arg0) + ) + (the-as squid ((method-of-type process-drawable relocate) obj arg0)) + ) + +;; definition for method 11 of type squid +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! squid ((obj squid) (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)))) + (set! (-> s4-0 penetrated-by) + (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + dark-punch + dark-giant + ) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 23) 0))) + (set! (-> s4-0 total-prims) (the-as uint 24)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action deadly)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 -4096.0 0.0 32768.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 -12288.0 0.0 12288.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-sphere s4-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 bot player-list)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) 0.0 -24576.0 0.0 12288.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 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 bot player-list)) + (set! (-> v1-14 prim-core action) (collide-action deadly)) + (set! (-> v1-14 transform-index) 6) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 12288.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-16 prim-core action) (collide-action deadly)) + (set! (-> v1-16 transform-index) 15) + (set-vector! (-> v1-16 local-sphere) 0.0 7168.0 0.0 10240.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-18 prim-core action) (collide-action deadly)) + (set! (-> v1-18 transform-index) 13) + (set-vector! (-> v1-18 local-sphere) 0.0 8192.0 6144.0 12288.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (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! (-> v1-20 transform-index) 23) + (set-vector! (-> v1-20 local-sphere) 0.0 1024.0 -2048.0 8192.0) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-22 prim-core action) (collide-action deadly)) + (set! (-> v1-22 transform-index) 22) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 5) (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-24 prim-core action) (collide-action deadly)) + (set! (-> v1-24 transform-index) 21) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 6) (the-as uint 0)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-26 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-26 prim-core action) (collide-action deadly)) + (set! (-> v1-26 transform-index) 20) + (set-vector! (-> v1-26 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-28 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 7) (the-as uint 0)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-28 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-28 prim-core action) (collide-action deadly)) + (set! (-> v1-28 transform-index) 19) + (set-vector! (-> v1-28 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-30 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 8) (the-as uint 0)))) + (set! (-> v1-30 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-30 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-30 prim-core action) (collide-action deadly)) + (set! (-> v1-30 transform-index) 18) + (set-vector! (-> v1-30 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-32 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 9) (the-as uint 0)))) + (set! (-> v1-32 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-32 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-32 prim-core action) (collide-action deadly)) + (set! (-> v1-32 transform-index) 31) + (set-vector! (-> v1-32 local-sphere) 0.0 1024.0 -2048.0 8192.0) + ) + (let ((v1-34 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 10) (the-as uint 0)))) + (set! (-> v1-34 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-34 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-34 prim-core action) (collide-action deadly)) + (set! (-> v1-34 transform-index) 30) + (set-vector! (-> v1-34 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-36 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 11) (the-as uint 0)))) + (set! (-> v1-36 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-36 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-36 prim-core action) (collide-action deadly)) + (set! (-> v1-36 transform-index) 29) + (set-vector! (-> v1-36 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-38 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 12) (the-as uint 0)))) + (set! (-> v1-38 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-38 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-38 prim-core action) (collide-action deadly)) + (set! (-> v1-38 transform-index) 28) + (set-vector! (-> v1-38 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-40 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 13) (the-as uint 0)))) + (set! (-> v1-40 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-40 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-40 prim-core action) (collide-action deadly)) + (set! (-> v1-40 transform-index) 27) + (set-vector! (-> v1-40 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-42 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 14) (the-as uint 0)))) + (set! (-> v1-42 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-42 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-42 prim-core action) (collide-action deadly)) + (set! (-> v1-42 transform-index) 26) + (set-vector! (-> v1-42 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-44 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 15) (the-as uint 0)))) + (set! (-> v1-44 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-44 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-44 prim-core action) (collide-action deadly)) + (set! (-> v1-44 transform-index) 17) + (set-vector! (-> v1-44 local-sphere) 0.0 0.0 4096.0 10240.0) + ) + (let ((v1-46 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 16) (the-as uint 0)))) + (set! (-> v1-46 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-46 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-46 prim-core action) (collide-action deadly)) + (set! (-> v1-46 transform-index) 5) + (set-vector! (-> v1-46 local-sphere) 0.0 0.0 -2048.0 22528.0) + ) + (let ((v1-48 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 17) (the-as uint 0)))) + (set! (-> v1-48 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-48 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-48 prim-core action) (collide-action deadly)) + (set! (-> v1-48 transform-index) 36) + (set-vector! (-> v1-48 local-sphere) 0.0 -3686.4 0.0 11264.0) + ) + (let ((v1-50 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 18) (the-as uint 0)))) + (set! (-> v1-50 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-50 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-50 prim-core action) (collide-action deadly)) + (set! (-> v1-50 transform-index) 43) + (set-vector! (-> v1-50 local-sphere) 0.0 3686.4 0.0 11264.0) + ) + (let ((v1-52 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 19) (the-as uint 0)))) + (set! (-> v1-52 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-52 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-52 prim-core action) (collide-action deadly)) + (set! (-> v1-52 transform-index) 50) + (set-vector! (-> v1-52 local-sphere) 0.0 0.0 -3072.0 13312.0) + ) + (let ((v1-54 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 20) (the-as uint 0)))) + (set! (-> v1-54 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-54 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-54 prim-core action) (collide-action deadly)) + (set! (-> v1-54 transform-index) 55) + (set-vector! (-> v1-54 local-sphere) 0.0 0.0 -3072.0 13312.0) + ) + (set! (-> s4-0 nav-radius) 8192.0) + (let ((v1-56 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-56 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-56 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-squid" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj draw light-index) (the-as uint 10)) + (logior! (-> obj skel status) (joint-control-status sync-math)) + (set! (-> obj mask) (logior (process-mask enemy) (-> obj mask))) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj trans quad) (-> obj root-override trans quad)) + (set! (-> obj force-onto-mesh) #t) + (set! (-> obj mesh-forced) #f) + (quaternion-copy! (-> obj quat) (-> obj root-override quat)) + (dotimes (s5-2 6) + (set! (-> obj tentacles s5-2) + (ppointer->handle (process-spawn squid-tentacle (-> obj root-override trans) s5-2 :to obj)) + ) + ) + (set! (-> obj baron) (the-as squid-baron (process-spawn squid-baron (-> obj root-override trans) :to obj))) + (set! (-> obj driver) (process-spawn squid-driver "driver-" :to obj)) + (init (-> obj driver-blend) 0.0 0.0025 0.025 0.5) + (set-params! (-> obj hit-reaction) (the-as vector #f) 0.2 1.0 0.5) + (let ((s5-6 (vector+! + (new 'stack-no-clear 'vector) + (-> obj root-override trans) + (new 'static 'vector :x -20480.0 :y 23388.16 :z 143360.0) + ) + ) + ) + (set! (-> obj collision-actor) (process-spawn squid-collision s5-6 0 :to obj)) + ) + (set! (-> obj blink-time) 0) + (setup-part-engine obj #t) + (set! (-> obj thruster-part) (create-launch-control (-> *part-group-id-table* 1118) obj)) + (dotimes (v1-110 10) + (set! (-> obj grenade v1-110 grenade) (the-as handle #f)) + (set! (-> obj grenade v1-110 marker) (the-as handle #f)) + (set! (-> obj grenade v1-110 show-it) #f) + ) + (set! (-> obj gun-tilt-left-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 36)) + (set! (-> obj gun-tilt-right-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 43)) + (set! (-> obj gun-tilt) 0.0) + (set! (-> obj tentacle-base-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 6)) + (init (-> obj tentacle-base-rotation-speed) 0.0 0.01 0.1 0.9) + (set! (-> obj tentacle-base-rotation) 0.0) + (set! (-> obj first-path) (new 'process 'curve-control obj 'first -1000000000.0)) + (logior! (-> obj first-path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> obj second-path) (new 'process 'curve-control obj 'second -1000000000.0)) + (logior! (-> obj second-path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> obj third-path) (new 'process 'curve-control obj 'third -1000000000.0)) + (logior! (-> obj third-path flags) (path-control-flag display draw-line draw-point draw-text)) + (change-to (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor 0) obj) + (set! (-> obj current-nav-poly) #f) + (set! (-> obj shield-timer) 0) + (set! (-> obj shield-hit-points) 1.0) + (set! (-> obj shield-shattered) #f) + (set! (-> obj hit-points) 10) + (set! (-> obj invincible-timer) 0) + (set! (-> obj stage) 0) + (set! (-> obj stage-2-go-status) 0) + (set! (-> obj debug-on) #f) + (when (-> obj draw shadow) + (set! (-> obj draw shadow-ctrl) + (new 'process 'shadow-control -122880.0 4096.0 4096000.0 (shadow-flags) 819200.0) + ) + (let ((v1-141 (-> obj draw shadow-ctrl))) + (logclear! (-> v1-141 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + (set! (-> obj hud) (the-as handle #f)) + (setup-masks (-> obj draw) 0 5440) + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1124) obj)) + (set! (-> obj desired-rotate-to-vector-angle) 0.0) + (set! (-> obj allowed-rotate-to-vector-angle) 0.0) + (set! (-> obj rush-sound) (new-sound-id)) + (set! (-> obj rush-sound-playing) #f) + (set! (-> obj rush-end-time) 0) + (set! (-> obj jet-sound) (new-sound-id)) + (set! (-> obj jet-sound-playing) #f) + (set! (-> obj jet-pitch) 0) + (set! (-> obj jet-volume) 0) + (set! (-> obj tentacle-sound) (new-sound-id)) + (set! (-> obj tentacle-sound-playing) #f) + (set! (-> obj spin-sound) (new-sound-id)) + (set! (-> obj spin-sound-playing) #f) + (set! (-> obj max-plane) -1) + (set! (-> obj last-damaged-talker) 0) + (set! (-> obj last-shield-hit-talker) 0) + (set! (-> obj last-no-energy-talker) 0) + (set! (-> obj last-shooting-talker) 0) + (set! (-> obj last-headbutting-talker) 0) + (set! (-> obj last-general-talker) 0) + (set! (-> obj last-start-recharging-talker) -1) + (set! (-> obj last-done-recharging-talker) -1) + (set! (-> obj suck) (you-suck-scale *game-info* #f)) + (if (task-node-closed? (game-task-node palace-boss-resolution)) + (go (method-of-object obj beaten)) + (go (method-of-object obj hidden)) + ) + (none) + ) + +;; definition for method 42 of type squid +;; INFO: Used lq/sq +(defmethod squid-method-42 squid ((obj squid) (arg0 vector)) + (set! (-> arg0 quad) (-> (if *target* + (get-trans *target* 3) + (-> obj nav state mesh bounds) + ) + quad + ) + ) + arg0 + ) + +;; definition for method 43 of type squid +;; WARN: Return type mismatch int vs none. +(defmethod squid-method-43 squid ((obj squid) (arg0 vector) (arg1 float) (arg2 float)) + (let ((s4-0 (new 'stack-no-clear 'matrix)) + (s5-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> obj quat))) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-! s3-0 arg0 (-> obj trans)) + (vector-flatten! s3-0 s3-0 (-> s5-0 vector 1)) + (vector-normalize! s3-0 1.0) + (matrix-from-two-vectors-max-angle-partial! + s4-0 + (-> s5-0 vector 2) + s3-0 + (fmin (-> obj allowed-rotate-to-vector-angle) arg1) + arg2 + ) + (let* ((v1-2 (vector-cross! (new 'stack-no-clear 'vector) s3-0 (-> s5-0 vector 2))) + (f0-2 (vector-length v1-2)) + ) + (if (< (vector-dot v1-2 (-> s5-0 vector 1)) 0.0) + (set! f0-2 (- f0-2)) + ) + (set! (-> obj desired-rotate-to-vector-angle) (asin f0-2)) + ) + ) + (matrix*! s5-0 s5-0 s4-0) + (matrix-remove-z-rot s5-0 (new 'static 'vector :y -1.0)) + (matrix->quaternion (-> obj quat) s5-0) + ) + (quaternion-normalize! (-> obj quat)) + 0 + (none) + ) + +;; definition for method 44 of type squid +;; INFO: Used lq/sq +(defmethod squid-method-44 squid ((obj squid) (arg0 vector) (arg1 vector)) + (let ((v1-0 (new 'stack-no-clear 'collide-query))) + (set! (-> v1-0 start-pos quad) (-> arg0 quad)) + (vector-! (-> v1-0 move-dist) arg1 arg0) + (let ((a1-1 v1-0)) + (set! (-> a1-1 radius) 409.6) + (set! (-> a1-1 collide-with) (collide-spec player-list special-obstacle)) + (set! (-> a1-1 ignore-process0) obj) + (set! (-> a1-1 ignore-process1) #f) + (set! (-> a1-1 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> a1-1 action-mask) (collide-action solid)) + ) + (< (fill-and-probe-using-line-sphere *collide-cache* v1-0) 0.0) + ) + ) + +;; definition for method 45 of type squid +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 310] +(defmethod move-to-spot squid ((obj squid) (arg0 vector) (arg1 symbol)) + (local-vars + (sv-656 vector) + (sv-672 vector) + (sv-688 matrix) + (sv-704 clamp-travel-vector-to-mesh-return-info) + (sv-720 int) + (sv-736 nav-control) + (sv-752 vector) + (sv-768 nav-control) + (sv-784 vector) + ) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 13))) + (dotimes (v1-0 13) + (set! (-> s5-0 v1-0 quad) (the-as uint128 0)) + ) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (f30-0 0.0) + ) + (set! sv-656 (new 'stack-no-clear 'vector)) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s0-0 0) + ) + (set! sv-672 (squid-method-42 obj (new 'stack-no-clear 'vector))) + (set! (-> sv-672 y) (+ 8192.0 (-> sv-672 y))) + (set! (-> s3-0 quad) (-> arg0 quad)) + (set! (-> s3-0 y) (-> obj nav state mesh bounds y)) + (set! (-> obj current-nav-poly) (cloest-point-on-mesh (-> obj nav) s3-0 s3-0 (-> obj current-nav-poly))) + (cond + ((-> obj current-nav-poly) + (vector-! sv-656 (-> obj nav state mesh bounds) s3-0) + (set! (-> sv-656 y) 0.0) + (vector-normalize! sv-656 614400.0) + (let ((a2-2 (matrix-rotate-y! (new 'stack-no-clear 'matrix) -19114.668))) + (vector-matrix*! sv-656 sv-656 a2-2) + ) + (set! sv-688 (matrix-rotate-y! (new 'stack-no-clear 'matrix) 2730.6667)) + (set! sv-704 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + (set! sv-720 0) + (while (< sv-720 13) + (vector-matrix*! sv-656 sv-656 sv-688) + (set! (-> s5-0 s0-0 quad) (-> sv-656 quad)) + (set! (-> sv-704 poly) #f) + (clamp-vector-to-mesh-cross-gaps + (-> obj nav) + s3-0 + (-> obj current-nav-poly) + (-> s5-0 s0-0) + 614400.0 + #f + sv-704 + ) + (set! (-> s5-0 s0-0 quad) (-> sv-704 intersection quad)) + (set! (-> s5-0 s0-0 y) (+ 20480.0 (-> obj nav state mesh bounds y))) + (cond + ((not (-> sv-704 found-boundary)) + ) + ((let ((f0-6 (vector-vector-distance-squared sv-672 (-> s5-0 s0-0))) + (f1-2 102400.0) + ) + (< f0-6 (* f1-2 f1-2)) + ) + ) + ((not (squid-method-44 obj (-> s5-0 s0-0) sv-672)) + ) + ((let ((f0-7 (vector-vector-distance-squared s3-0 (-> s5-0 s0-0))) + (f1-5 81920.0) + ) + (< f0-7 (* f1-5 f1-5)) + ) + (let ((f28-0 (vector-vector-distance-squared s3-0 (-> s5-0 s0-0)))) + (new 'stack-no-clear 'vector) + (when (< f30-0 f28-0) + (set! (-> s1-0 quad) (-> s5-0 s0-0 quad)) + (when (-> sv-704 poly) + (let ((a3-2 (new 'stack-no-clear 'vector))) + (set! sv-736 (-> obj nav)) + (let ((a1-15 (-> sv-704 poly))) + (set! sv-752 s1-0) + (let ((v1-53 (-> s5-0 s0-0))) + (project-point-onto-plane-of-poly-local + (-> sv-736 state mesh) + a1-15 + sv-752 + a3-2 + (vector-! (new 'stack-no-clear 'vector) v1-53 (-> sv-736 state mesh bounds)) + ) + ) + ) + ) + (let ((v1-54 sv-752)) + (let ((a0-33 (-> sv-736 state mesh bounds))) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> sv-752 quad)) + (.lvf vf5 (&-> a0-33 quad)) + ) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-54 quad) vf6) + ) + 0 + (set! (-> s1-0 y) (+ 32768.0 (-> s1-0 y))) + ) + (set! f30-0 f28-0) + ) + ) + ) + (else + (when (-> sv-704 poly) + (let ((a3-3 (new 'stack-no-clear 'vector))) + (set! sv-768 (-> obj nav)) + (let ((a1-17 (-> sv-704 poly))) + (set! sv-784 (-> s5-0 s0-0)) + (let ((v1-67 (-> s5-0 s0-0))) + (project-point-onto-plane-of-poly-local + (-> sv-768 state mesh) + a1-17 + sv-784 + a3-3 + (vector-! (new 'stack-no-clear 'vector) v1-67 (-> sv-768 state mesh bounds)) + ) + ) + ) + ) + (let ((v1-68 sv-784)) + (let ((a0-38 (-> sv-768 state mesh bounds))) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> sv-784 quad)) + (.lvf vf5 (&-> a0-38 quad)) + ) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-68 quad) vf6) + ) + 0 + (set! (-> s5-0 s0-0 y) (+ 32768.0 (-> s5-0 s0-0 y))) + ) + (+! s0-0 1) + ) + ) + (set! sv-720 (+ sv-720 1)) + ) + (when arg1 + (cond + ((and (zero? s0-0) (!= f30-0 0.0)) + (set! (-> s5-0 0 quad) (-> s1-0 quad)) + ) + ((zero? s0-0) + ) + (else + (set! (-> s5-0 0 quad) (-> s5-0 (rand-vu-int-count s0-0) quad)) + ) + ) + (set! (-> s3-0 y) (-> arg0 y)) + (set-traj-towards-vec obj arg0 s3-0 (-> s5-0 0)) + ) + ) + (else + (format 0 "~A bad current poly~%" (-> obj name)) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 46 of type squid +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-traj-towards-vec squid ((obj squid) (src vector) (arg2 vector) (dest vector)) + "Set up the [[trajectory]] towards `dest`." + (with-pp + (set! (-> obj traj-timer) (-> pp clock frame-counter)) + (set! (-> obj traj-src quad) (-> src quad)) + (set! (-> obj traj-dest quad) (-> dest quad)) + (set! (-> obj traj-duration) (* 0.00091552734 (vector-vector-xz-distance arg2 dest))) + (set! (-> obj traj-duration) (fmax 480.0 (-> obj traj-duration))) + (let ((f0-4 49152.0)) + (if (< (-> arg2 y) (-> dest y)) + (+! f0-4 (- (-> dest y) (-> arg2 y))) + ) + (setup-from-to-duration-and-height! (-> obj traj) arg2 dest 1.0 f0-4) + ) + (set! (-> obj residual-accumulator-1) 1.0) + (set! (-> obj residual-accumulator-2) 0.0) + 0 + (none) + ) + ) + +;; definition for method 47 of type squid +(defmethod float-sin-clamp squid ((obj squid) (arg0 float)) + (parameter-ease-sin-clamp (* 0.6366198 arg0)) + ) + +;; definition for method 48 of type squid +;; INFO: Used lq/sq +(defmethod squid-method-48 squid ((obj squid)) + (with-pp + (when (< 0.00001 (-> obj residual-accumulator-1)) + (set! (-> obj residual-accumulator-1) (* 0.95 (-> obj residual-accumulator-1))) + (+! (-> obj residual-accumulator-2) (-> obj residual-accumulator-1)) + ) + (let* ((f28-0 ((method-of-type trajectory compute-time-until-apex) + (the-as trajectory (&-> (the-as squid-grenade (-> obj self)) ignore-handle)) + ) + ) + (s3-0 (compute-trans-at-time (-> obj traj) f28-0 (new 'stack-no-clear 'vector))) + (s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (f30-0 (/ (the float (- (-> pp clock frame-counter) (-> obj traj-timer))) (-> obj traj-duration))) + ) + (let ((f26-0 (float-sin-clamp obj f30-0))) + (when (and (-> obj can-play-squid-boost) (< 0.125 f30-0)) + (set! (-> obj can-play-squid-boost) #f) + (sound-play "squid-boost") + ) + (cond + ((< f26-0 1.0) + (compute-trans-at-time (-> obj traj) f26-0 s5-0) + (set! (-> s4-0 quad) (-> obj traj-src quad)) + (+! (-> s4-0 y) (* 204.8 (the float (- (-> pp clock frame-counter) (-> obj traj-timer))) (/ f26-0 f30-0))) + (vector+float*! s4-0 s4-0 (-> obj residual-velocity) (-> obj residual-accumulator-2)) + (vector-lerp! s5-0 s4-0 s5-0 f26-0) + (cond + ((< f28-0 f26-0) + (let ((f28-1 (/ (- f26-0 f28-0) (- 1.0 f28-0)))) + (vector-lerp! s4-0 s3-0 (-> obj traj-dest) f28-1) + (vector-lerp! s5-0 s5-0 s4-0 f28-1) + ) + (squid-method-43 obj (squid-method-42 obj (new 'stack-no-clear 'vector)) 1092.2667 0.05) + (vector-! s4-0 (-> obj traj-dest) (-> obj trans)) + (vector-normalize! s4-0 1.75) + (dotimes (s3-2 6) + (send-event (handle->process (-> obj tentacles s3-2)) 'set-gravity s4-0) + ) + ) + (else + (squid-method-43 obj (-> obj traj-dest) 546.13336 0.005) + ) + ) + (set! (-> obj trans quad) (-> s5-0 quad)) + ) + (else + (dotimes (s5-1 6) + (send-event (handle->process (-> obj tentacles s5-1)) 'set-gravity-slow (new 'static 'vector :y -1.0)) + ) + (set! (-> obj trans quad) (-> obj traj-dest quad)) + ) + ) + ) + f30-0 + ) + ) + ) + +;; definition for method 49 of type squid +;; WARN: Return type mismatch int vs none. +(defmethod setup-part-engine squid ((obj squid) (arg0 symbol)) + (with-pp + (when (>= (- (-> pp clock frame-counter) (-> obj blink-time)) 0) + (set! (-> obj blink-mask) 0) + (dotimes (s5-0 10) + (let* ((f30-0 0.5) + (v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-7 (the-as number (logior #x3f800000 v1-6))) + ) + (if (< f30-0 (+ -1.0 (the-as float v1-7))) + (logior! (-> obj blink-mask) (ash 1 s5-0)) + ) + ) + ) + (set! (-> obj blink-time) (+ (-> pp clock frame-counter) (the int (* 300.0 (rand-vu-float-range 0.25 0.75))))) + (set! arg0 #t) + ) + (when arg0 + (remove-from-process *part-engine* obj) + (add-connection + *part-engine* + obj + 5 + obj + 4790 + (new 'static 'vector :x -5906.432 :y 3317.76 :z -409.6 :w 819200.0) + ) + (add-connection + *part-engine* + obj + 5 + obj + 4790 + (new 'static 'vector :x 5906.432 :y 3317.76 :z -409.6 :w 819200.0) + ) + (add-connection *part-engine* obj 6 obj 4791 (new 'static 'vector :y 3366.912 :w 819200.0)) + (add-connection *part-engine* obj 13 obj 4791 (new 'static 'vector :y 11993.088 :z 5255.168 :w 819200.0)) + (add-connection + *part-engine* + obj + 5 + obj + 4792 + (new 'static 'vector :x 5439.488 :y -1794.048 :z 11444.224 :w 819200.0) + ) + (add-connection + *part-engine* + obj + 5 + obj + 4792 + (new 'static 'vector :x -5439.488 :y -1794.048 :z 11444.224 :w 819200.0) + ) + (let ((s5-2 (-> obj blink-mask))) + (if (logtest? s5-2 1) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x -4128.768 :y 2355.2 :z 3653.632 :w 819200.0) + ) + ) + (if (logtest? s5-2 2) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x -4554.752 :y 2449.408 :z 2359.296 :w 819200.0) + ) + ) + (if (logtest? s5-2 4) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x -4386.816 :y 2191.36 :z 528.384 :w 819200.0) + ) + ) + (if (logtest? s5-2 8) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x -5832.704 :y 2945.024 :z 1691.648 :w 819200.0) + ) + ) + (if (logtest? s5-2 16) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x -5861.376 :y 2920.448 :z 1118.208 :w 819200.0) + ) + ) + (if (logtest? s5-2 32) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x 4128.768 :y 2355.2 :z 3653.632 :w 819200.0) + ) + ) + (if (logtest? s5-2 64) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x 4554.752 :y 2449.408 :z 2359.296 :w 819200.0) + ) + ) + (if (logtest? s5-2 128) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x 4386.816 :y 2191.36 :z -528.384 :w 819200.0) + ) + ) + (if (logtest? s5-2 256) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x 5832.704 :y 2945.024 :z 1691.648 :w 819200.0) + ) + ) + (if (logtest? s5-2 512) + (add-connection + *part-engine* + obj + 5 + obj + 4793 + (new 'static 'vector :x 5861.376 :y 2920.448 :z 1118.208 :w 819200.0) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 50 of type squid +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs none. +(defmethod squid-post squid ((obj squid)) + (local-vars + (v0-33 object) + (s5-9 int) + (sv-496 + (function skeleton-group int joint-exploder-tuning joint-exploder-static-params none :behavior joint-exploder) + ) + ) + (with-pp + (if (= (-> obj stage) 2) + (eval! + (new 'stack 'script-context (the-as basic (process->ppointer pp)) pp (the-as vector #f)) + '(want-anim "palace-boss-res") + ) + ) + (when (-> obj force-onto-mesh) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> obj trans quad)) + (set! (-> obj trans y) (-> obj nav state mesh bounds y)) + (set! (-> obj current-nav-poly) + (cloest-point-on-mesh (-> obj nav) (-> obj trans) (-> obj trans) (-> obj current-nav-poly)) + ) + (set! (-> obj trans y) (-> s5-0 y)) + (let ((f0-2 409.6)) + (set! (-> obj mesh-forced) (< (* f0-2 f0-2) (vector-vector-distance-squared (-> obj trans) s5-0))) + ) + ) + ) + (setup-part-engine obj #f) + (update! (-> obj driver-blend) 0.0) + (let ((s4-0 (new 'stack-no-clear 'matrix)) + (s5-1 (new 'stack-no-clear 'vector)) + (f30-1 (parameter-ease-sin-clamp (-> obj driver-blend value))) + ) + (matrix-identity! s4-0) + (send-event (ppointer->process (-> obj driver)) 'matrix s4-0) + (vector+float*! (-> obj root-override trans) (-> obj trans) (-> s4-0 trans) f30-1) + (matrix->quaternion (the-as quaternion s5-1) s4-0) + (cond + ((< (-> s5-1 w) (cos 1.8204443)) + (let* ((f28-1 (acos (-> s5-1 w))) + (f30-2 (* f30-1 f28-1)) + ) + (vector-float*! s5-1 s5-1 (/ (sin f30-2) (sin f28-1))) + (set! (-> s5-1 w) (cos f30-2)) + ) + (quaternion-normalize! (quaternion*! (-> obj root-override quat) (the-as quaternion s5-1) (-> obj quat))) + ) + (else + (quaternion-copy! (-> obj root-override quat) (-> obj quat)) + ) + ) + ) + (update! (-> obj hit-reaction) (the-as vector #f)) + (vector+float*! + (-> obj root-override trans) + (-> obj root-override trans) + (the-as vector (-> obj hit-reaction)) + 4096.0 + ) + (update! (-> obj tentacle-base-rotation-speed) 0.0) + (let ((f0-14 (+ (-> obj tentacle-base-rotation) (* 910.2222 (-> obj tentacle-base-rotation-speed value))))) + (set! (-> obj tentacle-base-rotation) (- f0-14 (* (the float (the int (/ f0-14 65536.0))) 65536.0))) + ) + (quaternion-set! + (-> obj tentacle-base-jm quat) + 0.0 + (sin (-> obj tentacle-base-rotation)) + 0.0 + (cos (-> obj tentacle-base-rotation)) + ) + (when (< 0.5 (-> obj tentacle-base-rotation-speed value)) + (let ((s5-3 (new 'stack-no-clear 'vector))) + (let ((s4-5 (new 'stack-no-clear 'vector))) + (vector<-cspace! s5-3 (-> obj node-list data 6)) + (vector-normalize-copy! s4-5 (-> obj node-list data 6 bone transform vector 1) 16384.0) + (vector+! s5-3 s5-3 s4-5) + ) + (dotimes (s4-6 6) + (send-event (handle->process (-> obj tentacles s4-6)) 'avoid-center s5-3) + ) + ) + ) + (if (or (zero? (-> obj stage)) (or (and (= (-> obj stage) 1) (>= (-> obj max-plane) 8)) + (and (= (-> obj stage) 2) + (>= (-> obj max-plane) 24) + (not (and (-> obj next-state) (= (-> obj next-state name) 'flee))) + ) + ) + ) + (set-setting! 'point-of-interest 'abs (-> obj trans) 0) + (remove-setting! 'point-of-interest) + ) + (transform-post) + (do-push-aways (-> obj root-override)) + (dotimes (s5-4 10) + (let ((a0-46 (handle->process (-> obj grenade s5-4 marker)))) + (when a0-46 + (if (and (not (-> obj grenade s5-4 show-it)) (not (handle->process (-> obj grenade s5-4 grenade)))) + (deactivate a0-46) + ) + ) + ) + ) + (let ((s5-5 0) + (f30-3 0.0) + ) + (dotimes (s4-7 6) + (let ((s5-6 s5-5) + (a1-25 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-25 from) (process->ppointer pp)) + (set! (-> a1-25 num-params) 0) + (set! (-> a1-25 message) 'get-num-bg-collisions) + (set! s5-5 (max s5-6 (the-as int (send-event-function (handle->process (-> obj tentacles s4-7)) a1-25)))) + ) + (let ((a1-26 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-26 from) (process->ppointer pp)) + (set! (-> a1-26 num-params) 0) + (set! (-> a1-26 message) 'get-max-movement) + (set! f30-3 (fmax f30-3 (the-as float (send-event-function (handle->process (-> obj tentacles s4-7)) a1-26)))) + ) + ) + (set! v0-33 (cond + ((or (and (not (-> obj tentacle-sound-playing)) (>= s5-5 5) (>= f30-3 1638.4)) + (or (and (-> obj next-state) (= (-> obj next-state name) 'recharge)) + (let ((v1-123 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (and v1-123 (= v1-123 (-> obj draw art-group data 5))) + ) + ) + ) + (sound-play "tentacles1" :id (-> obj tentacle-sound) :position (-> obj root-override trans)) + (set! v0-33 #t) + (set! (-> obj tentacle-sound-playing) (the-as symbol v0-33)) + v0-33 + ) + ((and (-> obj tentacle-sound-playing) (< s5-5 3)) + (sound-stop (-> obj tentacle-sound)) + (set! (-> obj tentacle-sound-playing) #f) + (sound-play "tentacles-up") + ) + ((-> obj tentacle-sound-playing) + (sound-play "tentacles1" :id (-> obj tentacle-sound) :position (-> obj root-override trans)) + ) + ) + ) + ) + (when (-> obj rush-sound-playing) + (cond + ((or (zero? (-> obj rush-end-time)) (< (- (-> pp clock frame-counter) (-> obj rush-end-time)) (seconds 0.1))) + (the-as int (sound-play "squid-rush" :id (-> obj rush-sound) :position (-> obj root-override trans))) + ) + (else + (sound-stop (-> obj rush-sound)) + (set! (-> obj rush-sound-playing) #f) + (set! (-> obj rush-end-time) 0) + 0 + ) + ) + ) + (let ((v1-149 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((or (and v1-149 (= v1-149 (-> obj draw art-group data 33))) + (let ((v1-155 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (or (and (and v1-155 (= v1-155 (-> obj draw art-group data 35))) (< -11.0 (ja-aframe-num 0))) + (and (-> obj next-state) (= (-> obj next-state name) 'pre-flee)) + ) + ) + ) + (when (-> obj jet-sound-playing) + (sound-stop (-> obj jet-sound)) + (set! (-> obj jet-sound-playing) #f) + ) + ) + (else + (let* ((f0-23 + (fmin 1.0 (* 0.0011111111 (the float (- (-> pp clock frame-counter) (the-as time-frame (-> obj jet-pitch)))))) + ) + (f28-2 + (fmin 1.0 (* 0.006666667 (the float (- (-> pp clock frame-counter) (the-as time-frame (-> obj jet-volume)))))) + ) + (f30-6 (* 0.2 (- 1.0 f0-23) (sin (* 32768.0 f0-23)))) + (f0-31 (+ 1.0 (* 5.0 (- 1.0 f28-2) (sin (* 32768.0 f30-6))))) + ) + (if (-> obj negate-jet-pitch) + (set! f30-6 (- f30-6)) + ) + (sound-play-by-name + (static-sound-name "squid-jets") + (-> obj jet-sound) + (the int (* 1024.0 f0-31)) + (the int (* 1524.0 f30-6)) + 0 + (sound-group sfx) + (-> obj root-override trans) + ) + ) + (set! (-> obj jet-sound-playing) #t) + ) + ) + ) + (let ((v1-193 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (when (and (not (and v1-193 (= v1-193 (-> obj draw art-group data 33)))) + (let ((v1-199 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (not (and (and v1-199 (= v1-199 (-> obj draw art-group data 35))) (< -11.0 (ja-aframe-num 0)))) + ) + ) + (set! (-> *part-id-table* 4812 init-specs 12 initial-valuef) 0.0) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 24)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 25)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 32)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 33)) + (set! (-> *part-id-table* 4812 init-specs 12 initial-valuef) 10922.667) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 24)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 25)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 32)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 33)) + (set! (-> *part-id-table* 4812 init-specs 12 initial-valuef) 21845.334) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 24)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 25)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 32)) + (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 33)) + ) + ) + (when (not (and (-> obj next-state) (= (-> obj next-state name) 'recharge))) + (let ((v1-249 + (the int (lerp-scale 0.0 128.0 (the float (- (-> pp clock frame-counter) (-> obj shield-timer))) 0.0 600.0)) + ) + ) + (cond + ((< 0.0 (-> obj shield-hit-points)) + (set! s5-9 (min 100 v1-249)) + (set! (-> obj shield-shattered) #f) + ) + ((< 16 v1-249) + (set! s5-9 128) + (when (not (-> obj shield-shattered)) + (set! (-> obj shield-shattered) #t) + (sound-play "sqd-shield-brk") + (let ((s4-10 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> s4-10 fountain-rand-transv-lo quad) (-> obj root-override trans quad)) + (set! (-> s4-10 fountain-rand-transv-lo y) (+ -12288.0 (-> s4-10 fountain-rand-transv-lo y))) + (set! (-> s4-10 fountain-rand-transv-hi x) 16424.96) + (set! (-> s4-10 fountain-rand-transv-hi y) 32808.96) + (set! (-> s4-10 fountain-rand-transv-hi z) -32808.96) + (set! (-> s4-10 fountain-rand-transv-hi w) -32808.96) + (set! (-> s4-10 rot-speed) 0.0001) + (set! (-> s4-10 gravity) -32768.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-squid-shield" (the-as (pointer uint32) #f)) + 70 + s4-10 + *squid-shield-exploder-params* + :to obj + :stack-size #x8000 + ) + (dotimes (s3-4 6) + (let ((s1-2 (handle->process (-> obj tentacles s3-4)))) + (when s1-2 + (let ((s2-2 (get-process *default-dead-pool* joint-exploder #x4000))) + (when s2-2 + (let ((t9-67 (method-of-type joint-exploder activate))) + (t9-67 + (the-as joint-exploder s2-2) + s1-2 + (symbol->string (-> joint-exploder symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((s1-3 run-function-in-process) + (s0-1 s2-2) + ) + (set! sv-496 joint-exploder-init-by-other) + (let ((a2-30 (art-group-get-by-name *level* "skel-squid-tentacle-shield" (the-as (pointer uint32) #f))) + (a3-14 67) + (t0-11 s4-10) + (t1-8 *squid-tentacle-shield-exploder-params*) + ) + ((the-as (function object object object object object object none) s1-3) s0-1 sv-496 a2-30 a3-14 t0-11 t1-8) + ) + ) + (-> s2-2 ppointer) + ) + ) + ) + ) + ) + ) + ) + ) + (else + (set! s5-9 (- 16 v1-249)) + ) + ) + ) + (set! (-> obj draw force-fade) (the-as uint s5-9)) + (dotimes (s4-11 6) + (send-event (handle->process (-> obj tentacles s4-11)) 'set-fade s5-9) + ) + (let* ((f0-56 (lerp-scale 0.5 0.0 (the float (- (-> pp clock frame-counter) (-> obj shield-timer))) 0.0 75.0)) + (a0-147 + (vector-float*! (new 'stack-no-clear 'vector) (-> obj shield-color) (if (< 0.0 (-> obj shield-hit-points)) + f0-56 + (- 1.0 f0-56) + ) + ) + ) + ) + (set! (-> a0-147 w) 1.0) + (set-shield-flash! a0-147) + ) + (cond + ((>= (-> obj draw force-fade) (the-as uint 128)) + (setup-masks (-> obj draw) 0 8192) + (logclear! (-> obj draw status) (draw-control-status warp-cross-fade)) + ) + (else + (setup-masks (-> obj draw) 8192 0) + (logior! (-> obj draw status) (draw-control-status warp-cross-fade)) + ) + ) + ) + (let ((v1-316 (handle->process (-> obj hud)))) + (when v1-316 + (if (not (and (-> obj next-state) (= (-> obj next-state name) 'recharge))) + (set! (-> (the-as hud-squid v1-316) values 2 target) (the int (* 100.0 (-> obj shield-hit-points)))) + ) + (cond + ((and (zero? (-> obj hit-points)) (< (-> obj stage) 2)) + (set! (-> (the-as hud-squid v1-316) values 0 target) (+ (-> obj stage) 1)) + (set! (-> (the-as hud-squid v1-316) values 1 target) 100) + ) + (else + (set! (-> (the-as hud-squid v1-316) values 0 target) (-> obj stage)) + (set! (-> (the-as hud-squid v1-316) values 1 target) (/ (* 100 (-> obj hit-points)) 10)) + ) + ) + ) + ) + (set! (-> obj allowed-rotate-to-vector-angle) (fabs (-> obj desired-rotate-to-vector-angle))) + (none) + ) + ) + +;; definition for method 51 of type squid +;; WARN: Return type mismatch (pointer process) vs (pointer squid-whirlwind). +(defmethod spawn-whirlwind squid ((obj squid)) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (s4-0 (squid-method-42 obj (new 'stack-no-clear 'vector))) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (send-event (handle->process (-> obj tentacles 0)) 'get-joint-pos 13 gp-0) + (vector-! s4-0 s4-0 (-> obj root-override trans)) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (vector+float*! s3-0 (-> obj root-override trans) s4-0 16384.0) + ) + (process-spawn squid-whirlwind gp-0 (-> obj root-override trans) (-> obj nav state mesh) s4-0 :to obj) + ) + ) + +;; definition for function squid-num-grenades-to-shoot +(defbehavior squid-num-grenades-to-shoot squid () + (cond + ((>= 0.4 (-> self suck)) + 5 + ) + ((>= 0.7 (-> self suck)) + 4 + ) + (else + 3 + ) + ) + ) + +;; definition for method 52 of type squid +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defmethod spawn-grenade squid ((obj squid) (arg0 int) (arg1 squid-grenade-holder) (arg2 float)) + (squid-increment-shield (+ -0.001 (/ -1.0 (* 2.0 (the float (* (squid-num-grenades-to-shoot) 2)))))) + (let ((s4-1 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data arg0))) + (v1-6 (-> arg1 target-position)) + ) + (set! (-> s4-1 ent) (-> obj entity)) + (set! (-> s4-1 charge) arg2) + (set! (-> s4-1 options) (projectile-options)) + (set! (-> s4-1 pos quad) (-> a0-3 quad)) + (set! (-> s4-1 notify-handle) (process->handle obj)) + (set! (-> s4-1 owner-handle) (the-as handle #f)) + (set! (-> s4-1 ignore-handle) (process->handle obj)) + (let* ((a1-11 *game-info*) + (a2-12 (+ (-> a1-11 attack-id) 1)) + ) + (set! (-> a1-11 attack-id) a2-12) + (set! (-> s4-1 attack-id) a2-12) + ) + (set! (-> s4-1 timeout) (new 'static 'handle :process #x4b0 :u64 #x4b0)) + (vector-! (-> s4-1 vel) v1-6 a0-3) + ) + (set! (-> arg1 grenade) (ppointer->handle (spawn-projectile squid-grenade s4-1 obj *default-dead-pool*))) + ) + (set! (-> arg1 show-it) #f) + (none) + ) + +;; definition of type squid-shot +(deftype squid-shot (guard-shot) + () + :heap-base #x170 + :method-count-assert 40 + :size-assert #x1f0 + :flag-assert #x28017001f0 + ) + +;; definition for method 3 of type squid-shot +(defmethod inspect squid-shot ((obj squid-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 squid-shot +;; WARN: Return type mismatch int vs none. +(defmethod play-impact-sound squid-shot ((obj squid-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "guard-shot-fire") + ) + ((= v1-0 (projectile-options lose-altitude)) + (sound-play "sqd-shot-hit") + ) + ) + ) + 0 + (none) + ) + +;; definition for function squid-shot-move +;; WARN: Return type mismatch int vs none. +(defun squid-shot-move ((arg0 squid-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root-override))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 81920.0 f0-0) + (vector-normalize! s4-0 81920.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (if (logtest? (-> arg0 root-override status) (collide-status touch-actor)) + (set! (-> arg0 hit-actor?) #t) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +;; definition for method 31 of type squid-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! squid-shot ((obj squid-shot)) + "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" + (set! (-> obj hit-actor?) #f) + (set! (-> obj tail-pos quad) (-> obj root-override trans quad)) + (set! (-> obj attack-mode) 'squid-shot) + (set! (-> obj max-speed) 983040.0) + (set! (-> obj move) squid-shot-move) + (set! (-> obj update-velocity) projectile-update-velocity-space-wars) + (set! (-> obj timeout) (seconds 0.417)) + (logior! (-> obj options) (projectile-options account-for-target-velocity)) + (set-gravity-length (-> obj root-override dynam) 573440.0) + (set! (-> obj options) (logior (projectile-options respect-invinc-time) (-> obj options))) + (set! (-> obj invinc-time) (seconds 3.5)) + (none) + ) + +;; definition for method 24 of type squid-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod draw-laser-sight squid-shot ((obj squid-shot)) + "TODO - confirm If applicable, draw the laser sight particles" + (draw-beam (-> *part-id-table* 4861) (-> obj tail-pos) (-> obj starting-dir) #f #t) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> obj tail-pos) a0-3)) + (t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 4862)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 + (none) + ) + +;; definition for method 25 of type squid-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod spawn-impact-particles squid-shot ((obj squid-shot)) + "Spawns associated particles with the projectile if applicable" + (let* ((gp-0 (-> obj root-override trans)) + (a1-0 (-> obj tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) + (f30-0 (vector-length s5-1)) + ) + (let ((s4-1 (vector+float*! (new 'stack-no-clear 'vector) a1-0 s5-1 0.8))) + (set! (-> *part-id-table* 4857 init-specs 4 initial-valuef) f30-0) + (set! (-> *part-id-table* 4857 init-specs 11 initial-valuef) (the-as float #x5)) + (set! (-> *part-id-table* 4857 init-specs 10 initial-valuef) 0.0) + (draw-beam (-> *part-id-table* 4857) a1-0 s5-1 #f #t) + (vector-normalize! s5-1 1.0) + (let ((t9-2 sp-launch-particles-var) + (a0-8 *sp-particle-system-2d*) + (a1-2 (-> *part-id-table* 4858)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> s4-1 quad)) + (t9-2 a0-8 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-9 *sp-particle-system-2d*) + (a1-3 (-> *part-id-table* 4859)) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> s4-1 quad)) + (t9-3 a0-9 a1-3 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + (let ((s4-2 (new 'stack-no-clear 'matrix)) + (f26-0 (* 0.000012207031 f30-0)) + (f30-1 (-> *part-id-table* 4860 init-specs 3 initial-valuef)) + (f28-0 (-> *part-id-table* 4860 init-specs 4 initial-valuef)) + ) + (forward-up->inv-matrix s4-2 s5-1 *up-vector*) + (set! (-> s4-2 trans quad) (-> gp-0 quad)) + (set! (-> *part-id-table* 4860 init-specs 3 initial-valuef) (* f26-0 f30-1)) + (set! (-> *part-id-table* 4860 init-specs 4 initial-valuef) (* f26-0 f28-0)) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 4860) + s4-2 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + (set! (-> *part-id-table* 4860 init-specs 3 initial-valuef) f30-1) + (set! (-> *part-id-table* 4860 init-specs 4 initial-valuef) f28-0) + ) + ) + 0 + (none) + ) + +;; definition for method 26 of type squid-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod spawn-shell-particles squid-shot ((obj squid-shot)) + "TODO - confirm" + (let* ((s3-0 (-> obj root-override)) + (s4-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj tail-pos) (-> s3-0 trans)) 2048.0)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> s3-0 trans quad)) + (let ((a2-1 (vector-! (new 'stack-no-clear 'vector) (-> s3-0 trans) (-> obj tail-pos)))) + (set! (-> *part-id-table* 4857 init-specs 4 initial-valuef) (vector-length a2-1)) + (set! (-> *part-id-table* 4857 init-specs 11 initial-valuef) (the-as float #x28)) + (set! (-> *part-id-table* 4857 init-specs 10 initial-valuef) -3.2) + (draw-beam (-> *part-id-table* 4857) (-> obj tail-pos) a2-1 #f #t) + ) + (vector+! gp-0 gp-0 s4-0) + (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when s5-1 + (let ((t9-3 (method-of-type part-tracker activate))) + (t9-3 + (the-as part-tracker s5-1) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((t9-4 run-function-in-process) + (a0-12 s5-1) + (a1-5 part-tracker-init) + (a2-6 (-> *part-group-id-table* 1125)) + (a3-2 0) + (t0-1 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> gp-0 quad)) + ((the-as (function object object object object object object object object none) t9-4) + a0-12 + a1-5 + a2-6 + a3-2 + t0-1 + t1-0 + t2-0 + t3-0 + ) + ) + (-> s5-1 ppointer) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 53 of type squid +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 53 squid)" 53 squid) + + + + diff --git a/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc b/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc new file mode 100644 index 0000000000..1938fb2c72 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc @@ -0,0 +1,1773 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function squid-talker +(defbehavior squid-talker squid ((arg0 symbol)) + (case arg0 + (('damaged) + (let* ((f30-0 0.2) + (v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + ) + (if (< f30-0 (+ -1.0 (the-as float v1-4))) + (return (the-as int #f)) + ) + ) + (let ((v1-8 (rand-vu-int-count 4))) + (if (>= v1-8 (-> self last-damaged-talker)) + (+! v1-8 1) + ) + (set! (-> self last-damaged-talker) v1-8) + (cond + ((zero? v1-8) + (talker-spawn-func (-> *talker-speech* 229) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-8 1) + (talker-spawn-func (-> *talker-speech* 230) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-8 2) + (talker-spawn-func (-> *talker-speech* 231) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-8 3) + (talker-spawn-func (-> *talker-speech* 233) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-8 4) + (talker-spawn-func (-> *talker-speech* 238) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + ) + (('shield-hit) + (let* ((f30-1 0.15) + (v1-22 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-23 (the-as number (logior #x3f800000 v1-22))) + ) + (if (< f30-1 (+ -1.0 (the-as float v1-23))) + (return (the-as int #f)) + ) + ) + (let ((v1-27 (rand-vu-int-count 3))) + (if (>= v1-27 (-> self last-shield-hit-talker)) + (+! v1-27 1) + ) + (set! (-> self last-shield-hit-talker) v1-27) + (cond + ((zero? v1-27) + (talker-spawn-func (-> *talker-speech* 209) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-27 1) + (talker-spawn-func (-> *talker-speech* 205) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-27 2) + (talker-spawn-func (-> *talker-speech* 207) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-27 3) + (talker-spawn-func (-> *talker-speech* 208) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + ) + (('start-recharging) + (let* ((f30-2 0.05) + (v1-39 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-40 (the-as number (logior #x3f800000 v1-39))) + ) + (if (and (< f30-2 (+ -1.0 (the-as float v1-40))) (!= (-> self last-start-recharging-talker) -1)) + (return (the-as int #f)) + ) + ) + (set! (-> self last-start-recharging-talker) 0) + (talker-spawn-func (-> *talker-speech* 228) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (('done-recharging) + (let* ((f30-3 0.05) + (v1-51 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-52 (the-as number (logior #x3f800000 v1-51))) + ) + (when (or (< f30-3 (+ -1.0 (the-as float v1-52))) (= (-> self last-done-recharging-talker) -1)) + (set! (-> self last-done-recharging-talker) 0) + (return (the-as int #f)) + ) + ) + (talker-spawn-func (-> *talker-speech* 224) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (('shooting) + (let* ((f30-4 0.1) + (v1-63 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-64 (the-as number (logior #x3f800000 v1-63))) + ) + (if (< f30-4 (+ -1.0 (the-as float v1-64))) + (return (the-as int #f)) + ) + ) + (let ((v1-68 (rand-vu-int-count 4))) + (if (>= v1-68 (-> self last-shooting-talker)) + (+! v1-68 1) + ) + (set! (-> self last-shooting-talker) v1-68) + (cond + ((zero? v1-68) + (talker-spawn-func (-> *talker-speech* 225) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-68 1) + (talker-spawn-func (-> *talker-speech* 215) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-68 2) + (talker-spawn-func (-> *talker-speech* 218) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-68 3) + (talker-spawn-func (-> *talker-speech* 232) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-68 4) + (talker-spawn-func (-> *talker-speech* 240) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + ) + (('headbutting) + (let* ((f30-5 0.2) + (v1-82 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-83 (the-as number (logior #x3f800000 v1-82))) + ) + (if (< f30-5 (+ -1.0 (the-as float v1-83))) + (return (the-as int #f)) + ) + ) + (let ((v1-87 (rand-vu-int-count 9))) + (if (>= v1-87 (-> self last-headbutting-talker)) + (+! v1-87 1) + ) + (set! (-> self last-headbutting-talker) v1-87) + (cond + ((zero? v1-87) + (talker-spawn-func (-> *talker-speech* 212) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 1) + (talker-spawn-func (-> *talker-speech* 214) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 2) + (talker-spawn-func (-> *talker-speech* 217) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 3) + (talker-spawn-func (-> *talker-speech* 219) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 4) + (talker-spawn-func (-> *talker-speech* 223) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 5) + (talker-spawn-func (-> *talker-speech* 216) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 6) + (talker-spawn-func (-> *talker-speech* 227) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 7) + (talker-spawn-func (-> *talker-speech* 232) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 8) + (talker-spawn-func (-> *talker-speech* 240) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-87 9) + (talker-spawn-func (-> *talker-speech* 237) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + ) + (('general) + (let* ((f30-6 0.0002) + (v1-112 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-113 (the-as number (logior #x3f800000 v1-112))) + ) + (if (< f30-6 (+ -1.0 (the-as float v1-113))) + (return (the-as int #f)) + ) + ) + (let ((v1-117 (rand-vu-int-count 7))) + (if (>= v1-117 (-> self last-general-talker)) + (+! v1-117 1) + ) + (set! (-> self last-general-talker) v1-117) + (cond + ((zero? v1-117) + (talker-spawn-func (-> *talker-speech* 210) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-117 1) + (talker-spawn-func (-> *talker-speech* 211) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-117 2) + (talker-spawn-func (-> *talker-speech* 213) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-117 3) + (talker-spawn-func (-> *talker-speech* 220) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-117 4) + (talker-spawn-func (-> *talker-speech* 222) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-117 5) + (talker-spawn-func (-> *talker-speech* 226) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-117 6) + (talker-spawn-func (-> *talker-speech* 235) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-117 7) + (talker-spawn-func (-> *talker-speech* 239) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + ) + ) + 0 + ) + +;; failed to figure out what this is: +(defstate test (squid) + :virtual #t + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (ja :num! (loop!)) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (set! (-> self driver-blend target) (- 1.0 (-> self driver-blend target))) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (debug-draw (-> self first-path)) + (debug-draw (-> self second-path)) + (debug-draw (-> self third-path)) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +;; definition for symbol *squid-first-pole*, type vector +(define *squid-first-pole* (new 'static 'vector :x 1087078.4 :y 1725235.2 :z 2165145.5)) + +;; definition for symbol *squid-second-pole*, type vector +(define *squid-second-pole* (new 'static 'vector :x 1257472.0 :y 1725644.8 :z 2468249.5)) + +;; definition for function go-through-wall +;; WARN: Check prologue - tricky store of r0 +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defbehavior go-through-wall squid () + (local-vars (sv-16 res-tag)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-1 (res-lump-data (-> self entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when (and v1-1 (< (the-as uint (-> self stage)) (-> sv-16 elt-count))) + (let ((gp-0 (-> v1-1 (-> self stage)))) + (dotimes (s5-0 (-> gp-0 length)) + (let ((v1-3 s5-0)) + (cond + ((zero? v1-3) + (let ((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) 'shutdown) + (let ((t9-1 send-event-function) + (v1-8 (-> gp-0 data s5-0 actor)) + ) + (t9-1 + (if v1-8 + (-> v1-8 extra process) + ) + a1-5 + ) + ) + ) + ) + ((= v1-3 3) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 0) + (set! (-> a1-6 message) 'trigger) + (let ((t9-2 send-event-function) + (v1-15 (-> gp-0 data s5-0 actor)) + ) + (t9-2 + (if v1-15 + (-> v1-15 extra process) + ) + a1-6 + ) + ) + ) + ) + (else + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer self)) + (set! (-> a1-7 num-params) 0) + (set! (-> a1-7 message) 'stop) + (let ((t9-3 send-event-function) + (v1-22 (-> gp-0 data s5-0 actor)) + ) + (t9-3 + (if v1-22 + (-> v1-22 extra process) + ) + a1-7 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! (-> self gate-intact) #f) + (none) + ) + +;; failed to figure out what this is: +(defstate beaten (squid) + :virtual #t + :enter (behavior () + (ja-channel-set! 0) + (ja-post) + (dotimes (gp-0 6) + (let ((a0-2 (handle->process (-> self tentacles gp-0)))) + (if a0-2 + (deactivate a0-2) + ) + ) + ) + (dotimes (gp-1 3) + (set! (-> self stage) gp-1) + (go-through-wall) + ) + (send-event (handle->process (-> self hud)) 'hide-and-die) + (set! (-> self hud) (the-as handle #f)) + (when (-> self jet-sound-playing) + (sound-stop (-> self jet-sound)) + (set! (-> self jet-sound-playing) #f) + ) + (when (-> self tentacle-sound-playing) + (sound-stop (-> self tentacle-sound)) + (set! (-> self tentacle-sound-playing) #f) + ) + (remove-setting! 'point-of-interest) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + ) + +;; failed to figure out what this is: +(defstate wait-around-corner (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (remove-setting! 'point-of-interest) + (none) + ) + :trans (behavior () + (let ((v1-1 (squid-method-42 self (new 'stack-no-clear 'vector)))) + (when (< 2560000.0 (-> v1-1 z)) + (vector-reset! (-> self residual-velocity)) + (set! (-> self stage-2-go-status) 2) + (go-virtual fire-whirlwind) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + ) + +;; failed to figure out what this is: +(defstate wait-beside-building (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (remove-setting! 'point-of-interest) + (none) + ) + :trans (behavior () + (vector-reset! (-> self residual-velocity)) + (if (>= (-> self max-plane) 8) + (go-virtual fly-to-post) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + ) + +;; failed to figure out what this is: +(defstate flee (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (set! (-> self can-play-squid-boost) #f) + (set! (-> self invincible-timer) 0) + (let ((v1-0 (-> self stage))) + (cond + ((zero? v1-0) + (let ((gp-1 (vector+! + (new 'stack-no-clear 'vector) + (-> self entity trans) + (new 'static 'vector :x 131072.0 :y -3235.84 :z 225280.0) + ) + ) + ) + (deactivate (-> self collision-actor 0)) + (set! (-> self collision-actor) (process-spawn squid-collision gp-1 1 :to self)) + ) + ) + ((= v1-0 1) + (let ((gp-3 (vector+! + (new 'stack-no-clear 'vector) + (-> self entity trans) + (new 'static 'vector :x 135168.0 :y -655.36 :z 217088.0) + ) + ) + ) + (deactivate (-> self collision-actor 0)) + (set! (-> self collision-actor) (process-spawn squid-collision gp-3 2 :to self)) + ) + ) + (else + (process-spawn scene-player :init scene-player-init "palace-boss-res" #t #f) + (remove-setting! 'music) + (go-virtual beaten) + ) + ) + ) + (let ((a3-6 (new 'stack-no-clear 'vector))) + (set! (-> a3-6 quad) (-> self nav state mesh bounds quad)) + (set! (-> a3-6 y) (+ 16384.0 (-> a3-6 y))) + (set-traj-towards-vec self (-> self trans) (-> self trans) a3-6) + ) + (set! (-> self gate-intact) #t) + (set! (-> self force-onto-mesh) #f) + (none) + ) + :exit (behavior () + (set! (-> self hit-points) 10) + (set! (-> self stage) (min 2 (+ (-> self stage) 1))) + (change-to (nav-mesh-from-res-tag (-> self entity) 'nav-mesh-actor (-> self stage)) self) + (set! (-> self current-nav-poly) #f) + (none) + ) + :trans (behavior () + (ja :num! (loop!)) + (let* ((f0-1 (squid-method-48 self)) + (f30-0 (float-sin-clamp self f0-1)) + ) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((v1-8 (-> self stage))) + (cond + ((zero? v1-8) + (get-point-at-percent-along-path! (-> self first-path) gp-0 f30-0 'interp) + (if (and (-> self gate-intact) + (< (+ -2895.872 (-> *squid-first-pole* x)) (-> self root-override trans x)) + (< (+ -2895.872 (-> *squid-first-pole* z)) (-> self root-override trans z)) + ) + (go-through-wall) + ) + ) + ((= v1-8 1) + (get-point-at-percent-along-path! (-> self second-path) gp-0 f30-0 'interp) + (if (and (-> self gate-intact) (< (+ -4096.0 (-> *squid-second-pole* z)) (-> self root-override trans z))) + (go-through-wall) + ) + ) + (else + (get-point-at-percent-along-path! (-> self first-path) gp-0 f30-0 'interp) + ) + ) + ) + (set! (-> self trans quad) (-> gp-0 quad)) + ) + (when (>= f30-0 1.0) + (let ((v1-35 (-> self stage))) + (cond + ((zero? v1-35) + (go-virtual wait-beside-building) + ) + ((= v1-35 1) + (go-virtual wait-around-corner) + ) + (else + (vector-reset! (-> self residual-velocity)) + (go-virtual fly-to-shoot-spot) + ) + ) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate pre-flee (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self traj-timer) + (+ (-> self clock frame-counter) (the int (* 300.0 (rand-vu-float-range 0.25 0.5)))) + ) + (set! (-> self traj initial-position quad) (-> self trans quad)) + (let ((v1-7 (-> self stage))) + (cond + ((zero? v1-7) + (get-point-at-percent-along-path! (-> self first-path) (-> self traj-dest) 0.0 'interp) + ) + ((= v1-7 1) + (get-point-at-percent-along-path! (-> self second-path) (-> self traj-dest) 0.0 'interp) + ) + (else + (set-setting! 'music #f 0 0) + (process-grab? *target* #f) + (get-point-at-percent-along-path! (-> self third-path) (-> self traj-dest) 0.0 'interp) + (send-event (handle->process (-> self hud)) 'hide-and-die) + ) + ) + ) + (set! (-> self tentacle-base-rotation-speed target) 1.0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 36) :num! min) + (none) + ) + :exit (behavior () + (process-release? *target*) + (set! (-> self tentacle-base-rotation-speed target) 0.0) + (when (-> self spin-sound-playing) + (sound-stop (-> self spin-sound)) + (set! (-> self spin-sound-playing) #f) + ) + (none) + ) + :trans (behavior () + (local-vars + (sv-80 symbol) + (sv-96 symbol) + (sv-112 vector) + (sv-128 matrix) + (sv-144 symbol) + (sv-160 symbol) + (sv-176 vector) + (sv-192 matrix) + (sv-208 symbol) + (sv-224 symbol) + (sv-240 vector) + (sv-256 matrix) + ) + (quaternion-rotate-y! (-> self quat) (-> self quat) 5461.3335) + (vector-lerp! + (-> self trans) + (the-as vector (-> self traj)) + (-> self traj-dest) + (parameter-ease-sqr-clamp (* 0.0011111111 (the float (- (-> self clock frame-counter) (-> self state-time))))) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 3)) + (go-virtual flee) + ) + (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 55))) + (when (>= (- (-> self clock frame-counter) (-> self traj-timer)) 0) + (sound-play "squid-explosion") + (set! (-> self traj-timer) + (+ (-> self clock frame-counter) (the int (* 300.0 (rand-vu-float-range 0.25 0.5)))) + ) + (cond + ((zero? (-> self stage)) + (setup-masks (-> self draw) 320 160) + (let ((gp-4 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-4 + (let ((t9-11 (method-of-type part-tracker activate))) + (t9-11 (the-as part-tracker gp-4) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((s5-3 run-function-in-process) + (s4-1 gp-4) + (s3-1 part-tracker-init) + (s2-0 (-> *part-group-id-table* 1123)) + (s1-0 0) + (s0-0 #f) + ) + (set! sv-80 (the-as symbol #f)) + (set! sv-96 (the-as symbol #f)) + (set! sv-128 *launch-matrix*) + (set! sv-112 (-> sv-128 trans)) + (let ((v1-33 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 43)) quad))) + (set! (-> sv-112 quad) v1-33) + ) + ((the-as (function object object object object object object object object none) s5-3) + s4-1 + s3-1 + s2-0 + s1-0 + s0-0 + sv-80 + sv-96 + sv-128 + ) + ) + (-> gp-4 ppointer) + ) + ) + ) + ((= (-> self stage) 1) + (setup-masks (-> self draw) 5120 2590) + (let ((gp-5 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-5 + (let ((t9-16 (method-of-type part-tracker activate))) + (t9-16 (the-as part-tracker gp-5) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((s5-4 run-function-in-process) + (s4-2 gp-5) + (s3-2 part-tracker-init) + (s2-1 (-> *part-group-id-table* 1123)) + (s1-1 0) + (s0-1 #f) + ) + (set! sv-144 (the-as symbol #f)) + (set! sv-160 (the-as symbol #f)) + (set! sv-192 *launch-matrix*) + (set! sv-176 (-> sv-192 trans)) + (let ((v1-47 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 55)) quad))) + (set! (-> sv-176 quad) v1-47) + ) + ((the-as (function object object object object object object object object none) s5-4) + s4-2 + s3-2 + s2-1 + s1-1 + s0-1 + sv-144 + sv-160 + sv-192 + ) + ) + (-> gp-5 ppointer) + ) + ) + ) + (else + (let ((gp-6 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-6 + (let ((t9-20 (method-of-type part-tracker activate))) + (t9-20 (the-as part-tracker gp-6) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((s5-5 run-function-in-process) + (s4-3 gp-6) + (s3-3 part-tracker-init) + (s2-2 (-> *part-group-id-table* 1123)) + (s1-2 0) + (s0-2 #f) + ) + (set! sv-208 (the-as symbol #f)) + (set! sv-224 (the-as symbol #f)) + (set! sv-256 *launch-matrix*) + (set! sv-240 (-> sv-256 trans)) + (let ((v1-59 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 55)) quad))) + (set! (-> sv-240 quad) v1-59) + ) + ((the-as (function object object object object object object object object none) s5-5) + s4-3 + s3-3 + s2-2 + s1-2 + s0-2 + sv-208 + sv-224 + sv-256 + ) + ) + (-> gp-6 ppointer) + ) + ) + ) + ) + ) + (sound-play "squid-spin" :id (-> self spin-sound) :position (-> self root-override trans)) + (set! (-> self spin-sound-playing) #t) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate recharge (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (squid-talker 'start-recharging) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self invincible-timer) 0) + (setup-masks (-> self draw) 8192 0) + (logior! (-> self draw status) (draw-control-status warp-cross-fade)) + (dotimes (gp-0 6) + (send-event (handle->process (-> self tentacles gp-0)) 'set-anim 47) + ) + (set! (-> self driver-blend target) 0.0) + (ja-channel-push! 1 (seconds 0.5)) + (ja :group! (-> self draw art-group data 33) :num! min) + (none) + ) + :exit (behavior () + (squid-talker 'done-recharging) + (dotimes (gp-0 6) + (send-event (handle->process (-> self tentacles gp-0)) 'set-anim 45) + ) + (none) + ) + :trans (behavior () + (if (and (zero? (-> self hit-points)) + (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + ) + (go-virtual pre-flee) + ) + (let ((v1-10 (ja-group))) + (cond + ((and v1-10 (= v1-10 (-> self draw art-group data 34))) + (ja :num! (seek!)) + (when (ja-done? 0) + (vector-reset! (-> self residual-velocity)) + (go-virtual fly-to-shoot-spot) + ) + ) + ((>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (set! (-> self driver-blend target) 1.0) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 34) :num! min) + ) + ((let ((v1-37 (ja-group))) + (and v1-37 (= v1-37 (-> self draw art-group data 35))) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.25)) + (ja :group! (-> self draw art-group data 35) :num! min) + ) + ) + (else + (ja :num! (seek!)) + (if (ja-done? 0) + (ja :group! (-> self draw art-group data 35) :num! min) + ) + ) + ) + ) + (set! (-> self shield-hit-points) 1.0) + (let ((v1-70 (handle->process (-> self hud)))) + (if v1-70 + (set! (-> (the-as hud-squid v1-70) values 2 target) + (min 100 (/ (* 100 (- (-> self clock frame-counter) (-> self state-time))) 600)) + ) + ) + ) + (let ((gp-3 (new 'stack-no-clear 'vector))) + (let ((f30-0 + (* 16384.0 (fmin 1.0 (* 0.0016666667 (the float (- (-> self clock frame-counter) (-> self state-time)))))) + ) + ) + (let* ((f0-16 (* 164.25063 (the float (- (-> self clock frame-counter) (-> self state-time))))) + (f0-19 (lerp-scale 70.0 120.0 (fabs (cos f0-16)) 1.0 0.0)) + ) + (set! (-> self draw force-fade) + (the-as + uint + (the int (lerp-scale 128.0 f0-19 (the float (- (-> self clock frame-counter) (-> self state-time))) 0.0 37.5)) + ) + ) + ) + (set! (-> self shield-timer) + (- (-> self clock frame-counter) + (the-as time-frame (the int (lerp-scale 0.0 600.0 (the float (-> self draw force-fade)) 0.0 128.0))) + ) + ) + (set! (-> gp-3 x) (fabs (cos f30-0))) + (set! (-> gp-3 y) (fabs (sin f30-0))) + ) + (set! (-> gp-3 z) 0.0) + (set! (-> gp-3 w) 1.0) + (set-shield-color! gp-3) + (set! (-> self shield-color quad) (-> gp-3 quad)) + (vector-float*! gp-3 gp-3 0.5) + (set-shield-flash! gp-3) + (set! (-> gp-3 w) 1.0) + ) + (dotimes (gp-4 6) + (send-event (handle->process (-> self tentacles gp-4)) 'set-fade (-> self draw force-fade)) + (when (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 2)) + (case (-> self stage) + ((1) + (send-event (handle->process (-> self tentacles gp-4)) 'wrap *squid-second-pole*) + ) + (else + (send-event (handle->process (-> self tentacles gp-4)) 'wrap *squid-first-pole*) + ) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +;; definition for function squid-adjust-fly-anim +;; WARN: Return type mismatch number vs none. +(defbehavior squid-adjust-fly-anim squid () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 (-> self draw art-group data 21))) + (ja :num! (seek!)) + (if (>= 5.0 (ja-frame-num 0)) + (set! (-> self allowed-rotate-to-vector-angle) 0.0) + ) + (when (or (ja-done? 0) (< -364.0889 (-> self desired-rotate-to-vector-angle))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 23) + :num! (identity (the float (max 0 (- 20 (the int (ja-aframe-num 0)))))) + ) + ) + ) + ((let ((v1-26 (ja-group))) + (and (and v1-26 (= v1-26 (-> self draw art-group data 23))) (< (-> self desired-rotate-to-vector-angle) 0.0)) + ) + (ja :num! (seek!)) + (if (ja-done? 0) + (ja :group! (-> self draw art-group data 3) :num! min) + ) + ) + ((let ((v1-44 (ja-group))) + (and v1-44 (= v1-44 (-> self draw art-group data 24))) + ) + (ja :num! (seek!)) + (if (>= 5.0 (ja-frame-num 0)) + (set! (-> self allowed-rotate-to-vector-angle) 0.0) + ) + (when (or (ja-done? 0) (< (-> self desired-rotate-to-vector-angle) 364.0889)) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 26) + :num! (identity (the float (max 0 (- 105 (the int (ja-aframe-num 0)))))) + ) + ) + ) + (else + (let ((v1-68 (ja-group))) + (cond + ((and (and v1-68 (= v1-68 (-> self draw art-group data 26))) (< 0.0 (-> self desired-rotate-to-vector-angle))) + (ja :num! (seek!)) + (if (ja-done? 0) + (ja :group! (-> self draw art-group data 3) :num! min) + ) + ) + ((< (-> self desired-rotate-to-vector-angle) -910.2222) + (set! (-> self allowed-rotate-to-vector-angle) 0.0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 21) :num! min) + (set! (-> self jet-volume) (the-as int (-> self clock frame-counter))) + (set! (-> self jet-pitch) (the-as int (-> self clock frame-counter))) + (set! (-> self negate-jet-pitch) #f) + ) + ((< 910.2222 (-> self desired-rotate-to-vector-angle)) + (set! (-> self allowed-rotate-to-vector-angle) 0.0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 24) :num! min) + (set! (-> self jet-volume) (the-as int (-> self clock frame-counter))) + (set! (-> self jet-pitch) (the-as int (-> self clock frame-counter))) + (set! (-> self negate-jet-pitch) #f) + ) + ((let ((v1-106 (ja-group))) + (and v1-106 (= v1-106 (-> self draw art-group data 3))) + ) + (ja :num! (loop!)) + ) + (else + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 3) :num! min) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate fly-to-post (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (squid-talker 'no-energy) + (set! (-> self can-play-squid-boost) #t) + (case (-> self stage) + ((1) + (set-traj-towards-vec self (-> self trans) (-> self trans) *squid-second-pole*) + ) + (else + (set-traj-towards-vec self (-> self trans) (-> self trans) *squid-first-pole*) + ) + ) + (none) + ) + :trans (behavior () + (if (and (zero? (-> self hit-points)) + (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + ) + (go-virtual pre-flee) + ) + (squid-adjust-fly-anim) + (let ((f0-0 (float-sin-clamp self (squid-method-48 self)))) + (if (< 0.5 f0-0) + (set! (-> self force-onto-mesh) #f) + ) + (if (>= f0-0 1.0) + (go-virtual recharge) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate headbut (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (squid-talker 'headbutting) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self traj-timer) (-> self clock frame-counter)) + (vector-reset! (-> self residual-velocity)) + (set! (-> self can-play-squid-boost) #t) + (none) + ) + :exit (behavior () + (sound-play "squid-rush-end") + (set! (-> self rush-end-time) (-> self clock frame-counter)) + (let ((v1-5 (ja-group))) + (when (and v1-5 (= v1-5 (-> self draw art-group data 5))) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 6) :num! min) + (sound-play "sqd-shield-down") + (set! (-> self jet-volume) (the-as int (-> self clock frame-counter))) + (set! (-> self jet-pitch) (the-as int (-> self clock frame-counter))) + (set! (-> self negate-jet-pitch) #t) + ) + ) + (none) + ) + :trans (behavior () + (if (and (zero? (-> self hit-points)) + (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + ) + (go-virtual pre-flee) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 3)) + (go-virtual fly-to-shoot-spot) + ) + (let ((v1-17 (ja-group))) + (cond + ((and v1-17 (= v1-17 (-> self draw art-group data 4))) + (ja :num! (seek!)) + (when (and (-> self can-play-squid-boost) (< 30.0 (ja-aframe-num 0))) + (sound-play "squid-boost") + (set! (-> self can-play-squid-boost) #f) + (set! (-> self jet-volume) (the-as int (-> self clock frame-counter))) + (set! (-> self jet-pitch) (the-as int (-> self clock frame-counter))) + (set! (-> self negate-jet-pitch) #f) + (set! (-> self rush-sound-playing) #t) + (set! (-> self rush-end-time) 0) + 0 + ) + (if (ja-done? 0) + (ja :group! (-> self draw art-group data 5) :num! min) + ) + (if (< (ja-aframe-num 0) 20.0) + (squid-method-42 self (-> self traj-dest)) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (else + (let ((v1-53 (ja-group))) + (cond + ((and v1-53 (= v1-53 (-> self draw art-group data 5))) + (ja :num! (loop!)) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 4) :num! min) + ) + ) + ) + ) + ) + ) + (squid-method-43 self (-> self traj-dest) 22.755556 0.75) + (let ((gp-3 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.017)) + (let ((f0-8 (vector-vector-xz-distance-squared (-> self traj-dest) (-> self trans))) + (f1-1 8192.0) + ) + (< f0-8 (* f1-1 f1-1)) + ) + ) + (go-virtual fly-to-shoot-spot) + ) + (when (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.017)) (-> self mesh-forced)) + (vector-reset! (-> self residual-velocity)) + (go-virtual fly-to-shoot-spot) + ) + (let ((v1-89 (ja-group))) + (when (and v1-89 (or (= v1-89 (-> self draw art-group data 4)) (= v1-89 (-> self draw art-group data 5)))) + (set! (-> gp-3 quad) (-> self traj-dest quad)) + (set! (-> s3-0 quad) (-> self traj-dest quad)) + (clamp-vector-to-mesh-cross-gaps (-> self nav) gp-3 (-> self current-nav-poly) s3-0 409600.0 #f s2-0) + (set! (-> self residual-velocity quad) (-> self trans quad)) + (let ((f30-1 + (lerp-scale 0.01 1.0 (+ -375.0 (the float (- (-> self clock frame-counter) (-> self traj-timer)))) 0.0 150.0) + ) + ) + (set! (-> gp-3 y) (-> self trans y)) + (vector-seek-3d-smooth! (-> self trans) gp-3 (* 4096.0 f30-1) 0.5) + (set! (-> gp-3 quad) (-> self trans quad)) + (set! (-> self current-nav-poly) + (cloest-point-on-mesh (-> self nav) gp-3 (-> self trans) (-> self current-nav-poly)) + ) + (let ((s2-1 (-> self nav)) + (a1-15 (-> self current-nav-poly)) + (s3-1 s5-1) + ) + (let ((v1-105 gp-3)) + (project-point-onto-plane-of-poly-local + (-> s2-1 state mesh) + a1-15 + s3-1 + s4-0 + (vector-! (new 'stack-no-clear 'vector) v1-105 (-> s2-1 state mesh bounds)) + ) + ) + (vector+! s3-1 s3-1 (-> s2-1 state mesh bounds)) + ) + 0 + (set! (-> s5-1 y) (+ 20480.0 (-> s5-1 y))) + (set! (-> self trans y) (lerp (-> self trans y) (-> s5-1 y) (* 0.4 f30-1))) + ) + (set! (-> self trans y) (fmax (-> self trans y) (fmin (-> s5-1 y) (-> gp-3 y)))) + (vector-! (-> self residual-velocity) (-> self trans) (-> self residual-velocity)) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +;; definition for function squid-whirlwind-time +;; WARN: Return type mismatch int vs time-frame. +(defbehavior squid-whirlwind-time squid () + (the-as time-frame (cond + ((>= 0.4 (-> self suck)) + 900 + ) + ((>= 0.7 (-> self suck)) + 780 + ) + (else + 570 + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate fire-whirlwind (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (squid-talker 'shooting) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self stop-shooting) #f) + (set! (-> self traj-timer) 0) + (set! (-> self tentacle-base-rotation-speed target) 1.0) + (dotimes (gp-0 6) + (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel #x3f428f5c) + ) + (none) + ) + :exit (behavior () + (set! (-> self tentacle-base-rotation-speed target) 0.0) + (dotimes (gp-0 6) + (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel #x3f333333) + ) + (none) + ) + :trans (behavior () + (if (and (zero? (-> self hit-points)) + (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + ) + (go-virtual pre-flee) + ) + (let ((v1-10 (ja-group))) + (cond + ((not (and v1-10 (= v1-10 (-> self draw art-group data 3)))) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 3) :num! min) + ) + (else + (ja :num! (loop!)) + ) + ) + ) + (squid-method-43 self (squid-method-42 self (new 'stack-no-clear 'vector)) 9.102222 0.75) + (when (or (>= (- (-> self clock frame-counter) (-> self state-time)) (squid-whirlwind-time)) + (-> self stop-shooting) + ) + (vector-reset! (-> self residual-velocity)) + (go-virtual fly-to-shoot-spot) + ) + (when (>= (- (-> self clock frame-counter) (-> self traj-timer)) (seconds 0.7)) + (spawn-whirlwind self) + (set! (-> self traj-timer) (-> self clock frame-counter)) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +;; definition for function setup-grenade +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defbehavior setup-grenade squid ((arg0 int)) + (let ((s5-0 (squid-method-42 self (new 'stack-no-clear 'vector))) + (f28-0 (rand-vu-float-range 0.0 3276.8)) + (f30-0 (rand-vu-float-range 8192.0 24576.0)) + (gp-0 (-> self grenade arg0)) + ) + (let ((f28-1 (+ f28-0 (* 6553.6 (the float arg0))))) + (set! (-> gp-0 target-position quad) (-> s5-0 quad)) + (set-vector! (-> gp-0 target-position) (sin f28-1) 0.0 (cos f28-1) 1.0) + ) + (vector+float*! s5-0 s5-0 (-> gp-0 target-position) f30-0) + (set! (-> s5-0 y) (-> self nav state mesh bounds y)) + (set! (-> gp-0 target-position quad) (-> s5-0 quad)) + (let ((a1-5 (cloest-point-on-mesh (-> self nav) s5-0 s5-0 (the-as nav-poly #f))) + (a3-1 (new 'stack-no-clear 'vector)) + (s3-0 (-> self nav)) + (s4-2 s5-0) + ) + (let ((v1-13 s5-0)) + (project-point-onto-plane-of-poly-local + (-> s3-0 state mesh) + a1-5 + s4-2 + a3-1 + (vector-! (new 'stack-no-clear 'vector) v1-13 (-> s3-0 state mesh bounds)) + ) + ) + (vector+! s4-2 s4-2 (-> s3-0 state mesh bounds)) + ) + 0 + (set! (-> s5-0 y) (+ 409.6 (-> s5-0 y))) + (set! (-> gp-0 target-position y) (-> s5-0 y)) + (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) + (set! (-> gp-0 marker) + (ppointer->handle + (when s5-1 + (let ((t9-8 (method-of-type part-tracker activate))) + (t9-8 (the-as part-tracker s5-1) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-9 run-function-in-process) + (a0-17 s5-1) + (a1-8 part-tracker-init) + (a2-7 (-> *part-group-id-table* 1119)) + (a3-3 0) + (t0-2 #f) + (t1-2 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> gp-0 target-position quad)) + ((the-as (function object object object object object object object object none) t9-9) + a0-17 + a1-8 + a2-7 + a3-3 + t0-2 + t1-2 + t2-0 + t3-0 + ) + ) + (-> s5-1 ppointer) + ) + ) + ) + ) + (set! (-> gp-0 show-it) #t) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate fire-grenades (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (squid-talker 'shooting) + (set! (-> self state-time) 0) + (set! (-> self stop-shooting) #f) + (setup-masks (-> self draw) 30 0) + (dotimes (gp-0 6) + (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel #x3f428f5c) + ) + (none) + ) + :exit (behavior () + (dotimes (gp-0 6) + (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel #x3f333333) + ) + (none) + ) + :trans (behavior () + (if (and (zero? (-> self hit-points)) + (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + ) + (go-virtual pre-flee) + ) + (squid-method-43 self (squid-method-42 self (new 'stack-no-clear 'vector)) 22.755556 0.75) + (let ((v1-13 (ja-group))) + (cond + ((and v1-13 (= v1-13 (-> self draw art-group data 7))) + (ja :num! (seek!)) + (when (ja-done? 0) + (cond + ((or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) + (ja :group! (-> self draw art-group data 15) :num! min) + ) + ((-> self fire-aft) + (ja :group! (-> self draw art-group data 11) :num! min) + (set! (-> self fire-aft) #f) + ) + (else + (ja :group! (-> self draw art-group data 8) :num! min) + (set! (-> self fire-aft) #t) + ) + ) + ) + ) + ((let ((v1-44 (ja-group))) + (and v1-44 (= v1-44 (-> self draw art-group data 8))) + ) + (ja :num! (seek!)) + (cond + ((not (ja-done? 0)) + ) + ((or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) + (ja :group! (-> self draw art-group data 10) :num! min) + ) + (else + (ja :group! (-> self draw art-group data 9) :num! min) + (setup-grenade 0) + (setup-grenade 5) + (spawn-grenade self 51 (the-as squid-grenade-holder (-> self grenade)) 2.0) + (spawn-grenade self 56 (-> self grenade 5) 1.0) + (setup-masks (-> self draw) 0 2) + (set! (-> self next-gun) 1) + ) + ) + ) + ((let ((v1-75 (ja-group))) + (and v1-75 (= v1-75 (-> self draw art-group data 9))) + ) + (ja :num! (seek!)) + (cond + ((or (and (= (-> self next-gun) 5) (not (ja-done? 0))) + (and (< (-> self next-gun) 5) (< (ja-aframe-num 0) 65.0)) + ) + ) + ((or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) + (set! (-> self next-gun) 0) + (ja :group! (-> self draw art-group data 10) :num! min) + ) + ((< (-> self next-gun) (squid-num-grenades-to-shoot)) + (setup-grenade (-> self next-gun)) + (setup-grenade (+ (-> self next-gun) 5)) + (spawn-grenade self 52 (-> self grenade (-> self next-gun)) 2.0) + (spawn-grenade self 57 (-> self grenade (+ (-> self next-gun) 5)) 1.0) + (setup-masks (-> self draw) 0 4) + (+! (-> self next-gun) 1) + (ja :group! (-> self draw art-group data 9) :num! min) + ) + (else + (set! (-> self next-gun) 0) + (ja :group! (-> self draw art-group data 10) :num! min) + ) + ) + ) + ((let ((v1-124 (ja-group))) + (and v1-124 (= v1-124 (-> self draw art-group data 10))) + ) + (ja :num! (seek!)) + (if (ja-done? 0) + (ja :group! (-> self draw art-group data 15) :num! min) + ) + ) + ((let ((v1-141 (ja-group))) + (and v1-141 (= v1-141 (-> self draw art-group data 11))) + ) + (ja :num! (seek!)) + (cond + ((not (ja-done? 0)) + ) + ((or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) + (ja :group! (-> self draw art-group data 13) :num! min) + ) + (else + (ja :group! (-> self draw art-group data 12) :num! min) + (setup-grenade 0) + (setup-grenade 5) + (spawn-grenade self 53 (the-as squid-grenade-holder (-> self grenade)) 2.0) + (spawn-grenade self 58 (-> self grenade 5) 1.0) + (setup-masks (-> self draw) 0 8) + (set! (-> self next-gun) 1) + ) + ) + ) + ((let ((v1-172 (ja-group))) + (and v1-172 (= v1-172 (-> self draw art-group data 12))) + ) + (ja :num! (seek!)) + (cond + ((or (and (= (-> self next-gun) 5) (not (ja-done? 0))) + (and (< (-> self next-gun) 5) (< (ja-aframe-num 0) 165.0)) + ) + ) + ((or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) + (set! (-> self next-gun) 0) + (ja :group! (-> self draw art-group data 13) :num! min) + ) + ((< (-> self next-gun) (squid-num-grenades-to-shoot)) + (setup-grenade (-> self next-gun)) + (setup-grenade (+ (-> self next-gun) 5)) + (spawn-grenade self 54 (-> self grenade (-> self next-gun)) 2.0) + (spawn-grenade self 59 (-> self grenade (+ (-> self next-gun) 5)) 1.0) + (setup-masks (-> self draw) 0 16) + (+! (-> self next-gun) 1) + (ja :group! (-> self draw art-group data 12) :num! min) + ) + (else + (set! (-> self next-gun) 0) + (ja :group! (-> self draw art-group data 13) :num! min) + ) + ) + ) + ((let ((v1-221 (ja-group))) + (and v1-221 (= v1-221 (-> self draw art-group data 13))) + ) + (ja :num! (seek!)) + (if (ja-done? 0) + (ja :group! (-> self draw art-group data 15) :num! min) + ) + ) + ((let ((v1-238 (ja-group))) + (and v1-238 (= v1-238 (-> self draw art-group data 15))) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 3) :num! min) + (cond + ((= (-> self shield-hit-points) 0.0) + (go-virtual fly-to-post) + ) + (else + (vector-reset! (-> self residual-velocity)) + (go-virtual fly-to-shoot-spot) + ) + ) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.15)) + (ja :group! (-> self draw art-group data 7) :num! min) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate fire (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (squid-talker 'shooting) + (set! (-> self state-time) 0) + (set! (-> self stop-shooting) #f) + (let ((s4-0 (squid-method-42 self (new 'stack-no-clear 'vector))) + (gp-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-! gp-0 s4-0 (-> self trans)) + (set! (-> gp-0 y) 0.0) + (if (< (vector-normalize-ret-len! gp-0 49152.0) 49152.0) + (set! (-> gp-0 quad) (-> s4-0 quad)) + (vector+! gp-0 gp-0 (-> self trans)) + ) + (set! (-> gp-0 y) (+ 8192.0 (-> self nav state mesh bounds y))) + (set! (-> s5-0 quad) (-> gp-0 quad)) + (set! (-> s5-0 y) (+ -40960.0 (-> s5-0 y))) + (set! (-> self gun-high-to-low) (squid-method-44 self gp-0 s5-0)) + ) + (dotimes (gp-1 6) + (send-event (handle->process (-> self tentacles gp-1)) 'set-stretch-vel #x3f428f5c) + ) + (none) + ) + :exit (behavior () + (dotimes (gp-0 6) + (send-event (handle->process (-> self tentacles gp-0)) 'set-stretch-vel #x3f333333) + ) + (none) + ) + :trans (behavior () + (if (and (zero? (-> self hit-points)) + (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + ) + (go-virtual pre-flee) + ) + (let ((s5-0 (squid-method-42 self (new 'stack-no-clear 'vector)))) + (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self quat)) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (f30-0 0.0) + ) + (vector-! s5-0 s5-0 (-> self trans)) + (squid-method-43 + self + (squid-method-42 self (new 'stack-no-clear 'vector)) + (lerp-scale 18.204445 9.102222 (-> self suck) 0.0 1.0) + 0.75 + ) + (when #t + (vector-flatten! gp-0 s5-0 (the-as vector (-> self node-list data 36 bone transform))) + (vector-normalize-copy! gp-0 gp-0 1.0) + (let ((f30-1 (- (asin (vector-dot gp-0 (-> self node-list data 36 bone transform vector 2)))))) + (set! f30-0 + (cond + ((and (zero? (-> self state-time)) (not (-> self gun-high-to-low))) + (+ 3640.889 f30-1) + ) + ((zero? (-> self state-time)) + (+ -3640.889 f30-1) + ) + ((-> self gun-high-to-low) + (+ f30-1 + (lerp-scale -1820.4445 910.2222 (the float (- (-> self clock frame-counter) (-> self state-time))) 0.0 900.0) + ) + ) + (else + (+ f30-1 + (lerp-scale 3640.889 -910.2222 (the float (- (-> self clock frame-counter) (-> self state-time))) 0.0 900.0) + ) + ) + ) + ) + ) + ) + (+! (-> self gun-tilt) (fmin 364.0889 (fmax -364.0889 (* 0.3 f30-0)))) + ) + ) + (set! (-> self gun-tilt) (fmin 8192.0 (fmax -8192.0 (-> self gun-tilt)))) + (let ((f30-2 (* 0.5 (-> self gun-tilt)))) + (quaternion-set! (-> self gun-tilt-left-jm quat) (sin f30-2) 0.0 0.0 (cos f30-2)) + ) + (quaternion-copy! (-> self gun-tilt-right-jm quat) (-> self gun-tilt-left-jm quat)) + (let ((v1-50 (ja-group))) + (cond + ((and v1-50 (= v1-50 (-> self draw art-group data 16))) + (ja :num! (seek!)) + (when (and (= (-> self next-gun) 1) (>= (ja-aframe-num 0) 250.0)) + (squid-method-53 self 39) + (squid-method-53 self 46) + (set! (-> self next-gun) 0) + 0 + ) + (if (ja-done? 0) + (ja :group! (-> self draw art-group data 17) :num! min) + ) + ) + ((let ((v1-77 (ja-group))) + (and v1-77 (= v1-77 (-> self draw art-group data 17))) + ) + (if (or (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 3)) + (or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) + ) + (ja :num! (seek!)) + (ja :num! (loop!)) + ) + (cond + ((and (zero? (-> self next-gun)) (>= (ja-aframe-num 0) 254.0) (< (ja-aframe-num 0) 258.0)) + (squid-method-53 self 42) + (squid-method-53 self 49) + (set! (-> self next-gun) 1) + ) + ((and (= (-> self next-gun) 1) (>= (ja-aframe-num 0) 258.0)) + (squid-method-53 self 39) + (squid-method-53 self 46) + (set! (-> self next-gun) 0) + 0 + ) + ) + (if (and (or (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 3)) + (or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) + ) + (ja-done? 0) + ) + (ja :group! (-> self draw art-group data 18) :num! min) + ) + ) + ((let ((v1-132 (ja-group))) + (and v1-132 (= v1-132 (-> self draw art-group data 18))) + ) + (ja :num! (seek!)) + (when (and (zero? (-> self next-gun)) (>= (ja-aframe-num 0) 262.0)) + (squid-method-53 self 42) + (squid-method-53 self 49) + (set! (-> self next-gun) 1) + ) + (if (ja-done? 0) + (ja :group! (-> self draw art-group data 19) :num! min) + ) + ) + (else + (let ((v1-158 (ja-group))) + (cond + ((and v1-158 (= v1-158 (-> self draw art-group data 19))) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 3) :num! min) + (cond + ((= (-> self shield-hit-points) 0.0) + (go-virtual fly-to-post) + ) + (else + (vector-reset! (-> self residual-velocity)) + (go-virtual fly-to-shoot-spot) + ) + ) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data 16) :num! min) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self next-gun) 1) + ) + ) + ) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate fly-to-shoot-spot (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (set! (-> self can-play-squid-boost) #t) + (move-to-spot self (-> self trans) #t) + (dotimes (gp-0 6) + (send-event (handle->process (-> self tentacles gp-0)) 'set-gravity-slow (new 'static 'vector :y -1.0)) + ) + (set! (-> self reload-played) #f) + (none) + ) + :exit (behavior () + (set! (-> self force-onto-mesh) #t) + (none) + ) + :trans (behavior () + (squid-talker 'general) + (cond + ((and (zero? (-> self hit-points)) + (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + ) + (go-virtual pre-flee) + ) + ((and (= (-> self shield-hit-points) 0.0) (< (-> self stage) 2)) + (go-virtual fly-to-post) + ) + ) + (squid-adjust-fly-anim) + (when (and (zero? (-> self stage)) + (not (-> self reload-played)) + (< (- (-> self traj-duration) (the float (- (-> self clock frame-counter) (-> self traj-timer)))) -210.0) + ) + (sound-play "squid-reload") + (set! (-> self reload-played) #t) + ) + (when (>= (float-sin-clamp self (squid-method-48 self)) 1.0) + (dotimes (gp-2 6) + (send-event (handle->process (-> self tentacles gp-2)) 'set-gravity-slow (new 'static 'vector :y -1.0)) + ) + (case (-> self stage) + ((2) + (cond + ((or (>= (-> self stage-2-go-status) 2) (and (< -2 (-> self stage-2-go-status)) (< (rand-vu) 0.5))) + (set! (-> self stage-2-go-status) (min -1 (+ (-> self stage-2-go-status) -1))) + (go-virtual fire-whirlwind) + ) + (else + (set! (-> self stage-2-go-status) (max 1 (+ (-> self stage-2-go-status) 1))) + (go-virtual headbut) + ) + ) + ) + ((1) + (go-virtual fire-grenades) + ) + (else + (if (not (-> self reload-played)) + (sound-play "squid-reload") + ) + (go-virtual fire) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate idle (squid) + :virtual #t + :event squid-handler + :enter (behavior () + (set-setting! 'music 'danger4 0 0) + (set! (-> self driver-blend target) 1.0) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self hud) (ppointer->handle (process-spawn hud-squid :init hud-init-by-other :to self))) + (vector+! (-> self trans) (-> self trans) (new 'static 'vector :x 101171.2 :y 45056.0 :z 31047.68)) + (let ((v1-14 (squid-method-42 self (new 'stack-no-clear 'vector)))) + (vector-! v1-14 v1-14 (-> self trans)) + (let ((f30-1 (* 0.5 (atan (-> v1-14 x) (-> v1-14 z))))) + (set! (-> self quat x) 0.0) + (set! (-> self quat y) (sin f30-1)) + (set! (-> self quat z) 0.0) + (set! (-> self quat w) (cos f30-1)) + ) + ) + (sound-play "squid-reload") + (go-virtual fire) + (none) + ) + :trans (behavior () + (ja :num! (loop!)) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 3)) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + :post (behavior () + (squid-post self) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate hidden (squid) + :virtual #t + :enter (behavior () + (ja-channel-set! 0) + (ja-post) + (none) + ) + :exit (behavior () + (ja-channel-push! 1 0) + (ja :group! (-> self draw art-group data 3) :num! min) + (none) + ) + :trans (behavior () + (cond + ((< (fabs (-> (squid-method-42 self (new 'stack-no-clear 'vector)) x)) 4096.0) + ) + (else + (when (task-node-closed? (game-task-node palace-boss-introduction)) + (let ((f0-2 (vector-vector-xz-distance-squared (-> self trans) (target-pos 0))) + (f1-1 217088.0) + ) + (cond + ((< f0-2 (* f1-1 f1-1)) + (set! (-> self allowed-rotate-to-vector-angle) 32768.0) + (squid-method-43 self (squid-method-42 self (new 'stack-no-clear 'vector)) 32585.955 0.999) + (go-virtual idle) + ) + ((let ((f1-4 286720.0)) + (< f0-2 (* f1-4 f1-4)) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + :code (the-as (function none :behavior squid) sleep-code) + ) + + + + diff --git a/test/offline/config/jak2/config.jsonc b/test/offline/config/jak2/config.jsonc index 61ffc0d47f..9acadecdee 100644 --- a/test/offline/config/jak2/config.jsonc +++ b/test/offline/config/jak2/config.jsonc @@ -54,6 +54,7 @@ "DGO/PAC.DGO", "DGO/PAE.DGO", "DGO/PALOUT.DGO", + "DGO/PALBOSS.DGO", "DGO/PAR.DGO", "DGO/PAS.DGO", "DGO/PRI.DGO",