Files
jak-project/goal_src/jak2/levels/palace/boss/squid-setup.gc
T
water111 637990314b wip: better stack var support (#4222)
Closes #736

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2026-04-19 00:14:44 +02:00

2703 lines
110 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: squid-setup.gc
;; 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)
(center-vel vector :inline)
(current-nav-poly nav-poly)
(duration time-frame)
(whirl-sound sound-id)
(whirl-sound-playing symbol)
)
(:state-methods
idle
)
)
(deftype squid-collision (process-drawable)
()
(:state-methods
idle
)
)
(deftype squid-driver (process-drawable)
((prefix string)
(run-free symbol)
)
(:state-methods
idle
)
)
(deftype squid-baron (process-drawable)
()
(:state-methods
idle
)
)
(deftype squid-tentacle-chain (structure)
((position vector :inline)
(velocity vector :inline)
(old-x vector :inline)
(joint-mod joint-mod)
)
)
(deftype squid-tentacle (process-drawable)
((root collide-shape-moving :override)
(chain-joints squid-tentacle-chain 11 :inline)
(gravity vector :inline)
(gravity-target vector :inline)
(stretch-vel float)
(center vector :inline)
(avoid-center symbol)
(wrap symbol)
(num-bg-collisions int32)
(max-movement float)
)
(:state-methods
test
idle
)
(:methods
(joint-setup (_type_) none)
(squid-tentacle-method-23 (_type_) none)
)
)
(deftype squid-grenade-holder (structure)
((target-position vector :inline)
(show-it symbol)
(grenade handle)
(marker handle)
)
)
(deftype squid-grenade (projectile)
((traj trajectory :inline)
(traj-dest vector :inline)
(traj-timer time-frame)
(traj-duration float)
(fly-sound sound-id)
)
)
(deftype squid (process-focusable)
((quat quaternion :inline)
(trans vector :inline)
(residual-velocity vector :inline)
(residual-accumulator-1 float)
(residual-accumulator-2 float)
(force-onto-mesh symbol)
(mesh-forced symbol)
(hit-reaction oscillating-vector :inline)
(traj trajectory :inline)
(traj-src vector :inline)
(traj-dest vector :inline)
(traj-timer time-frame)
(traj-duration float)
(current-nav-poly nav-poly)
(tentacles handle 6)
(baron squid-baron)
(driver (pointer squid-driver))
(driver-blend cam-float-seeker :inline)
(blink-time time-frame)
(blink-mask int32)
(thruster-part sparticle-launch-control)
(gun-tilt-left-jm joint-mod)
(gun-tilt-right-jm joint-mod)
(gun-tilt float)
(next-gun int8)
(fire-aft symbol)
(gun-high-to-low symbol)
(grenade squid-grenade-holder 10 :inline)
(first-path path-control)
(second-path path-control)
(third-path path-control)
(shield-timer time-frame)
(shield-color vector :inline)
(shield-shattered symbol)
(shield-hit-points float)
(hit-points int32)
(invincible-timer time-frame)
(stage int32)
(collision-actor (pointer squid-collision))
(tentacle-base-jm joint-mod)
(tentacle-base-rotation float)
(tentacle-base-rotation-speed cam-float-seeker :inline)
(stage-2-go-status int32)
(gate-intact symbol)
(hud handle)
(desired-rotate-to-vector-angle degrees)
(allowed-rotate-to-vector-angle degrees)
(stop-shooting symbol)
(attack-id uint32)
(rush-sound sound-id)
(rush-sound-playing symbol)
(rush-end-time time-frame)
(jet-sound sound-id)
(jet-sound-playing symbol)
(jet-pitch int64)
(negate-jet-pitch symbol)
(jet-volume int64)
(can-play-squid-boost symbol)
(tentacle-sound sound-id)
(tentacle-sound-playing symbol)
(spin-sound sound-id)
(spin-sound-playing symbol)
(reload-played symbol)
(max-plane int32)
(debug-timer time-frame)
(debug-on symbol)
(last-damaged-talker int8)
(last-shield-hit-talker int8)
(last-no-energy-talker int8)
(last-shooting-talker int8)
(last-headbutting-talker int8)
(last-general-talker int8)
(last-start-recharging-talker int8)
(last-done-recharging-talker int8)
(suck float)
)
(:state-methods
test
beaten
wait-around-corner
wait-beside-building
flee
pre-flee
recharge
fly-to-post
headbut
fire-whirlwind
fire-grenades
fire
fly-to-shoot-spot
idle
hidden
)
(:methods
(squid-method-42 (_type_ vector) vector)
(squid-method-43 (_type_ vector float float) none)
(squid-method-44 (_type_ vector vector) symbol)
(move-to-spot (_type_ vector symbol) none)
(set-traj-towards-vec (_type_ vector vector vector) none)
(float-sin-clamp (_type_ float) float)
(squid-method-48 (_type_) float)
(setup-part-engine (_type_ symbol) none)
(squid-post (_type_) none)
(spawn-whirlwind (_type_) (pointer squid-whirlwind))
(spawn-grenade (_type_ int squid-grenade-holder float) none)
(squid-method-53 (_type_ int) none)
)
)
(defskelgroup skel-squid squid squid-lod0-jg squid-squid-idle-ja
((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 squid-driver-squid-idle-ja
((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 group-squid-whirlwind-fire 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 ((this squid-tentacle))
(dotimes (s5-0 11)
(let ((s4-0 (-> this 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 ((this squid-tentacle))
(local-vars (v1-134 float) (v1-162 float) (f0-51 float))
(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! (-> this gravity) (-> this 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 (-> this 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) (-> this node-list data 3)))
(s3-1
(vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 3 bone transform vector 2) 1.0)
)
(s2-0
(vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 3 bone transform vector 1) 1.0)
)
(s1-0 (new 'stack-no-clear 'vector))
)
(set! (-> this num-bg-collisions) 0)
(set! (-> this max-movement) 0.0)
(dotimes (s0-0 11)
(let ((sv-1456 (-> this chain-joints s0-0))
(sv-1904 (new 'stack-no-clear 'vector))
)
(set! (-> sv-1904 quad) (-> sv-1456 position quad))
(cond
((-> this wrap)
(+! (-> sv-1904 y) -409.6)
(let ((sv-1472 (new 'stack-no-clear 'vector)))
(let ((v1-25 sv-1904)
(a0-10 (-> this center))
)
(.lvf vf4 (&-> v1-25 quad))
(.lvf vf5 (&-> a0-10 quad))
)
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.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
(let ((sv-1520 sv-1904))
(let ((sv-1488 sv-1904)
(sv-1504 (-> this gravity))
(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.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.svf (&-> sv-1520 quad) vf4)
)
(when (-> this avoid-center)
(vector-! s1-0 (-> sv-1456 position) (-> this center))
(vector-normalize!
s1-0
(* 4096.0 (-> pp clock time-adjust-ratio) (fmax 0.0 (lerp-scale 0.4 0.6 (the float s0-0) 0.0 8.0)))
)
(vector+! sv-1904 sv-1904 s1-0)
)
)
)
(when (< s0-0 10)
(let ((sv-1600 sv-1904))
(let ((sv-1568 sv-1904)
(sv-1584 (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ s0-0 1) 64))))
(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.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.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) (-> this node-list data 3)))
(sv-1616 (new 'stack-no-clear 'vector))
)
(+! (-> v0-15 y) 31744.0)
(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
(-> this 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.w vf6 vf0)
(.lvf vf4 (&-> a0-31 quad))
)
(.lvf vf5 (&-> sv-1616 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-77 quad) vf6)
)
)
)
)
(let ((sv-1632 (new 'stack-no-clear 'vector)))
(let ((v1-79 sv-1904)
(a0-33 (-> this center))
)
(.lvf vf4 (&-> v1-79 quad))
(.lvf vf5 (&-> a0-33 quad))
)
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-1632 quad) vf6)
(set! (-> sv-1632 y) 0.0)
(let ((f0-32 (vector-normalize-ret-len! sv-1632 1.0)))
(if (< f0-32 4096.0)
(vector+float*! sv-1904 sv-1904 sv-1632 (- 4096.0 f0-32))
)
)
)
(let ((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.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.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)
(vector-normalize! sv-1728 (sin f26-0))
(let ((sv-1712 sv-1728))
(let ((sv-1680 sv-1728)
(sv-1696 s2-0)
(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.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.svf (&-> sv-1712 quad) vf4)
)
(vector+float*! sv-1904 s4-1 sv-1728 f30-3)
)
)
)
(let ((sv-1744 (new 'stack-no-clear 'collide-query))
(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.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-1776 quad) vf6)
(let ((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.x vf2 vf0 vf0)
(.mul.vf vf1 vf1 vf1)
(.mul.x.vf.x acc vf2 vf1)
(.add.mul.y.vf.x acc vf2 vf1 acc)
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
(.mov v1-134 vf1)
(< v1-134 (square 409.6))
)
)
(+! 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) this)
(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.w vf6 vf0)
(.lvf vf4 (&-> a0-64 quad))
)
(.lvf vf5 (&-> sv-1776 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-128 quad) vf6)
)
(goto cfg-27)
)
)
)
)
(label cfg-27)
(if (< 1 sv-1760)
(+! (-> this num-bg-collisions) 1)
)
)
)
(let ((sv-1808 (new 'stack-no-clear 'vector)))
(let ((a0-69 sv-1904))
(.lvf vf4 (&-> s4-1 quad))
(.lvf vf5 (&-> a0-69 quad))
)
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-1808 quad) vf6)
(vector-normalize-ret-len! sv-1808 1.0)
(let ((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.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.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 (-> this 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.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.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.x vf2 vf0 vf0)
(.mul.vf vf1 vf1 vf1)
(.mul.x.vf.x acc vf2 vf1)
(.add.mul.y.vf.x acc vf2 vf1 acc)
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
(.mov v1-162 vf1)
(let ((f0-53 v1-162)
(f1-21 (if (= s0-0 10)
9830.4
6144.0
)
)
)
(if (< (square f1-21) f0-53)
(vector--float*! sv-1904 s4-1 a2-14 (/ f1-21 (sqrtf f0-53)))
)
)
)
(set! (-> this max-movement)
(fmax (vector-vector-distance (-> sv-1456 position) sv-1904) (-> this 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! (-> s5-1 vector 0) (-> s5-1 vector 1) s3-1)
(vector-normalize! (-> s5-1 vector 0) 1.0)
(let ((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 (-> s5-1 vector 0) sv-1872) (cos 3640.889))
(vector-cross! sv-1872 sv-1872 (-> s5-1 vector 0))
(vector-cross! sv-1872 (-> s5-1 vector 0) sv-1872)
(vector-normalize! sv-1872 1.0)
(let ((sv-1840 (-> s5-1 vector)))
(let ((sv-1824 (-> s5-1 vector))
(f0-60 (cos 3640.889))
)
(.lvf vf1 (&-> sv-1824 0 quad))
(let ((v1-192 f0-60))
(.mov vf2 v1-192)
)
)
(.add.x.vf.w vf1 vf0 vf0)
(.mul.x.vf.xyz vf1 vf1 vf2)
(.svf (&-> sv-1840 0 quad) vf1)
)
(let ((sv-1888 (-> s5-1 vector)))
(let ((sv-1856 (-> s5-1 vector))
(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.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.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) (-> s5-1 vector 0) (-> 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! (-> this avoid-center) #f)
(set! (-> this wrap) #f)
0
(none)
)
)
)
;; WARN: Return type mismatch process-drawable vs squid-tentacle.
(defmethod relocate ((this squid-tentacle) (offset int))
(dotimes (v1-0 11)
(if (nonzero? (-> this chain-joints v1-0 joint-mod))
(&+! (-> this chain-joints v1-0 joint-mod) offset)
)
)
(the-as squid-tentacle ((method-of-type process-drawable relocate) this offset))
)
;; 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) (the-as collide-shape-moving s4-0))
)
(set! (-> self root 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) arg0)
)
)
(when arg2
(part-tracker-spawn :to self :group group-squid-grenade-explode :mat-joint gp-0)
(sound-play "hit-squid")
)
(if (logtest? (attack-mask attacker-velocity) (-> arg1 mask))
(set! (-> gp-0 quad) (-> arg1 attacker-velocity quad))
(vector-! gp-0 (-> self root 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) (+ (current-time) (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 ()
(when (zero? (-> self hit-points))
(set! (-> self shield-hit-points) 0.0)
(cond
((zero? (-> self stage))
(setup-masks (-> self draw) 320 160)
(part-tracker-spawn
:to self
:group group-squid-grenade-explode
:userdata (the-as symbol #f)
:target (the-as symbol #f)
:mat-joint (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node squid-lod0-jg gunL))
)
)
((= (-> self stage) 1)
(setup-masks (-> self draw) 5120 2590)
(part-tracker-spawn
:to self
:group group-squid-grenade-explode
:userdata (the-as symbol #f)
:target (the-as symbol #f)
:mat-joint (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node squid-lod0-jg podL))
)
)
)
)
(none)
)
(defbehavior squid-handler squid ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(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)
(let* ((sv-16 (new 'static 'res-tag))
(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-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*) (not (logtest? (-> *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 squid-shields-up-ja)) (< 16.0 (ja-aframe-num 0)))
(let ((v1-49 (ja-group)))
(or (and v1-49 (= v1-49 squid-shields-idle-ja))
(let ((v1-54 (ja-group)))
(and (and v1-54 (= v1-54 squid-shields-down-ja)) (< (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)
)
)
((time-elapsed? (-> 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-time! (-> self invincible-timer))
(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 (the-as process (as-type arg0 process-focusable))))
(when a0-66
(if (send-event
a0-66
'attack
(-> arg3 param 0)
(static-attack-info ((id (new-attack-id)) (shove-back (meters 6)) (shove-up (meters 3))))
)
#f
)
)
)
)
)
)
)
(defmethod deactivate ((this squid))
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
(if (nonzero? (-> this thruster-part))
(kill-and-free-particles (-> this thruster-part))
)
(if (-> this rush-sound-playing)
(sound-stop (-> this rush-sound))
)
(if (-> this jet-sound-playing)
(sound-stop (-> this jet-sound))
)
(if (-> this spin-sound-playing)
(sound-stop (-> this spin-sound))
)
(if (-> this tentacle-sound-playing)
(sound-stop (-> this tentacle-sound))
)
((method-of-type process-drawable deactivate) this)
(none)
)
;; WARN: Return type mismatch process-drawable vs squid.
(defmethod relocate ((this squid) (offset int))
(if (nonzero? (-> this thruster-part))
(&+! (-> this thruster-part) offset)
)
(if (nonzero? (-> this first-path))
(&+! (-> this first-path) offset)
)
(if (nonzero? (-> this second-path))
(&+! (-> this second-path) offset)
)
(if (nonzero? (-> this third-path))
(&+! (-> this third-path) offset)
)
(if (nonzero? (-> this gun-tilt-left-jm))
(&+! (-> this gun-tilt-left-jm) offset)
)
(if (nonzero? (-> this gun-tilt-right-jm))
(&+! (-> this gun-tilt-right-jm) offset)
)
(if (nonzero? (-> this tentacle-base-jm))
(&+! (-> this tentacle-base-jm) offset)
)
(the-as squid ((method-of-type process-drawable relocate) this offset))
)
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! ((this 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 this (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! (-> this root) s4-0)
)
(process-drawable-from-entity! this arg0)
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-squid" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(set! (-> this draw light-index) (the-as uint 10))
(logior! (-> this skel status) (joint-control-status sync-math))
(logior! (-> this mask) (process-mask enemy))
(logclear! (-> this mask) (process-mask actor-pause))
(set! (-> this trans quad) (-> this root trans quad))
(set! (-> this force-onto-mesh) #t)
(set! (-> this mesh-forced) #f)
(quaternion-copy! (-> this quat) (-> this root quat))
(dotimes (s5-2 6)
(set! (-> this tentacles s5-2)
(ppointer->handle (process-spawn squid-tentacle (-> this root trans) s5-2 :to this))
)
)
(set! (-> this baron) (the-as squid-baron (process-spawn squid-baron (-> this root trans) :to this)))
(set! (-> this driver) (process-spawn squid-driver "driver-" :to this))
(init (-> this driver-blend) 0.0 0.0025 0.025 0.5)
(set-params! (-> this hit-reaction) (the-as vector #f) 0.2 1.0 0.5)
(let ((s5-6 (vector+!
(new 'stack-no-clear 'vector)
(-> this root trans)
(new 'static 'vector :x -20480.0 :y 23388.16 :z 143360.0)
)
)
)
(set! (-> this collision-actor) (process-spawn squid-collision s5-6 0 :to this))
)
(set! (-> this blink-time) 0)
(setup-part-engine this #t)
(set! (-> this thruster-part) (create-launch-control group-squid-thruster this))
(dotimes (v1-110 10)
(set! (-> this grenade v1-110 grenade) (the-as handle #f))
(set! (-> this grenade v1-110 marker) (the-as handle #f))
(set! (-> this grenade v1-110 show-it) #f)
)
(set! (-> this gun-tilt-left-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 36))
(set! (-> this gun-tilt-right-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 43))
(set! (-> this gun-tilt) 0.0)
(set! (-> this tentacle-base-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 6))
(init (-> this tentacle-base-rotation-speed) 0.0 0.01 0.1 0.9)
(set! (-> this tentacle-base-rotation) 0.0)
(set! (-> this first-path) (new 'process 'curve-control this 'first -1000000000.0))
(logior! (-> this first-path flags) (path-control-flag display draw-line draw-point draw-text))
(set! (-> this second-path) (new 'process 'curve-control this 'second -1000000000.0))
(logior! (-> this second-path flags) (path-control-flag display draw-line draw-point draw-text))
(set! (-> this third-path) (new 'process 'curve-control this 'third -1000000000.0))
(logior! (-> this third-path flags) (path-control-flag display draw-line draw-point draw-text))
(change-to (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0) this)
(set! (-> this current-nav-poly) #f)
(set! (-> this shield-timer) 0)
(set! (-> this shield-hit-points) 1.0)
(set! (-> this shield-shattered) #f)
(set! (-> this hit-points) 10)
(set! (-> this invincible-timer) 0)
(set! (-> this stage) 0)
(set! (-> this stage-2-go-status) 0)
(set! (-> this debug-on) #f)
(when (-> this draw shadow)
(set! (-> this draw shadow-ctrl)
(new 'process 'shadow-control -122880.0 4096.0 4096000.0 (shadow-flags) 819200.0)
)
(let ((v1-141 (-> this draw shadow-ctrl)))
(logclear! (-> v1-141 settings flags) (shadow-flags disable-draw))
)
0
)
(set! (-> this hud) (the-as handle #f))
(setup-masks (-> this draw) 0 5440)
(set! (-> this part) (create-launch-control group-squid-damage this))
(set! (-> this desired-rotate-to-vector-angle) 0.0)
(set! (-> this allowed-rotate-to-vector-angle) 0.0)
(set! (-> this rush-sound) (new-sound-id))
(set! (-> this rush-sound-playing) #f)
(set! (-> this rush-end-time) 0)
(set! (-> this jet-sound) (new-sound-id))
(set! (-> this jet-sound-playing) #f)
(set! (-> this jet-pitch) 0)
(set! (-> this jet-volume) 0)
(set! (-> this tentacle-sound) (new-sound-id))
(set! (-> this tentacle-sound-playing) #f)
(set! (-> this spin-sound) (new-sound-id))
(set! (-> this spin-sound-playing) #f)
(set! (-> this max-plane) -1)
(set! (-> this last-damaged-talker) 0)
(set! (-> this last-shield-hit-talker) 0)
(set! (-> this last-no-energy-talker) 0)
(set! (-> this last-shooting-talker) 0)
(set! (-> this last-headbutting-talker) 0)
(set! (-> this last-general-talker) 0)
(set! (-> this last-start-recharging-talker) -1)
(set! (-> this last-done-recharging-talker) -1)
(set! (-> this suck) (you-suck-scale *game-info* #f))
(if (task-node-closed? (game-task-node palace-boss-resolution))
(go (method-of-object this beaten))
(go (method-of-object this hidden))
)
(none)
)
(defmethod squid-method-42 ((this squid) (arg0 vector))
(set! (-> arg0 quad) (-> (if *target*
(get-trans *target* 3)
(-> this nav state mesh bounds)
)
quad
)
)
arg0
)
(defmethod squid-method-43 ((this squid) (arg0 vector) (arg1 float) (arg2 float))
(let ((s4-0 (new 'stack-no-clear 'matrix))
(s5-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this quat)))
)
(let ((s3-0 (new 'stack-no-clear 'vector)))
(vector-! s3-0 arg0 (-> this 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 (-> this 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! (-> this 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 (-> this quat) s5-0)
)
(quaternion-normalize! (-> this quat))
0
(none)
)
(defmethod squid-method-44 ((this 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) this)
(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)
)
)
(defmethod move-to-spot ((this squid) (arg0 vector) (arg1 symbol))
(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)
(sv-656 (new 'stack-no-clear 'vector))
(s3-0 (new 'stack-no-clear 'vector))
(s0-0 0)
(sv-672 (squid-method-42 this (new 'stack-no-clear 'vector)))
)
(+! (-> sv-672 y) 8192.0)
(set! (-> s3-0 quad) (-> arg0 quad))
(set! (-> s3-0 y) (-> this nav state mesh bounds y))
(set! (-> this current-nav-poly) (cloest-point-on-mesh (-> this nav) s3-0 s3-0 (-> this current-nav-poly)))
(cond
((-> this current-nav-poly)
(vector-! sv-656 (-> this 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)
)
(let ((sv-688 (matrix-rotate-y! (new 'stack-no-clear 'matrix) 2730.6667))
(sv-704 (new 'stack 'clamp-travel-vector-to-mesh-return-info))
(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
(-> this nav)
s3-0
(-> this 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 (-> this nav state mesh bounds y)))
(cond
((not (-> sv-704 found-boundary))
)
((< (vector-vector-distance-squared sv-672 (-> s5-0 s0-0)) (square 102400.0))
)
((not (squid-method-44 this (-> s5-0 s0-0) sv-672))
)
((< (vector-vector-distance-squared s3-0 (-> s5-0 s0-0)) (square 81920.0))
(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))
(sv-736 (-> this nav))
(a1-15 (-> sv-704 poly))
(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.w vf6 vf0)
(.lvf vf4 (&-> sv-752 quad))
(.lvf vf5 (&-> a0-33 quad))
)
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-54 quad) vf6)
)
)
0
(+! (-> s1-0 y) 32768.0)
)
(set! f30-0 f28-0)
)
)
)
(else
(when (-> sv-704 poly)
(let ((a3-3 (new 'stack-no-clear 'vector))
(sv-768 (-> this nav))
(a1-17 (-> sv-704 poly))
(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.w vf6 vf0)
(.lvf vf4 (&-> sv-784 quad))
(.lvf vf5 (&-> a0-38 quad))
)
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-68 quad) vf6)
)
)
0
(+! (-> s5-0 s0-0 y) 32768.0)
)
(+! s0-0 1)
)
)
(+! 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 this arg0 s3-0 (-> s5-0 0))
)
)
(else
(format 0 "~A bad current poly~%" (-> this name))
)
)
)
)
0
(none)
)
)
(defmethod set-traj-towards-vec ((this squid) (src vector) (arg2 vector) (dest vector))
"Set up the [[trajectory]] towards `dest`."
(set-time! (-> this traj-timer))
(set! (-> this traj-src quad) (-> src quad))
(set! (-> this traj-dest quad) (-> dest quad))
(set! (-> this traj-duration) (* 0.00091552734 (vector-vector-xz-distance arg2 dest)))
(set! (-> this traj-duration) (fmax 480.0 (-> this traj-duration)))
(let ((f0-4 49152.0))
(if (< (-> arg2 y) (-> dest y))
(+! f0-4 (- (-> dest y) (-> arg2 y)))
)
(setup-from-to-duration-and-height! (-> this traj) arg2 dest 1.0 f0-4)
)
(set! (-> this residual-accumulator-1) 1.0)
(set! (-> this residual-accumulator-2) 0.0)
0
(none)
)
(defmethod float-sin-clamp ((this squid) (arg0 float))
(parameter-ease-sin-clamp (* 0.6366198 arg0))
)
(defmethod squid-method-48 ((this squid))
(when (< 0.00001 (-> this residual-accumulator-1))
(set! (-> this residual-accumulator-1) (* 0.95 (-> this residual-accumulator-1)))
(+! (-> this residual-accumulator-2) (-> this residual-accumulator-1))
)
(let* ((f28-0 ((method-of-type trajectory compute-time-until-apex)
(the-as trajectory (&-> (the-as squid-grenade (-> this self)) ignore-handle))
)
)
(s3-0 (compute-trans-at-time (-> this 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 (- (current-time) (-> this traj-timer))) (-> this traj-duration)))
)
(let ((f26-0 (float-sin-clamp this f30-0)))
(when (and (-> this can-play-squid-boost) (< 0.125 f30-0))
(set! (-> this can-play-squid-boost) #f)
(sound-play "squid-boost")
)
(cond
((< f26-0 1.0)
(compute-trans-at-time (-> this traj) f26-0 s5-0)
(set! (-> s4-0 quad) (-> this traj-src quad))
(+! (-> s4-0 y) (* 204.8 (the float (- (current-time) (-> this traj-timer))) (/ f26-0 f30-0)))
(vector+float*! s4-0 s4-0 (-> this residual-velocity) (-> this 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 (-> this traj-dest) f28-1)
(vector-lerp! s5-0 s5-0 s4-0 f28-1)
)
(squid-method-43 this (squid-method-42 this (new 'stack-no-clear 'vector)) 1092.2667 0.05)
(vector-! s4-0 (-> this traj-dest) (-> this trans))
(vector-normalize! s4-0 1.75)
(dotimes (s3-2 6)
(send-event (handle->process (-> this tentacles s3-2)) 'set-gravity s4-0)
)
)
(else
(squid-method-43 this (-> this traj-dest) 546.13336 0.005)
)
)
(set! (-> this trans quad) (-> s5-0 quad))
)
(else
(dotimes (s5-1 6)
(send-event (handle->process (-> this tentacles s5-1)) 'set-gravity-slow (new 'static 'vector :y -1.0))
)
(set! (-> this trans quad) (-> this traj-dest quad))
)
)
)
f30-0
)
)
(defmethod setup-part-engine ((this squid) (arg0 symbol))
(when (>= (- (current-time) (-> this blink-time)) 0)
(set! (-> this 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! (-> this blink-mask) (ash 1 s5-0))
)
)
)
(set! (-> this blink-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.25 0.75)))))
(set! arg0 #t)
)
(when arg0
(remove-from-process *part-engine* this)
(add-connection
*part-engine*
this
5
this
4790
(new 'static 'vector :x -5906.432 :y 3317.76 :z -409.6 :w 819200.0)
)
(add-connection
*part-engine*
this
5
this
4790
(new 'static 'vector :x 5906.432 :y 3317.76 :z -409.6 :w 819200.0)
)
(add-connection *part-engine* this 6 this 4791 (new 'static 'vector :y 3366.912 :w 819200.0))
(add-connection *part-engine* this 13 this 4791 (new 'static 'vector :y 11993.088 :z 5255.168 :w 819200.0))
(add-connection
*part-engine*
this
5
this
4792
(new 'static 'vector :x 5439.488 :y -1794.048 :z 11444.224 :w 819200.0)
)
(add-connection
*part-engine*
this
5
this
4792
(new 'static 'vector :x -5439.488 :y -1794.048 :z 11444.224 :w 819200.0)
)
(let ((s5-2 (-> this blink-mask)))
(if (logtest? s5-2 1)
(add-connection
*part-engine*
this
5
this
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*
this
5
this
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*
this
5
this
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*
this
5
this
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*
this
5
this
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*
this
5
this
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*
this
5
this
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*
this
5
this
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*
this
5
this
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*
this
5
this
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 ((this squid))
(local-vars (v0-33 object) (s5-9 int))
(with-pp
(if (= (-> this stage) 2)
(script-eval '(want-anim "palace-boss-res"))
)
(when (-> this force-onto-mesh)
(let ((s5-0 (new 'stack-no-clear 'vector)))
(set! (-> s5-0 quad) (-> this trans quad))
(set! (-> this trans y) (-> this nav state mesh bounds y))
(set! (-> this current-nav-poly)
(cloest-point-on-mesh (-> this nav) (-> this trans) (-> this trans) (-> this current-nav-poly))
)
(set! (-> this trans y) (-> s5-0 y))
(set! (-> this mesh-forced) (< (square 409.6) (vector-vector-distance-squared (-> this trans) s5-0)))
)
)
(setup-part-engine this #f)
(update! (-> this 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 (-> this driver-blend value)))
)
(matrix-identity! s4-0)
(send-event (ppointer->process (-> this driver)) 'matrix s4-0)
(vector+float*! (-> this root trans) (-> this 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*! (-> this root quat) (the-as quaternion s5-1) (-> this quat)))
)
(else
(quaternion-copy! (-> this root quat) (-> this quat))
)
)
)
(update! (-> this hit-reaction) (the-as vector #f))
(vector+float*! (-> this root trans) (-> this root trans) (-> this hit-reaction value) 4096.0)
(update! (-> this tentacle-base-rotation-speed) 0.0)
(let ((f0-14 (+ (-> this tentacle-base-rotation) (* 910.2222 (-> this tentacle-base-rotation-speed value)))))
(set! (-> this tentacle-base-rotation) (- f0-14 (* (the float (the int (/ f0-14 65536.0))) 65536.0)))
)
(quaternion-set!
(-> this tentacle-base-jm quat)
0.0
(sin (-> this tentacle-base-rotation))
0.0
(cos (-> this tentacle-base-rotation))
)
(when (< 0.5 (-> this 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 (-> this node-list data 6))
(vector-normalize-copy! s4-5 (-> this 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 (-> this tentacles s4-6)) 'avoid-center s5-3)
)
)
)
(if (or (zero? (-> this stage)) (or (and (= (-> this stage) 1) (>= (-> this max-plane) 8))
(and (= (-> this stage) 2)
(>= (-> this max-plane) 24)
(not (and (-> this next-state) (= (-> this next-state name) 'flee)))
)
)
)
(set-setting! 'point-of-interest 'abs (-> this trans) 0)
(remove-setting! 'point-of-interest)
)
(transform-post)
(do-push-aways (-> this root))
(dotimes (s5-4 10)
(let ((a0-46 (handle->process (-> this grenade s5-4 marker))))
(when a0-46
(if (and (not (-> this grenade s5-4 show-it)) (not (handle->process (-> this 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 (-> this 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 (-> this tentacles s4-7)) a1-26)))
)
)
)
(set! v0-33 (cond
((or (and (not (-> this tentacle-sound-playing)) (>= s5-5 5) (>= f30-3 1638.4))
(or (and (-> this next-state) (= (-> this next-state name) 'recharge))
(let ((v1-123 (if (> (-> this skel active-channels) 0)
(-> this skel root-channel 0 frame-group)
)
)
)
(and v1-123 (= v1-123 (-> this draw art-group data 5)))
)
)
)
(sound-play "tentacles1" :id (-> this tentacle-sound) :position (-> this root trans))
(set! v0-33 #t)
(set! (-> this tentacle-sound-playing) (the-as symbol v0-33))
v0-33
)
((and (-> this tentacle-sound-playing) (< s5-5 3))
(sound-stop (-> this tentacle-sound))
(set! (-> this tentacle-sound-playing) #f)
(sound-play "tentacles-up")
)
((-> this tentacle-sound-playing)
(sound-play "tentacles1" :id (-> this tentacle-sound) :position (-> this root trans))
)
)
)
)
(when (-> this rush-sound-playing)
(cond
((or (zero? (-> this rush-end-time)) (not (time-elapsed? (-> this rush-end-time) (seconds 0.1))))
(the-as int (sound-play "squid-rush" :id (-> this rush-sound) :position (-> this root trans)))
)
(else
(sound-stop (-> this rush-sound))
(set! (-> this rush-sound-playing) #f)
(set! (-> this rush-end-time) 0)
0
)
)
)
(let ((v1-149 (if (> (-> this skel active-channels) 0)
(-> this skel root-channel 0 frame-group)
)
)
)
(cond
((or (and v1-149 (= v1-149 (-> this draw art-group data 33)))
(let ((v1-155 (if (> (-> this skel active-channels) 0)
(-> this skel root-channel 0 frame-group)
)
)
)
(or (and (and v1-155 (= v1-155 (-> this draw art-group data 35))) (< -11.0 (ja-aframe-num 0)))
(and (-> this next-state) (= (-> this next-state name) 'pre-flee))
)
)
)
(when (-> this jet-sound-playing)
(sound-stop (-> this jet-sound))
(set! (-> this jet-sound-playing) #f)
)
)
(else
(let* ((f0-23 (fmin 1.0 (* 0.0011111111 (the float (- (current-time) (the-as time-frame (-> this jet-pitch)))))))
(f28-2 (fmin 1.0 (* 0.006666667 (the float (- (current-time) (the-as time-frame (-> this 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 (-> this negate-jet-pitch)
(set! f30-6 (- f30-6))
)
(sound-play-by-name
(static-sound-name "squid-jets")
(-> this jet-sound)
(the int (* 1024.0 f0-31))
(the int (* 1524.0 f30-6))
0
(sound-group sfx)
(-> this root trans)
)
)
(set! (-> this jet-sound-playing) #t)
)
)
)
(let ((v1-193 (if (> (-> this skel active-channels) 0)
(-> this skel root-channel 0 frame-group)
)
)
)
(when (and (not (and v1-193 (= v1-193 (-> this draw art-group data 33))))
(let ((v1-199 (if (> (-> this skel active-channels) 0)
(-> this skel root-channel 0 frame-group)
)
)
)
(not (and (and v1-199 (= v1-199 (-> this 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 (-> this thruster-part) (-> this node-list data 24))
(spawn-with-cspace (-> this thruster-part) (-> this node-list data 25))
(spawn-with-cspace (-> this thruster-part) (-> this node-list data 32))
(spawn-with-cspace (-> this thruster-part) (-> this node-list data 33))
(set! (-> *part-id-table* 4812 init-specs 12 initial-valuef) 10922.667)
(spawn-with-cspace (-> this thruster-part) (-> this node-list data 24))
(spawn-with-cspace (-> this thruster-part) (-> this node-list data 25))
(spawn-with-cspace (-> this thruster-part) (-> this node-list data 32))
(spawn-with-cspace (-> this thruster-part) (-> this node-list data 33))
(set! (-> *part-id-table* 4812 init-specs 12 initial-valuef) 21845.334)
(spawn-with-cspace (-> this thruster-part) (-> this node-list data 24))
(spawn-with-cspace (-> this thruster-part) (-> this node-list data 25))
(spawn-with-cspace (-> this thruster-part) (-> this node-list data 32))
(spawn-with-cspace (-> this thruster-part) (-> this node-list data 33))
)
)
(when (not (and (-> this next-state) (= (-> this next-state name) 'recharge)))
(let ((v1-249 (the int (lerp-scale 0.0 128.0 (the float (- (current-time) (-> this shield-timer))) 0.0 600.0))))
(cond
((< 0.0 (-> this shield-hit-points))
(set! s5-9 (min 100 v1-249))
(set! (-> this shield-shattered) #f)
)
((< 16 v1-249)
(set! s5-9 128)
(when (not (-> this shield-shattered))
(set! (-> this 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) (-> this root trans quad))
(+! (-> s4-10 fountain-rand-transv-lo y) -12288.0)
(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 this
:stack-size #x8000
)
(dotimes (s3-4 6)
(let ((s1-2 (handle->process (-> this tentacles s3-4))))
(if s1-2
(process-spawn
joint-exploder
(art-group-get-by-name *level* "skel-squid-tentacle-shield" (the-as (pointer uint32) #f))
67
s4-10
*squid-tentacle-shield-exploder-params*
:to s1-2
)
)
)
)
)
)
)
(else
(set! s5-9 (- 16 v1-249))
)
)
)
(set! (-> this draw force-fade) (the-as uint s5-9))
(dotimes (s4-11 6)
(send-event (handle->process (-> this tentacles s4-11)) 'set-fade s5-9)
)
(let* ((f0-56 (lerp-scale 0.5 0.0 (the float (- (current-time) (-> this shield-timer))) 0.0 75.0))
(a0-147
(vector-float*! (new 'stack-no-clear 'vector) (-> this shield-color) (if (< 0.0 (-> this shield-hit-points))
f0-56
(- 1.0 f0-56)
)
)
)
)
(set! (-> a0-147 w) 1.0)
(set-shield-flash! a0-147)
)
(cond
((>= (-> this draw force-fade) (the-as uint 128))
(setup-masks (-> this draw) 0 8192)
(logclear! (-> this draw status) (draw-control-status warp-cross-fade))
)
(else
(setup-masks (-> this draw) 8192 0)
(logior! (-> this draw status) (draw-control-status warp-cross-fade))
)
)
)
(let ((v1-316 (handle->process (-> this hud))))
(when v1-316
(if (not (and (-> this next-state) (= (-> this next-state name) 'recharge)))
(set! (-> (the-as hud-squid v1-316) values 2 target) (the int (* 100.0 (-> this shield-hit-points))))
)
(cond
((and (zero? (-> this hit-points)) (< (-> this stage) 2))
(set! (-> (the-as hud-squid v1-316) values 0 target) (+ (-> this stage) 1))
(set! (-> (the-as hud-squid v1-316) values 1 target) 100)
)
(else
(set! (-> (the-as hud-squid v1-316) values 0 target) (-> this stage))
(set! (-> (the-as hud-squid v1-316) values 1 target) (/ (* 100 (-> this hit-points)) 10))
)
)
)
)
(set! (-> this allowed-rotate-to-vector-angle) (fabs (-> this desired-rotate-to-vector-angle)))
(none)
)
)
;; WARN: Return type mismatch (pointer process) vs (pointer squid-whirlwind).
(defmethod spawn-whirlwind ((this squid))
(let ((gp-0 (new 'stack-no-clear 'vector))
(s4-0 (squid-method-42 this (new 'stack-no-clear 'vector)))
)
(let ((s3-0 (new 'stack-no-clear 'vector)))
(send-event (handle->process (-> this tentacles 0)) 'get-joint-pos 13 gp-0)
(vector-! s4-0 s4-0 (-> this root trans))
(set! (-> s4-0 y) 0.0)
(vector-normalize! s4-0 1.0)
(vector+float*! s3-0 (-> this root trans) s4-0 16384.0)
)
(process-spawn squid-whirlwind gp-0 (-> this root trans) (-> this nav state mesh) s4-0 :to this)
)
)
(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 ((this 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) (-> this node-list data arg0)))
(v1-6 (-> arg1 target-position))
)
(set! (-> s4-1 ent) (-> this 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 this))
(set! (-> s4-1 owner-handle) (the-as handle #f))
(set! (-> s4-1 ignore-handle) (process->handle this))
(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) (seconds 4))
(vector-! (-> s4-1 vel) v1-6 a0-3)
)
(set! (-> arg1 grenade) (ppointer->handle (spawn-projectile squid-grenade s4-1 this *default-dead-pool*)))
)
(set! (-> arg1 show-it) #f)
(none)
)
(deftype squid-shot (guard-shot)
()
)
(defmethod play-impact-sound ((this 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)))
(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 status) (collide-status touch-actor))
(set! (-> arg0 hit-actor?) #t)
)
(go (method-of-object arg0 impact))
)
)
0
(none)
)
(defmethod init-proj-settings! ((this squid-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> this hit-actor?) #f)
(set! (-> this tail-pos quad) (-> this root trans quad))
(set! (-> this attack-mode) 'squid-shot)
(set! (-> this max-speed) 983040.0)
(set! (-> this move) squid-shot-move)
(set! (-> this update-velocity) projectile-update-velocity-space-wars)
(set! (-> this timeout) (seconds 0.417))
(logior! (-> this options) (projectile-options account-for-target-velocity))
(set-gravity-length (-> this root dynam) 573440.0)
(logior! (-> this options) (projectile-options respect-invinc-time))
(set! (-> this invinc-time) (seconds 3.5))
(none)
)
(defmethod draw-laser-sight ((this squid-shot))
"TODO - confirm If applicable, draw the laser sight particles"
(draw-beam (-> *part-id-table* 4861) (-> this tail-pos) (-> this starting-dir) #f #t)
(let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0))
(v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this 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 ((this squid-shot))
"Spawns associated particles with the projectile if applicable"
(let* ((gp-0 (-> this root trans))
(a1-0 (-> this 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)
(launch-particles (-> *part-id-table* 4858) s4-1)
(launch-particles (-> *part-id-table* 4859) s4-1)
)
(let ((s4-2 (new 'stack-no-clear 'matrix))
(f26-0 (/ f30-0 (meters 20)))
(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))
(launch-particles (-> *part-id-table* 4860) s4-2 :origin-is-matrix #t)
(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 ((this squid-shot))
"TODO - confirm"
(let* ((s3-0 (-> this root))
(s4-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this 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) (-> this 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) (-> this tail-pos) a2-1 #f #t)
)
(vector+! gp-0 gp-0 s4-0)
(part-tracker-spawn :to *entity-pool* :group group-squid-shot-hit :mat-joint gp-0)
)
0
(none)
)
(defmethod-mips2c "(method 53 squid)" 53 squid)