jak-project/goal_src/jak1/levels/beach/beach-obs.gc
Tyler Wilding d1ece445d4
Dependency graph work - Part 1 - Preliminary work (#3505)
Relates to #1353 

This adds no new functionality or overhead to the compiler, yet. This is
the preliminary work that has:
- added code to the compiler in several spots to flag when something is
used without being properly required/imported/whatever (disabled by
default)
- that was used to generate project wide file dependencies (some
circulars were manually fixed)
- then that graph underwent a transitive reduction and the result was
written to all `jak1` source files.

The next step will be making this actually produce and use a dependency
graph. Some of the reasons why I'm working on this:
- eliminates more `game.gp` boilerplate. This includes the `.gd` files
to some extent (`*-ag` files and `tpage` files will still need to be
handled) this is the point of the new `bundles` form. This should make
it even easier to add a new file into the source tree.
- a build order that is actually informed from something real and
compiler warnings that tell you when you are using something that won't
be available at build time.
- narrows the search space for doing LSP actions -- like searching for
references. Since it would be way too much work to store in the compiler
every location where every symbol/function/etc is used, I have to do
ad-hoc searches. By having a dependency graph i can significantly reduce
that search space.
- opens the doors for common shared code with a legitimate pattern.
Right now jak 2 shares code from the jak 1 folder. This is basically a
hack -- but by having an explicit require syntax, it would be possible
to reference arbitrary file paths, such as a `common` folder.

Some stats:
- Jak 1 has about 2500 edges between files, including transitives
- With transitives reduced at the source code level, each file seems to
have a modest amount of explicit requirements.

Known issues:
- Tracking the location for where `defmacro`s and virtual state
definitions were defined (and therefore the file) is still problematic.
Because those forms are in a macro environment, the reader does not
track them. I'm wondering if a workaround could be to search the
reader's text_db by not just the `goos::Object` but by the text
position. But for the purposes of finishing this work, I just statically
analyzed and searched the code with throwaway python code.
2024-05-12 12:37:59 -04:00

1442 lines
51 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
(bundles "BEA.DGO")
(require "engine/common-obs/process-taskable.gc")
(require "engine/camera/pov-camera-h.gc")
(require "levels/beach/wobbler.gc")
;; name: beach-obs.gc
;; name in dgo: beach-obs
;; dgos: BEA, L1
(define-extern spawn-flying-rock (function vector vector float entity none))
;; DECOMP BEGINS
(defskelgroup *beachcam-sg* beachcam beachcam-lod0-jg beachcam-anim-ja
((beachcam-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 60)
)
(deftype windmill-one (process-drawable)
((root collide-shape-moving :override)
(sound-id sound-id)
)
(:states
windmill-one-idle
)
)
(defskelgroup *windmill-one-sg* windmill-one windmill-one-lod0-jg windmill-one-idle-ja
((windmill-one-lod0-mg (meters 20)) (windmill-one-lod1-mg (meters 40)) (windmill-one-lod2-mg (meters 999999)))
:bounds (static-spherem -12 -8 -1 16)
:longest-edge (meters 7.5)
)
(defstate windmill-one-idle (windmill-one)
:exit (behavior ()
(sound-stop (-> self sound-id))
)
:trans (behavior ()
(rider-trans)
(let ((t2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node windmill-one-lod0-jg big))))
(if (!= (+ (-> t2-0 x) (-> t2-0 y) (-> t2-0 z)) 0.0)
(sound-play "gears-rumble" :id (-> self sound-id) :position (the-as symbol t2-0))
)
)
)
:code (behavior ()
(loop
(ja-no-eval :group! windmill-one-idle-ja :num! (seek! max 0.5) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max 0.5))
)
)
)
:post rider-post
)
(defmethod init-from-entity! ((this windmill-one) (arg0 entity-actor))
(logior! (-> this mask) (process-mask platform))
(let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player))))
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-0 reaction) default-collision-reaction)
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(alloc-riders s4-0 1)
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0)))
(set! (-> s3-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
(set! (-> s3-0 prim-core action) (collide-action solid rider-plat-sticky))
(set! (-> s3-0 transform-index) 0)
(set-vector! (-> s3-0 local-sphere) -40960.0 -40960.0 32768.0 69632.0)
(set-root-prim! s4-0 s3-0)
(let ((s2-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s2-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s2-0 collide-with) (collide-kind target))
(set! (-> s2-0 prim-core action) (collide-action solid rider-plat-sticky))
(set! (-> s2-0 prim-core offense) (collide-offense indestructible))
(set! (-> s2-0 transform-index) 8)
(set-vector! (-> s2-0 local-sphere) 4915.2 0.0 -4915.2 13516.8)
(append-prim s3-0 s2-0)
)
(let ((s2-1 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s2-1 prim-core collide-as) (collide-kind ground-object))
(set! (-> s2-1 collide-with) (collide-kind target))
(set! (-> s2-1 prim-core action) (collide-action solid rider-plat-sticky))
(set! (-> s2-1 prim-core offense) (collide-offense indestructible))
(set! (-> s2-1 transform-index) 9)
(set-vector! (-> s2-1 local-sphere) 4915.2 0.0 -4915.2 13516.8)
(append-prim s3-0 s2-1)
)
)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(backup-collide-with-as s4-0)
(set! (-> this root) s4-0)
)
(set! (-> this root pause-adjust-distance) 409600.0)
(process-drawable-from-entity! this arg0)
(initialize-skeleton this *windmill-one-sg* '())
(logior! (-> this skel status) (janim-status inited))
(update-transforms! (-> this root))
(set! (-> this sound-id) (new-sound-id))
(go windmill-one-idle)
(none)
)
(defpartgroup group-beach-grotto-pole-rocks
:id 155
:flags (use-local-clock)
:bounds (static-bspherem 0 -12 0 14)
:parts ((sp-item 539 :period (seconds 5) :length (seconds 0.05))
(sp-item 539 :period (seconds 5) :length (seconds 0.1))
(sp-item 539 :period (seconds 5) :length (seconds 0.15))
(sp-item 539 :period (seconds 5) :length (seconds 0.25))
(sp-item 539 :period (seconds 5) :length (seconds 0.5))
(sp-item 539 :period (seconds 5) :length (seconds 1))
(sp-item 540 :period (seconds 5) :length (seconds 0.1))
)
)
(defpart 539
:init-specs ((:texture (new 'static 'texture-id :index #x1d :page #x2))
(:num 0.5)
(:x (meters -9) (meters 18))
(:y (meters -6))
(:z (meters -9) (meters 18))
(:scale-x (meters 0.1) (meters 0.5))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 32.0 40.0)
(:g 32.0 40.0)
(:b 32.0 40.0)
(:a 128.0)
(:vel-y (meters 0) (meters -0.04))
(:rotvel-z (degrees -0.3) (degrees 0.6))
(:accel-y (meters -0.0016666667) (meters -0.00016666666))
(:timer (seconds 1.3))
(:flags (bit2))
(:userdata 0.0)
(:func 'check-water-level-drop)
)
)
(defpart 540
:init-specs ((:texture (new 'static 'texture-id :page #x2))
(:num 12.0)
(:y (meters -7))
(:scale-x (meters 3) (meters 4.5))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 48.0 16.0)
(:g 48.0)
(:b 48.0)
(:a 0.0)
(:vel-y (meters 0) (meters 0.006666667))
(:rotvel-z (degrees -0.3) (degrees 0.6))
(:fade-a 1.0666667)
(:accel-y (meters 0.000016666667))
(:timer (seconds 4))
(:flags (bit2 bit12))
(:next-time (seconds 0.2))
(:next-launcher 541)
(:conerot-x (degrees 90) (degrees 10))
(:conerot-y (degrees 0) (degrees 360))
(:conerot-radius (meters 3.5) (meters 6))
)
)
(defpart 541
:init-specs ((:fade-a 0.0) (:next-time (seconds 1.5) (seconds 0.797)) (:next-launcher 542))
)
(defpart 542
:init-specs ((:fade-a -0.14222223))
)
(deftype grottopole (process-drawable)
((root collide-shape :override)
(speed meters)
(distance meters)
(position int32)
(max-position int32)
(incomming-attack-id uint64)
)
(:states
grottopole-idle
grottopole-moving-down
grottopole-moving-up
)
)
(defskelgroup *grottopole-sg* grottopole grottopole-lod0-jg grottopole-idle-ja
((grottopole-lod0-mg (meters 20)) (grottopole-lod1-mg (meters 999999)))
:bounds (static-spherem 0 -8 0 9)
)
(defstate grottopole-idle (grottopole)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(when (= (-> proc type) target)
(case message
(('attack)
(let ((v1-2 (-> block param 2)))
(when (!= v1-2 (-> self incomming-attack-id))
(set! (-> self incomming-attack-id) v1-2)
(case (-> block param 1)
(('uppercut)
(when (and (< (-> *target* control trans y) (+ -40960.0 (-> self root trans y)))
(< (-> self position) (-> self max-position))
((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> block param 0))
(the-as collide-shape-moving (-> self root))
(the-as uint 2)
)
)
(sound-play "grotto-pole-hit")
(sound-play "dirt-crumble")
(increment-success-for-hint (text-id beach-grottopole-increment))
(go grottopole-moving-up)
)
)
(('flop)
(when (and (< (+ -40960.0 (-> self root trans y)) (-> *target* control trans y))
(> (-> self position) 0)
((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> block param 0))
(the-as collide-shape-moving (-> self root))
(the-as uint 1)
)
)
(sound-play "grotto-pole-hit")
(sound-play "dirt-crumble")
(go grottopole-moving-down)
)
)
)
)
)
)
)
)
)
:code (behavior ()
(set-time! (-> self state-time))
(ja :group! grottopole-idle-ja :num! min)
(transform-post)
(suspend)
(loop
(logior! (-> self mask) (process-mask sleep))
(suspend)
)
)
)
(defun move-grottopole ((arg0 grottopole) (arg1 float))
(let ((f30-0 0.0)
(s4-0 (new-stack-vector0))
(s3-0 (new-stack-vector0))
(s2-0 #f)
)
(set! (-> arg0 part local-clock) 0)
(set-vector! s4-0 0.0 0.0 0.0 1.0)
(while (and (not s2-0) (< f30-0 (-> arg0 distance)))
(let ((f28-0 (* (-> arg0 speed) (seconds-per-frame))))
(when (< (-> arg0 distance) (+ f30-0 f28-0))
(set! f28-0 (- (-> arg0 distance) f30-0))
(set! s2-0 #t)
)
(set! (-> s4-0 y) (* f28-0 arg1))
(move-by-vector! (-> arg0 root) s4-0)
(+! f30-0 f28-0)
)
(set! (-> s3-0 quad) (-> arg0 entity extra trans quad))
(+! (-> s3-0 y) -4096.0)
(spawn (-> arg0 part) s3-0)
(suspend)
0
)
)
0
(none)
)
(defun move-grottopole-to-position ((arg0 grottopole))
(let ((a1-0 (new 'stack-no-clear 'vector)))
(set-vector! a1-0 0.0 (* (-> arg0 distance) (the float (-> arg0 position))) 0.0 1.0)
(move-by-vector! (-> arg0 root) a1-0)
)
0
(none)
)
(defstate grottopole-moving-up (grottopole)
:code (behavior ()
(+! (-> self position) 1)
(let ((v1-4 (-> self entity extra perm)))
(logior! (-> v1-4 status) (entity-perm-status user-set-from-cstage))
(set! (-> v1-4 user-int16 0) (-> self position))
)
(move-grottopole self 1.0)
(go grottopole-idle)
)
:post transform-post
)
(defstate grottopole-moving-down (grottopole)
:code (behavior ()
(+! (-> self position) -1)
(let ((v1-4 (-> self entity extra perm)))
(logior! (-> v1-4 status) (entity-perm-status user-set-from-cstage))
(set! (-> v1-4 user-int16 0) (-> self position))
)
(move-grottopole self -1.0)
(go grottopole-idle)
)
:post transform-post
)
(defmethod init-from-entity! ((this grottopole) (arg0 entity-actor))
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others))))
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0)))
(set! (-> s3-0 prim-core collide-as) (collide-kind wall-object))
(set! (-> s3-0 collide-with) (collide-kind target))
(set! (-> s3-0 prim-core action) (collide-action solid))
(set-vector! (-> s3-0 local-sphere) 0.0 -20480.0 0.0 40960.0)
(set-root-prim! s4-0 s3-0)
(let ((s2-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1))))
(set! (-> s2-0 prim-core collide-as) (collide-kind wall-object))
(set! (-> s2-0 collide-with) (collide-kind target))
(set! (-> s2-0 prim-core action) (collide-action solid))
(set! (-> s2-0 prim-core offense) (collide-offense indestructible))
(set! (-> s2-0 transform-index) 3)
(set-vector! (-> s2-0 local-sphere) 0.0 -20480.0 0.0 40960.0)
(append-prim s3-0 s2-0)
)
(let ((s2-1 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0))))
(set! (-> s2-1 prim-core collide-as) (collide-kind wall-object))
(set! (-> s2-1 collide-with) (collide-kind target))
(set! (-> s2-1 prim-core action) (collide-action solid))
(set! (-> s2-1 prim-core offense) (collide-offense indestructible))
(set! (-> s2-1 transform-index) 3)
(set-vector! (-> s2-1 local-sphere) 0.0 -20480.0 0.0 40960.0)
(append-prim s3-0 s2-1)
)
(let ((s2-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 2))))
(set! (-> s2-2 prim-core collide-as) (collide-kind wall-object))
(set! (-> s2-2 collide-with) (collide-kind target))
(set! (-> s2-2 prim-core action) (collide-action solid))
(set! (-> s2-2 prim-core offense) (collide-offense indestructible))
(set! (-> s2-2 transform-index) 3)
(set-vector! (-> s2-2 local-sphere) 0.0 -20480.0 0.0 40960.0)
(append-prim s3-0 s2-2)
)
)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(backup-collide-with-as s4-0)
(set! (-> this root) s4-0)
)
(process-drawable-from-entity! this arg0)
(initialize-skeleton this *grottopole-sg* '())
(set! (-> this speed) (res-lump-float arg0 'speed :default 81920.0))
(set! (-> this distance) (res-lump-float arg0 'distance :default 3072.0))
(set! (-> this position) 0)
(set! (-> this max-position) (res-lump-value arg0 'num-positions int :default (the-as uint128 3)))
(set! (-> this part) (create-launch-control (-> *part-group-id-table* 155) this))
(set! (-> this position) (-> this entity extra perm user-int16 0))
(move-grottopole-to-position this)
(go grottopole-idle)
(none)
)
(deftype ecoventrock (process-drawable)
((root collide-shape :override)
)
(:states
(ecoventrock-break symbol)
ecoventrock-idle
)
)
(defskelgroup *ecoventrock-sg* ecoventrock ecoventrock-lod0-jg ecoventrock-idle-ja
((ecoventrock-lod0-mg (meters 20)) (ecoventrock-lod1-mg (meters 999999)))
:bounds (static-spherem 0 1 0 3)
)
(defpartgroup group-beach-harvester-rock-explosion
:id 156
:duration (seconds 2)
:flags (use-local-clock)
:bounds (static-bspherem 0 0 0 8)
:parts ((sp-item 543 :period (seconds 5) :length (seconds 0.017))
(sp-item 544 :period (seconds 5) :length (seconds 0.017))
(sp-item 545 :period (seconds 5) :length (seconds 0.017))
(sp-item 546 :period (seconds 5) :length (seconds 0.017))
(sp-item 547 :period (seconds 5) :length (seconds 0.017))
(sp-item 548 :period (seconds 5) :length (seconds 0.05))
)
)
(defpart 547
:init-specs ((:texture (new 'static 'texture-id :index #x12 :page #x2))
(:num 1.0)
(:scale-x (meters 15))
(:scale-y :copy scale-x)
(:r 130.0)
(:g 64.0)
(:b 54.0)
(:a 128.0)
(:fade-a -2.1333334)
(:timer (seconds 0.2))
(:flags (bit2 bit3))
)
)
(defpart 543
:init-specs ((:texture (new 'static 'texture-id :index #x1d :page #x2))
(:num 4.0 6.0)
(:scale-x (meters 0.1) (meters 0.3))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 70.0 16.0)
(:g 70.0 16.0)
(:b 70.0)
(:a 128.0)
(:vel-y (meters 0.06666667))
(:rotvel-z (degrees -1.2) (degrees 2.4))
(:accel-y (meters -0.0026666666))
(:friction 0.99)
(:timer (seconds 1))
(:flags (bit2))
(:next-time (seconds 0.58))
(:next-launcher 549)
(:conerot-x (degrees 45))
(:conerot-y (degrees 0) (degrees 360))
)
)
(defpart 544
:init-specs ((:texture (new 'static 'texture-id :index #x1d :page #x2))
(:num 4.0 6.0)
(:scale-x (meters 0.1) (meters 0.3))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 70.0 16.0)
(:g 70.0 16.0)
(:b 70.0)
(:a 128.0)
(:vel-y (meters 0.04))
(:rotvel-z (degrees -1.2) (degrees 2.4))
(:accel-y (meters -0.0026666666))
(:friction 0.99)
(:timer (seconds 1))
(:flags (bit2))
(:next-time (seconds 0.417))
(:next-launcher 549)
(:conerot-x (degrees 30))
(:conerot-y (degrees 0) (degrees 360))
)
)
(defpart 545
:init-specs ((:texture (new 'static 'texture-id :index #x1d :page #x2))
(:num 4.0 6.0)
(:scale-x (meters 0.1) (meters 0.3))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 80.0 16.0)
(:g 80.0 16.0)
(:b 80.0)
(:a 128.0)
(:vel-y (meters 0.08))
(:rotvel-z (degrees -1.2) (degrees 2.4))
(:accel-y (meters -0.0026666666))
(:friction 0.99)
(:timer (seconds 1))
(:flags (bit2))
(:next-time (seconds 0.65))
(:next-launcher 549)
(:conerot-x (degrees 35))
(:conerot-y (degrees 0) (degrees 360))
)
)
(defpart 549
:init-specs ((:vel-y (meters 0.026666667)) (:rotvel-z (degrees -1.2) 1 (degrees 2.4)) (:fade-a -1.0666667))
)
(defpart 548
:init-specs ((:texture (new 'static 'texture-id :page #x2))
(:num 16.0)
(:y (meters 0.5) (meters 1))
(:scale-x (meters 2.5) (meters 1.5))
(:scale-y :copy scale-x)
(:r 96.0 64.0)
(:g 64.0 48.0)
(:b 64.0 16.0)
(:a 16.0 32.0)
(:vel-y (meters 0.016666668) (meters 0.016666668))
(:scalevel-x (meters 0.013333334))
(:scalevel-y (meters 0.0033333334))
(:accel-y (meters -0.00026666667))
(:friction 0.95)
(:timer (seconds 2))
(:flags (bit2 bit12))
(:next-time (seconds 0.1) (seconds 0.997))
(:next-launcher 550)
(:conerot-x (degrees 70) (degrees 20))
(:conerot-y (degrees 0) (degrees 360))
)
)
(defpart 550
:init-specs ((:fade-a -0.2))
)
(defstate ecoventrock-idle (ecoventrock)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('attack)
(sound-play "cannon-shot")
(increment-success-for-hint (text-id sidekick-hint-ecorocks))
(go ecoventrock-break #f)
)
)
)
:code (behavior ()
(transform-post)
(loop
(logior! (-> self mask) (process-mask sleep))
(suspend)
)
)
)
(defstate ecoventrock-break (ecoventrock)
:event process-drawable-fuel-cell-handler
:enter (behavior ((arg0 symbol))
(set-time! (-> self state-time))
)
:code (behavior ((arg0 symbol))
(local-vars (sv-128 symbol))
(ja-channel-set! 0)
(clear-collide-with-as (-> self root))
(ja-post)
(process-entity-status! self (entity-perm-status complete) #t)
(let ((v1-2 (entity-actor-lookup (-> self entity) 'alt-actor 0)))
(send-event
(if v1-2
(-> v1-2 extra process)
)
'update
)
)
(when (not arg0)
(process-spawn
part-tracker
:init part-tracker-init
(-> *part-group-id-table* 156)
-1
#f
#f
#f
(-> self root root-prim prim-core)
:to *entity-pool*
)
(let* ((s5-1 (-> self root trans))
(v1-14 (target-pos 0))
(f0-1 (- (-> s5-1 x) (-> v1-14 x)))
(f1-2 (- (-> s5-1 z) (-> v1-14 z)))
(f2-1 7372.8)
(f30-0 5734.4)
(f2-2 (/ f2-1 (sqrtf (+ (* f0-1 f0-1) (* f1-2 f1-2)))))
(f28-0 (* f0-1 f2-2))
(f26-0 (* f1-2 f2-2))
(s4-0 (new-stack-vector0))
(s3-0 (new-stack-vector0))
)
(set-vector! s3-0 f28-0 f30-0 f26-0 1.0)
(set-vector! s4-0 (+ (-> s5-1 x) (-> s3-0 x)) (-> s5-1 y) (+ (-> s5-1 z) (-> s3-0 z)) 1.0)
(vector-float*! s3-0 s3-0 10.0)
(spawn-flying-rock s4-0 s3-0 1.0 (-> self entity))
(let ((f20-0 (rand-vu-float-range 90.0 130.0))
(f24-0 (rand-vu-float-range 230.0 270.0))
)
(let ((f22-0 (cos (* 182.04445 f20-0)))
(f0-14 (sin (* 182.04445 f20-0)))
)
(set-vector! s3-0 (+ (* f26-0 f0-14) (* f28-0 f22-0)) f30-0 (+ (* f28-0 (- f0-14)) (* f26-0 f22-0)) 1.0)
)
(set-vector! s4-0 (+ (-> s5-1 x) (-> s3-0 x)) (-> s5-1 y) (+ (-> s5-1 z) (-> s3-0 z)) 1.0)
(vector-float*! s3-0 s3-0 10.0)
(spawn-flying-rock s4-0 s3-0 1.0 (-> self entity))
(let ((f22-1 (cos (* 182.04445 f24-0)))
(f0-30 (sin (* 182.04445 f24-0)))
)
(set-vector! s3-0 (+ (* f26-0 f0-30) (* f28-0 f22-1)) f30-0 (+ (* f28-0 (- f0-30)) (* f26-0 f22-1)) 1.0)
)
)
(set-vector! s4-0 (+ (-> s5-1 x) (-> s3-0 x)) (-> s5-1 y) (+ (-> s5-1 z) (-> s3-0 z)) 1.0)
(vector-float*! s3-0 s3-0 10.0)
(spawn-flying-rock s4-0 s3-0 1.0 (-> self entity))
(set-vector! s3-0 (+ (* -0.866 f26-0) (* 0.5 f28-0)) (* 0.5 f30-0) (+ (* 0.866 f28-0) (* 0.5 f26-0)) 1.0)
(set-vector! s4-0 (-> s5-1 x) (+ 3276.8 (-> s5-1 y)) (-> s5-1 z) 1.0)
(vector-float*! s3-0 s3-0 10.0)
(spawn-flying-rock s4-0 s3-0 1.0 (-> self entity))
)
)
(when (or (-> self link prev) (-> self link next))
(set! sv-128 (the-as symbol #f))
(apply-all (-> self link) actor-link-subtask-complete-hook (& sv-128))
(when sv-128
(let ((s5-2 (current-time)))
(until (time-elapsed? s5-2 (seconds 0.5))
(suspend)
)
)
(let ((gp-1 (cond
(arg0
(the-as int #f)
)
(else
(ambient-hint-spawn "gamcam10" (the-as vector #f) *entity-pool* 'camera)
(ppointer->handle
(process-spawn pov-camera (-> self root trans) *beachcam-sg* (-> self name) 0 #f '() :to self)
)
)
)
)
)
(process-drawable-birth-fuel-cell (the-as entity #f) (the-as vector #f) #f)
(while (handle->process (the-as handle gp-1))
(suspend)
)
)
(while (-> self child)
(suspend)
)
)
)
(process-entity-status! self (entity-perm-status dead) #t)
(deactivate self)
)
)
(defmethod init-from-entity! ((this ecoventrock) (arg0 entity-actor))
(logior! (-> this mask) (process-mask enemy))
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player))))
(let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s3-0 prim-core collide-as) (collide-kind enemy))
(set! (-> s3-0 collide-with) (collide-kind target))
(set! (-> s3-0 prim-core action) (collide-action solid))
(set! (-> s3-0 prim-core offense) (collide-offense indestructible))
(set! (-> s3-0 transform-index) 0)
(set-vector! (-> s3-0 local-sphere) 0.0 2457.6 0.0 6963.2)
(set-root-prim! s4-0 s3-0)
)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(backup-collide-with-as s4-0)
(set! (-> this root) s4-0)
)
(process-drawable-from-entity! this arg0)
(initialize-skeleton this *ecoventrock-sg* '())
(set! (-> this link) (new 'process 'actor-link-info this))
(transform-post)
(nav-mesh-connect this (-> this root) (the-as nav-control #f))
(if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete)))
(go ecoventrock-break #t)
(go ecoventrock-idle)
)
(none)
)
(deftype flying-rock (process-drawable)
((root collide-shape-moving :override)
(tumble quaternion :inline)
)
(:states
flying-rock-idle
flying-rock-rolling
)
)
(defskelgroup *kickrock-sg* kickrock kickrock-lod0-jg kickrock-idle-ja
((kickrock-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 10)
)
(defstate flying-rock-rolling (flying-rock)
:enter (behavior ()
(set-time! (-> self state-time))
)
:code (behavior ()
(let ((gp-0 #f)
(f30-0 0.99)
(s5-0 0)
)
(while (< s5-0 2)
(cond
((logtest? (-> self root status) (cshape-moving-flags onsurf))
(when (not gp-0)
(+! s5-0 1)
(set! f30-0 0.8)
(set! gp-0 #t)
)
)
(else
(when gp-0
(set! f30-0 0.99)
(set! gp-0 #f)
)
)
)
(vector-float*! (-> self root transv) (-> self root transv) f30-0)
(set! (-> self root transv w) 1.0)
(if (not gp-0)
(vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 1.0))
)
(update-transforms! (-> self root))
(fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (collide-kind background))
(quaternion*! (-> self root quat) (-> self root quat) (-> self tumble))
(suspend)
)
)
(while (< 2048.0 (vector-length (-> self root transv)))
(cond
((logtest? (-> self root status) (cshape-moving-flags onsurf))
(vector-float*! (-> self root transv) (-> self root transv) 0.8)
)
(else
(vector-float*! (-> self root transv) (-> self root transv) 0.99)
(vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 1.0))
)
)
(set! (-> self root transv w) 1.0)
(update-transforms! (-> self root))
(fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (collide-kind background))
(let ((gp-2 (new 'stack-no-clear 'vector))
(f30-1 (vector-length (-> self root transv)))
)
(set-vector! gp-2 (-> self root transv z) 0.0 (- (-> self root transv x)) 1.0)
(vector-normalize! gp-2 1.0)
(let ((f0-12 (* 0.00061035156 (seconds-per-frame) f30-1)))
(quaternion-vector-angle! (-> self tumble) gp-2 (* 10430.379 f0-12))
)
)
(quaternion*! (-> self root quat) (-> self tumble) (-> self root quat))
(suspend)
)
(go flying-rock-idle)
)
:post (behavior ()
(if (time-elapsed? (-> self state-time) (seconds 3))
(go flying-rock-idle)
)
(ja-post)
)
)
(defstate flying-rock-idle (flying-rock)
:code (behavior ()
(clear-collide-with-as (-> self root))
(while (or (logtest? (-> self draw status) (draw-status was-drawn))
(and *target* (>= 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))))
)
(suspend)
)
(deactivate self)
)
:post ja-post
)
(defbehavior flying-rock-init-by-other flying-rock ((arg0 vector) (arg1 vector) (arg2 float) (arg3 entity-actor))
(set! (-> self entity) arg3)
(let ((s3-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player))))
(set! (-> s3-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s3-0 reaction) simple-collision-reaction)
(set! (-> s3-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(let ((s2-0 (new 'process 'collide-shape-prim-sphere s3-0 (the-as uint 0))))
(set! (-> s2-0 prim-core collide-as) (collide-kind enemy))
(set! (-> s2-0 collide-with) (collide-kind background target))
(set! (-> s2-0 prim-core action) (collide-action solid))
(set! (-> s2-0 prim-core offense) (collide-offense indestructible))
(set! (-> s2-0 transform-index) 0)
(set-vector! (-> s2-0 local-sphere) 0.0 0.0 0.0 (* 409.6 arg2))
(set-root-prim! s3-0 s2-0)
)
(set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w)))
(backup-collide-with-as s3-0)
(set! (-> self root) s3-0)
)
(set! (-> self root trans quad) (-> arg0 quad))
(set-vector! (-> self root scale) arg2 arg2 arg2 1.0)
(let ((s5-1 (new-stack-vector0)))
(set-vector!
s5-1
(rand-vu-float-range -1.0 1.0)
(rand-vu-float-range -1.0 1.0)
(rand-vu-float-range -1.0 1.0)
1.0
)
(vector-normalize! s5-1 1.0)
(quaternion-vector-angle! (-> self tumble) s5-1 (rand-vu-float-range 0.0 1820.4445))
)
(quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (rand-vu-float-range 0.0 65536.0))
(initialize-skeleton self *kickrock-sg* '())
(set! (-> self root transv quad) (-> arg1 quad))
(go flying-rock-rolling)
(none)
)
(defun spawn-flying-rock ((arg0 vector) (arg1 vector) (arg2 float) (arg3 entity))
(process-spawn flying-rock arg0 arg1 arg2 arg3 :to *entity-pool*)
0
(none)
)
(deftype bladeassm (process-drawable)
((root collide-shape-moving :override)
(angle float)
)
(:states
bladeassm-idle
)
)
(defskelgroup *bladeassm-sg* bladeassm bladeassm-lod0-jg bladeassm-idle-ja
((bladeassm-lod0-mg (meters 20)) (bladeassm-lod1-mg (meters 40)) (bladeassm-lod2-mg (meters 999999)))
:bounds (static-spherem 0 0 0 10)
:longest-edge (meters 10)
)
(defstate bladeassm-idle (bladeassm)
:code (behavior ()
(loop
(+! (-> self angle) (* 3640.889 (seconds-per-frame)))
(set! (-> self angle) (the float (sar (shl (the int (-> self angle)) 48) 48)))
(pusher-post)
(suspend)
)
)
)
(defun bladeassm-prebind-function ((arg0 process-drawable) (arg1 int) (arg2 bladeassm) (arg3 event-message-block))
(let ((v1-0 arg2))
(quaternion-axis-angle! (the-as quaternion (&-> arg0 link)) 0.0 0.0 1.0 (-> v1-0 angle))
)
0
)
(defmethod init-from-entity! ((this bladeassm) (arg0 entity-actor))
(logior! (-> this mask) (process-mask ambient))
(let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player))))
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-0 reaction) default-collision-reaction)
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s3-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
(set! (-> s3-0 prim-core action) (collide-action solid))
(set! (-> s3-0 prim-core offense) (collide-offense indestructible))
(set! (-> s3-0 transform-index) 3)
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 49152.0)
(set-root-prim! s4-0 s3-0)
)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(backup-collide-with-as s4-0)
(set! (-> this root) s4-0)
)
(process-drawable-from-entity! this arg0)
(initialize-skeleton this *bladeassm-sg* '())
(set! (-> this skel prebind-function)
(the-as (function pointer int process-drawable none) bladeassm-prebind-function)
)
(logclear! (-> this mask) (process-mask actor-pause))
(go bladeassm-idle)
(none)
)
(deftype flutflutegg (process-drawable)
((root collide-shape-moving :override)
(fall-dist meters)
(start vector :inline)
(dir vector :inline)
(pos float)
(vel float)
(wobbler wobbler)
(last-impulse-time int32)
(incomming-attack-id uint64)
(ambients-played int32)
(ambient ambient-control :inline)
)
(:methods
(flutflutegg-method-20 (_type_ float float float) none)
)
(:states
(flutflutegg-break symbol)
flutflutegg-idle
flutflutegg-physics
flutflutegg-physics-fall
)
)
(defskelgroup *flutflutegg-sg* flutflutegg flutflutegg-lod0-jg flutflutegg-idle-ja
((flutflutegg-lod0-mg (meters 20)) (flutflutegg-lod1-mg (meters 40)) (flutflutegg-lod2-mg (meters 999999)))
:bounds (static-spherem 0 3.5 0 3.5)
)
(defskelgroup *flutflut-naked-sg* flutflut flutflut-lod0-jg flutflut-flutflut-idle-ja
((flutflut-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 8)
)
(defmethod relocate ((this flutflutegg) (arg0 int))
(if (nonzero? (-> this wobbler))
(&+! (-> this wobbler) arg0)
)
(call-parent-method this arg0)
)
;; WARN: Function (method 20 flutflutegg) has a return type of none, but the expression builder found a return statement.
(defmethod flutflutegg-method-20 ((this flutflutegg) (arg0 float) (arg1 float) (arg2 float))
(if (not (time-elapsed? (the-as time-frame (-> this last-impulse-time)) (seconds 0.5)))
(return 0)
)
(set! (-> this last-impulse-time) (the-as int (current-time)))
(+! (-> this vel) arg0)
(inc-xy-vel! (-> this wobbler) arg1 arg2)
0
(none)
)
(defbehavior flutflutegg-hit-sounds flutflutegg ()
(sound-play "egg-hit")
(cond
((not (task-closed? (game-task beach-flutflut) (task-status need-introduction)))
)
((not (logtest? (-> self ambients-played) 8))
(if (play-ambient (-> self ambient) "BIR-AM04" #f (the-as vector #f))
(logior! (-> self ambients-played) 8)
)
)
((not (logtest? (-> self ambients-played) 512))
(if (play-ambient (-> self ambient) "BIR-AM10" #f (the-as vector #f))
(logior! (-> self ambients-played) 512)
)
)
)
(none)
)
(defstate flutflutegg-idle (flutflutegg)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(when (and (= message 'attack)
(or (= (-> block param 1) 'punch) (= (-> block param 1) 'spin) (= (-> block param 1) 'spin-air))
(!= (-> self incomming-attack-id) (-> block param 2))
)
(set! (-> self incomming-attack-id) (-> block param 2))
(flutflutegg-hit-sounds)
(let ((s5-1 (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root trans))))
(set! (-> s5-1 y) 0.0)
(vector-normalize! s5-1 1.0)
(let ((f0-2 (vector-dot s5-1 (-> self dir)))
(f1-2 (- (* (-> s5-1 x) (-> self dir z)) (* (-> s5-1 z) (-> self dir x))))
)
(if (< f0-2 -0.7)
(flutflutegg-method-20 self 24576.0 (* -8192.0 f1-2) (* -8192.0 f0-2))
(flutflutegg-method-20 self 0.0 (* -8192.0 f1-2) (* -8192.0 f0-2))
)
)
)
(go flutflutegg-physics)
)
)
:trans (behavior ()
(let* ((gp-0 (ambient-control-method-10 (-> self ambient) (new 'stack-no-clear 'vector) (seconds 3) 368640.0 self))
(v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-3 (the-as number (logior #x3f800000 v1-2)))
(f30-0 (+ -1.0 (the-as float v1-3)))
)
(cond
((not (task-closed? (game-task beach-flutflut) (task-status need-introduction)))
)
((not gp-0)
)
((< 327680.0 (vector-length gp-0))
(set! (-> self ambients-played) 0)
0
)
((and (not (logtest? (-> self ambients-played) 1)) (< (vector-length gp-0) 327680.0) (< -61440.0 (-> gp-0 y)))
(if (play-ambient (-> self ambient) "BIR-AM01" #f (the-as vector #f))
(logior! (-> self ambients-played) 1)
)
)
((and (not (logtest? (-> self ambients-played) 2)) (< (vector-length gp-0) 163840.0) (< -40960.0 (-> gp-0 y)))
(if (play-ambient (-> self ambient) "BIR-AM02" #f (the-as vector #f))
(logior! (-> self ambients-played) 2)
)
)
((and (not (logtest? (-> self ambients-played) 16)) (< (vector-length gp-0) 81920.0) (< -24576.0 (-> gp-0 y)))
(if (play-ambient (-> self ambient) "BIR-AM05" #f (the-as vector #f))
(logior! (-> self ambients-played) 16)
)
)
((and (not (logtest? (-> self ambients-played) 4)) (< (vector-length gp-0) 40960.0) (< -24576.0 (-> gp-0 y)))
(if (play-ambient (-> self ambient) "BIR-AM03" #f (the-as vector #f))
(logior! (-> self ambients-played) 4)
)
)
((< (-> gp-0 y) -24576.0)
)
((not (time-elapsed? (-> self ambient last-ambient-time) (seconds 30)))
)
((< 0.8 f30-0)
(play-ambient (-> self ambient) "BIR-AM07" #f (-> self root trans))
)
((< 0.6 f30-0)
(play-ambient (-> self ambient) "BIR-AM08" #f (-> self root trans))
)
((< 0.4 f30-0)
(play-ambient (-> self ambient) "BIR-AM09" #f (-> self root trans))
)
((< 0.2 f30-0)
(play-ambient (-> self ambient) "BIR-AM12" #f (-> self root trans))
)
(else
(play-ambient (-> self ambient) "BIR-AM13" #f (-> self root trans))
)
)
)
)
:code (behavior ()
(ja-post)
(loop
(suspend)
)
)
)
(defstate flutflutegg-physics (flutflutegg)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(when (and (time-elapsed? (-> self state-time) (seconds 0.5))
(= message 'attack)
(or (= (-> block param 1) 'punch) (= (-> block param 1) 'spin) (= (-> block param 1) 'spin-air))
(!= (-> self incomming-attack-id) (-> block param 2))
)
(set! (-> self incomming-attack-id) (-> block param 2))
(flutflutegg-hit-sounds)
(let ((s5-1 (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root trans))))
(set! (-> s5-1 y) 0.0)
(vector-normalize! s5-1 1.0)
(let ((f0-2 (vector-dot s5-1 (-> self dir)))
(f1-2 (- (* (-> s5-1 x) (-> self dir z)) (* (-> s5-1 z) (-> self dir x))))
)
(if (< f0-2 -0.7)
(flutflutegg-method-20 self 24576.0 (* -8192.0 f1-2) (* -8192.0 f0-2))
(flutflutegg-method-20 self 0.0 (* -8192.0 f1-2) (* -8192.0 f0-2))
)
)
)
)
)
:code (behavior ()
(set-time! (-> self state-time))
(loop
(+! (-> self pos) (* (-> self vel) (seconds-per-frame)))
;; og:preserve-this PAL patch here
(set! (-> self vel) (* (-> self vel) (- 1.0 (* 0.05 (-> *display* time-adjust-ratio)))))
(move! (-> self wobbler))
(let ((a1-0 (new 'stack-no-clear 'vector)))
(vector-float*! a1-0 (-> self dir) (-> self pos))
(vector+! a1-0 a1-0 (-> self start))
(move-to-point! (-> self root) a1-0)
)
(wobbler-method-12 (-> self wobbler) (-> self root quat))
(let ((a2-3 (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 -18204.445)))
(quaternion*! (-> self root quat) (-> self root quat) a2-3)
)
(suspend)
(when (>= (-> self pos) (-> self fall-dist))
(when (task-closed? (game-task beach-flutflut) (task-status need-introduction))
(if (play-ambient (-> self ambient) "BIR-AM06" #f (the-as vector #f))
(logior! (-> self ambients-played) 32)
)
)
(go flutflutegg-physics-fall)
)
)
)
:post ja-post
)
(defstate flutflutegg-physics-fall (flutflutegg)
:code (behavior ()
(local-vars (v1-25 symbol))
(process-spawn
camera-tracker
:init camera-tracker-init
(lambda :behavior camera-tracker
()
(while (not (process-grab? *target*))
(suspend)
)
(camera-change-to "camera-135" 0 #f)
(camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 9))
(let ((gp-0 (current-time)))
(until (time-elapsed? gp-0 (seconds 4))
(suspend)
)
)
(while (not (process-release? (handle->process (-> self grab-target))))
(suspend)
)
(camera-look-at (the-as pair *target*) (the-as uint 0))
(send-event *camera* 'blend-from-as-fixed)
(camera-change-to (the-as string 'base) 75 #f)
(none)
)
:to self
)
(close-specific-task! (game-task beach-flutflut) (task-status need-reminder))
(loop
(vector-float*! (-> self root transv) (-> self dir) (-> self vel))
(set-time! (-> self state-time))
(until v1-25
(vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0))
(integrate-for-enemy-with-move-to-ground!
(-> self root)
(-> self root transv)
(collide-kind background)
8192.0
#f
#f
#f
)
(move! (-> self wobbler))
(wobbler-method-12 (-> self wobbler) (-> self root quat))
(let ((a2-6 (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 -18204.445)))
(quaternion*! (-> self root quat) (-> self root quat) a2-6)
)
(suspend)
(set! v1-25 (and (time-elapsed? (-> self state-time) (seconds 0.5))
(logtest? (-> self root status) (cshape-moving-flags onsurf))
)
)
)
(sound-play "sack-land" :vol 200)
(go flutflutegg-break #f)
)
)
:post ja-post
)
(defstate flutflutegg-break (flutflutegg)
:code (behavior ((arg0 symbol))
(when arg0
(set-vector! (-> self root trans) -231190.94 64559.105 -1164727.5 1.0)
(quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 -18204.445)
)
(suspend)
(update-transforms! (-> self root))
(when (not arg0)
(ja-no-eval :group! flutflutegg-crack-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
(ja :group! flutflutegg-crack-ja :num! max)
(while (and (not (task-closed? (game-task beach-flutflut) (task-status need-reward-speech)))
(not (logtest? (-> self ambients-played) 1024))
)
(if (play-ambient (-> self ambient) "BIR-AM11" #f (the-as vector #f))
(logior! (-> self ambients-played) 1024)
)
(suspend)
)
(let ((gp-2 (current-time)))
(while (not (task-closed? (game-task beach-flutflut) (task-status need-reward-speech)))
(if (time-elapsed? gp-2 (seconds 10))
(level-hint-spawn
(text-id beach-flutflutegg-hint)
"sksp0029"
(the-as entity #f)
*entity-pool*
(game-task none)
)
)
(suspend)
)
)
(ja-channel-set! 0)
(while (not (task-closed? (game-task beach-flutflut) (task-status need-resolution)))
(suspend)
)
(ja-channel-set! 1)
(set-vector! (-> self root trans) -231190.94 64559.105 -1164727.5 1.0)
(quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 0.0)
(ja :group! flutflutegg-broke-ja :num! max)
(loop
(logior! (-> self mask) (process-mask sleep))
(suspend)
)
)
:post ja-post
)
(defmethod init-from-entity! ((this flutflutegg) (arg0 entity-actor))
(let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player))))
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-0 reaction) default-collision-reaction)
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0)))
(set! (-> s3-0 prim-core collide-as) (collide-kind enemy))
(set! (-> s3-0 collide-with) (collide-kind target))
(set! (-> s3-0 prim-core action) (collide-action solid))
(set! (-> s3-0 prim-core offense) (collide-offense indestructible))
(set-vector! (-> s3-0 local-sphere) 0.0 12288.0 0.0 12288.0)
(set-root-prim! s4-0 s3-0)
(let ((s2-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0))))
(set! (-> s2-0 prim-core collide-as) (collide-kind enemy))
(set! (-> s2-0 collide-with) (collide-kind target))
(set! (-> s2-0 prim-core action) (collide-action solid))
(set! (-> s2-0 prim-core offense) (collide-offense indestructible))
(set-vector! (-> s2-0 local-sphere) 0.0 8192.0 0.0 8192.0)
(append-prim s3-0 s2-0)
)
(let ((s2-1 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0))))
(set! (-> s2-1 prim-core collide-as) (collide-kind enemy))
(set! (-> s2-1 collide-with) (collide-kind target))
(set! (-> s2-1 prim-core action) (collide-action solid))
(set! (-> s2-1 prim-core offense) (collide-offense indestructible))
(set-vector! (-> s2-1 local-sphere) 0.0 16384.0 0.0 7782.4)
(append-prim s3-0 s2-1)
)
)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(backup-collide-with-as s4-0)
(set! (-> this root) s4-0)
)
(process-drawable-from-entity! this arg0)
(initialize-skeleton this *flutflutegg-sg* '())
(vector-z-quaternion! (-> this dir) (-> this root quat))
(set! (-> this start quad) (-> this root trans quad))
(set! (-> this fall-dist) 20480.0)
(set-yaw-angle-clear-roll-pitch! (-> this root) (+ -16384.0 (y-angle (-> this root))))
(set! (-> this pos) 0.0)
(set! (-> this vel) 0.0)
(set! (-> this wobbler) (new 'process 'wobbler))
(reset! (-> this wobbler) 0.1 0.98 4096.0)
(set! (-> this last-impulse-time) 0)
(set! (-> this ambients-played) 0)
(if (task-closed? (game-task beach-flutflut) (task-status need-reminder))
(go flutflutegg-break #t)
(go flutflutegg-idle)
)
(none)
)
(deftype harvester (process-drawable)
((root collide-shape :override)
(alt-actor entity-actor)
)
(:states
harvester-idle
(harvester-inflate symbol)
)
)
(defskelgroup *harvester-sg* harvester harvester-lod0-jg harvester-idle-ja
((harvester-lod0-mg (meters 20)) (harvester-lod1-mg (meters 40)) (harvester-lod2-mg (meters 999999)))
:bounds (static-spherem 0 7 0 11)
)
(defstate harvester-idle (harvester)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('update)
(if (and (-> self alt-actor) (logtest? (-> self alt-actor extra perm status) (entity-perm-status complete)))
(go harvester-inflate #f)
)
)
)
)
:code (behavior ()
(if (and (-> self alt-actor) (logtest? (-> self alt-actor extra perm status) (entity-perm-status complete)))
(go harvester-inflate #t)
)
(ja :group! harvester-inflate-ja :num! (identity (ja-aframe 1.0 0)))
(ja-post)
(loop
(logior! (-> self mask) (process-mask sleep))
(suspend)
)
)
)
(defstate harvester-inflate (harvester)
:code (behavior ((arg0 symbol))
(when (not arg0)
(ja-no-eval :group! harvester-inflate-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
(loop
(ja-no-eval :group! harvester-idle-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
)
:post ja-post
)
(defmethod init-from-entity! ((this harvester) (arg0 entity-actor))
(logior! (-> this mask) (process-mask ambient))
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player))))
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0)))
(set! (-> s3-0 prim-core collide-as) (collide-kind background))
(set! (-> s3-0 collide-with) (collide-kind target))
(set! (-> s3-0 prim-core action) (collide-action solid))
(set! (-> s3-0 transform-index) 0)
(set-vector! (-> s3-0 local-sphere) 0.0 20480.0 0.0 40960.0)
(set-root-prim! s4-0 s3-0)
(let ((s2-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s2-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s2-0 collide-with) (collide-kind target))
(set! (-> s2-0 prim-core action) (collide-action solid))
(set! (-> s2-0 prim-core offense) (collide-offense indestructible))
(set! (-> s2-0 transform-index) 4)
(set-vector! (-> s2-0 local-sphere) 0.0 6144.0 0.0 24576.0)
(append-prim s3-0 s2-0)
)
(let ((s2-1 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0))))
(set! (-> s2-1 prim-core collide-as) (collide-kind ground-object))
(set! (-> s2-1 collide-with) (collide-kind target))
(set! (-> s2-1 prim-core action) (collide-action solid))
(set! (-> s2-1 prim-core offense) (collide-offense indestructible))
(set! (-> s2-1 transform-index) 4)
(set-vector! (-> s2-1 local-sphere) 16384.0 -20480.0 16384.0 20480.0)
(append-prim s3-0 s2-1)
)
(let ((s2-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0))))
(set! (-> s2-2 prim-core collide-as) (collide-kind ground-object))
(set! (-> s2-2 collide-with) (collide-kind target))
(set! (-> s2-2 prim-core action) (collide-action solid))
(set! (-> s2-2 prim-core offense) (collide-offense indestructible))
(set! (-> s2-2 transform-index) 4)
(set-vector! (-> s2-2 local-sphere) 16384.0 -20480.0 -16384.0 20480.0)
(append-prim s3-0 s2-2)
)
(let ((s2-3 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 0))))
(set! (-> s2-3 prim-core collide-as) (collide-kind ground-object))
(set! (-> s2-3 collide-with) (collide-kind target))
(set! (-> s2-3 prim-core action) (collide-action solid))
(set! (-> s2-3 prim-core offense) (collide-offense indestructible))
(set! (-> s2-3 transform-index) 4)
(set-vector! (-> s2-3 local-sphere) -16384.0 -20480.0 -16384.0 20480.0)
(append-prim s3-0 s2-3)
)
(let ((s2-4 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 4) (the-as uint 0))))
(set! (-> s2-4 prim-core collide-as) (collide-kind ground-object))
(set! (-> s2-4 collide-with) (collide-kind target))
(set! (-> s2-4 prim-core action) (collide-action solid))
(set! (-> s2-4 prim-core offense) (collide-offense indestructible))
(set! (-> s2-4 transform-index) 4)
(set-vector! (-> s2-4 local-sphere) -16384.0 -20480.0 16384.0 20480.0)
(append-prim s3-0 s2-4)
)
)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(backup-collide-with-as s4-0)
(set! (-> this root) s4-0)
)
(process-drawable-from-entity! this arg0)
(initialize-skeleton this *harvester-sg* '())
(set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0))
(go harvester-idle)
(none)
)
(deftype beachcam (process-hidden)
()
)
(defun beachcam-spawn ()
(with-pp
(let ((gp-0 (entity-actor-lookup (-> pp entity) 'alt-actor 0)))
(when gp-0
(let* ((gp-1
(ppointer->handle (process-spawn
pov-camera
(-> gp-0 extra trans)
*beachcam-sg*
(new 'static 'spool-anim :name "beachcam-cannon" :index 3 :parts 1 :command-list '())
0
#f
'()
:to pp
)
)
)
(s5-2 (ppointer->handle
(process-spawn fuel-cell :init fuel-cell-init-as-clone gp-1 (-> pp entity extra perm task) :to pp)
)
)
)
(let ((v1-13 (handle->process gp-1)))
(if v1-13
(set! (-> (the-as pov-camera v1-13) notify-handle) (the-as handle s5-2))
)
)
(while (handle->process gp-1)
(suspend)
)
(send-event (handle->process s5-2) 'stop-cloning)
)
)
)
0
(none)
)
)