Files
jak-project/test/decompiler/reference/jak2/levels/under/jellyfish_REF.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

1457 lines
56 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type jellyfish-formation
(deftype jellyfish-formation (hover-formation)
()
)
;; definition for method 3 of type jellyfish-formation
(defmethod inspect ((this jellyfish-formation))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type hover-formation inspect)))
(t9-0 this)
)
(label cfg-4)
this
)
;; definition for method 15 of type jellyfish-formation
(defmethod hover-formation-method-15 ((this jellyfish-formation) (arg0 vector) (arg1 vector))
(logior! (-> this formation flags) 2)
0
)
;; definition of type jellyfish-chain-physics
(deftype jellyfish-chain-physics (chain-physics)
()
)
;; definition for method 3 of type jellyfish-chain-physics
(defmethod inspect ((this jellyfish-chain-physics))
(when (not this)
(set! this this)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" this (-> this type))
(format #t "~1Tchain-joints[20] @ #x~X~%" (-> this chain-joints))
(format #t "~1Tnum-joints: ~D~%" (-> this num-joints))
(format #t "~1Troot-joint-index: ~D~%" (-> this root-joint-index))
(format #t "~1Tjoint-length: ~f~%" (-> this joint-length))
(format #t "~1Tgravity: #<vector @ #x~X>~%" (-> this gravity))
(format #t "~1Tgravity-target: #<vector @ #x~X>~%" (-> this gravity-target))
(format #t "~1Tstretch-vel: ~f~%" (-> this stretch-vel))
(format #t "~1Tstretch-vel-parallel: ~f~%" (-> this stretch-vel-parallel))
(format #t "~1Tcompress-vel: ~f~%" (-> this compress-vel))
(format #t "~1Tcompress-vel-parallel: ~f~%" (-> this compress-vel-parallel))
(format #t "~1Tnegate-y: ~A~%" (-> this negate-y))
(format #t "~1Taxial-slop: ~f~%" (-> this axial-slop))
(format #t "~1Tmaximum-stretch: ~f~%" (-> this maximum-stretch))
(format #t "~1Tturn-off-start: ~D~%" (-> this turn-off-start))
(format #t "~1Tturn-off-duration: ~D~%" (-> this turn-off-duration))
(label cfg-4)
this
)
;; definition for method 13 of type jellyfish-chain-physics
;; WARN: Return type mismatch int vs none.
(defmethod apply-gravity ((this jellyfish-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable))
(vector-float*!
arg0
(-> this gravity)
(* 4096.0 (-> self clock time-adjust-ratio) (lerp-scale 0.01 0.1 (the float arg1) 0.0 5.0))
)
(vector+float*! arg0 arg0 (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* arg1 64))) 0.2)
0
(none)
)
;; definition for method 14 of type jellyfish-chain-physics
;; WARN: Return type mismatch int vs none.
(defmethod chain-physics-method-14 ((this jellyfish-chain-physics) (arg0 vector) (arg1 int))
(vector-float*!
arg0
(the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ arg1 1) 64)))
(lerp-scale 0.1 0.9 (the float arg1) 0.0 5.0)
)
0
(none)
)
;; definition for method 16 of type jellyfish-chain-physics
(defmethod chain-physics-method-16 ((this jellyfish-chain-physics) (arg0 int))
(if (zero? arg0)
0.0
5461.3335
)
)
;; definition for method 12 of type jellyfish-chain-physics
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod gravity-update ((this jellyfish-chain-physics) (arg0 process-drawable))
((method-of-type chain-physics gravity-update) this arg0)
(let ((gp-0 (new 'stack-no-clear 'collide-query)))
(let ((s5-0 (new 'stack-no-clear 'bounding-box)))
(let ((s4-0 (new 'stack-no-clear 'sphere)))
(set! (-> s4-0 quad) (-> (the-as collide-shape-moving (-> arg0 root)) root-prim prim-core world-sphere quad))
(vector+float*!
(the-as vector s4-0)
(the-as vector s4-0)
(vector-y-quaternion! (new 'stack-no-clear 'vector) (-> arg0 root quat))
-14336.0
)
(set! (-> s4-0 r) 12288.0)
(set-from-sphere! s5-0 s4-0)
)
(set! (-> gp-0 collide-with) (collide-spec backgnd))
(set! (-> gp-0 ignore-process0) #f)
(set! (-> gp-0 ignore-process1) #f)
(set! (-> gp-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> gp-0 action-mask) (collide-action solid))
(mem-copy! (the-as pointer (-> gp-0 bbox)) (the-as pointer s5-0) 32)
)
(fill-using-bounding-box *collide-cache* gp-0)
)
0
(none)
)
;; definition for method 17 of type jellyfish-chain-physics
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod chain-physics-method-17 ((this jellyfish-chain-physics) (arg0 vector) (arg1 int))
(local-vars (v1-26 float))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(init-vf0-vector)
(let* ((s5-0 (new 'stack-no-clear 'collide-query))
(v1-2 (-> this chain-joints arg1))
(s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> v1-2 position)))
(s3-0 0)
)
(set! (-> arg0 quad) (-> v1-2 position quad))
(until (or (< 6 s3-0) (begin
(.lvf vf1 (&-> s4-1 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-26 vf1)
(< v1-26 (square 409.6))
)
)
(+! s3-0 1)
(set! (-> s5-0 start-pos quad) (-> arg0 quad))
(set! (-> s5-0 move-dist quad) (-> s4-1 quad))
(let ((v1-7 s5-0))
(set! (-> v1-7 radius) 1228.8)
(set! (-> v1-7 collide-with) (collide-spec backgnd))
(set! (-> v1-7 ignore-process0) #f)
(set! (-> v1-7 ignore-process1) #f)
(set! (-> v1-7 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> v1-7 action-mask) (collide-action solid))
)
(set! (-> s5-0 num-spheres) (the-as uint #f))
(let ((f0-1 (probe-using-line-sphere *collide-cache* s5-0)))
(cond
((>= f0-1 0.0)
(let ((f0-2 (fmin 1.0 f0-1)))
(vector+float*! arg0 arg0 s4-1 f0-2)
(vector-float*! s4-1 s4-1 (- 1.0 f0-2))
)
(let ((f0-5 (vector-dot s4-1 (-> s5-0 best-other-tri normal))))
(vector--float*! s4-1 s4-1 (-> s5-0 best-other-tri normal) (* 1.2 f0-5))
)
)
(else
(vector+! arg0 arg0 s4-1)
(goto cfg-11)
)
)
)
)
)
(label cfg-11)
0
(none)
)
)
;; definition of type jellyfish
(deftype jellyfish (hover-enemy)
((los los-control :inline)
(sync sync-eased :inline)
(sound-id sound-id)
(path-player-u float)
(path-my-u float)
(path-y-offset float)
(path-stare-u float)
(tentacle-clock float)
(tentacle-blend float)
(last-attack-time time-frame)
(last-fire-time time-frame)
(charge-path-timer time-frame)
(tentacles jellyfish-chain-physics 5)
(tentacles-initialized symbol)
(stare-pos vector :inline)
(charge-pos vector :inline)
(grab-front symbol)
(grab-offset vector :inline)
(grab-start-pos vector :inline)
(grab-start-quat quaternion :inline)
(focus-rot quaternion :inline)
(attach-lerp float)
)
(:state-methods
jellyfish-state-156
threaten
charge-attack
grab-mech
die-now
)
(:methods
(jellyfish-method-161 (_type_ vector float) vector)
(jellyfish-method-162 (_type_) symbol)
(jellyfish-method-163 (_type_ process-focusable) symbol)
(jellyfish-method-164 (_type_ process-focusable) symbol)
)
)
;; definition for method 3 of type jellyfish
(defmethod inspect ((this jellyfish))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type hover-enemy inspect)))
(t9-0 this)
)
(format #t "~2Tlos: #<los-control @ #x~X>~%" (-> this los))
(format #t "~2Tsync: #<sync-eased @ #x~X>~%" (-> this sync))
(format #t "~2Tsound-id: ~D~%" (-> this sound-id))
(format #t "~2Tpath-player-u: ~f~%" (-> this path-player-u))
(format #t "~2Tpath-my-u: ~f~%" (-> this path-my-u))
(format #t "~2Tpath-y-offset: ~f~%" (-> this path-y-offset))
(format #t "~2Tpath-stare-u: ~f~%" (-> this path-stare-u))
(format #t "~2Ttentacle-clock: ~f~%" (-> this tentacle-clock))
(format #t "~2Ttentacle-blend: ~f~%" (-> this tentacle-blend))
(format #t "~2Tlast-attack-time: ~D~%" (-> this last-attack-time))
(format #t "~2Tlast-fire-time: ~D~%" (-> this last-fire-time))
(format #t "~2Tcharge-path-timer: ~D~%" (-> this charge-path-timer))
(format #t "~2Ttentacles[5] @ #x~X~%" (-> this tentacles))
(format #t "~2Ttentacles-initialized: ~A~%" (-> this tentacles-initialized))
(format #t "~2Tstare-pos: #<vector @ #x~X>~%" (-> this stare-pos))
(format #t "~2Tcharge-pos: #<vector @ #x~X>~%" (-> this charge-pos))
(format #t "~2Tgrab-front: ~A~%" (-> this grab-front))
(format #t "~2Tgrab-offset: #<vector @ #x~X>~%" (-> this grab-offset))
(format #t "~2Tgrab-start-pos: #<vector @ #x~X>~%" (-> this grab-start-pos))
(format #t "~2Tgrab-start-quat: #<quaternion @ #x~X>~%" (-> this grab-start-quat))
(format #t "~2Tfocus-rot: #<quaternion @ #x~X>~%" (-> this focus-rot))
(format #t "~2Tattach-lerp: ~f~%" (-> this attach-lerp))
(label cfg-4)
this
)
;; definition for symbol *jellyfish-mech-reserved*, type symbol
(define *jellyfish-mech-reserved* #f)
;; definition of type jellyfish-joint-mod-tentacle-info
(deftype jellyfish-joint-mod-tentacle-info (structure)
((axis vector :inline)
(angle float)
(period float)
(offset float)
)
)
;; definition for method 3 of type jellyfish-joint-mod-tentacle-info
(defmethod inspect ((this jellyfish-joint-mod-tentacle-info))
(when (not this)
(set! this this)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" this 'jellyfish-joint-mod-tentacle-info)
(format #t "~1Taxis: #<vector @ #x~X>~%" (-> this axis))
(format #t "~1Tangle: ~f~%" (-> this angle))
(format #t "~1Tperiod: ~f~%" (-> this period))
(format #t "~1Toffset: ~f~%" (-> this offset))
(label cfg-4)
this
)
;; failed to figure out what this is:
(defskelgroup skel-jellyfish jellyfish jellyfish-lod0-jg jellyfish-idle-ja
((jellyfish-lod0-mg (meters 999999)))
:bounds (static-spherem 0 -1.8 0 5)
)
;; definition for symbol *jellyfish-mainvein-chain-setup*, type (array chain-physics-setup)
(define *jellyfish-mainvein-chain-setup* (new 'static 'boxed-array :type chain-physics-setup
(new 'static 'chain-physics-setup :joint-index 11)
(new 'static 'chain-physics-setup :joint-index 12)
(new 'static 'chain-physics-setup :joint-index 13)
(new 'static 'chain-physics-setup :joint-index 14)
(new 'static 'chain-physics-setup :joint-index 15)
)
)
;; definition for symbol *jellyfish-lfront-chain-setup*, type (array chain-physics-setup)
(define *jellyfish-lfront-chain-setup* (new 'static 'boxed-array :type chain-physics-setup
(new 'static 'chain-physics-setup :joint-index 17)
(new 'static 'chain-physics-setup :joint-index 18)
(new 'static 'chain-physics-setup :joint-index 19)
(new 'static 'chain-physics-setup :joint-index 20)
)
)
;; definition for symbol *jellyfish-rfront-chain-setup*, type (array chain-physics-setup)
(define *jellyfish-rfront-chain-setup* (new 'static 'boxed-array :type chain-physics-setup
(new 'static 'chain-physics-setup :joint-index 22)
(new 'static 'chain-physics-setup :joint-index 23)
(new 'static 'chain-physics-setup :joint-index 24)
(new 'static 'chain-physics-setup :joint-index 25)
)
)
;; definition for symbol *jellyfish-lrear-chain-setup*, type (array chain-physics-setup)
(define *jellyfish-lrear-chain-setup* (new 'static 'boxed-array :type chain-physics-setup
(new 'static 'chain-physics-setup :joint-index 27)
(new 'static 'chain-physics-setup :joint-index 28)
(new 'static 'chain-physics-setup :joint-index 29)
(new 'static 'chain-physics-setup :joint-index 30)
)
)
;; definition for symbol *jellyfish-rrear-chain-setup*, type (array chain-physics-setup)
(define *jellyfish-rrear-chain-setup* (new 'static 'boxed-array :type chain-physics-setup
(new 'static 'chain-physics-setup :joint-index 32)
(new 'static 'chain-physics-setup :joint-index 33)
(new 'static 'chain-physics-setup :joint-index 34)
(new 'static 'chain-physics-setup :joint-index 35)
)
)
;; definition for symbol *jellyfish-enemy-info*, type enemy-info
(define *jellyfish-enemy-info* (new 'static 'enemy-info
:use-die-falling #t
:use-victory #f
:use-jump-blocked #f
:debug-draw-neck #f
:jump-debug-draw #f
:move-to-ground #f
:hover-if-no-ground #f
:idle-anim-script #f
:idle-anim 2
:notice-anim 2
:hostile-anim 2
:hit-anim 2
:knocked-anim 2
:knocked-land-anim 2
:die-anim 3
:die-falling-anim 3
:victory-anim 2
:jump-wind-up-anim -1
:jump-in-air-anim -1
:jump-land-anim -1
:neck-joint 36
:look-at-joint 3
:bullseye-joint 3
:sound-hit (static-sound-name "jellyfish-hit")
:sound-die (static-sound-name "jellyfish-die")
:notice-distance (meters 45)
:notice-distance-delta (meters 4)
:proximity-notice-distance (meters 20)
:default-hit-points 1
:gnd-collide-with (collide-spec backgnd)
:overlaps-others-collide-with-filter (collide-spec jak bot player-list)
:movement-gravity (meters -100)
:friction 0.8
:attack-shove-back (meters 3)
:attack-shove-up (meters 2)
:attack-mode 'generic
:attack-damage 2
:jump-height-min (meters 3)
:jump-height-factor 0.5
:knocked-seek-ry-clamp 2730.6667
:knocked-soft-vxz-lo 72089.6
:knocked-soft-vxz-hi 108134.4
:knocked-soft-vy-lo 81920.0
:knocked-soft-vy-hi 122880.0
:knocked-medium-vxz-lo 28672.0
:knocked-medium-vxz-hi 65536.0
:knocked-medium-vy-lo 12288.0
:knocked-medium-vy-hi 36864.0
:knocked-hard-vxz-lo 78643.2
:knocked-hard-vxz-hi 117964.8
:knocked-hard-vy-lo 183500.8
:knocked-hard-vy-hi 209715.2
:knocked-huge-vxz-lo 164659.2
:knocked-huge-vxz-hi 249036.8
:knocked-huge-vy-lo 183500.8
:knocked-huge-vy-hi 217907.2
:knocked-yellow-vxz-lo 40960.0
:knocked-yellow-vxz-hi 49152.0
:knocked-yellow-vy-lo 57344.0
:knocked-yellow-vy-hi 81920.0
:knocked-red-vxz-lo 24576.0
:knocked-red-vxz-hi 196608.0
:knocked-red-vy-lo 94208.0
:knocked-red-vy-hi 151552.0
:knocked-blue-vxz-lo 40960.0
:knocked-blue-vxz-hi 49152.0
:knocked-blue-vy-lo 24576.0
:knocked-blue-vy-hi 81920.0
:shadow-size (meters 2)
:shadow-max-y (meters 10)
:shadow-min-y (meters -20)
:shadow-locus-dist (meters 150)
:gem-joint 36
:gem-seg #x2
:gem-no-seg #x4
:gem-offset (new 'static 'sphere :y -409.6 :z 4751.36 :r 163840.0)
)
)
;; failed to figure out what this is:
(set! (-> *jellyfish-enemy-info* fact-defaults) *fact-info-enemy-defaults*)
;; definition for method 151 of type jellyfish
(defmethod hover-enemy-method-151 ((this jellyfish))
(new 'static 'hover-enemy-info
:fly-forward-anim 2
:fly-backward-anim 2
:fly-left-anim 2
:fly-right-anim 2
:shoot-anim 2
:main-joint 3
:gun-base 40
:engine-left -1
:engine-right -1
)
)
;; definition for method 152 of type jellyfish
(defmethod hover-enemy-method-152 ((this jellyfish))
(new 'static 'hover-nav-params :max-speed 32768.0 :max-acceleration 24576.0 :friction 0.8)
)
;; failed to figure out what this is:
(defstate active (jellyfish)
:virtual #t
:enter (behavior ()
(let ((gp-1 (jellyfish-method-161 self (new 'stack-no-clear 'vector) (get-norm! (-> self sync) 0)))
(v1-6 (jellyfish-method-161
self
(new 'stack-no-clear 'vector)
(get-norm! (-> self sync) (the-as int (+ (current-time) (seconds 1))))
)
)
(s5-2 (new 'stack-no-clear 'vector))
)
(vector-! s5-2 v1-6 gp-1)
(vector-normalize! s5-2 1.0)
(hover-nav-control-method-10 (-> self hover) gp-1 s5-2 (the-as vector #t))
)
(set! (-> self restart-fly-anims) #t)
)
:trans (behavior ()
(local-vars (a0-8 vector) (gp-2 vector))
(seek! (-> self tentacle-blend) 1.0 (seconds-per-frame))
(hover-nav-control-method-11
(-> self hover)
(jellyfish-method-161 self (new 'stack-no-clear 'vector) (get-norm! (-> self sync) 0))
)
(when (and (jellyfish-method-164 self (the-as process-focusable #f))
(begin
(set! gp-2 (jellyfish-method-161 self (new 'stack-no-clear 'vector) (get-norm! (-> self sync) 0)))
(set! a0-8 (jellyfish-method-161 self (new 'stack-no-clear 'vector) (-> self path-player-u)))
(-> self focus-pos)
(< (fabs (- (-> self root trans y) (-> gp-2 y))) 8192.0)
)
(< (vector-vector-xz-distance a0-8 gp-2) 16384.0)
)
(set! (-> self path-stare-u) (get-norm! (-> self sync) 0))
(go-virtual stare)
)
)
:code hover-enemy-fly-code
:post (behavior ()
(debug-draw (-> self path))
(hover-enemy-dest-post)
)
)
;; failed to figure out what this is:
(defstate stare (jellyfish)
:virtual #t
:enter (behavior ()
(let ((t9-1 (-> (the-as (state enemy) (find-parent-state)) enter)))
(if t9-1
(t9-1)
)
)
(jellyfish-method-161 self (-> self stare-pos) (-> self path-stare-u))
(+! (-> self stare-pos y) -32768.0)
(let ((gp-0 (new 'stack-no-clear 'collide-query)))
(set! (-> gp-0 start-pos quad) (-> self stare-pos quad))
(+! (-> gp-0 start-pos y) 8192.0)
(set-vector! (-> gp-0 move-dist) 0.0 -81920.0 0.0 0.0)
(let ((v1-8 gp-0))
(set! (-> v1-8 radius) 819.2)
(set! (-> v1-8 collide-with) (collide-spec backgnd))
(set! (-> v1-8 ignore-process0) self)
(set! (-> v1-8 ignore-process1) #f)
(set! (-> v1-8 ignore-pat) (-> self root pat-ignore-mask))
(set! (-> v1-8 action-mask) (collide-action solid))
)
(if (>= (fill-and-probe-using-line-sphere *collide-cache* gp-0) 0.0)
(set! (-> self stare-pos y) (fmax (-> self stare-pos y) (+ 24576.0 (-> gp-0 best-other-tri intersect y))))
)
)
(set! (-> self charge-path-timer) 0)
(look-at-target! self (enemy-flag look-at-focus))
)
:trans (behavior ()
(local-vars (gp-0 vector))
(seek! (-> self tentacle-blend) 1.0 (seconds-per-frame))
(when (time-elapsed? (-> self state-time) (seconds 0.1))
(let ((v1-4 (-> self focus aware)))
(cond
((>= 1 (the-as int v1-4))
(go-virtual active)
)
((= v1-4 (enemy-aware unaware))
(go-flee self)
)
)
)
(if (and (time-elapsed? (-> self state-time) (seconds 2))
(not (jellyfish-method-164 self (the-as process-focusable #f)))
)
(go-virtual active)
)
(if (and (not *jellyfish-mech-reserved*)
(time-elapsed? (-> self state-time) (seconds 1))
(jellyfish-method-163 self (the-as process-focusable #f))
(begin
(set! gp-0 (jellyfish-method-161 self (new 'stack-no-clear 'vector) (-> self path-stare-u)))
(< (vector-vector-xz-distance (-> self root trans) gp-0) 12288.0)
)
(< (fabs (- (-> self root trans y) (-> gp-0 y))) 40960.0)
)
(go-virtual threaten)
)
)
)
:post (behavior ()
(hover-nav-control-method-11 (-> self hover) (-> self stare-pos))
(hover-enemy-dest-post)
)
)
;; failed to figure out what this is:
(defstate threaten (jellyfish)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(set! *jellyfish-mech-reserved* #t)
)
:exit (behavior ()
(set! *jellyfish-mech-reserved* #f)
)
:trans (behavior ()
(seek! (-> self tentacle-blend) 0.0 (seconds-per-frame))
)
:code (behavior ()
(set! (-> self restart-fly-anims) #t)
(ja-channel-push! 1 (seconds 0.1))
(ja-no-eval :group! jellyfish-notice-ja :num! (seek! max 1.4) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max 1.4))
)
(let ((gp-0 (handle->process (-> self focus handle)))
(s5-0 (-> self root trans))
)
(cond
((not (jellyfish-method-163 self (the-as process-focusable gp-0)))
(go-virtual stare)
)
((< (vector-vector-distance s5-0 (get-trans (the-as process-focusable gp-0) 3)) 20480.0)
(go-virtual grab-mech)
)
((jellyfish-method-162 self)
(go-virtual charge-attack)
)
(else
(go-virtual stare)
)
)
)
)
:post (behavior ()
(hover-nav-control-method-11 (-> self hover) (the-as vector #f))
(hover-enemy-dest-post)
)
)
;; failed to figure out what this is:
(defstate charge-attack (jellyfish)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(set! *jellyfish-mech-reserved* #t)
(look-at-target! self (enemy-flag look-at-move-dest))
(hover-nav-control-method-14 (-> self hover) 8.0 10.0)
(hover-nav-control-method-10
(-> self hover)
(-> self charge-pos)
(vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> self charge-pos) (-> self root trans)) 1.0)
(the-as vector #t)
)
(logior! (-> self focus-status) (focus-status dangerous))
(set-time! (-> self state-time))
)
:exit (behavior ()
(hover-nav-control-method-14 (-> self hover) 1.0 1.0)
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(hover-nav-control-method-20 (-> self hover))
(set! *jellyfish-mech-reserved* #f)
)
:trans (behavior ()
(let ((gp-0 (-> self root trans)))
(if (< (vector-vector-distance gp-0 (-> self charge-pos)) 16384.0)
(go-virtual threaten)
)
(let ((s5-0 (handle->process (-> self focus handle))))
(cond
((not (jellyfish-method-163 self (the-as process-focusable s5-0)))
(go-virtual stare)
)
((< (vector-vector-distance gp-0 (get-trans (the-as process-focusable s5-0) 3)) 20480.0)
(go-virtual grab-mech)
)
)
)
)
)
:code (behavior ()
(ja-no-eval :group! jellyfish-notice-charge-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(until #f
(ja-no-eval :group! jellyfish-notice-charge-loop-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
#f
)
:post (behavior ()
(let* ((gp-0 (-> self root trans))
(s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self charge-pos) gp-0))
)
(let* ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) gp-0))
(f30-0 (vector-length s5-1))
(f28-0 (vector-length s4-1))
)
(let ((s3-0 (new 'stack-no-clear 'quaternion)))
(vector-normalize! s5-1 1.0)
(vector-normalize! s4-1 1.0)
(quaternion-from-two-vectors-partial! s3-0 s5-1 s4-1 (* 8.0 (seconds-per-frame)))
(vector-orient-by-quat! s5-1 s5-1 s3-0)
)
(vector-normalize! s5-1 (fmin f30-0 (+ 16384.0 f28-0)))
)
(vector+! (-> self charge-pos) gp-0 s5-1)
)
(hover-nav-control-method-11 (-> self hover) (-> self charge-pos))
(hover-enemy-dest-post)
)
)
;; failed to figure out what this is:
(defstate grab-mech (jellyfish)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(set! *jellyfish-mech-reserved* #t)
(set! (-> self attach-lerp) 0.0)
(let ((gp-0 *target*))
(if (and gp-0 (focus-test? gp-0 mech) (not (logtest? (-> gp-0 focus-status) (focus-status dead ignore))))
(set! (-> self grab-front) (< (vector-dot
(vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))
(-> gp-0 manipy 0 node-list data 3 bone transform vector 2)
)
0.0
)
)
)
)
)
:exit (behavior ()
(sound-stop (-> self sound-id))
(hover-enemy-method-147 self)
(let ((v1-3 (-> self root root-prim)))
(set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as))
(set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with))
)
(dotimes (gp-0 3)
(initialize-chain-joints (-> self tentacles gp-0))
)
(set! *jellyfish-mech-reserved* #f)
)
:trans (behavior ()
(let ((gp-0 *target*))
(cond
((not (jellyfish-method-163 self gp-0))
(set-time! (-> self last-attack-time))
(go-virtual active)
)
(else
(let ((gp-1 (-> gp-0 manipy 0 node-list data 3)))
(vector<-cspace! (-> self focus-pos) gp-1)
(matrix-with-scale->quaternion (-> self focus-rot) (-> gp-1 bone transform))
)
)
)
)
)
:code (behavior ()
(dotimes (gp-0 3)
(turn-off (-> self tentacles gp-0) (seconds 0.93))
)
(ja-channel-push! 1 (seconds 0.1))
(set-vector! (-> self grab-offset) 0.0 14336.0 0.0 0.0)
(set! (-> self grab-start-pos quad) (-> self root trans quad))
(quaternion-copy! (-> self grab-start-quat) (-> self root quat))
(ja-no-eval :group! jellyfish-grab-start-ja :num! (seek! max 1.2) :frame-num 0.0)
(until (ja-done? 0)
(set! (-> self attach-lerp) (lerp-scale 0.0 1.0 (ja-aframe-num 0) 0.0 14.0))
(suspend)
(ja :num! (seek! max 1.2))
)
(let ((v1-34 (-> self root root-prim)))
(set! (-> v1-34 prim-core collide-as) (collide-spec))
(set! (-> v1-34 prim-core collide-with) (collide-spec))
)
0
(if (-> self grab-front)
(set-vector! (-> self grab-offset) 0.0 9179.136 -3682.304 0.0)
(set-vector! (-> self grab-offset) 0.0 9179.136 4354.048 0.0)
)
(set! (-> self grab-start-pos quad) (-> self root trans quad))
(quaternion-copy! (-> self grab-start-quat) (-> self root quat))
(ja-no-eval :group! jellyfish-grab-attach-ja :num! (seek! max 1.2) :frame-num 0.0)
(until (ja-done? 0)
(set! (-> self attach-lerp) (lerp-scale 0.0 1.0 (ja-aframe-num 0) 14.0 23.0))
(suspend)
(ja :num! (seek! max 1.2))
)
(set! (-> self grab-start-pos quad) (-> self root trans quad))
(quaternion-copy! (-> self grab-start-quat) (-> self root quat))
(send-event
*target*
'shove
#f
(static-attack-info ((id (new-attack-id)) (shove-up (meters 3)) (shove-back (meters 0)) (mode 'shock)))
)
(let ((gp-3 *target*))
(dotimes (s5-2 2)
(ja-no-eval :group! jellyfish-grab-attach-loop-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(if (and gp-3 (focus-test? gp-3 mech) (not (logtest? (-> gp-3 focus-status) (focus-status dead ignore))))
(send-event
gp-3
'attack
#f
(static-attack-info ((id (new-attack-id)) (mode 'shock) (intersection (-> self root trans))))
)
)
(sound-play "squid-attack" :id (-> self sound-id))
(suspend)
(ja :num! (seek!))
)
)
)
(sound-stop (-> self sound-id))
(set-vector! (-> self grab-offset) 0.0 20480.0 0.0 0.0)
(set! (-> self grab-start-pos quad) (-> self root trans quad))
(quaternion-copy! (-> self grab-start-quat) (-> self root quat))
(dotimes (gp-4 3)
(initialize-chain-joints (-> self tentacles gp-4))
)
(ja-no-eval :group! jellyfish-grab-detach-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(set! (-> self attach-lerp) (lerp-scale 0.0 1.0 (ja-aframe-num 0) 48.0 65.0))
(suspend)
(ja :num! (seek!))
)
(set-time! (-> self last-attack-time))
(go-virtual active)
)
:post (behavior ()
(let ((gp-0 (new 'stack-no-clear 'vector)))
(set! (-> gp-0 quad) (-> self grab-offset quad))
(let ((s5-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self focus-rot))))
(vector-orient-by-quat! gp-0 gp-0 s5-0)
(vector+! gp-0 (-> self focus-pos) gp-0)
(if (-> self grab-front)
(quaternion-rotate-y! s5-0 s5-0 32768.0)
)
(vector-lerp! (-> self root trans) (-> self grab-start-pos) gp-0 (-> self attach-lerp))
(quaternion-slerp! (-> self root quat) (-> self grab-start-quat) s5-0 (-> self attach-lerp))
)
)
(enemy-simple-post)
)
)
;; failed to figure out what this is:
(defstate die (jellyfish)
:virtual #t
:event enemy-event-handler
:code (behavior ()
(dying self)
(logclear! (-> self focus-status) (focus-status dangerous))
(enemy-method-52 self (-> self root transv))
(let ((gp-0 (current-time)))
(ja-no-eval :group! jellyfish-die-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(let ((s5-0 (ja-group))
(f0-4 (ja-aframe-num 0))
)
(when (and (= s5-0 jellyfish-die-ja) (>= f0-4 0.0) (>= 0.5 f0-4))
(when (time-elapsed? gp-0 (seconds 0.05))
(process-drawable-shock-skel-effect
self
(-> *lightning-spec-id-table* 5)
lightning-probe-callback
(-> *part-id-table* 166)
2048.0
-1
-1
)
(set! gp-0 (current-time))
)
)
)
(suspend)
(ja :num! (seek!))
)
)
(let ((v1-52 (-> self root root-prim)))
(set! (-> v1-52 prim-core collide-as) (collide-spec))
(set! (-> v1-52 prim-core collide-with) (collide-spec))
)
0
(logior! (-> self draw status) (draw-control-status no-draw))
(send-event self 'death-end)
(while (-> self child)
(suspend)
)
(cleanup-for-death self)
)
:post enemy-falling-post
)
;; failed to figure out what this is:
(defstate die-now (jellyfish)
:virtual #t
:event enemy-event-handler
:code (behavior ()
(dying self)
(let ((v1-3 (-> self root root-prim)))
(set! (-> v1-3 prim-core collide-as) (collide-spec))
(set! (-> v1-3 prim-core collide-with) (collide-spec))
)
0
(logior! (-> self draw status) (draw-control-status no-draw))
(ja-no-eval :group! jellyfish-die-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(send-event self 'death-end)
(while (-> self child)
(suspend)
)
(cleanup-for-death self)
)
)
;; definition for method 74 of type jellyfish
(defmethod general-event-handler ((this jellyfish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
"Handles various events for the enemy
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
(case arg2
(('hit 'hit-knocked)
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> this enemy-flags) (enemy-flag alert))
(logior! (-> this focus-status) (focus-status hit))
(if (zero? (-> this hit-points))
(logior! (-> this focus-status) (focus-status dead))
)
(logclear! (-> this enemy-flags) (enemy-flag lock-focus))
(enemy-method-62 this)
(logior! (-> this enemy-flags) (enemy-flag lock-focus))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(go (method-of-object this die))
#t
)
(else
((method-of-type hover-enemy general-event-handler) this arg0 arg1 arg2 arg3)
)
)
)
;; definition for method 161 of type jellyfish
(defmethod jellyfish-method-161 ((this jellyfish) (arg0 vector) (arg1 float))
(get-point-in-path! (-> this path) arg0 arg1 'interp)
(+! (-> arg0 y) (-> this path-y-offset))
arg0
)
;; definition for method 164 of type jellyfish
;; WARN: Return type mismatch object vs symbol.
(defmethod jellyfish-method-164 ((this jellyfish) (arg0 process-focusable))
(local-vars (v1-10 object))
(jellyfish-method-161 this (new 'stack-no-clear 'vector) (get-norm! (-> this sync) 0))
(let ((s5-1 (jellyfish-method-161 this (new 'stack-no-clear 'vector) (-> this path-player-u)))
(gp-1 (-> this focus-pos))
)
(-> this root trans)
(the-as
symbol
(and (and (if arg0
arg0
(handle->process (-> this focus handle))
)
(focus-test?
(the-as process-focusable (if arg0
arg0
(handle->process (-> this focus handle))
)
)
mech
)
(begin
(let ((v1-13 #t))
(set! arg0 (cond
(arg0
(empty)
arg0
)
(else
(the-as process-focusable (handle->process (-> this focus handle)))
)
)
)
(let ((a0-18 (the-as focus-status (logand (-> arg0 focus-status) (focus-status dead ignore)))))
(cmove-#f-nonzero v1-10 a0-18 v1-13)
)
)
v1-10
)
)
(< (vector-vector-xz-distance s5-1 gp-1) 122880.0)
(< (fabs (- (-> s5-1 y) (-> gp-1 y))) 65536.0)
)
)
)
)
;; definition for method 163 of type jellyfish
;; WARN: Return type mismatch object vs symbol.
(defmethod jellyfish-method-163 ((this jellyfish) (arg0 process-focusable))
(local-vars (v1-8 object))
(jellyfish-method-161 this (new 'stack-no-clear 'vector) (-> this path-stare-u))
(let ((s5-0 (-> this focus-pos)))
(-> this root trans)
(the-as
symbol
(and (and (if arg0
arg0
(handle->process (-> this focus handle))
)
(focus-test?
(the-as process-focusable (if arg0
arg0
(handle->process (-> this focus handle))
)
)
mech
)
(begin
(let ((v1-11 #t))
(set! arg0 (cond
(arg0
(empty)
arg0
)
(else
(the-as process-focusable (handle->process (-> this focus handle)))
)
)
)
(let ((a0-16 (the-as focus-status (logand (-> arg0 focus-status) (focus-status dead ignore)))))
(cmove-#f-nonzero v1-8 a0-16 v1-11)
)
)
v1-8
)
)
(< (vector-vector-xz-distance s5-0 (-> this stare-pos)) 81920.0)
(< (fabs (- (-> s5-0 y) (-> this stare-pos y))) 32768.0)
)
)
)
)
;; definition for method 162 of type jellyfish
;; INFO: Used lq/sq
(defmethod jellyfish-method-162 ((this jellyfish))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
)
(init-vf0-vector)
(let* ((s5-0 (-> this root trans))
(s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) s5-0))
(s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-1 1.0))
(f0-0 (vector-length s3-1))
(f28-0 (+ 16384.0 f0-0))
)
(vector-normalize! s3-1 f28-0)
(vector+! (-> this charge-pos) s5-0 s3-1)
(let ((f30-0 f28-0)
(f28-1 (/ f28-0 (meters 10)))
(s3-2 0)
(s2-0 (new 'stack-no-clear 'vector))
(s1-0 (new 'stack-no-clear 'vector))
(s0-0 (new 'stack-no-clear 'collide-query))
(f26-0 40960.0)
(sv-624 0)
)
(while (< sv-624 (the int f28-1))
(let ((a2-1 s2-0))
(let ((v1-9 s5-0)
(a0-6 s4-0)
(a1-2 s3-2)
)
(.lvf vf2 (&-> a0-6 quad))
(.lvf vf1 (&-> v1-9 quad))
(.mov vf3 a1-2)
)
(.add.x.vf.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.svf (&-> a2-1 quad) vf4)
)
(when (> sv-624 0)
(set! (-> s0-0 start-pos quad) (-> s1-0 quad))
(vector-! (-> s0-0 move-dist) s2-0 s1-0)
(let ((v1-14 s0-0))
(set! (-> v1-14 radius)
(-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0 local-sphere w)
)
(set! (-> v1-14 collide-with) (collide-spec backgnd enemy obstacle hit-by-others-list))
(set! (-> v1-14 ignore-process0) this)
(set! (-> v1-14 ignore-process1) #f)
(set! (-> v1-14 ignore-pat) (-> this root pat-ignore-mask))
(set! (-> v1-14 action-mask) (collide-action solid))
)
(if (>= (fill-and-probe-using-line-sphere *collide-cache* s0-0) 0.0)
(return #f)
)
)
(set! (-> s1-0 quad) (-> s2-0 quad))
(set! f30-0 (fmax 0.0 (+ -40960.0 f30-0)))
(+! s3-2 (the int (fmin 40960.0 f30-0)))
(set! f26-0 (+ -4915.2 f26-0))
(+! sv-624 1)
)
)
)
#t
)
)
;; definition for function jellyfish-joint-mod-tentacle
(defun jellyfish-joint-mod-tentacle ((arg0 cspace) (arg1 transformq))
(let* ((s4-0 (-> arg0 param1))
(s3-0 (the-as structure (-> arg0 param2)))
(f0-0 4.0)
(t9-0 sin)
(f1-0 65536.0)
(f2-1
(+ (-> (the-as jellyfish s4-0) tentacle-clock) (-> (the-as jellyfish-joint-mod-tentacle-info s3-0) offset))
)
(f0-4 (* (t9-0 (* f1-0 (/ (- f2-1 (* (the float (the int (/ f2-1 f0-0))) f0-0)) f0-0)))
(-> (the-as jellyfish-joint-mod-tentacle-info s3-0) angle)
)
)
(s2-0 (new 'stack-no-clear 'quaternion))
)
(let ((a2-1 (quaternion-vector-angle!
(new 'stack-no-clear 'quaternion)
(-> (the-as jellyfish-joint-mod-tentacle-info s3-0) axis)
f0-4
)
)
)
(quaternion-normalize! (quaternion*! s2-0 (-> arg1 quat) a2-1))
)
(quaternion-slerp! (-> arg1 quat) (-> arg1 quat) s2-0 (-> (the-as jellyfish s4-0) tentacle-blend))
)
(cspace<-parented-transformq-joint! arg0 arg1)
(none)
)
;; definition for method 55 of type jellyfish
;; INFO: Used lq/sq
(defmethod common-post ((this jellyfish))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(let ((v1-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) (-> this main-joint-acc) (-> this root quat)))
)
(+! (-> this tentacle-clock)
(* (lerp-scale 1.0 10.0 (fmax (fmax (fmax 0.0 (fabs (-> v1-1 x))) (-> v1-1 y)) (fabs (-> v1-1 z))) 0.0 24576.0)
(seconds-per-frame)
)
)
)
(when (not (-> this tentacles-initialized))
(set! (-> this tentacles-initialized) #t)
(dotimes (s5-0 5)
(initialize-chain-joints (-> this tentacles s5-0))
)
)
(dotimes (s5-1 5)
(update (-> this tentacles s5-1) this)
)
(let ((a1-3 (handle->process (-> this focus handle))))
(if a1-3
(los-control-method-9 (-> this los) (the-as process-focusable a1-3) (the-as vector #f) 4096.0)
)
)
(let ((a0-10 (handle->process (-> this focus handle))))
(when (and a0-10
(focus-test? (the-as process-focusable a0-10) mech)
(not (logtest? (-> (the-as process-focusable a0-10) focus-status) (focus-status dead ignore)))
)
(set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-10) 0) quad))
(set! (-> this path-player-u) (get-furthest-point-on-path (-> this path) (-> this focus-pos)))
)
)
(set! (-> this path-my-u) (get-furthest-point-on-path (-> this path) (-> this root trans)))
((method-of-type hover-enemy common-post) this)
(none)
)
;; definition for method 116 of type jellyfish
;; WARN: Return type mismatch object vs none.
(defmethod go-idle ((this jellyfish))
(go (method-of-object this active))
(none)
)
;; definition for method 149 of type jellyfish
;; WARN: Return type mismatch int vs none.
(defmethod hover-enemy-method-149 ((this jellyfish))
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-jellyfish" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
0
(none)
)
;; definition for method 150 of type jellyfish
(defmethod hover-enemy-method-150 ((this jellyfish))
*jellyfish-enemy-info*
)
;; definition for method 114 of type jellyfish
;; WARN: Return type mismatch int vs none.
(defmethod init-enemy-collision! ((this jellyfish))
"Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly"
(let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))))
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction) cshape-reaction-default)
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
)
(set! (-> s5-0 penetrated-by) (penetrate
generic-attack
lunge
flop
punch
spin
roll
uppercut
bonk
tube
vehicle
flut-attack
board
mech-punch
dark-punch
dark-giant
)
)
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0)))
(set! (-> s5-0 total-prims) (the-as uint 5))
(set! (-> s4-0 prim-core collide-as) (collide-spec enemy))
(set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak bot enemy obstacle player-list))
(set! (-> s4-0 prim-core action) (collide-action solid deadly))
(set! (-> s4-0 transform-index) 3)
(set-vector! (-> s4-0 local-sphere) 0.0 -7372.8 0.0 20480.0)
(set! (-> s5-0 root-prim) s4-0)
)
(let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-14 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-14 prim-core collide-with) (collide-spec backgnd jak bot enemy obstacle player-list))
(set! (-> v1-14 prim-core action) (collide-action solid deadly))
(set-vector! (-> v1-14 local-sphere) 0.0 1228.8 -2048.0 6144.0)
)
(let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-16 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-16 prim-core collide-with) (collide-spec backgnd jak bot enemy obstacle player-list))
(set! (-> v1-16 prim-core action) (collide-action solid deadly))
(set-vector! (-> v1-16 local-sphere) 0.0 -819.2 -2048.0 4915.2)
)
(let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-18 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-18 prim-core collide-with) (collide-spec backgnd jak bot enemy obstacle player-list))
(set! (-> v1-18 prim-core action) (collide-action solid deadly))
(set-vector! (-> v1-18 local-sphere) 0.0 3276.8 -2048.0 4915.2)
)
(let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-20 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-20 prim-core action) (collide-action semi-solid))
(set! (-> v1-20 transform-index) 3)
(set-vector! (-> v1-20 local-sphere) 0.0 0.0 1228.8 8192.0)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(let ((v1-23 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-23 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with))
)
(set! (-> s5-0 max-iteration-count) (the-as uint 3))
(set! (-> this root) s5-0)
)
0
(none)
)
;; definition for method 7 of type jellyfish
;; WARN: Return type mismatch hover-enemy vs jellyfish.
(defmethod relocate ((this jellyfish) (offset int))
(dotimes (v1-0 5)
(if (nonzero? (-> this tentacles v1-0))
(&+! (-> this tentacles v1-0) offset)
)
)
(the-as jellyfish ((method-of-type hover-enemy relocate) this offset))
)
;; definition for method 10 of type jellyfish
(defmethod deactivate ((this jellyfish))
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
(sound-stop (-> this sound-id))
(call-parent-method this)
(none)
)
;; definition for method 115 of type jellyfish
;; WARN: Return type mismatch int vs none.
(defmethod init-enemy! ((this jellyfish))
"Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods"
(hover-enemy-method-149 this)
(init-enemy-behaviour-and-stats! this (hover-enemy-method-150 this))
(hover-enemy-method-155 this)
(set-vector! (-> this offset) 0.0 6144.0 61440.0 1.0)
(set! (-> this knocked-fall-dist) 0.0)
(let ((v1-8 (-> this neck)))
(set! (-> v1-8 up) (the-as uint 1))
(set! (-> v1-8 nose) (the-as uint 2))
(set! (-> v1-8 ear) (the-as uint 0))
(set! (-> v1-8 twist-speed-x) 0.05)
(set! (-> v1-8 twist-speed-y) 0.06)
(set! (-> v1-8 max-dist) 122880.0)
)
(set! (-> this root dynam gravity y) 40960.0)
(set! (-> this root dynam gravity-length) 40960.0)
(set! (-> this root dynam gravity-max) 40960.0)
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(new-source! (-> this los) this (seconds 1) (collide-spec backgnd enemy obstacle hit-by-others-list))
(set-time! (-> this last-fire-time))
(set! (-> this last-attack-time) 0)
(set! (-> this sound-id) (new-sound-id))
(set! (-> this path) (new 'process 'path-control this 'path 0.0 (-> this entity) #f))
(set! (-> this path-player-u) 0.0)
(set! (-> this path-my-u) 0.0)
(logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text))
(set! (-> this path-y-offset) (res-lump-float (-> this entity) 'y-offset))
(let ((a1-4 (new 'stack-no-clear 'sync-info-params)))
(let ((v1-32 0))
(if #t
(set! v1-32 (logior v1-32 1))
)
(set! (-> a1-4 sync-type) 'sync-eased)
(set! (-> a1-4 sync-flags) (the-as sync-flags v1-32))
)
(set! (-> a1-4 period) (the-as uint 6000))
(set! (-> a1-4 entity) (-> this entity))
(set! (-> a1-4 percent) 0.0)
(set! (-> a1-4 ease-in) 0.15)
(set! (-> a1-4 ease-out) 0.15)
(set! (-> a1-4 pause-in) 0.0)
(set! (-> a1-4 pause-out) 0.0)
(initialize! (-> this sync) a1-4)
)
(add-connection
*part-engine*
this
36
this
318
(new 'static 'vector :x 1187.84 :y -3112.96 :z 1392.64 :w 163840.0)
)
(add-connection
*part-engine*
this
36
this
318
(new 'static 'vector :x -1187.84 :y -3112.96 :z 1392.64 :w 163840.0)
)
(add-connection *part-engine* this 36 this 743 (new 'static 'vector :y 1433.6 :z 1228.8 :w 163840.0))
(dotimes (s5-1 5)
(set! (-> this tentacles s5-1) (new 'process 'jellyfish-chain-physics))
)
(chain-physics-initialize this (-> this tentacles 0) 10 4096.0 *jellyfish-mainvein-chain-setup*)
(chain-physics-initialize this (-> this tentacles 1) 16 4096.0 *jellyfish-lfront-chain-setup*)
(chain-physics-initialize this (-> this tentacles 2) 21 4096.0 *jellyfish-rfront-chain-setup*)
(chain-physics-initialize this (-> this tentacles 3) 26 4096.0 *jellyfish-lrear-chain-setup*)
(chain-physics-initialize this (-> this tentacles 4) 31 4096.0 *jellyfish-rrear-chain-setup*)
(set! (-> this tentacles 2 negate-y) #t)
(set! (-> this tentacles 4 negate-y) #t)
(let ((a0-35 (-> this skel root-channel 0)))
(set! (-> a0-35 frame-group) (the-as art-joint-anim (-> this draw art-group data 2)))
(set! (-> a0-35 frame-num) 0.0)
(joint-control-channel-group! a0-35 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity)
)
(ja-post)
(dotimes (s5-2 5)
(initialize-chain-joints (-> this tentacles s5-2))
)
(let ((a1-15 (-> this node-list data 16))
(v1-68
(new 'static 'jellyfish-joint-mod-tentacle-info
:axis (new 'static 'vector :z 1.0 :w 1.0)
:angle 3094.7556
:offset 30.0
)
)
)
(set! (-> a1-15 param0) jellyfish-joint-mod-tentacle)
(set! (-> a1-15 param1) this)
(set! (-> a1-15 param2) (the-as basic v1-68))
)
(let ((a1-16 (-> this node-list data 21))
(v1-70
(new 'static 'jellyfish-joint-mod-tentacle-info
:axis (new 'static 'vector :z 1.0 :w 1.0)
:angle 3094.7556
:offset 30.0
)
)
)
(set! (-> a1-16 param0) jellyfish-joint-mod-tentacle)
(set! (-> a1-16 param1) this)
(set! (-> a1-16 param2) (the-as basic v1-70))
)
(let ((a1-17 (-> this node-list data 26))
(v1-72
(new 'static 'jellyfish-joint-mod-tentacle-info
:axis (new 'static 'vector :z 1.0 :w 1.0)
:angle 4369.067
:offset 45.0
)
)
)
(set! (-> a1-17 param0) jellyfish-joint-mod-tentacle)
(set! (-> a1-17 param1) this)
(set! (-> a1-17 param2) (the-as basic v1-72))
)
(let ((a1-18 (-> this node-list data 31))
(v1-74
(new 'static 'jellyfish-joint-mod-tentacle-info
:axis (new 'static 'vector :z 1.0 :w 1.0)
:angle 4369.067
:offset 45.0
)
)
)
(set! (-> a1-18 param0) jellyfish-joint-mod-tentacle)
(set! (-> a1-18 param1) this)
(set! (-> a1-18 param2) (the-as basic v1-74))
)
(let ((a1-19 (-> this node-list data 10))
(v1-76
(new 'static 'jellyfish-joint-mod-tentacle-info :axis (new 'static 'vector :x 1.0 :w 1.0) :angle 2730.6667)
)
)
(set! (-> a1-19 param0) jellyfish-joint-mod-tentacle)
(set! (-> a1-19 param1) this)
(set! (-> a1-19 param2) (the-as basic v1-76))
)
(set! (-> this tentacles-initialized) #f)
(set! (-> this tentacle-clock) 0.0)
(set! (-> this tentacle-blend) 1.0)
(add-connection
*part-engine*
this
36
this
318
(new 'static 'vector :x 1966.08 :y -1843.2 :z 2129.92 :w 163840.0)
)
(add-connection
*part-engine*
this
36
this
318
(new 'static 'vector :x -1966.08 :y -1843.2 :z 2129.92 :w 163840.0)
)
0
(none)
)