jak-project/goal_src/levels/jungleb/plant-boss.gc
water111 c3b6e7eb7e
some cleanup and docs on collide-touch and the tie extractor (#1074)
* some cleanup and docs on collide-touch and the tie extractor

* temp

* more updates

* update ref tests

* type fix

* rest of collide shape

* another set of updates
2022-01-12 10:47:17 -05:00

2804 lines
110 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: plant-boss.gc
;; name in dgo: plant-boss
;; dgos: JUB, L1
(declare-type plant-boss-leaf process-drawable)
;; DECOMP BEGINS
(deftype plant-boss (process-drawable)
((root-override collide-shape :offset 112)
(neck joint-mod :offset-assert 176)
(body joint-mod :offset-assert 180)
(leaf (pointer plant-boss-leaf) 2 :offset-assert 184)
(energy float :offset-assert 192)
(health float :offset-assert 196)
(ate symbol :offset-assert 200)
(cycle-count int32 :offset-assert 204)
(snap-count int32 :offset-assert 208)
(attack-prim collide-shape-prim-sphere 3 :offset-assert 212)
(death-prim collide-shape-prim-mesh 3 :offset-assert 224)
(cam-tracker handle :offset-assert 240)
(want-aphid-count int32 :offset-assert 248)
(aphid-count int32 :offset-assert 252)
(aphid-spawn-time int64 :offset-assert 256)
(interp float :offset-assert 264)
(try int32 :offset-assert 268)
(camera handle :offset-assert 272)
(money handle :offset-assert 280)
(try-inc symbol :offset-assert 288)
)
:heap-base #xc0
:method-count-assert 20
:size-assert #x124
:flag-assert #x1400c00124
(:states
(plant-boss-attack int)
(plant-boss-dead symbol)
(plant-boss-dead-bounce float)
plant-boss-dead-idle
plant-boss-eat
plant-boss-far-idle
(plant-boss-hit symbol)
plant-boss-idle
plant-boss-intro
(plant-boss-reset int)
(plant-boss-root-die symbol)
plant-boss-root-idle
plant-boss-spawn
(plant-boss-vine-die symbol)
(plant-boss-vine-hit basic)
plant-boss-vine-idle
plant-boss-vulnerable
)
)
(defmethod relocate plant-boss ((obj plant-boss) (arg0 int))
(if (nonzero? (-> obj neck))
(&+! (-> obj neck) arg0)
)
(if (nonzero? (-> obj body))
(&+! (-> obj body) arg0)
)
(dotimes (v1-8 3)
(if (nonzero? (-> obj attack-prim v1-8))
(&+! (-> obj attack-prim v1-8) arg0)
)
(if (nonzero? (-> obj death-prim v1-8))
(&+! (-> obj death-prim v1-8) arg0)
)
)
(the-as
plant-boss
((the-as (function process-drawable int process-drawable) (find-parent-method plant-boss 7)) obj arg0)
)
)
(deftype plant-boss-arm (process-drawable)
((parent-override (pointer plant-boss) :offset 12)
(root-override collide-shape :offset 112)
(side int32 :offset-assert 176)
)
:heap-base #x50
:method-count-assert 20
:size-assert #xb4
:flag-assert #x14005000b4
(:states
(plant-boss-arm-die symbol)
(plant-boss-arm-hit basic)
plant-boss-arm-idle
(plant-boss-back-arms-die symbol)
(plant-boss-back-arms-hit symbol)
plant-boss-back-arms-idle
)
)
(deftype plant-boss-leaf (process-drawable)
((root-override collide-shape-moving :offset 112)
(side int32 :offset-assert 176)
(state-object symbol :offset-assert 180)
(state-time-frame int64 :offset-assert 184)
)
:heap-base #x50
:method-count-assert 20
:size-assert #xc0
:flag-assert #x14005000c0
(:states
plant-boss-leaf-bounce
plant-boss-leaf-close
(plant-boss-leaf-die basic)
(plant-boss-leaf-idle symbol)
(plant-boss-leaf-open symbol)
(plant-boss-leaf-open-idle symbol)
)
)
(defskelgroup *plant-boss-sg* plant-boss
0
3
((1 (meters 999999)))
:bounds (static-spherem 0 0 10 20)
:longest-edge (meters 0)
:shadow 2
)
(defskelgroup *plant-boss-arm-sg* plant-boss
22
25
((23 (meters 999999)))
:bounds (static-spherem 0 0 0 20)
:longest-edge (meters 0)
:shadow 24
)
(defskelgroup *plant-boss-leaf-sg* plant-boss
37
42
((38 (meters 999999)))
:bounds (static-spherem 0 0 0 6)
:longest-edge (meters 0)
:shadow 39
)
(defskelgroup *plant-boss-back-arms-sg* plant-boss
30
33
((31 (meters 999999)))
:bounds (static-spherem 0 0 0 8)
:longest-edge (meters 0)
:shadow 32
)
(defskelgroup *plant-boss-vine-sg* plant-boss
48
50
((49 (meters 999999)))
:bounds (static-spherem 0 0 0 10)
:longest-edge (meters 0)
)
(defskelgroup *plant-boss-root-sg* plant-boss
53
55
((54 (meters 999999)))
:bounds (static-spherem 0 20 0 20)
:longest-edge (meters 0)
)
(define
*plant-boss-shadow-control*
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
:center
(new 'static 'vector :w (the-as float #x2))
:shadow-dir
(new 'static 'vector :y -1.0 :w 409600.0)
:bot-plane (new 'static 'plane :y 1.0 :w 37683.2)
:top-plane (new 'static 'plane :y 1.0 :w 4096.0)
)
)
)
(defbehavior plant-boss-generic-event-handler plant-boss ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(local-vars (v0-0 object))
(case arg2
(('child-die)
(set! v0-0 (seekl (-> self aphid-count) 0 1))
(set! (-> self aphid-count) (the-as int v0-0))
v0-0
)
(('joint)
24
)
(('try)
(-> self try)
)
(('notify)
(case (-> arg3 param 0)
(('pickup)
(when (type-type? (-> arg0 type) money)
(let ((gp-0 (-> self entity extra perm)))
(logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage))
(set! v0-0 (seekl (-> gp-0 user-int8 1) 5 1))
(set! (-> gp-0 user-int8 1) (the-as int v0-0))
)
v0-0
)
)
)
)
(('target)
(case (-> arg3 param 0)
(('die)
(if (= (-> arg3 param 1) 'plant-boss)
(go plant-boss-eat)
)
)
)
)
)
)
(defbehavior plant-boss-default-event-handler plant-boss ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('touch 'attack)
(if (and ((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> arg3 param 0))
(the-as collide-shape-moving (-> self root-override))
(the-as uint 1)
)
(not (= (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(-> self draw art-group data 13)
)
)
)
(send-event arg0 'attack-or-shove (-> arg3 param 0) (new 'static 'attack-info))
)
)
(else
(plant-boss-generic-event-handler arg0 arg1 arg2 arg3)
)
)
)
(defbehavior plant-boss-post plant-boss ()
(when *target*
(let ((gp-0 (-> *target* control root-prim prim-core)))
(set-target! (-> self neck) (the-as vector gp-0))
(set-target! (-> self body) (the-as vector gp-0))
)
)
(transform-post)
(none)
)
(defstate plant-boss-arm-idle (plant-boss-arm)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('hide 'die)
(go plant-boss-arm-die (the-as symbol (-> arg3 param 0)))
)
(('hit)
(go plant-boss-arm-hit (the-as basic (-> arg3 param 0)))
)
)
)
:code
(behavior ()
(ja-channel-set! 2)
(let ((gp-0 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
gp-0
(the-as art-joint-anim (-> self draw art-group data 25))
num-func-identity
)
(set! (-> gp-0 frame-num) 0.0)
)
(let ((gp-1 (-> self skel root-channel 1)))
(joint-control-channel-group-eval!
gp-1
(the-as art-joint-anim (-> self draw art-group data 26))
num-func-identity
)
(set! (-> gp-1 frame-num) 0.0)
)
(while #t
(let ((a0-3 (-> self skel root-channel 0)))
(set! (-> a0-3 param 0) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-loop!)
)
(let ((v1-16 (-> self skel root-channel 1)))
(set! (-> v1-16 frame-interp) (- (-> (new 'static 'array float 1 1.0) 0) (-> self parent-override 0 energy)))
)
(suspend)
)
(none)
)
:post
(the-as (function none :behavior plant-boss-arm) ja-post)
)
(defstate plant-boss-arm-hit (plant-boss-arm)
:event
(-> plant-boss-arm-idle event)
:code
(behavior ((arg0 basic))
(ja-channel-push! 1 30)
(let ((gp-0 (-> self skel root-channel 0)))
(set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 29)))
(set! (-> gp-0 param 0) (ja-aframe (the-as float 90.0) 0))
(set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-0 frame-num) 0.0)
(joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 29)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((gp-1 (-> self skel root-channel 0)))
(set! (-> gp-1 param 0) (ja-aframe (the-as float 90.0) 0))
(set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!)
)
)
(let ((a0-7 (-> self skel root-channel 0)))
(set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1)))
(set! (-> a0-7 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group! a0-7 (the-as art-joint-anim #f) num-func-seek!)
)
(ja-channel-push! 1 75)
(let ((gp-2 (-> self skel root-channel 0)))
(set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 25)))
(set! (-> gp-2 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 25)) data 0 length) -1))
)
(set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-2 frame-num) (ja-aframe (the-as float 90.0) 0))
(joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 25)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-11 (-> self skel root-channel 0)))
(set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1)))
(set! (-> a0-11 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!)
)
)
(go plant-boss-arm-idle)
(none)
)
:post
(the-as (function none :behavior plant-boss-arm) ja-post)
)
(defstate plant-boss-arm-die (plant-boss-arm)
:code
(behavior ((arg0 symbol))
(let ((a0-1 (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0)))
(set! (-> self root-override root-prim local-sphere w) 81920.0)
(set! (-> (the-as collide-shape-prim-mesh a0-1) local-sphere w) 69632.0)
(set! (-> (the-as collide-shape-prim-mesh a0-1) collide-with) (collide-kind target))
(set! (-> (the-as collide-shape-prim-mesh a0-1) prim-core collide-as) (collide-kind enemy))
(set! (-> (the-as collide-shape-prim-mesh a0-1) prim-core offense) (collide-offense indestructible))
(let ((t9-0 (method-of-object (the-as collide-shape-prim-mesh a0-1) change-mesh))
(v1-10 (-> self side))
)
(t9-0 (the-as collide-shape-prim-mesh a0-1) (if (= v1-10 1)
1
0
)
)
)
)
(cond
(arg0
(ja-channel-set! 1)
)
(else
(ja-channel-push! 1 75)
(let ((f30-0 (rand-vu-float-range (-> (new 'static 'array float 1 0.8) 0) (-> (new 'static 'array float 1 1.0) 0)))
)
(case (-> self side)
((1)
(let ((a0-6 (-> self skel root-channel 0)))
(set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 28)))
(set! (-> a0-6 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 28)) data 0 length) -1))
)
(set! (-> a0-6 param 1) f30-0)
(set! (-> a0-6 frame-num) 0.0)
(joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 28)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(let ((a0-7 (-> self skel root-channel 0)))
(set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1)))
(set! (-> a0-7 param 1) f30-0)
(joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
(else
(let ((a0-9 (-> self skel root-channel 0)))
(set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 27)))
(set! (-> a0-9 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 27)) data 0 length) -1))
)
(set! (-> a0-9 param 1) f30-0)
(set! (-> a0-9 frame-num) 0.0)
(joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 27)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(let ((a0-10 (-> self skel root-channel 0)))
(set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1)))
(set! (-> a0-10 param 1) f30-0)
(joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
)
)
)
(case (-> self side)
((1)
(let ((gp-1 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
gp-1
(the-as art-joint-anim (-> self draw art-group data 28))
num-func-identity
)
(set! (-> gp-1 frame-num)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 28)) data 0 length) -1))
)
)
)
(else
(let ((gp-2 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
gp-2
(the-as art-joint-anim (-> self draw art-group data 27))
num-func-identity
)
(set! (-> gp-2 frame-num)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 27)) data 0 length) -1))
)
)
)
)
(set! (-> (find-prim-by-id (-> self root-override) (the-as uint 1)) prim-core action) (collide-action))
0
(set! (-> (find-prim-by-id (-> self root-override) (the-as uint 2)) prim-core action) (collide-action))
0
(update-transforms! (-> self root-override))
(while #t
(logior! (-> self mask) (process-mask sleep))
(suspend)
)
(none)
)
:post
(the-as (function none :behavior plant-boss-arm) ja-post)
)
(defstate plant-boss-back-arms-idle (plant-boss-arm)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(if (or (= arg2 'touch) (= arg2 'attack))
(send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info))
)
(cond
((= arg2 'hit)
(go plant-boss-back-arms-hit (the-as symbol (-> arg3 param 0)))
)
((= arg2 'die)
(go plant-boss-back-arms-die (the-as symbol (-> arg3 param 0)))
)
)
)
:code
(behavior ()
(while #t
(let ((a0-0 (-> self skel root-channel 0)))
(set! (-> a0-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 33)))
(set! (-> a0-0 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 33)) data 0 length) -1))
)
(set! (-> a0-0 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> a0-0 frame-num) 0.0)
(joint-control-channel-group! a0-0 (the-as art-joint-anim (-> self draw art-group data 33)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-1 (-> self skel root-channel 0)))
(set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1)))
(set! (-> a0-1 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
(none)
)
:post
(the-as (function none :behavior plant-boss-arm) ja-post)
)
(defstate plant-boss-back-arms-hit (plant-boss-arm)
:event
(-> plant-boss-back-arms-idle event)
:code
(behavior ((arg0 symbol))
(ja-channel-push! 1 30)
(cond
((or (= arg0 'spin) (= arg0 'spin-air))
(let ((gp-1 (-> self skel root-channel 0)))
(set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 36)))
(set! (-> gp-1 param 0) (ja-aframe (the-as float 45.0) 0))
(set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-1 frame-num) 0.0)
(joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 36)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((gp-2 (-> self skel root-channel 0)))
(set! (-> gp-2 param 0) (ja-aframe (the-as float 45.0) 0))
(set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
(else
(let ((gp-3 (-> self skel root-channel 0)))
(set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 35)))
(set! (-> gp-3 param 0) (ja-aframe (the-as float 45.0) 0))
(set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-3 frame-num) 0.0)
(joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 35)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((gp-4 (-> self skel root-channel 0)))
(set! (-> gp-4 param 0) (ja-aframe (the-as float 45.0) 0))
(set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
(let ((a0-13 (-> self skel root-channel 0)))
(set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1)))
(set! (-> a0-13 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group! a0-13 (the-as art-joint-anim #f) num-func-seek!)
)
(ja-channel-push! 1 75)
(let ((gp-5 (-> self skel root-channel 0)))
(set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 33)))
(set! (-> gp-5 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 33)) data 0 length) -1))
)
(set! (-> gp-5 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-5 frame-num) (ja-aframe (the-as float 45.0) 0))
(joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 33)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-17 (-> self skel root-channel 0)))
(set! (-> a0-17 param 0) (the float (+ (-> a0-17 frame-group data 0 length) -1)))
(set! (-> a0-17 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!)
)
)
(go plant-boss-back-arms-idle)
(none)
)
:post
(the-as (function none :behavior plant-boss-arm) ja-post)
)
(defstate plant-boss-back-arms-die (plant-boss-arm)
:code
(behavior ((arg0 symbol))
(cond
(arg0
(ja-channel-set! 1)
)
(else
(ja-channel-push! 1 75)
(let ((a0-3 (-> self skel root-channel 0)))
(set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 34)))
(set! (-> a0-3 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) data 0 length) -1))
)
(set! (-> a0-3 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 34)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(let ((a0-4 (-> self skel root-channel 0)))
(set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1)))
(set! (-> a0-4 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
(clear-collide-with-as (-> self root-override))
(let ((gp-0 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
gp-0
(the-as art-joint-anim (-> self draw art-group data 34))
num-func-identity
)
(set! (-> gp-0 frame-num)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) data 0 length) -1))
)
)
(while #t
(suspend)
)
(none)
)
:post
(the-as (function none :behavior plant-boss-arm) ja-post)
)
(defstate plant-boss-vine-idle (plant-boss)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('hide 'die)
(go plant-boss-vine-die (the-as symbol (-> arg3 param 0)))
)
(('hit)
(go plant-boss-vine-hit (the-as basic (-> arg3 param 0)))
)
)
)
:code
(behavior ()
(let ((f30-0 (rand-vu-float-range (the-as float 0.9) (the-as float 1.1))))
(while #t
(let ((a0-1 (-> self skel root-channel 0)))
(set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 50)))
(set! (-> a0-1 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 50)) data 0 length) -1))
)
(set! (-> a0-1 param 1) f30-0)
(set! (-> a0-1 frame-num) 0.0)
(joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 50)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-2 (-> self skel root-channel 0)))
(set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1)))
(set! (-> a0-2 param 1) f30-0)
(joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
(none)
)
:post
(the-as (function none :behavior plant-boss) ja-post)
)
(defstate plant-boss-vine-hit (plant-boss)
:event
(-> plant-boss-vine-idle event)
:code
(behavior ((arg0 basic))
(ja-channel-push! 1 30)
(let ((gp-0 (-> self skel root-channel 0)))
(set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 52)))
(set! (-> gp-0 param 0) (ja-aframe (the-as float 45.0) 0))
(set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-0 frame-num) 0.0)
(joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 52)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((gp-1 (-> self skel root-channel 0)))
(set! (-> gp-1 param 0) (ja-aframe (the-as float 45.0) 0))
(set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!)
)
)
(let ((a0-7 (-> self skel root-channel 0)))
(set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1)))
(set! (-> a0-7 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group! a0-7 (the-as art-joint-anim #f) num-func-seek!)
)
(ja-channel-push! 1 75)
(let ((gp-2 (-> self skel root-channel 0)))
(set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 50)))
(set! (-> gp-2 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 50)) data 0 length) -1))
)
(set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-2 frame-num) (ja-aframe (the-as float 45.0) 0))
(joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 50)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-11 (-> self skel root-channel 0)))
(set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1)))
(set! (-> a0-11 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!)
)
)
(go plant-boss-vine-idle)
(none)
)
:post
(the-as (function none :behavior plant-boss) ja-post)
)
(defstate plant-boss-vine-die (plant-boss)
:code
(behavior ((arg0 symbol))
(when (not arg0)
(let ((f30-0 (rand-vu-float-range (-> (new 'static 'array float 1 0.0) 0) (-> (new 'static 'array float 1 1.0) 0)))
(gp-0 (-> *display* base-frame-counter))
)
(until (>= (- (-> *display* base-frame-counter) gp-0) (the int (* 300.0 f30-0)))
(let ((a0-2 (-> self skel root-channel 0)))
(set! (-> a0-2 param 0) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!)
)
(suspend)
)
)
(ja-channel-push! 1 75)
(let ((a0-6 (-> self skel root-channel 0)))
(set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 51)))
(set! (-> a0-6 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 51)) data 0 length) -1))
)
(set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> a0-6 frame-num) 0.0)
(joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 51)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(let ((a0-7 (-> self skel root-channel 0)))
(set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1)))
(set! (-> a0-7 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
(none)
)
:post
(the-as (function none :behavior plant-boss) ja-post)
)
(defstate plant-boss-root-idle (plant-boss)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('hide 'die)
(go plant-boss-root-die (the-as symbol (-> arg3 param 0)))
)
)
)
:code
(behavior ()
(let ((f30-0 (rand-vu-float-range (the-as float 0.9) (the-as float 1.1))))
(while #t
(let ((a0-1 (-> self skel root-channel 0)))
(set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 55)))
(set! (-> a0-1 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 55)) data 0 length) -1))
)
(set! (-> a0-1 param 1) f30-0)
(set! (-> a0-1 frame-num) 0.0)
(joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 55)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-2 (-> self skel root-channel 0)))
(set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1)))
(set! (-> a0-2 param 1) f30-0)
(joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
(none)
)
:post
(the-as (function none :behavior plant-boss) ja-post)
)
(defstate plant-boss-root-die (plant-boss)
:code
(behavior ((arg0 symbol))
(when (not arg0)
(let ((gp-0 (-> *display* base-frame-counter)))
(until (>= (- (-> *display* base-frame-counter) gp-0) 1200)
(+! (-> self root-override trans z) (* -4096.0 (-> *display* seconds-per-frame)))
(suspend)
)
)
)
(none)
)
:post
(the-as (function none :behavior plant-boss) ja-post)
)
(defbehavior plant-boss-arm-init plant-boss-arm ((arg0 vector) (arg1 float) (arg2 int))
(stack-size-set! (-> self main-thread) 128)
(let ((s3-0 (new 'process 'collide-shape self (collide-list-enum hit-by-player))))
(let ((s2-0 (new 'process 'collide-shape-prim-group s3-0 (the-as uint 3) 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 16384.0 0.0 16384.0)
(set-root-prim! s3-0 s2-0)
(let ((s1-0 (new 'process 'collide-shape-prim-mesh s3-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s1-0 prim-core collide-as) (collide-kind))
(set! (-> s1-0 collide-with) (collide-kind))
(set! (-> s1-0 prim-core action) (collide-action solid))
(set! (-> s1-0 prim-core offense) (collide-offense no-offense))
(set! (-> s1-0 transform-index) 5)
(set-vector! (-> s1-0 local-sphere) 0.0 0.0 0.0 81920.0)
(append-prim s2-0 s1-0)
)
(let ((s1-1 (new 'process 'collide-shape-prim-sphere s3-0 (the-as uint 1))))
(set! (-> s1-1 prim-core collide-as) (collide-kind enemy))
(set! (-> s1-1 collide-with) (collide-kind target))
(set! (-> s1-1 prim-core action) (collide-action solid))
(set! (-> s1-1 prim-core offense) (collide-offense indestructible))
(set-vector! (-> s1-1 local-sphere) 0.0 12288.0 0.0 12288.0)
(append-prim s2-0 s1-1)
)
(let ((s1-2 (new 'process 'collide-shape-prim-sphere s3-0 (the-as uint 2))))
(set! (-> s1-2 prim-core collide-as) (collide-kind enemy))
(set! (-> s1-2 collide-with) (collide-kind target))
(set! (-> s1-2 prim-core action) (collide-action solid))
(set! (-> s1-2 prim-core offense) (collide-offense indestructible))
(set-vector! (-> s1-2 local-sphere) 0.0 20480.0 0.0 12288.0)
(append-prim s2-0 s1-2)
)
)
(set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w)))
(backup-collide-with-as s3-0)
(set! (-> self root-override) s3-0)
)
(set! (-> self root-override trans quad) (-> arg0 quad))
(set-yaw-angle-clear-roll-pitch! (-> self root-override) arg1)
(set! (-> self side) arg2)
(initialize-skeleton self *plant-boss-arm-sg* '())
(set! (-> self draw shadow-ctrl) *plant-boss-shadow-control*)
(go plant-boss-arm-idle)
(none)
)
(defbehavior plant-boss-back-arms-init plant-boss-arm ((arg0 vector) (arg1 float) (arg2 int))
(stack-size-set! (-> self main-thread) 128)
(let ((s3-0 (new 'process 'collide-shape self (collide-list-enum hit-by-player))))
(let ((s2-0 (new 'process 'collide-shape-prim-group s3-0 (the-as uint 2) 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) -30720.0 6144.0 26624.0 16384.0)
(set-root-prim! s3-0 s2-0)
(let ((s1-0 (new 'process 'collide-shape-prim-sphere s3-0 (the-as uint 0))))
(set! (-> s1-0 prim-core collide-as) (collide-kind enemy))
(set! (-> s1-0 collide-with) (collide-kind target))
(set! (-> s1-0 prim-core action) (collide-action solid))
(set! (-> s1-0 prim-core offense) (collide-offense indestructible))
(set-vector! (-> s1-0 local-sphere) -32768.0 6144.0 32768.0 4915.2)
(append-prim s2-0 s1-0)
)
(let ((s1-1 (new 'process 'collide-shape-prim-sphere s3-0 (the-as uint 0))))
(set! (-> s1-1 prim-core collide-as) (collide-kind enemy))
(set! (-> s1-1 collide-with) (collide-kind target))
(set! (-> s1-1 prim-core action) (collide-action solid))
(set! (-> s1-1 prim-core offense) (collide-offense indestructible))
(set-vector! (-> s1-1 local-sphere) -28672.0 6144.0 20480.0 4915.2)
(append-prim s2-0 s1-1)
)
)
(set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w)))
(backup-collide-with-as s3-0)
(set! (-> self root-override) s3-0)
)
(set! (-> self root-override trans quad) (-> arg0 quad))
(set-yaw-angle-clear-roll-pitch! (-> self root-override) arg1)
(set! (-> self side) arg2)
(initialize-skeleton self *plant-boss-back-arms-sg* '())
(set! (-> self draw shadow-ctrl) *plant-boss-shadow-control*)
(go plant-boss-back-arms-idle)
(none)
)
(defbehavior plant-boss-vine-init plant-boss-arm ((arg0 vector) (arg1 vector) (arg2 float) (arg3 int))
(stack-size-set! (-> self main-thread) 128)
(set! (-> self root-override) (the-as collide-shape (new 'process 'trsqv)))
(set-vector! (-> self root-override scale) arg2 arg2 arg2 (-> (new 'static 'array float 1 1.0) 0))
(set! (-> self root-override trans quad) (-> arg0 quad))
(quaternion-zxy! (-> self root-override quat) arg1)
(set! (-> self side) arg3)
(initialize-skeleton self *plant-boss-vine-sg* '())
(go plant-boss-vine-idle)
(none)
)
(defbehavior plant-boss-root-init plant-boss-arm ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 int))
(stack-size-set! (-> self main-thread) 128)
(set! (-> self root-override) (the-as collide-shape (new 'process 'trsqv)))
(set! (-> self root-override scale quad) (-> arg2 quad))
(set! (-> self root-override trans quad) (-> arg0 quad))
(quaternion-zxy! (-> self root-override quat) arg1)
(set! (-> self side) arg3)
(initialize-skeleton self *plant-boss-root-sg* '())
(go plant-boss-root-idle)
(none)
)
(defstate plant-boss-leaf-idle (plant-boss-leaf)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('trigger)
(go plant-boss-leaf-open (the-as symbol (-> arg3 param 0)))
)
(('die)
(go plant-boss-leaf-die (the-as basic (-> arg3 param 0)))
)
)
)
:code
(behavior ((arg0 symbol))
(while #t
(case (-> self side)
((1)
(dotimes (gp-0 4)
(let ((a0-2 (-> self skel root-channel 0)))
(set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 43)))
(set! (-> a0-2 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 43)) data 0 length) -1))
)
(set! (-> a0-2 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 43)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-3 (-> self skel root-channel 0)))
(set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1)))
(set! (-> a0-3 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
(else
(dotimes (gp-1 5)
(let ((a0-5 (-> self skel root-channel 0)))
(set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 40)))
(set! (-> a0-5 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 40)) data 0 length) -1))
)
(set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 40)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-6 (-> self skel root-channel 0)))
(set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1)))
(set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
)
)
(none)
)
:post
(the-as (function none :behavior plant-boss-leaf) ja-post)
)
(defstate plant-boss-leaf-open (plant-boss-leaf)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('kill)
(go plant-boss-leaf-close)
)
(('die)
(go plant-boss-leaf-die (the-as basic (-> arg3 param 0)))
)
)
)
:trans
(the-as (function none :behavior plant-boss-leaf) rider-trans)
:code
(behavior ((arg0 symbol))
(let ((a0-1 (-> self skel root-channel 0)))
(set! (-> a0-1 param 0) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!)
)
(ja-channel-push! 1 30)
(case (-> self side)
((1)
(let ((gp-0 (-> self skel root-channel 0)))
(set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 44)))
(set! (-> gp-0 param 0) (ja-aframe (the-as float 30.0) 0))
(set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-0 frame-num) 0.0)
(joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(let ((gp-1 (-> self skel root-channel 0)))
(set! (-> gp-1 param 0) (ja-aframe (the-as float 30.0) 0))
(set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!)
)
)
(sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t)
(let ((gp-3 (-> self skel root-channel 0)))
(set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 44)))
(set! (-> gp-3 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 44)) data 0 length) -1))
)
(set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-3 frame-num) (ja-aframe (the-as float 30.0) 0))
(joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-14 (-> self skel root-channel 0)))
(set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1)))
(set! (-> a0-14 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
(else
(let ((gp-4 (-> self skel root-channel 0)))
(set! (-> gp-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 41)))
(set! (-> gp-4 param 0) (ja-aframe (the-as float 30.0) 0))
(set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-4 frame-num) 0.0)
(joint-control-channel-group! gp-4 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(let ((gp-5 (-> self skel root-channel 0)))
(set! (-> gp-5 param 0) (ja-aframe (the-as float 30.0) 0))
(set! (-> gp-5 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! gp-5 (the-as art-joint-anim #f) num-func-seek!)
)
)
(sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t)
(let ((gp-7 (-> self skel root-channel 0)))
(set! (-> gp-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 41)))
(set! (-> gp-7 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 41)) data 0 length) -1))
)
(set! (-> gp-7 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-7 frame-num) (ja-aframe (the-as float 30.0) 0))
(joint-control-channel-group! gp-7 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-26 (-> self skel root-channel 0)))
(set! (-> a0-26 param 0) (the float (+ (-> a0-26 frame-group data 0 length) -1)))
(set! (-> a0-26 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-26 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
(go plant-boss-leaf-open-idle #f)
(none)
)
:post
(the-as (function none :behavior plant-boss-leaf) rider-post)
)
(defstate plant-boss-leaf-open-idle (plant-boss-leaf)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('kill)
(set! (-> self state-object) #t)
(let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (-> arg3 param 0)))))
(set! (-> self state-time-frame) (the-as int v0-0))
v0-0
)
)
(('bonk)
(if (not (-> self state-object))
(go plant-boss-leaf-bounce)
)
)
(('die)
(go plant-boss-leaf-die (the-as basic (-> arg3 param 0)))
)
)
)
:trans
(the-as (function none :behavior plant-boss-leaf) rider-trans)
:code
(behavior ((arg0 symbol))
(local-vars (v1-19 symbol))
(set! (-> self state-object) arg0)
(case (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(((-> self draw art-group data 47) (-> self draw art-group data 46))
(ja-channel-push! 1 30)
)
)
(case (-> self side)
((1)
(let ((v1-10 (-> self skel root-channel 0)))
(set! (-> v1-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 45)))
)
)
(else
(let ((v1-13 (-> self skel root-channel 0)))
(set! (-> v1-13 frame-group) (the-as art-joint-anim (-> self draw art-group data 42)))
)
)
)
(until v1-19
(suspend)
(let ((a0-16 (-> self skel root-channel 0)))
(set! (-> a0-16 param 0) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-loop!)
)
(set! v1-19 (and (-> self state-object) (< (-> self state-time-frame) (-> *display* base-frame-counter))))
)
(go plant-boss-leaf-close)
(none)
)
:post
(the-as (function none :behavior plant-boss-leaf) rider-post)
)
(defstate plant-boss-leaf-bounce (plant-boss-leaf)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('kill)
(set! (-> self state-object) #t)
(let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (-> arg3 param 0)))))
(set! (-> self state-time-frame) (the-as int v0-0))
v0-0
)
)
(('die)
(go plant-boss-leaf-die (the-as basic (-> arg3 param 0)))
)
)
)
:trans
(the-as (function none :behavior plant-boss-leaf) rider-trans)
:code
(behavior ()
(ja-channel-push! 1 30)
(case (-> self side)
((1)
(let ((a0-2 (-> self skel root-channel 0)))
(set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 47)))
(set! (-> a0-2 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 47)) data 0 length) -1))
)
(set! (-> a0-2 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 47)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(let ((a0-3 (-> self skel root-channel 0)))
(set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1)))
(set! (-> a0-3 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
(else
(let ((a0-5 (-> self skel root-channel 0)))
(set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 46)))
(set! (-> a0-5 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 46)) data 0 length) -1))
)
(set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 46)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(let ((a0-6 (-> self skel root-channel 0)))
(set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1)))
(set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
(go plant-boss-leaf-open-idle (-> self state-object))
(none)
)
:post
(the-as (function none :behavior plant-boss-leaf) rider-post)
)
(defstate plant-boss-leaf-close (plant-boss-leaf)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('die)
(go plant-boss-leaf-die (the-as basic (-> arg3 param 0)))
)
)
)
:trans
(the-as (function none :behavior plant-boss-leaf) rider-trans)
:code
(behavior ()
(case (-> self side)
((1)
(sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t)
(let ((a0-4 (-> self skel root-channel 0)))
(set! (-> a0-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 44)))
(set! (-> a0-4 param 0) 0.0)
(set! (-> a0-4 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> a0-4 frame-num)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 44)) data 0 length) -1))
)
(joint-control-channel-group! a0-4 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-5 (-> self skel root-channel 0)))
(set! (-> a0-5 param 0) 0.0)
(set! (-> a0-5 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
(else
(sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t)
(let ((a0-10 (-> self skel root-channel 0)))
(set! (-> a0-10 frame-group) (the-as art-joint-anim (-> self draw art-group data 41)))
(set! (-> a0-10 param 0) 0.0)
(set! (-> a0-10 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> a0-10 frame-num)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 41)) data 0 length) -1))
)
(joint-control-channel-group! a0-10 (the-as art-joint-anim (-> self draw art-group data 41)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-11 (-> self skel root-channel 0)))
(set! (-> a0-11 param 0) 0.0)
(set! (-> a0-11 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
(go plant-boss-leaf-idle #f)
(none)
)
:post
(the-as (function none :behavior plant-boss-leaf) rider-post)
)
(defstate plant-boss-leaf-die (plant-boss-leaf)
:code
(behavior ((arg0 basic))
(while #t
(logior! (-> self mask) (process-mask sleep))
(suspend)
)
(none)
)
:post
(the-as (function none :behavior plant-boss-leaf) ja-post)
)
(defbehavior plant-boss-leaf-init plant-boss-leaf ((arg0 vector) (arg1 float) (arg2 int))
(stack-size-set! (-> self main-thread) 128)
(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) default-collision-reaction)
(set! (-> s3-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(alloc-riders s3-0 1)
(let ((s2-0 (new 'process 'collide-shape-prim-mesh s3-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) 8)
(set-vector! (-> s2-0 local-sphere) 0.0 0.0 12288.0 13926.4)
(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-override) s3-0)
)
(set! (-> self root-override trans quad) (-> arg0 quad))
(set-yaw-angle-clear-roll-pitch! (-> self root-override) arg1)
(set! (-> self side) arg2)
(initialize-skeleton self *plant-boss-leaf-sg* '())
(set! (-> self draw shadow-ctrl) *plant-boss-shadow-control*)
(go plant-boss-leaf-idle #f)
(none)
)
(defstate plant-boss-far-idle (plant-boss)
:code
(behavior ()
(clear-pending-settings-from-process *setting-control* self 'music)
(let ((gp-0 (-> self child)))
(while gp-0
(let ((s5-0 (ppointer->process gp-0)))
(set! gp-0 (-> gp-0 0 brother))
(if (type-type? (-> s5-0 type) aphid)
(deactivate s5-0)
)
)
)
)
(set! (-> self aphid-count) 0)
(let ((v1-9 (-> self neck)))
(set! (-> v1-9 blend) 0.0)
)
(let ((v1-10 (-> self body)))
(set! (-> v1-10 blend) 0.0)
)
(set-mode! (-> self neck) (joint-mod-handler-mode flex-blend))
(set-mode! (-> self body) (joint-mod-handler-mode flex-blend))
(set! (-> self body flex-blend) 0.0)
(ja-channel-set! 1)
(while #t
(let ((a0-6 (-> self skel root-channel 0)))
(set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 9)))
(set! (-> a0-6 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1))
)
(set! (-> a0-6 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> a0-6 frame-num) 0.0)
(joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 9)) num-func-seek!)
)
(until (ja-done? 0)
(set! (-> self energy) (seek (-> self energy) (the-as float 0.25) (-> *display* seconds-per-frame)))
(if (and (and *target*
(>= 245760.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))
)
(< (fabs (- (-> (target-pos 0) y) (-> self root-override trans y))) 40960.0)
)
(go plant-boss-intro)
)
(suspend)
(let ((a0-10 (-> self skel root-channel 0)))
(set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1)))
(set! (-> a0-10 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
(none)
)
:post
(the-as (function none :behavior plant-boss) ja-post)
)
(defstate plant-boss-intro (plant-boss)
:code
(behavior () (none)) ;; todo
:post
(the-as (function none :behavior plant-boss) ja-post)
)
(defstate plant-boss-idle (plant-boss)
:event
plant-boss-default-event-handler
:enter
(behavior ()
(set-setting! *setting-control* self 'music 'danger (-> (new 'static 'array float 1 0.0) 0) 0)
(set! (-> self state-time) (-> *display* base-frame-counter))
(set! (-> self body flex-blend) 0.0)
(set! (-> self neck flex-blend) (-> (new 'static 'array float 1 1.0) 0))
(none)
)
:trans
(behavior ()
(let ((f30-0 (vector-vector-distance (target-pos 0) (-> self root-override trans))))
(if (< 409600.0 f30-0)
(go plant-boss-far-idle)
)
(if (and (< f30-0 143360.0)
(>= (- (-> *display* base-frame-counter) (-> self state-time)) (cond
((>= (-> self try) 15)
1500
)
((>= (-> self try) 10)
1200
)
((>= (-> self try) 5)
900
)
(else
600
)
)
)
*target*
(zero? (logand (-> *target* state-flags) #x80f8))
)
(go plant-boss-attack 1)
)
)
(none)
)
:code
(behavior ()
(cond
((= (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(-> self draw art-group data 7)
)
(ja-channel-push! 1 150)
(let ((gp-0 (-> self skel root-channel 0)))
(set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 3)))
(set! (-> gp-0 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1))
)
(set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-0 frame-num) (ja-aframe (the-as float 60.0) 0))
(joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(let ((a0-7 (-> self skel root-channel 0)))
(set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1)))
(set! (-> a0-7 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
((= (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(-> self draw art-group data 12)
)
(ja-channel-push! 1 75)
(let ((gp-1 (-> self skel root-channel 0)))
(set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 13)))
(set! (-> gp-1 param 0) (ja-aframe (the-as float 75.0) 0))
(set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-1 frame-num) 0.0)
(joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(let ((gp-2 (-> self skel root-channel 0)))
(set! (-> gp-2 param 0) (ja-aframe (the-as float 75.0) 0))
(set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!)
)
)
(let ((a0-19 (-> self skel root-channel 0)))
(set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1)))
(set! (-> a0-19 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group! a0-19 (the-as art-joint-anim #f) num-func-seek!)
)
(ja-channel-push! 1 75)
(let ((gp-3 (-> self skel root-channel 0)))
(set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 3)))
(set! (-> gp-3 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1))
)
(set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-3 frame-num) (ja-aframe (the-as float 75.0) 0))
(joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(let ((a0-23 (-> self skel root-channel 0)))
(set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1)))
(set! (-> a0-23 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
((= (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(-> self draw art-group data 10)
)
)
(else
(ja-channel-push! 1 75)
)
)
(while #t
(when (or (and *cheat-mode* (cpad-hold? 1 r3)) (zero? (-> self aphid-count)))
(let ((a0-35 (-> self skel root-channel 0)))
(set! (-> a0-35 frame-group) (the-as art-joint-anim (-> self draw art-group data 3)))
(set! (-> a0-35 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1))
)
(set! (-> a0-35 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> a0-35 frame-num) 0.0)
(joint-control-channel-group! a0-35 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!)
)
(go plant-boss-vulnerable)
)
(let ((a0-36 (-> self skel root-channel 0)))
(set! (-> a0-36 frame-group) (the-as art-joint-anim (-> self draw art-group data 3)))
(set! (-> a0-36 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1))
)
(set! (-> a0-36 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> a0-36 frame-num) 0.0)
(joint-control-channel-group! a0-36 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-37 (-> self skel root-channel 0)))
(set! (-> a0-37 param 0) (the float (+ (-> a0-37 frame-group data 0 length) -1)))
(set! (-> a0-37 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-37 (the-as art-joint-anim #f) num-func-seek!)
)
)
(when (and *cheat-mode* (cpad-hold? 1 r3))
(let ((a0-43 (-> self skel root-channel 0)))
(set! (-> a0-43 frame-group) (the-as art-joint-anim (-> self draw art-group data 3)))
(set! (-> a0-43 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1))
)
(set! (-> a0-43 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> a0-43 frame-num) 0.0)
(joint-control-channel-group! a0-43 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!)
)
(go plant-boss-vulnerable)
)
(when (rand-vu-percent? (the-as float 0.2))
(let ((a0-45 (-> self skel root-channel 0)))
(set! (-> a0-45 frame-group) (the-as art-joint-anim (-> self draw art-group data 4)))
(set! (-> a0-45 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1))
)
(set! (-> a0-45 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> a0-45 frame-num) 0.0)
(joint-control-channel-group! a0-45 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-46 (-> self skel root-channel 0)))
(set! (-> a0-46 param 0) (the float (+ (-> a0-46 frame-group data 0 length) -1)))
(set! (-> a0-46 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-46 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
(none)
)
:post
plant-boss-post
)
(defstate plant-boss-spawn (plant-boss)
:event
plant-boss-default-event-handler
:enter
(behavior ()
(when (not (-> self try-inc))
(let ((gp-0 (-> self entity extra perm)))
(logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage))
(set! (-> gp-0 user-int8 0) (seekl (-> gp-0 user-int8 0) 255 1))
(set! (-> self try) (-> gp-0 user-int8 0))
)
(set! (-> self try-inc) #t)
)
(set! (-> self state-time) (-> *display* base-frame-counter))
(+! (-> self cycle-count) 1)
(set! (-> self snap-count) 0)
(set! (-> self body flex-blend) 0.0)
(set! (-> self neck flex-blend) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> self want-aphid-count) (min (- 4 (the int (-> self health))) (cond
((>= (-> self try) 15)
1
)
((>= (-> self try) 10)
2
)
(else
3
)
)
)
)
(none)
)
:trans
(behavior ()
(let ((f0-0 (vector-vector-distance (target-pos 0) (-> self root-override trans))))
(if (< 409600.0 f0-0)
(go plant-boss-far-idle)
)
)
(cond
((zero? (-> self want-aphid-count))
enter-state
(let ((v1-7 (the int (-> self health))))
(go plant-boss-attack (cond
((= v1-7 2)
2
)
((= v1-7 1)
3
)
(else
1
)
)
)
)
)
((>= (- (-> *display* base-frame-counter) (-> self aphid-spawn-time)) 420)
(let ((gp-1 (get-process *default-dead-pool* aphid #x4000)))
(when (when gp-1
(let ((t9-5 (method-of-type aphid activate)))
(t9-5 (the-as aphid gp-1) self 'aphid (the-as pointer #x70004000))
)
(run-now-in-process gp-1 aphid-init-by-other self (-> self root-override trans) (target-pos 0))
(-> gp-1 ppointer)
)
(+! (-> self aphid-count) 1)
(set! (-> self want-aphid-count) (seekl (-> self want-aphid-count) 0 1))
(set! (-> self aphid-spawn-time) (-> *display* base-frame-counter))
)
)
)
)
(none)
)
:code
(-> plant-boss-idle code)
:post
plant-boss-post
)
(defstate plant-boss-vulnerable (plant-boss)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('attack)
(when ((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> arg3 param 0))
(the-as collide-shape-moving (-> self root-override))
(the-as uint 1)
)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'shove)
(set! (-> a1-2 param 0) (-> arg3 param 0))
(let ((v1-6 (new 'static 'attack-info :mask #xc0)))
(set! (-> v1-6 shove-up) (-> (new 'static 'array float 1 8192.0) 0))
(set! (-> v1-6 shove-back) 24576.0)
(set! (-> a1-2 param 1) (the-as uint v1-6))
)
(send-event-function arg0 a1-2)
)
(go plant-boss-hit (the-as symbol (-> arg3 param 1)))
)
)
(else
(plant-boss-generic-event-handler arg0 arg1 arg2 arg3)
)
)
)
:enter
(behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(set! (-> self body flex-blend) 0.0)
(set! (-> self neck flex-blend) 0.0)
(set! (-> self attack-prim 0 local-sphere w) 12288.0)
(set! (-> self attack-prim 0 prim-core offense) (collide-offense indestructible))
(logior! (-> self attack-prim 0 prim-core action) (collide-action solid))
(none)
)
:exit
(behavior ()
(send-event (ppointer->process (-> self leaf 1)) 'kill 0)
(send-event (ppointer->process (-> self leaf 0)) 'kill 150)
(set! (-> self attack-prim 0 local-sphere w) 16384.0)
(set! (-> self attack-prim 0 prim-core offense) (collide-offense no-offense))
(logclear! (-> self attack-prim 0 prim-core action) (collide-action solid))
(none)
)
:code
(behavior ()
(ja-channel-push! 1 75)
(let ((gp-0 (-> self skel root-channel 0)))
(set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 11)))
(set! (-> gp-0 param 0) (ja-aframe (the-as float 60.0) 0))
(set! (-> gp-0 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-0 frame-num) 0.0)
(joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(let ((gp-1 (-> self skel root-channel 0)))
(set! (-> gp-1 param 0) (ja-aframe (the-as float 60.0) 0))
(set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!)
)
)
(send-event (ppointer->process (-> self leaf 1)) 'trigger)
(let ((gp-2 (-> self skel root-channel 0)))
(set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 11)))
(set! (-> gp-2 param 0) (ja-aframe (the-as float 120.0) 0))
(set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-2 frame-num) (ja-aframe (the-as float 60.0) 0))
(joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((gp-3 (-> self skel root-channel 0)))
(set! (-> gp-3 param 0) (ja-aframe (the-as float 120.0) 0))
(set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!)
)
)
(send-event (ppointer->process (-> self leaf 0)) 'trigger)
(let ((gp-4 (-> self skel root-channel 0)))
(set! (-> gp-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 11)))
(set! (-> gp-4 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) data 0 length) -1))
)
(set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-4 frame-num) (ja-aframe (the-as float 120.0) 0))
(joint-control-channel-group! gp-4 (the-as art-joint-anim (-> self draw art-group data 11)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-16 (-> self skel root-channel 0)))
(set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1)))
(set! (-> a0-16 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!)
)
)
(let ((gp-5 (cond
((>= (-> self try) 15)
6000
)
((>= (-> self try) 10)
3600
)
((>= (-> self try) 5)
3000
)
(else
2400
)
)
)
)
(while (< (- (-> *display* base-frame-counter) (-> self state-time)) gp-5)
(let ((a0-18 (-> self skel root-channel 0)))
(set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 12)))
(set! (-> a0-18 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1))
)
(set! (-> a0-18 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> a0-18 frame-num) 0.0)
(joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-19 (-> self skel root-channel 0)))
(set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1)))
(set! (-> a0-19 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
(go plant-boss-spawn)
(none)
)
:post
plant-boss-post
)
(defstate plant-boss-attack (plant-boss)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('touch 'attack)
(when (and ((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> arg3 param 0))
(the-as collide-shape-moving (-> self root-override))
(the-as uint 1)
)
(not (= (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(-> self draw art-group data 13)
)
)
)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'attack-or-shove)
(set! (-> a1-2 param 0) (-> arg3 param 0))
(let ((a0-8 (new 'static 'attack-info :mask #x20)))
(set! (-> a0-8 mode) 'plant-boss)
(set! (-> a1-2 param 1) (the-as uint a0-8))
)
(when (send-event-function arg0 a1-2)
(let ((v0-1 (the-as object #t)))
(set! (-> self ate) (the-as symbol v0-1))
v0-1
)
)
)
)
)
(else
(plant-boss-default-event-handler arg0 arg1 arg2 arg3)
)
)
)
:code
(behavior ((arg0 int))
(local-vars (v1-64 symbol))
(+! (-> self snap-count) 1)
(set! (-> self ate) #f)
(set! (-> self interp) 0.0)
(let ((s5-0 #f))
(if (= (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(-> self draw art-group data 7)
)
(set! s5-0 #t)
)
(ja-channel-push! 2 75)
(let ((s4-0 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
s4-0
(the-as art-joint-anim (-> self draw art-group data 5))
num-func-identity
)
(set! (-> s4-0 frame-num) 0.0)
)
(let ((s4-1 (-> self skel root-channel 1)))
(joint-control-channel-group-eval!
s4-1
(the-as art-joint-anim (-> self draw art-group data 6))
num-func-identity
)
(set! (-> s4-1 frame-num) 0.0)
)
(when s5-0
(let ((s5-1 (-> self skel root-channel 0)))
(set! (-> s5-1 num-func) num-func-identity)
(set! (-> s5-1 frame-num) (ja-aframe (the-as float 100.0) 0))
)
(let ((s5-2 (-> self skel root-channel 1)))
(set! (-> s5-2 num-func) num-func-identity)
(set! (-> s5-2 frame-num) (ja-aframe (the-as float 100.0) 0))
)
)
)
(let ((f30-0 (lerp-scale
(-> (new 'static 'array float 1 0.0) 0)
(-> (new 'static 'array float 1 1.0) 0)
(vector-vector-distance (target-pos 0) (-> self root-override trans))
(the-as float 26624.0)
(the-as float 86016.0)
)
)
)
(until (or v1-64 (ja-done? 0))
(set! (-> self body flex-blend) (seek
(-> self body flex-blend)
(-> (new 'static 'array float 1 1.0) 0)
(* 2.0 (-> *display* seconds-per-frame))
)
)
(set! (-> self neck flex-blend) (seek
(-> self neck flex-blend)
(-> (new 'static 'array float 1 0.0) 0)
(* 2.0 (-> *display* seconds-per-frame))
)
)
(set! f30-0 (seek
f30-0
(lerp-scale
(-> (new 'static 'array float 1 1.0) 0)
(-> (new 'static 'array float 1 0.0) 0)
(vector-vector-distance (target-pos 0) (-> self root-override trans))
(the-as float 26624.0)
(the-as float 86016.0)
)
(* 2.0 (-> *display* seconds-per-frame))
)
)
(set! (-> self interp) f30-0)
(let ((a0-19 (-> self skel root-channel 0)))
(set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1)))
(set! (-> a0-19 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!)
)
(let ((a0-20 (-> self skel root-channel 1)))
(set! (-> a0-20 frame-interp) f30-0)
(set! (-> a0-20 param 0) 0.0)
(joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-chan)
)
(suspend)
(set! v1-64 (>= (ja-aframe-num 0) 149.0))
)
)
(go plant-boss-reset arg0)
(none)
)
:post
plant-boss-post
)
(defstate plant-boss-eat (plant-boss)
:event
plant-boss-generic-event-handler
:exit
(behavior ()
(set! (-> self skel status) (logand -33 (-> self skel status)))
(let ((a0-4 (handle->process (-> self camera))))
(if a0-4
(deactivate a0-4)
)
)
(none)
)
:code
(behavior ()
(let ((f30-1 (if (= (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(-> self draw art-group data 5)
)
(fmax (-> (new 'static 'array float 1 129.0) 0) (ja-aframe-num 0))
(-> (new 'static 'array float 1 129.0) 0)
)
)
(gp-0 0)
)
(send-event *camera* 'change-state cam-lookat 0)
(logior! (-> self skel status) 1)
(ja-channel-push! 2 30)
(let ((s5-0 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
s5-0
(the-as art-joint-anim (-> self draw art-group data 18))
num-func-identity
)
(set! (-> s5-0 frame-num) (ja-aframe f30-1 0))
)
(let ((s5-1 (-> self skel root-channel 1)))
(set! (-> s5-1 frame-interp) (-> self interp))
(joint-control-channel-group-eval!
s5-1
(the-as art-joint-anim (-> self draw art-group data 19))
num-func-identity
)
(set! (-> s5-1 frame-num) (ja-aframe f30-1 0))
)
(until (>= (ja-aframe-num 0) 285.0)
(try-preload-stream *art-control* "$GAMCAM29" 0 self (the-as float -99.0))
(set! (-> self energy) (seek (-> self energy) (the-as float 0.5) (* 0.2 (-> *display* seconds-per-frame))))
(when (and (>= (ja-aframe-num 0) 175.0) (zero? gp-0))
(set! gp-0 1)
(let ((s5-2 (get-process *default-dead-pool* othercam #x4000)))
(set! (-> self camera)
(ppointer->handle (when s5-2
(let ((t9-11 (method-of-type othercam activate)))
(t9-11 (the-as othercam s5-2) self 'othercam (the-as pointer #x70004000))
)
(run-now-in-process s5-2 othercam-init-by-other self 28 #f #t)
(-> s5-2 ppointer)
)
)
)
)
(logior! (-> self skel status) 32)
(ambient-hint-spawn "gamcam29" (the-as vector #f) *entity-pool* 'ambient)
)
(when (and (>= (ja-aframe-num 0) 236.0) (= gp-0 1))
(set! gp-0 2)
(send-event (handle->process (-> self camera)) 'joint "camera2")
)
(set! (-> self body flex-blend)
(seek (-> self body flex-blend) (-> (new 'static 'array float 1 0.0) 0) (-> *display* seconds-per-frame))
)
(set! (-> self interp)
(seek (-> self interp) (-> (new 'static 'array float 1 0.0) 0) (-> *display* seconds-per-frame))
)
(let ((a0-31 (-> self skel root-channel 0)))
(set! (-> a0-31 param 0) (the float (+ (-> a0-31 frame-group data 0 length) -1)))
(set! (-> a0-31 param 1) 0.66)
(joint-control-channel-group-eval! a0-31 (the-as art-joint-anim #f) num-func-seek!)
)
(let ((a0-32 (-> self skel root-channel 1)))
(set! (-> a0-32 frame-interp) (-> self interp))
(set! (-> a0-32 param 0) 0.0)
(joint-control-channel-group-eval! a0-32 (the-as art-joint-anim #f) num-func-chan)
)
(suspend)
)
)
(ja-channel-push! 1 75)
(let ((a0-35 (-> self skel root-channel 0)))
(set! (-> a0-35 frame-group) (the-as art-joint-anim (-> self draw art-group data 20)))
(set! (-> a0-35 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 20)) data 0 length) -1))
)
(set! (-> a0-35 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> a0-35 frame-num) 0.0)
(joint-control-channel-group! a0-35 (the-as art-joint-anim (-> self draw art-group data 20)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(let ((a0-36 (-> self skel root-channel 0)))
(set! (-> a0-36 param 0) (the float (+ (-> a0-36 frame-group data 0 length) -1)))
(set! (-> a0-36 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-36 (the-as art-joint-anim #f) num-func-seek!)
)
)
(send-event *target* 'end-mode)
(set! (-> self skel status) (logand -2 (-> self skel status)))
(go plant-boss-idle)
(none)
)
:post
plant-boss-post
)
(defstate plant-boss-reset (plant-boss)
:event
(-> plant-boss-eat event)
:code
(behavior ((arg0 int))
(let ((gp-0 #f))
(cond
((= (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(-> self draw art-group data 10)
)
(set! gp-0 #t)
(ja-channel-push! 1 150)
)
(else
(ja-channel-push! 1 300)
)
)
(let ((s4-0 (-> self skel root-channel 0)))
(set! (-> s4-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 7)))
(set! (-> s4-0 param 0) (ja-aframe (the-as float 210.0) 0))
(set! (-> s4-0 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> s4-0 frame-num) 0.0)
(joint-control-channel-group! s4-0 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(set! (-> self body flex-blend)
(seek (-> self body flex-blend) (-> (new 'static 'array float 1 0.0) 0) (-> *display* seconds-per-frame))
)
(if (>= 1 arg0)
(set! (-> self neck flex-blend)
(seek (-> self neck flex-blend) (-> (new 'static 'array float 1 1.0) 0) (-> *display* seconds-per-frame))
)
)
(suspend)
(let ((s4-1 (-> self skel root-channel 0)))
(set! (-> s4-1 param 0) (ja-aframe (the-as float 210.0) 0))
(set! (-> s4-1 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!)
)
)
(if (< 1 arg0)
(go plant-boss-attack (+ arg0 -1))
)
(let ((s5-1 (-> self skel root-channel 0)))
(set! (-> s5-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 7)))
(set! (-> s5-1 param 0) (ja-aframe (the-as float 240.0) 0))
(set! (-> s5-1 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> s5-1 frame-num) (ja-aframe (the-as float 210.0) 0))
(joint-control-channel-group! s5-1 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!)
)
(until (ja-done? 0)
(set! (-> self body flex-blend)
(seek (-> self body flex-blend) (-> (new 'static 'array float 1 0.0) 0) (-> *display* seconds-per-frame))
)
(set! (-> self neck flex-blend) (seek
(-> self neck flex-blend)
(-> (new 'static 'array float 1 1.0) 0)
(* 2.0 (-> *display* seconds-per-frame))
)
)
(suspend)
(let ((s5-2 (-> self skel root-channel 0)))
(set! (-> s5-2 param 0) (ja-aframe (the-as float 240.0) 0))
(set! (-> s5-2 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! s5-2 (the-as art-joint-anim #f) num-func-seek!)
)
)
(let ((a0-23 (-> self skel root-channel 0)))
(set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1)))
(set! (-> a0-23 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group! a0-23 (the-as art-joint-anim #f) num-func-seek!)
)
(if gp-0
(go plant-boss-spawn)
(go plant-boss-idle)
)
)
(none)
)
:post
plant-boss-post
)
(defstate plant-boss-hit (plant-boss)
:event
(-> plant-boss-eat event)
:code
(behavior ((arg0 symbol))
(let ((s5-0 (-> self child)))
(while s5-0
(send-event (ppointer->process s5-0) 'hit arg0)
(set! s5-0 (-> s5-0 0 brother))
)
)
(set! (-> self health)
(seek (-> self health) (-> (new 'static 'array float 1 0.0) 0) (-> (new 'static 'array float 1 1.0) 0))
)
(send-event (ppointer->process (-> self leaf 1)) 'kill 0)
(send-event (ppointer->process (-> self leaf 0)) 'kill 0)
(let ((a0-5 (-> self skel root-channel 0)))
(set! (-> a0-5 param 0) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!)
)
(ja-channel-push! 1 60)
(cond
((= arg0 'spin)
(let ((gp-1 (-> self skel root-channel 0)))
(set! (-> gp-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 15)))
(set! (-> gp-1 param 0) (ja-aframe (the-as float 20.0) 0))
(set! (-> gp-1 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-1 frame-num) 0.0)
(joint-control-channel-group! gp-1 (the-as art-joint-anim (-> self draw art-group data 15)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(let ((gp-2 (-> self skel root-channel 0)))
(set! (-> gp-2 param 0) (ja-aframe (the-as float 20.0) 0))
(set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
((= arg0 'spin-air)
(let ((gp-3 (-> self skel root-channel 0)))
(set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 16)))
(set! (-> gp-3 param 0) (ja-aframe (the-as float 20.0) 0))
(set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-3 frame-num) 0.0)
(joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(let ((gp-4 (-> self skel root-channel 0)))
(set! (-> gp-4 param 0) (ja-aframe (the-as float 20.0) 0))
(set! (-> gp-4 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
(else
(let ((gp-5 (-> self skel root-channel 0)))
(set! (-> gp-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 14)))
(set! (-> gp-5 param 0) (ja-aframe (the-as float 20.0) 0))
(set! (-> gp-5 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> gp-5 frame-num) 0.0)
(joint-control-channel-group! gp-5 (the-as art-joint-anim (-> self draw art-group data 14)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(let ((gp-6 (-> self skel root-channel 0)))
(set! (-> gp-6 param 0) (ja-aframe (the-as float 20.0) 0))
(set! (-> gp-6 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! gp-6 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
(if (= (-> self health) 0.0)
(go plant-boss-dead #f)
)
(let ((a0-23 (-> self skel root-channel 0)))
(set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1)))
(set! (-> a0-23 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group! a0-23 (the-as art-joint-anim #f) num-func-seek!)
)
(while (not (ja-done? 0))
(suspend)
(ja-eval)
)
(go plant-boss-spawn)
(none)
)
:post
plant-boss-post
)
(defstate plant-boss-dead (plant-boss)
:event
plant-boss-generic-event-handler
:code
(behavior ((arg0 symbol))
(logclear! (-> self mask) (process-mask actor-pause))
(set! (-> self neck flex-blend) 0.0)
(set! (-> self body flex-blend) 0.0)
(let* ((s5-0 (get-task-control (game-task jungle-plant)))
(v1-5 (get-reminder s5-0 0))
)
(save-reminder s5-0 (logior v1-5 1) 0)
)
(cond
(arg0
(ja-channel-set! 1)
(let ((s5-1 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
s5-1
(the-as art-joint-anim (-> self draw art-group data 17))
num-func-identity
)
(set! (-> s5-1 frame-num)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1))
)
)
(suspend)
(if (not (task-complete? *game-info* (-> self entity extra perm task)))
(birth-pickup-at-point
(-> self node-list data 42 bone transform vector 3)
(pickup-type fuel-cell)
(the float (-> self entity extra perm task))
#f
self
(the-as fact-info #f)
)
)
)
(else
(let ((s4-0 #f)
(s5-2 #f)
)
(let ((a0-10 (-> self skel root-channel 0)))
(set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1)))
(set! (-> a0-10 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group! a0-10 (the-as art-joint-anim #f) num-func-seek!)
)
(ja-channel-push! 1 150)
(let ((a0-12 (-> self skel root-channel 0)))
(set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 17)))
(set! (-> a0-12 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1))
)
(set! (-> a0-12 param 1) (-> (new 'static 'array float 1 1.0) 0))
(set! (-> a0-12 frame-num) 0.0)
(joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-seek!)
)
(until (ja-done? 0)
(ja-blend-eval)
(when (< 100.0 (ja-aframe-num 0))
(set-mode! (-> self neck) (joint-mod-handler-mode flex-blend))
(set-mode! (-> self body) (joint-mod-handler-mode flex-blend))
)
(when (and (>= (ja-aframe-num 0) 180.0) (not s4-0))
(let ((s4-1 (-> self child)))
(while s4-1
(send-event (ppointer->process s4-1) 'hide #f)
(set! s4-1 (-> s4-1 0 brother))
)
)
(set! s4-0 #t)
)
(when (and (>= (ja-aframe-num 0) 189.0) (not s5-2))
(process-entity-status! self (entity-perm-status complete) #t)
(when (not (task-complete? *game-info* (-> self entity extra perm task)))
(set! s5-2 #t)
(birth-pickup-at-point
(-> self node-list data 42 bone transform vector 3)
(pickup-type fuel-cell)
(the float (-> self entity extra perm task))
#f
self
(the-as fact-info #f)
)
)
)
(suspend)
(let ((a0-22 (-> self skel root-channel 0)))
(set! (-> a0-22 param 0) (the float (+ (-> a0-22 frame-group data 0 length) -1)))
(set! (-> a0-22 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
)
(let ((s5-3 (-> self child)))
(while s5-3
(send-event (ppointer->process s5-3) 'die arg0)
(set! s5-3 (-> s5-3 0 brother))
)
)
(set! (-> self death-prim 0 collide-with) (collide-kind target))
(set! (-> self death-prim 0 prim-core collide-as) (collide-kind enemy))
(set! (-> self death-prim 0 prim-core offense) (collide-offense indestructible))
(logior! (-> self death-prim 0 prim-core action) (collide-action solid))
(set! (-> self death-prim 1 prim-core collide-as) (collide-kind enemy))
(set! (-> self death-prim 1 collide-with) (collide-kind target))
(set! (-> self death-prim 1 prim-core offense) (collide-offense indestructible))
(logior! (-> self death-prim 1 prim-core action) (collide-action solid))
(set! (-> (find-prim-by-id (-> self root-override) (the-as uint 8)) prim-core action) (collide-action))
0
(set! (-> (find-prim-by-id (-> self root-override) (the-as uint 16)) prim-core action) (collide-action))
0
(logior! (-> self mask) (process-mask actor-pause))
(clear-pending-settings-from-process *setting-control* self 'music)
(go plant-boss-dead-idle)
(none)
)
:post
(behavior ()
(plant-boss-post)
(respond-to-collisions! (-> self root-override))
(none)
)
)
(defstate plant-boss-dead-idle (plant-boss)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('bonk)
(go plant-boss-dead-bounce (lerp-scale
(the-as float 0.1)
(-> (new 'static 'array float 1 1.0) 0)
(the-as float (-> arg3 param 1))
(the-as float 40960.0)
(the-as float 81920.0)
)
)
)
(else
(plant-boss-generic-event-handler arg0 arg1 arg2 arg3)
)
)
)
:code
(behavior ()
(ja-channel-set! 1)
(let ((gp-0 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
gp-0
(the-as art-joint-anim (-> self draw art-group data 17))
num-func-identity
)
(set! (-> gp-0 frame-num)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1))
)
)
(let ((gp-1 (-> *display* base-frame-counter)))
(until (>= (- (-> *display* base-frame-counter) gp-1) 1500)
(transform-post)
(respond-to-collisions! (-> self root-override))
(suspend)
)
)
(while #t
(logior! (-> self mask) (process-mask sleep))
(suspend)
)
(none)
)
)
(defstate plant-boss-dead-bounce (plant-boss)
:event
plant-boss-generic-event-handler
:trans
(the-as (function none :behavior plant-boss) rider-trans)
:code
(behavior ((arg0 float))
(let ((v1-2 (-> self entity extra perm)))
(if (and (< 0.3 arg0) (and (not (handle->process (-> self money))) (< (-> v1-2 user-int8 1) 5)))
(set! (-> self money) (ppointer->handle (birth-pickup-at-point
(-> self node-list data 42 bone transform vector 3)
(pickup-type money)
(-> (new 'static 'array float 1 1.0) 0)
#t
self
(the-as fact-info #f)
)
)
)
)
)
(ja-channel-set! 2)
(let ((s5-0 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
s5-0
(the-as art-joint-anim (-> self draw art-group data 21))
num-func-identity
)
(set! (-> s5-0 frame-num) 0.0)
)
(let ((s5-1 (-> self skel root-channel 1)))
(set! (-> s5-1 frame-interp) (- (-> (new 'static 'array float 1 1.0) 0) arg0))
(joint-control-channel-group-eval!
s5-1
(the-as art-joint-anim (-> self draw art-group data 17))
num-func-identity
)
(set! (-> s5-1 frame-num)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1))
)
)
(until (ja-done? 0)
(suspend)
(let ((a0-13 (-> self skel root-channel 0)))
(set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1)))
(set! (-> a0-13 param 1) (-> (new 'static 'array float 1 1.0) 0))
(joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!)
)
(let ((v1-39 (-> self skel root-channel 1)))
(set! (-> v1-39 frame-interp) (- (-> (new 'static 'array float 1 1.0) 0) arg0))
(set! (-> v1-39 num-func) num-func-identity)
(set! (-> v1-39 frame-num) (the float (+ (-> v1-39 frame-group data 0 length) -1)))
)
)
(go plant-boss-dead-idle)
(none)
)
:post
(the-as (function none :behavior plant-boss) rider-post)
)
(defmethod init-from-entity! plant-boss ((obj plant-boss) (arg0 entity-actor))
(stack-size-set! (-> obj main-thread) 512)
(let ((s4-0 (new 'process 'collide-shape obj (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 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 24576.0 32768.0 81920.0)
(set-root-prim! s4-0 s3-0)
(let ((s2-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 8))))
(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 12288.0 12288.0 12288.0)
(append-prim s3-0 s2-0)
)
(let ((s2-1 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 16))))
(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 20480.0 12288.0 12288.0)
(append-prim s3-0 s2-1)
)
(let ((s2-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 5))))
(set! (-> s2-2 prim-core collide-as) (collide-kind enemy))
(set! (-> s2-2 collide-with) (collide-kind target))
(set! (-> s2-2 prim-core offense) (collide-offense no-offense))
(set! (-> s2-2 transform-index) 13)
(set-vector! (-> s2-2 local-sphere) 0.0 (-> (new 'static 'array float 1 8192.0) 0) 0.0 16384.0)
(append-prim s3-0 s2-2)
(set! (-> obj attack-prim 0) s2-2)
)
(let ((s2-3 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s2-3 prim-core collide-as) (collide-kind))
(set! (-> s2-3 collide-with) (collide-kind))
(set! (-> s2-3 prim-core offense) (collide-offense no-offense))
(set! (-> s2-3 transform-index) 13)
(set-vector! (-> s2-3 local-sphere) 0.0 (-> (new 'static 'array float 1 8192.0) 0) 0.0 16384.0)
(append-prim s3-0 s2-3)
(set! (-> obj death-prim 0) s2-3)
)
(let ((s2-4 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0))))
(set! (-> s2-4 prim-core collide-as) (collide-kind))
(set! (-> s2-4 collide-with) (collide-kind))
(set! (-> s2-4 prim-core offense) (collide-offense no-offense))
(set! (-> s2-4 transform-index) 12)
(set-vector! (-> s2-4 local-sphere) 0.0 -24576.0 0.0 40960.0)
(append-prim s3-0 s2-4)
(set! (-> obj death-prim 1) s2-4)
)
)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(backup-collide-with-as s4-0)
(set! (-> obj root-override) s4-0)
)
(process-drawable-from-entity! obj arg0)
(initialize-skeleton obj *plant-boss-sg* '())
(set! (-> obj draw shadow-ctrl) *plant-boss-shadow-control*)
(let ((s5-1 (get-process *default-dead-pool* plant-boss-arm #x4000)))
(when s5-1
(let ((t9-18 (method-of-type plant-boss-arm activate)))
(t9-18 (the-as plant-boss-arm s5-1) obj 'plant-boss-arm (the-as pointer #x70004000))
)
(run-now-in-process
s5-1
plant-boss-arm-init
(vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -24576.0 :z 8192.0 :w 1.0))
(-> (new 'static 'array float 1 -8192.0) 0)
1
)
(-> s5-1 ppointer)
)
)
(let ((s5-2 (get-process *default-dead-pool* plant-boss-arm #x4000)))
(when s5-2
(let ((t9-21 (method-of-type plant-boss-arm activate)))
(t9-21 (the-as plant-boss-arm s5-2) obj 'plant-boss-arm (the-as pointer #x70004000))
)
(run-now-in-process
s5-2
plant-boss-arm-init
(vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 24576.0 :z 8192.0 :w 1.0))
(-> (new 'static 'array float 1 8192.0) 0)
0
)
(-> s5-2 ppointer)
)
)
(let ((s5-3 (get-process *default-dead-pool* plant-boss-arm #x4000)))
(when s5-3
(let ((t9-24 (method-of-type plant-boss-arm activate)))
(t9-24 (the-as plant-boss-arm s5-3) obj 'plant-boss-arm (the-as pointer #x70004000))
)
(run-now-in-process
s5-3
plant-boss-back-arms-init
(vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :w 1.0))
(-> (new 'static 'array float 1 0.0) 0)
2
)
(-> s5-3 ppointer)
)
)
(let ((s5-4 (get-process *default-dead-pool* plant-boss-arm #x4000)))
(when s5-4
(let ((t9-27 (method-of-type plant-boss-arm activate)))
(t9-27 (the-as plant-boss-arm s5-4) obj 'plant-boss-arm (the-as pointer #x70004000))
)
(run-now-in-process
s5-4
plant-boss-vine-init
(vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 38912.0 :z 8192.0 :w 1.0))
(new 'static 'vector :y 14563.556)
(-> (new 'static 'array float 1 1.0) 0)
3
)
(-> s5-4 ppointer)
)
)
(let ((s5-5 (get-process *default-dead-pool* plant-boss-arm #x4000)))
(when s5-5
(let ((t9-30 (method-of-type plant-boss-arm activate)))
(t9-30 (the-as plant-boss-arm s5-5) obj 'plant-boss-arm (the-as pointer #x70004000))
)
(run-now-in-process
s5-5
plant-boss-vine-init
(vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -40960.0 :z 8192.0 :w 1.0))
(new 'static 'vector :y -5461.3335)
(-> (new 'static 'array float 1 1.0) 0)
3
)
(-> s5-5 ppointer)
)
)
(let ((s5-6 (get-process *default-dead-pool* plant-boss-arm #x4000)))
(when s5-6
(let ((t9-33 (method-of-type plant-boss-arm activate)))
(t9-33 (the-as plant-boss-arm s5-6) obj 'plant-boss-arm (the-as pointer #x70004000))
)
(run-now-in-process
s5-6
plant-boss-vine-init
(vector+!
(new-stack-vector0)
(-> obj root-override trans)
(new 'static 'vector :x -29491.2 :z -7168.0 :w 1.0)
)
(new 'static 'vector :x -1820.4445 :y -11286.756)
(-> (new 'static 'array float 1 0.8) 0)
3
)
(-> s5-6 ppointer)
)
)
(let ((s5-7 (get-process *default-dead-pool* plant-boss-arm #x4000)))
(when s5-7
(let ((t9-36 (method-of-type plant-boss-arm activate)))
(t9-36 (the-as plant-boss-arm s5-7) obj 'plant-boss-arm (the-as pointer #x70004000))
)
(run-now-in-process
s5-7
plant-boss-vine-init
(vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 32768.0 :z -3072.0 :w 1.0))
(new 'static 'vector :x -910.2222 :y 22755.555)
(-> (new 'static 'array float 1 0.8) 0)
3
)
(-> s5-7 ppointer)
)
)
(let ((s5-8 (get-process *default-dead-pool* plant-boss-arm #x4000)))
(when s5-8
(let ((t9-39 (method-of-type plant-boss-arm activate)))
(t9-39 (the-as plant-boss-arm s5-8) obj 'plant-boss-arm (the-as pointer #x70004000))
)
(run-now-in-process
s5-8
plant-boss-root-init
(vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 18841.6 :z 4096.0 :w 1.0))
(new 'static 'vector :y -4096.0)
(new 'static 'vector :x 1.0 :y 1.0 :z 1.0)
4
)
(-> s5-8 ppointer)
)
)
(let ((s5-9 (get-process *default-dead-pool* plant-boss-arm #x4000)))
(when s5-9
(let ((t9-42 (method-of-type plant-boss-arm activate)))
(t9-42 (the-as plant-boss-arm s5-9) obj 'plant-boss-arm (the-as pointer #x70004000))
)
(run-now-in-process
s5-9
plant-boss-root-init
(vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -18841.6 :z 4096.0 :w 1.0))
(new 'static 'vector :x 364.0889 :y 4096.0)
(new 'static 'vector :x 1.0 :y 1.25 :z 1.0)
4
)
(-> s5-9 ppointer)
)
)
(let ((s5-10 (get-process *default-dead-pool* plant-boss-arm #x4000)))
(when s5-10
(let ((t9-45 (method-of-type plant-boss-arm activate)))
(t9-45 (the-as plant-boss-arm s5-10) obj 'plant-boss-arm (the-as pointer #x70004000))
)
(run-now-in-process
s5-10
plant-boss-root-init
(vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :z -2048.0 :w 1.0))
(new 'static 'vector :x 1820.4445)
(new 'static 'vector :x 0.9 :y 1.5 :z 1.0)
4
)
(-> s5-10 ppointer)
)
)
(let ((s5-11 (get-process *default-dead-pool* plant-boss-leaf #x4000)))
(set! (-> obj leaf 0)
(the-as
(pointer plant-boss-leaf)
(when s5-11
(let ((t9-48 (method-of-type plant-boss-leaf activate)))
(t9-48 (the-as plant-boss-leaf s5-11) obj 'plant-boss-leaf (the-as pointer #x70004000))
)
(run-now-in-process
s5-11
plant-boss-leaf-init
(vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :w 1.0))
(-> (new 'static 'array float 1 0.0) 0)
0
)
(-> s5-11 ppointer)
)
)
)
)
(let ((s5-12 (get-process *default-dead-pool* plant-boss-leaf #x4000)))
(set! (-> obj leaf 1)
(the-as
(pointer plant-boss-leaf)
(when s5-12
(let ((t9-51 (method-of-type plant-boss-leaf activate)))
(t9-51 (the-as plant-boss-leaf s5-12) obj 'plant-boss-leaf (the-as pointer #x70004000))
)
(run-now-in-process
s5-12
plant-boss-leaf-init
(vector+!
(new-stack-vector0)
(-> obj root-override trans)
(new 'static 'vector :x -13189.12 :y 2838.528 :z 12288.0 :w 1.0)
)
(-> (new 'static 'array float 1 0.0) 0)
1
)
(-> s5-12 ppointer)
)
)
)
)
(set! (-> obj energy) 0.25)
(set! (-> obj health) 3.0)
(set! (-> obj cam-tracker) (the-as handle #f))
(set! (-> obj camera) (the-as handle #f))
(set! (-> obj money) (the-as handle #f))
(set! (-> obj try-inc) #f)
(set! (-> obj neck) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) obj 13))
(set-vector!
(-> obj neck twist-max)
3640.889
(-> (new 'static 'array float 1 8192.0) 0)
0.0
(-> (new 'static 'array float 1 1.0) 0)
)
(set! (-> obj neck up) (the-as uint 0))
(set! (-> obj neck nose) (the-as uint 1))
(set! (-> obj neck ear) (the-as uint 2))
(set! (-> obj body) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) obj 4))
(set-vector!
(-> obj body twist-max)
0.0
(-> (new 'static 'array float 1 8192.0) 0)
0.0
(-> (new 'static 'array float 1 1.0) 0)
)
(set! (-> obj body up) (the-as uint 1))
(set! (-> obj body nose) (the-as uint 0))
(set! (-> obj body ear) (the-as uint 2))
(if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
(go plant-boss-dead #t)
)
(go plant-boss-far-idle)
(none)
)