decomp: squid-* files (#2170)

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
This commit is contained in:
Hat Kid 2023-01-29 00:44:10 +01:00 committed by GitHub
parent e6f55b9b55
commit be035181f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 14013 additions and 158 deletions

View File

@ -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 ;;

View File

@ -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": {},

View File

@ -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",

View File

@ -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"]
]
}

View File

@ -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"]]
}

View File

@ -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"]]
}

View File

@ -4090,5 +4090,8 @@
"vars": {
"v0-0": ["ret", "object"]
}
},
"(method 46 squid)": {
"args": ["obj", "src", "arg2", "dest"]
}
}

View File

@ -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

View File

@ -170,6 +170,7 @@ void OpenGLRenderer::init_bucket_renderers_jak2() {
// 130
init_bucket_renderer<TextureUploadHandler>("tex-l1-alpha", BucketCategory::TEX,
BucketId::TEX_L1_ALPHA);
init_bucket_renderer<Merc2>("merc-l0-alpha", BucketCategory::MERC, BucketId::MERC_L0_ALPHA);
init_bucket_renderer<TFragment>("tfrag-t-l1-alpha", BucketCategory::TFRAG,
BucketId::TFRAG_T_L1_ALPHA,
std::vector{tfrag3::TFragmentTreeKind::TRANS}, false, 1);

View File

@ -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,

View File

@ -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

View File

@ -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<std::unordered_map<std::string, std::vector<void (*)()>>> 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<u8>()}});

View File

@ -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

View File

@ -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)
)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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
)

View File

@ -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)
)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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",