jak-project/goal_src/levels/ogre/ogreboss.gc

2838 lines
106 KiB
Common Lisp
Raw Normal View History

;;-*-Lisp-*-
2020-09-04 14:44:23 -04:00
(in-package goal)
;; name: ogreboss.gc
;; name in dgo: ogreboss
;; dgos: L1, OGR
(declare-type ogreboss process-drawable)
(define-extern *ogreboss* ogreboss)
;; DECOMP BEGINS
(defskelgroup *ogreboss-sg* ogreboss
0
2
((1 (meters 999999)))
:bounds (static-spherem 0 0 0 20)
:longest-edge (meters 0)
)
(defskelgroup *ogreboss-cam-sg* ogreboss
25
27
((26 (meters 999999)))
:bounds (static-spherem 0 0 0 3)
:longest-edge (meters 0)
)
(defskelgroup *ogreboss-shoot-boulder-sg* ogreboss
29
32
((30 (meters 999999)))
:bounds (static-spherem 0 0 0 300)
:longest-edge (meters 0)
:shadow 31
)
(defskelgroup *ogreboss-shoot-boulder-break-sg* ogreboss
33
35
((34 (meters 999999)))
:bounds (static-spherem 0 0 0 15)
:longest-edge (meters 0)
)
(defskelgroup *ogreboss-bounce-boulder-sg* ogreboss
36
38
((37 (meters 999999)))
:bounds (static-spherem 0 0 0 50)
:longest-edge (meters 0)
)
(defskelgroup *ogreboss-super-boulder-sg* ogreboss
39
41
((40 (meters 999999)))
:bounds (static-spherem 0 0 0 8)
:longest-edge (meters 0)
)
(defskelgroup *ogreboss-column-sg* ogreboss
45
47
((46 (meters 999999)))
:bounds (static-spherem 0 0 0 30)
:longest-edge (meters 0)
)
(define *ogreboss-missile-shadow-control*
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
:center
(new 'static 'vector :w (the-as float #xe))
:shadow-dir
(new 'static 'vector :y -1.0 :w 614400.0)
:bot-plane
(new 'static 'plane :y 1.0 :w -102400.0)
:top-plane
(new 'static 'plane :y 1.0 :w -143360.0)
)
)
)
(define *ogreboss-shadow-control*
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
:center
(new 'static 'vector :w (the-as float #xc))
:shadow-dir
(new 'static 'vector :y -1.0 :w 614400.0)
:bot-plane
(new 'static 'plane :y 1.0 :w -102400.0)
:top-plane
(new 'static 'plane :y 1.0 :w -143360.0)
:fade-dist 819200.0
)
)
)
(deftype ogreboss-missile (process-drawable)
((parent-override (pointer process-drawable) :offset 12)
(root-override collide-shape-moving :offset 112)
(trajectory trajectory :inline :offset-assert 176)
(src-pos vector :inline :offset-assert 224)
(dest-pos vector :inline :offset-assert 240)
(start-time time-frame :offset-assert 256)
(tumble-quat quaternion :inline :offset-assert 272)
(blast-radius float :offset-assert 288)
(pickup-type pickup-type :offset-assert 292)
)
:heap-base #xc0
:method-count-assert 20
:size-assert #x128
:flag-assert #x1400c00128
(:states
ogreboss-missile-idle
ogreboss-missile-impact
ogreboss-missile-seek
)
)
(defstate ogreboss-missile-idle (ogreboss-missile)
:enter
(behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:code
(behavior ()
(let ((gp-0 (new 'stack-no-clear 'vector))
(s5-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'collide-tri-result))
)
(while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 6))
(let ((f0-1 (the float (- (-> *display* base-frame-counter) (-> self start-time)))))
(eval-position! (-> self trajectory) f0-1 gp-0)
)
(vector-! s5-0 gp-0 (-> self root-override trans))
(let ((f0-2 (fill-and-probe-using-line-sphere
*collide-cache*
(-> self root-override trans)
s5-0
(the-as float 4096.0)
(-> self root-override root-prim collide-with)
(-> self parent-override 0)
s4-0
1
)
)
)
(cond
((>= f0-2 0.0)
(vector+*! (-> self root-override trans) (-> self root-override trans) s5-0 f0-2)
(go ogreboss-missile-impact)
)
(else
(set! (-> self root-override trans quad) (-> gp-0 quad))
0
)
)
)
(quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat))
(spawn (-> self part) (-> self root-override trans))
(suspend)
)
)
(cleanup-for-death self)
(none)
)
:post
(the-as (function none :behavior ogreboss-missile) transform-post)
)
(defstate ogreboss-missile-seek (ogreboss-missile)
:code
(behavior ()
(let ((gp-0 (new 'stack-no-clear 'vector))
(s5-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'collide-tri-result))
)
(set! (-> self state-time) (-> *display* base-frame-counter))
(until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2))
(empty)
)
(while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 6))
(let ((f0-1 (the float (- (-> *display* base-frame-counter) (-> self start-time)))))
(eval-position! (-> self trajectory) f0-1 gp-0)
)
(vector-! s5-0 gp-0 (-> self root-override trans))
(let ((f0-2 (fill-and-probe-using-line-sphere
*collide-cache*
(-> self root-override trans)
s5-0
(the-as float 4096.0)
(-> self root-override root-prim collide-with)
(-> self parent-override 0)
s4-0
1
)
)
)
(cond
((>= f0-2 0.0)
(vector+*! (-> self root-override trans) (-> self root-override trans) s5-0 f0-2)
(go ogreboss-missile-impact)
)
(else
(set! (-> self root-override trans quad) (-> gp-0 quad))
0
)
)
)
(spawn (-> self part) (-> self root-override trans))
(suspend)
)
)
(cleanup-for-death self)
(none)
)
:post
(behavior ()
(quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat))
(transform-post)
(none)
)
)
(defun ogreboss-rock-explosion-effect ((arg0 basic))
(with-pp
(sound-play-by-name (static-sound-name "ogre-explode") (new-sound-id) 1024 0 0 1 (the-as symbol arg0))
(let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000)))
(when gp-1
(let ((t9-3 (method-of-type part-tracker activate)))
(t9-3 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000))
)
(run-now-in-process gp-1 part-tracker-init (-> *part-group-id-table* 471) -1 #f #f #f arg0)
(-> gp-1 ppointer)
)
)
(activate! *camera-smush-control* (the-as float 819.2) 37 600 (the-as float 1.0) (the-as float 0.995))
(let* ((s4-1 (get-process *default-dead-pool* manipy #x4000))
(gp-2 (when s4-1
(let ((t9-7 (method-of-type manipy activate)))
(t9-7 (the-as manipy s4-1) pp 'manipy (the-as pointer #x70004000))
)
(run-now-in-process s4-1 manipy-init arg0 (-> pp entity) *ogreboss-shoot-boulder-break-sg* #f)
(-> s4-1 ppointer)
)
)
)
(quaternion-axis-angle!
(-> (the-as manipy (-> gp-2 0)) root quat)
(the-as float 0.0)
(the-as float 1.0)
(the-as float 0.0)
(* 65536.0 (rand-vu))
)
(send-event (ppointer->process gp-2) 'anim-mode 'play1)
(the-as handle (ppointer->handle gp-2))
)
)
)
(defun ogreboss-missile-scale-explosion ((arg0 handle))
(let* ((gp-0 (handle->process arg0))
(f0-0 (-> (the-as process-drawable gp-0) root scale x))
(f0-2 (seek f0-0 (the-as float 0.0) (-> *display* seconds-per-frame)))
)
(set-vector! (-> (the-as process-drawable gp-0) root scale) f0-2 f0-2 f0-2 1.0)
)
0
(none)
)
(defstate ogreboss-missile-impact (ogreboss-missile)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('touched)
(cond
(#f
(cond
((= (-> arg0 type) target)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) 'attack)
(set! (-> a1-1 param 0) (-> arg3 param 0))
(let ((a0-3 (new 'static 'attack-info :mask #x20)))
(set! (-> a0-3 mode) 'explode)
(set! (-> a1-1 param 1) (the-as uint a0-3))
)
(send-event-function arg0 a1-1)
)
)
(else
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 4)
(set! (-> a1-2 message) 'attack)
(set! (-> a1-2 param 0) (-> arg3 param 0))
(set! (-> a1-2 param 1) (the-as uint 'explode))
(let ((v1-12 (+ *global-attack-id* 1)))
(set! *global-attack-id* v1-12)
(set! (-> a1-2 param 2) (the-as uint v1-12))
)
(set! (-> a1-2 param 3) (the-as uint 0))
(send-event-function arg0 a1-2)
)
)
)
(if (= (-> arg0 type) target)
(send-event (ppointer->process (-> self parent-override)) 'victory)
)
)
(else
(let* ((s4-0 arg0)
(t1-0 (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) target))
s4-0
)
)
)
(cond
(t1-0
(let ((s4-1 (new 'stack-no-clear 'vector))
(s3-0 (new 'stack-no-clear 'vector))
(t2-0 (new 'stack-no-clear 'collide-tri-result))
)
0.0
(set! (-> s4-1 quad) (-> (the-as target t1-0) control trans quad))
(set! (-> s4-1 y) (+ 4096.0 (-> s4-1 y)))
(set-vector! s3-0 0.0 (- 118784.0 (-> s4-1 y)) 0.0 1.0)
(let ((f30-0
(fill-and-probe-using-line-sphere
*collide-cache*
s4-1
s3-0
(the-as float 40.96)
(-> self root-override root-prim collide-with)
t1-0
t2-0
1
)
)
)
(add-debug-vector
#t
(bucket-id debug-draw1)
s4-1
s3-0
(meters 0.00024414062)
(the-as rgba (new 'static 'rgba :g #xff :a #x80))
)
(when (>= f30-0 0.0)
(let ((a1-7 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-7 from) self)
(set! (-> a1-7 num-params) 2)
(set! (-> a1-7 message) 'attack)
(set! (-> a1-7 param 0) (-> arg3 param 0))
(let ((a0-16 (new 'static 'attack-info :mask #x20)))
(set! (-> a0-16 mode) 'damage)
(set! (-> a1-7 param 1) (the-as uint a0-16))
)
(send-event-function arg0 a1-7)
)
(send-event (ppointer->process (-> self parent-override)) 'victory)
)
)
)
)
(else
(let ((v1-37 (new 'stack-no-clear 'vector)))
(set-vector! v1-37 0.0 -12288000.0 0.0 1.0)
(send-event arg0 'impulse v1-37)
)
)
)
)
)
)
)
)
)
:code
(behavior ()
(logclear! (-> self mask) (process-mask enemy projectile))
(ogreboss-rock-explosion-effect (the-as basic (-> self root-override trans)))
(when (nonzero? (-> self pickup-type))
(let ((t1-0 (new 'static 'fact-info :options (fact-options fade) :fade-time (seconds 5))))
(birth-pickup-at-point
(-> self root-override trans)
(-> self pickup-type)
(-> *FACT-bank* eco-single-inc)
#t
[game] pc port progress menu (#1281) * fix typo * more typo * shorten discord rpc text * allow expanding enums after the fact (untested) * make `game_text` work similar to subtitles * update progress decomp * update some types + `do-not-decompile` in bitfield * fixes and fall back to original progress code * update `progress` decomp with new enums * update config files * fix enums and debug menu * always allocate (but not use) a lot of particles * small rework to display mode options * revert resolution/aspect-ratio symbol mess * begin the override stuff * make `progress-draw` more readable * more fixes * codacy good boy points * first step overriding code * finish progress overrides, game options menu fully functional! * minor fixes * Update game.gp * Update sparticle-launcher.gc * clang * change camera controls text * oops * some cleanup * derp * nice job * implement menu scrolling lol * make scrollable menus less cramped, fix arrows * make some carousell things i guess * add msaa carousell to test * oops * Update progress-pc.gc * make `pc-get-screen-size` (untested) * resolution menu * input fixes * return when selecting resolution * scroll fixes * Update progress-pc.gc * add "fit to screen" button * bug * complete resolutions menu * aspect ratio menu * subtitles language * subtitle speaker * final adjustments * ref test * fix tests * fix ref! * reduce redundancy a bit * fix mem leaks? * save settings on progress exit * fix init reorder * remove unused code * rename goal project-like files to the project extension * sha display toggle * aspect ratio settings fixes * dont store text db's in compiler * properly save+load native aspect stuff
2022-04-11 18:38:54 -04:00
*entity-pool*
t1-0
)
)
)
(ja-channel-set! 0)
(let ((v1-10 (-> self root-override root-prim)))
(set! (-> v1-10 local-sphere w) (-> self blast-radius))
(set! (-> v1-10 prim-core world-sphere w) (-> self blast-radius))
(set! (-> v1-10 collide-with) (collide-kind cak-2 cak-3 target crate enemy wall-object ground-object))
(set! (-> v1-10 prim-core collide-as) (collide-kind enemy))
)
(update-transforms! (-> self root-override))
(let ((a1-1 (new 'stack-no-clear 'overlaps-others-params)))
(set! (-> a1-1 options) (the-as uint 0))
(set! (-> a1-1 tlist) *touching-list*)
(find-overlapping-shapes (-> self root-override) a1-1)
)
(suspend)
(clear-collide-with-as (-> self root-override))
(while (-> self child)
(suspend)
)
(cleanup-for-death self)
(none)
)
:post
(the-as (function none :behavior ogreboss-missile) ja-post)
)
(deftype ogreboss-missile-init-data (structure)
((src vector :offset-assert 0)
(dest vector :offset-assert 4)
(duration time-frame :offset-assert 8)
(xz-speed float :offset-assert 16)
(blast-radius float :offset-assert 20)
(pickup-type pickup-type :offset-assert 24)
)
:method-count-assert 9
:size-assert #x1c
:flag-assert #x90000001c
)
(defbehavior ogreboss-missile-init-by-other ogreboss-missile ((arg0 ogreboss-missile-init-data) (arg1 entity))
(set! (-> self entity) arg1)
(let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player))))
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction) default-collision-reaction)
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(let ((s4-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3))))
(set! (-> s4-0 prim-core collide-as) (collide-kind enemy))
(set! (-> s4-0 collide-with) (collide-kind background cak-2 target wall-object ground-object))
(set! (-> s4-0 prim-core action) (collide-action solid))
(set! (-> s4-0 prim-core offense) (collide-offense normal-attack))
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 12288.0)
(set-root-prim! s5-0 s4-0)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(backup-collide-with-as s5-0)
(set! (-> s5-0 event-self) 'touched)
(set! (-> self root-override) s5-0)
)
(set! (-> self root-override trans quad) (-> arg0 src quad))
(set! (-> self src-pos quad) (-> arg0 src quad))
(set! (-> self dest-pos quad) (-> arg0 dest quad))
(set! (-> self root-override quat vec quad) (-> self parent-override 0 root quat vec quad))
(vector-identity! (-> self root-override scale))
(initialize-skeleton self *ogreboss-shoot-boulder-sg* '())
(set! (-> self mask) (logior (process-mask enemy projectile) (-> self mask)))
(logclear! (-> self mask) (process-mask actor-pause))
(set! (-> self draw shadow-ctrl) *ogreboss-missile-shadow-control*)
(if (> (-> arg0 duration) 0)
(setup-from-to-duration!
(-> self trajectory)
(-> arg0 src)
(-> arg0 dest)
(the float (-> arg0 duration))
(the-as float -0.22755557)
)
(setup-from-to-xz-vel!
(-> self trajectory)
(-> arg0 src)
(-> arg0 dest)
(-> arg0 xz-speed)
(the-as float -0.22755557)
)
)
(set! (-> self start-time) (-> *display* base-frame-counter))
(set! (-> self blast-radius) (-> arg0 blast-radius))
(set! (-> self pickup-type) (-> arg0 pickup-type))
(let ((f30-1 (* 65536.0 (rand-vu))))
(quaternion-axis-angle!
(-> self tumble-quat)
(cos f30-1)
(the-as float 0.0)
(sin f30-1)
(the-as float 2730.6667)
)
)
(set! (-> self part) (create-launch-control (-> *part-group-id-table* 469) self))
(set-vector! (-> self draw color-emissive) 0.125 0.0625 0.0 0.0)
(go ogreboss-missile-idle)
(none)
)
(deftype ogreboss-super-boulder (process-drawable)
((parent-override (pointer process-drawable) :offset 12)
(root-override collide-shape-moving :offset 112)
(orig-pos vector :inline :offset-assert 176)
(src-pos vector :inline :offset-assert 192)
(spin-axis vector :inline :offset-assert 208)
(joint joint-mod-blend-local :offset-assert 224)
(speed float :offset-assert 228)
(size float :offset-assert 232)
(grow-rate float :offset-assert 236)
(lava entity-actor :offset-assert 240)
(sound-id sound-id :offset-assert 244)
(hit-boss symbol :offset-assert 248)
(tumble-quat quaternion :inline :offset-assert 256)
)
:heap-base #xa0
:method-count-assert 20
:size-assert #x110
:flag-assert #x1400a00110
(:states
ogreboss-super-boulder-die
ogreboss-super-boulder-hit
ogreboss-super-boulder-idle
ogreboss-super-boulder-killed-player
ogreboss-super-boulder-land
ogreboss-super-boulder-roll
ogreboss-super-boulder-throw
)
)
(defbehavior ogreboss-super-boulder-event-handler ogreboss-super-boulder ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('touch)
(when (and *target* ((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> arg3 param 0))
(-> 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) 'attack)
(set! (-> a1-2 param 0) (-> arg3 param 0))
(let ((a0-4 (new 'static 'attack-info :mask #x20)))
(set! (-> a0-4 mode) 'ogreboss-super-boulder)
(set! (-> a1-2 param 1) (the-as uint a0-4))
)
(send-event-function arg0 a1-2)
)
(go ogreboss-super-boulder-killed-player)
)
)
(('effect)
(case (-> arg3 param 0)
(('lava-ripple)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) self)
(set! (-> a1-3 num-params) 0)
(set! (-> a1-3 message) 'boulder)
(let ((t9-3 send-event-function)
(v1-12 (-> self lava))
)
(t9-3
(if v1-12
(-> v1-12 extra process)
)
a1-3
)
)
)
)
(else
#f
)
)
)
)
)
(defstate ogreboss-super-boulder-idle (ogreboss-super-boulder)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('speedup)
(let ((f0-1 (* 1.3 (-> self speed))))
(set! (-> self speed) f0-1)
f0-1
)
)
(('grow-faster)
(let ((f0-2 1.0))
(set! (-> self grow-rate) f0-2)
f0-2
)
)
(('go-throw)
(go ogreboss-super-boulder-throw)
)
(('go-hit)
(go ogreboss-super-boulder-hit)
)
(('go-die)
(go ogreboss-super-boulder-die)
)
)
)
:exit
(behavior ()
(sound-stop (-> self sound-id))
(none)
)
:code
(behavior ()
(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 41))
num-func-identity
)
(set! (-> gp-0 frame-num) 0.0)
)
(set! (-> self joint enable) #t)
(set! (-> self joint blend) 1.0)
(set! (-> self state-time) (-> *display* base-frame-counter))
(while #t
(quaternion-vector-angle!
(-> self tumble-quat)
(-> self spin-axis)
(* 32768.0 (-> *display* seconds-per-frame) (-> self speed))
)
(quaternion*! (-> self joint transform quat) (-> self joint transform quat) (-> self tumble-quat))
(+! (-> self size) (* (-> self grow-rate) (-> *display* seconds-per-frame)))
(set! (-> self size) (fmin 1.0 (-> self size)))
(let* ((f0-10 (sqrtf (-> self size)))
(f28-0 (* 0.0033333334 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))
(f30-0 (* 116508.445 f28-0 (-> self speed)))
)
(set-vector! (-> self joint transform scale) f0-10 f0-10 f0-10 1.0)
(let ((gp-1 (-> self joint transform)))
(set! (-> gp-1 trans x) (* 4096.0 (sin f30-0)))
(set! (-> gp-1 trans y) (+ 122880.0 (* 12288.0 (sin (* 98304.0 f28-0)))))
(set! (-> gp-1 trans z) (* 4096.0 (cos f30-0)))
(set! (-> gp-1 trans w) 1.0)
)
)
(spawn (-> self part) (-> self node-list data 3 bone transform vector 3))
(sound-play-by-name
(static-sound-name "ogre-rock")
(-> self sound-id)
1024
0
0
1
(the-as symbol (-> self joint transform))
)
(suspend)
)
(none)
)
:post
(the-as (function none :behavior ogreboss-super-boulder) transform-post)
)
(defbehavior ogreboss-super-boulder-impact-effect ogreboss-super-boulder ()
(sound-play-by-name
(static-sound-name "ogre-boulder")
(new-sound-id)
1024
0
0
1
(the-as symbol (-> self draw origin))
)
(activate! *camera-smush-control* (the-as float 819.2) 37 600 (the-as float 1.0) (the-as float 0.995))
(let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000)))
(when gp-1
(let ((t9-4 (method-of-type part-tracker activate)))
(t9-4 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000))
)
(run-now-in-process gp-1 part-tracker-init (-> *part-group-id-table* 471) -1 #f #f #f (-> self draw origin))
(-> gp-1 ppointer)
)
)
0
(none)
)
(defbehavior ogreboss-super-boulder-play-hit-anim ogreboss-super-boulder ()
(set! (-> self src-pos quad) (-> self root-override trans quad))
(let ((a0-3 (-> self skel root-channel 0)))
(set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 43)))
(set! (-> a0-3 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 43)) data 0 length) -1))
)
(set! (-> a0-3 param 1) 1.0)
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 43)) num-func-seek!)
)
(until (ja-done? 0)
(set! (-> self joint blend)
(seek (-> self joint blend) (the-as float 0.0) (* 5.0 (-> *display* seconds-per-frame)))
)
(let* ((f1-1 (/ (- (ja-frame-num 0) (ja-aframe (the-as float 54.0) 0))
(- (the float (ja-num-frames 0)) (ja-aframe (the-as float 54.0) 0))
)
)
(f0-13 (fmax 0.0 (fmin 1.0 f1-1)))
)
(vector-lerp! (-> self root-override trans) (-> self src-pos) (-> self orig-pos) f0-13)
)
(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) 1.0)
(joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!)
)
)
(the-as object 0)
)
(defstate ogreboss-super-boulder-throw (ogreboss-super-boulder)
:event
ogreboss-super-boulder-event-handler
:code
(behavior ()
(set! (-> self hit-boss) #f)
(set! (-> self src-pos quad) (-> self root-override trans quad))
(let ((a0-3 (-> self skel root-channel 0)))
(set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 42)))
(set! (-> a0-3 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 42)) data 0 length) -1))
)
(set! (-> a0-3 param 1) 1.0)
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 42)) num-func-seek!)
)
(until (ja-done? 0)
(set! (-> self joint blend)
(seek (-> self joint blend) (the-as float 0.0) (* 5.0 (-> *display* seconds-per-frame)))
)
(let* ((f1-1 (/ (- (ja-frame-num 0) (ja-aframe (the-as float 32.0) 0))
(- (the float (ja-num-frames 0)) (ja-aframe (the-as float 32.0) 0))
)
)
(f0-13 (fmax 0.0 (fmin 1.0 f1-1)))
)
(vector-lerp! (-> self root-override trans) (-> self src-pos) (-> self orig-pos) f0-13)
)
0
(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) 1.0)
(joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!)
)
)
(go ogreboss-super-boulder-land)
(none)
)
:post
(the-as (function none :behavior ogreboss-super-boulder) transform-post)
)
(defstate ogreboss-super-boulder-hit (ogreboss-super-boulder)
:event
ogreboss-super-boulder-event-handler
:code
(behavior ()
(set! (-> self hit-boss) #t)
(ogreboss-super-boulder-play-hit-anim)
(go ogreboss-super-boulder-land)
(none)
)
:post
(the-as (function none :behavior ogreboss-super-boulder) transform-post)
)
(defstate ogreboss-super-boulder-die (ogreboss-super-boulder)
:event
ogreboss-super-boulder-event-handler
:code
(behavior ()
(ogreboss-super-boulder-play-hit-anim)
(ogreboss-rock-explosion-effect (the-as basic (-> self draw origin)))
(ogreboss-rock-explosion-effect (the-as basic (-> self draw origin)))
(ja-channel-set! 0)
(while (-> self child)
(suspend)
)
(cleanup-for-death self)
(none)
)
:post
(the-as (function none :behavior ogreboss-super-boulder) transform-post)
)
(defstate ogreboss-super-boulder-land (ogreboss-super-boulder)
:event
ogreboss-super-boulder-event-handler
:code
(behavior ()
(set! (-> self root-override trans quad) (-> self orig-pos quad))
(ogreboss-super-boulder-impact-effect)
(set! (-> self joint enable) #f)
(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 100.0) 0))
(set! (-> gp-0 param 1) 1.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)
(when (< 81920.0
(vector-vector-distance (the-as vector (-> self root-override root-prim prim-core)) (target-pos 0))
)
(ja-channel-push! 1 30)
(go ogreboss-super-boulder-roll)
)
(suspend)
(let ((gp-2 (-> self skel root-channel 0)))
(set! (-> gp-2 param 0) (ja-aframe (the-as float 100.0) 0))
(set! (-> gp-2 param 1) 1.0)
(joint-control-channel-group-eval! gp-2 (the-as art-joint-anim #f) num-func-seek!)
)
)
(go ogreboss-super-boulder-roll)
(none)
)
:post
(behavior ()
(transform-post)
0
(none)
)
)
(defstate ogreboss-super-boulder-roll (ogreboss-super-boulder)
:event
ogreboss-super-boulder-event-handler
:code
(behavior ()
(ogreboss-super-boulder-impact-effect)
(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 162.0) 0))
(set! (-> gp-0 param 1) 1.0)
(set! (-> gp-0 frame-num) (ja-aframe (the-as float 100.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)
(suspend)
(let ((gp-1 (-> self skel root-channel 0)))
(set! (-> gp-1 param 0) (ja-aframe (the-as float 162.0) 0))
(set! (-> gp-1 param 1) 1.0)
(joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!)
)
)
(set! (-> self root-override root-prim local-sphere w) 28672.0)
(cond
((-> self hit-boss)
(while (let ((gp-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> gp-2 from) self)
(set! (-> gp-2 num-params) 0)
(set! (-> gp-2 message) 'break)
(let ((s5-0 send-event-function)
(v1-22 (entity-actor-lookup (-> self entity) 'alt-actor 0))
)
(not (s5-0
(if v1-22
(-> v1-22 extra process)
)
gp-2
)
)
)
)
(suspend)
)
)
(else
(while (let ((gp-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> gp-3 from) self)
(set! (-> gp-3 num-params) 0)
(set! (-> gp-3 message) 'break-no-damage)
(let ((s5-1 send-event-function)
(v1-27 (entity-actor-lookup (-> self entity) 'alt-actor 0))
)
(not (s5-1
(if v1-27
(-> v1-27 extra process)
)
gp-3
)
)
)
)
(suspend)
)
)
)
(let ((gp-4 (-> self skel root-channel 0)))
(set! (-> gp-4 frame-group) (the-as art-joint-anim (-> self draw art-group data 44)))
(set! (-> gp-4 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 44)) data 0 length) -1))
)
(set! (-> gp-4 param 1) 1.0)
(set! (-> gp-4 frame-num) (ja-aframe (the-as float 162.0) 0))
(joint-control-channel-group! gp-4 (the-as art-joint-anim (-> self draw art-group data 44)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-12 (-> self skel root-channel 0)))
(set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1)))
(set! (-> a0-12 param 1) 1.0)
(joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!)
)
)
(cleanup-for-death self)
(none)
)
:post
(behavior ()
(transform-post)
0
(none)
)
)
(defmethod relocate ogreboss-super-boulder ((obj ogreboss-super-boulder) (arg0 int))
(if (nonzero? (-> obj joint))
(&+! (-> obj joint) arg0)
)
(the-as
ogreboss-super-boulder
((the-as (function process-drawable int process-drawable) (find-parent-method ogreboss-super-boulder 7))
obj
arg0
)
)
)
(defstate ogreboss-super-boulder-killed-player (ogreboss-super-boulder)
:code
(behavior ()
(clear-collide-with-as (-> self root-override))
(ja-post)
(while #t
(suspend)
)
(none)
)
)
(defbehavior ogreboss-super-boulder-init-by-other ogreboss-super-boulder ((arg0 vector) (arg1 float) (arg2 entity))
(set! (-> self entity) arg2)
(let ((s4-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-others))))
(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-sphere s4-0 (the-as uint 3))))
(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) 3)
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 40960.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! (-> self root-override) s4-0)
)
(set! (-> self orig-pos quad) (-> arg0 quad))
(set! (-> self root-override trans quad) (-> self parent-override 0 root trans quad))
(set! (-> self root-override quat vec quad) (-> self parent-override 0 root quat vec quad))
(vector-identity! (-> self root-override scale))
(initialize-skeleton self *ogreboss-super-boulder-sg* '())
(logclear! (-> self mask) (process-mask actor-pause))
(set! (-> self lava) (entity-actor-lookup (-> self entity) 'water-actor 0))
(logior! (-> self skel effect flags) 1)
(set! (-> self draw origin-joint-index) (the-as uint 3))
(let ((f30-1 (* 65536.0 (rand-vu))))
(quaternion-axis-angle!
(-> self tumble-quat)
(cos f30-1)
(the-as float 0.0)
(sin f30-1)
(the-as float 2730.6667)
)
)
(set! (-> self joint) (new 'process 'joint-mod-blend-local self 3 #f))
(set! (-> self part) (create-launch-control (-> *part-group-id-table* 468) self))
(set-vector! (-> self draw color-emissive) 0.125 0.0625 0.0 0.0)
(set! (-> self speed) 1.0)
(set! (-> self size) 0.0)
(set! (-> self grow-rate) (/ 300.0 arg1))
(set! (-> self sound-id) (new-sound-id))
(go ogreboss-super-boulder-idle)
(none)
)
(deftype ogreboss-bounce-boulder (process-drawable)
((parent-override (pointer ogreboss-super-boulder) :offset 12)
(root-override collide-shape-moving :offset 112)
(src-pos vector :inline :offset-assert 176)
(side-dir vector :inline :offset-assert 192)
(side-pos float :offset-assert 208)
(dest-pos float :offset-assert 212)
(boulder-type int8 :offset-assert 216)
)
:heap-base #x70
:method-count-assert 20
:size-assert #xd9
:flag-assert #x14007000d9
(:states
ogreboss-bounce-boulder-idle
)
)
(defbehavior ogreboss-bounce-boulder-event-handler ogreboss-bounce-boulder ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('touch)
(if (and *target* ((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> arg3 param 0))
(-> self root-override)
(the-as uint 1)
)
)
(send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info))
)
)
)
)
(defstate ogreboss-bounce-boulder-idle (ogreboss-bounce-boulder)
:event
ogreboss-bounce-boulder-event-handler
:code
(behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(let ((f30-0 2.0))
(let ((gp-0 (-> self skel root-channel 0)))
(set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 38)))
(set! (-> gp-0 param 0) (ja-aframe (the-as float 40.0) 0))
(set! (-> gp-0 param 1) f30-0)
(set! (-> gp-0 frame-num) 0.0)
(joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 38)) num-func-seek!)
)
(until (ja-done? 0)
(set! (-> self side-pos)
(* (fmin 1.0 (/ (ja-frame-num 0) (ja-aframe (the-as float 40.0) 0))) (-> self dest-pos))
)
(suspend)
(let ((gp-1 (-> self skel root-channel 0)))
(set! (-> gp-1 param 0) (ja-aframe (the-as float 40.0) 0))
(set! (-> gp-1 param 1) f30-0)
(joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!)
)
)
(let ((gp-2 (-> self skel root-channel 0)))
(set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 38)))
(set! (-> gp-2 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 38)) data 0 length) -1))
)
(set! (-> gp-2 param 1) f30-0)
(set! (-> gp-2 frame-num) (ja-aframe (the-as float 40.0) 0))
(joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 38)) num-func-seek!)
)
(until (ja-done? 0)
(if (>= (ja-frame-num 0) (ja-aframe (the-as float 235.0) 0))
(set! (-> self side-pos)
(seek (-> self side-pos) (the-as float 0.0) (* 20480.0 (-> *display* seconds-per-frame)))
)
)
(suspend)
(let ((a0-12 (-> self skel root-channel 0)))
(set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1)))
(set! (-> a0-12 param 1) f30-0)
(joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
(cleanup-for-death self)
(none)
)
:post
(behavior ()
(vector+*! (-> self root-override trans) (-> self src-pos) (-> self side-dir) (-> self side-pos))
(transform-post)
(find-ground-and-draw-shadow
(the-as vector (-> self root-override root-prim prim-core))
(the-as vector #f)
(the-as float 49152.0)
(collide-kind background)
[game] pc port progress menu (#1281) * fix typo * more typo * shorten discord rpc text * allow expanding enums after the fact (untested) * make `game_text` work similar to subtitles * update progress decomp * update some types + `do-not-decompile` in bitfield * fixes and fall back to original progress code * update `progress` decomp with new enums * update config files * fix enums and debug menu * always allocate (but not use) a lot of particles * small rework to display mode options * revert resolution/aspect-ratio symbol mess * begin the override stuff * make `progress-draw` more readable * more fixes * codacy good boy points * first step overriding code * finish progress overrides, game options menu fully functional! * minor fixes * Update game.gp * Update sparticle-launcher.gc * clang * change camera controls text * oops * some cleanup * derp * nice job * implement menu scrolling lol * make scrollable menus less cramped, fix arrows * make some carousell things i guess * add msaa carousell to test * oops * Update progress-pc.gc * make `pc-get-screen-size` (untested) * resolution menu * input fixes * return when selecting resolution * scroll fixes * Update progress-pc.gc * add "fit to screen" button * bug * complete resolutions menu * aspect ratio menu * subtitles language * subtitle speaker * final adjustments * ref test * fix tests * fix ref! * reduce redundancy a bit * fix mem leaks? * save settings on progress exit * fix init reorder * remove unused code * rename goal project-like files to the project extension * sha display toggle * aspect ratio settings fixes * dont store text db's in compiler * properly save+load native aspect stuff
2022-04-11 18:38:54 -04:00
(the-as process-drawable #f)
(the-as float 0.0)
(the-as float 409600.0)
)
(none)
)
)
(defbehavior ogreboss-bounce-boulder-init-by-other ogreboss-bounce-boulder ((arg0 int) (arg1 entity))
(set! (-> self entity) arg1)
(let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player))))
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction) default-collision-reaction)
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(let ((s4-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3))))
(set! (-> s4-0 prim-core collide-as) (collide-kind enemy))
(set! (-> s4-0 collide-with) (collide-kind target))
(set! (-> s4-0 prim-core action) (collide-action solid))
(set! (-> s4-0 prim-core offense) (collide-offense indestructible))
(set! (-> s4-0 transform-index) 3)
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 14336.0)
(set-root-prim! s5-0 s4-0)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(backup-collide-with-as s5-0)
(set! (-> self root-override) s5-0)
)
(set! (-> self boulder-type) arg0)
(set! (-> self root-override trans quad) (-> self parent-override 0 root-override trans quad))
(set! (-> self root-override quat vec quad) (-> self parent-override 0 root-override quat vec quad))
(vector-identity! (-> self root-override scale))
(set! (-> self src-pos quad) (-> self root-override trans quad))
(set! (-> self side-pos) 0.0)
(set! (-> self dest-pos) (the-as float (cond
((zero? arg0)
0.0
)
((= arg0 1)
-20480.0
)
((= arg0 2)
20480.0
)
(else
0.0
)
)
)
)
(vector-x-quaternion! (-> self side-dir) (-> self root-override quat))
(initialize-skeleton self *ogreboss-bounce-boulder-sg* '())
(logclear! (-> self mask) (process-mask actor-pause))
(set! (-> self draw origin-joint-index) (the-as uint 3))
(set-vector! (-> self draw color-emissive) 0.125 0.0625 0.0 0.0)
(go ogreboss-bounce-boulder-idle)
(none)
)
(deftype ogreboss (process-drawable)
((root-override collide-shape :offset 112)
(old-player-transform transformq :inline :offset-assert 176)
(level float :offset-assert 224)
(difficulty float :offset-assert 228)
(boulder handle :offset-assert 232)
(column handle :offset-assert 240)
(z-plane vector :inline :offset-assert 256)
(far-pos vector :inline :offset-assert 272)
(near-pos vector :inline :offset-assert 288)
(side-dir vector :inline :offset-assert 304)
(target-offset-array vector 3 :inline :offset-assert 320)
(target-offset-array-2 vector :inline :offset 336)
(target-offset-array-3 vector :inline :offset 352)
(target-actor-array entity-actor 3 :offset-assert 368)
(target-blast-radius-array float 3 :offset-assert 380)
(shuffle-pos float :offset-assert 392)
(target-count int8 :offset-assert 396)
(hit-count int8 :offset-assert 397)
(max-hit-count int8 :offset-assert 398)
(roll-boulder int8 :offset-assert 399)
(try-count uint8 :offset-assert 400)
(hit-time time-frame :offset-assert 408)
(grow-time float :offset-assert 416)
(lava entity-actor :offset-assert 420)
(vulnerable symbol :offset-assert 424)
(bridge-assembled symbol :offset-assert 428)
(at-near-spot symbol :offset-assert 432)
(submerged symbol :offset-assert 436)
(try-counted symbol :offset-assert 440)
)
:heap-base #x150
:method-count-assert 20
:size-assert #x1bc
:flag-assert #x14015001bc
(:states
ogreboss-dead
ogreboss-die
ogreboss-idle
ogreboss-intro
ogreboss-stage1
ogreboss-stage2
ogreboss-stage3-hit
ogreboss-stage3-shuffle
ogreboss-stage3-throw
ogreboss-wait-for-player
)
)
(defbehavior ogreboss-inc-try-count ogreboss ()
(when (not (-> self try-counted))
(set! (-> self try-counted) #t)
(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-count) (the-as uint (-> gp-0 user-int8 0)))
)
)
0
(none)
)
(defbehavior ogreboss-player-inside-range? ogreboss ((arg0 float))
(< (vector-vector-distance (-> self far-pos) (target-pos 0)) arg0)
)
(defun ogreboss-set-stage1-camera ()
0
(none)
)
(defun ogreboss-set-stage2-camera ()
0
(none)
)
(defun ogreboss-reset-camera ()
0
(none)
)
(defbehavior ogreboss-idle-loop ogreboss ()
(while #t
(ja-channel-push! 1 30)
(let ((v1-0 (rand-vu-int-range 0 2)))
(cond
((zero? v1-0)
(let ((gp-0 (-> self skel root-channel 0)))
(set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 2)))
(set! (-> gp-0 param 0) (ja-aframe (the-as float 140.0) 0))
(set! (-> gp-0 param 1) 1.0)
(set! (-> gp-0 frame-num) 0.0)
(joint-control-channel-group! gp-0 (the-as art-joint-anim (-> self draw art-group data 2)) 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 140.0) 0))
(set! (-> gp-1 param 1) 1.0)
(joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!)
)
)
(let ((gp-2 (-> *display* base-frame-counter)))
(until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.16666667))
(suspend)
)
)
(let ((gp-3 (-> self skel root-channel 0)))
(set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 2)))
(set! (-> gp-3 param 0) (ja-aframe (the-as float 168.0) 0))
(set! (-> gp-3 param 1) 1.0)
(set! (-> gp-3 frame-num) (ja-aframe (the-as float 140.0) 0))
(joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 2)) 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 168.0) 0))
(set! (-> gp-4 param 1) 1.0)
(joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!)
)
)
(let ((gp-5 (-> *display* base-frame-counter)))
(until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 0.16666667))
(suspend)
)
)
(let ((gp-6 (-> self skel root-channel 0)))
(set! (-> gp-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 2)))
(set! (-> gp-6 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1))
)
(set! (-> gp-6 param 1) 1.0)
(set! (-> gp-6 frame-num) (ja-aframe (the-as float 168.0) 0))
(joint-control-channel-group! gp-6 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-15 (-> self skel root-channel 0)))
(set! (-> a0-15 param 0) (the float (+ (-> a0-15 frame-group data 0 length) -1)))
(set! (-> a0-15 param 1) 1.0)
(joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
((= v1-0 1)
(let ((a0-18 (-> self skel root-channel 0)))
(set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 4)))
(set! (-> a0-18 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1))
)
(set! (-> a0-18 param 1) 1.0)
(set! (-> a0-18 frame-num) 0.0)
(joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 4)) 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) 1.0)
(joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
(else
(dotimes (gp-7 4)
(let ((a0-21 (-> self skel root-channel 0)))
(set! (-> a0-21 frame-group) (the-as art-joint-anim (-> self draw art-group data 3)))
(set! (-> a0-21 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) data 0 length) -1))
)
(set! (-> a0-21 param 1) 1.0)
(set! (-> a0-21 frame-num) 0.0)
(joint-control-channel-group! a0-21 (the-as art-joint-anim (-> self draw art-group data 3)) num-func-seek!)
)
(until (ja-done? 0)
(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) 1.0)
(joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
)
)
)
(the-as none 0)
(none)
)
(defstate ogreboss-idle (ogreboss)
:enter
(behavior ()
(when (zero? (-> self try-count))
(let* ((s5-0 (get-process *default-dead-pool* manipy #x4000))
(gp-0
(when s5-0
(let ((t9-1 (method-of-type manipy activate)))
(t9-1 (the-as manipy s5-0) self 'manipy (the-as pointer #x70004000))
)
(run-now-in-process s5-0 manipy-init (-> self root-override trans) (-> self entity) *ogreboss-column-sg* #f)
(-> s5-0 ppointer)
)
)
)
(set! (-> self column) (ppointer->handle gp-0))
(send-event (ppointer->process gp-0) 'anim-mode 'loop)
(send-event (ppointer->process gp-0) 'art-joint-anim "ogreboss-column-idle" 0)
(send-event (ppointer->process gp-0) 'draw #t)
)
)
(none)
)
:trans
(behavior ()
(try-preload-stream *art-control* "$GAMCAM23" 0 self (the-as float -99.0))
(when *target*
(let ((gp-0 (-> *target* control trans)))
(if (and (< 122880.0 (-> gp-0 y))
(< (-> gp-0 x) 892928.0)
(and (ogreboss-player-inside-range? (the-as float 737280.0)) (< 0.0 (vector4-dot gp-0 (-> self z-plane))))
)
(go ogreboss-intro)
)
)
)
(none)
)
:code
(behavior ()
(ogreboss-reset-camera)
(ogreboss-idle-loop)
(none)
)
:post
(the-as (function none :behavior ogreboss) ja-post)
)
(defstate ogreboss-intro (ogreboss)
:code
(behavior ()
(when (zero? (-> self try-count))
(process-drawable-delay-player (seconds 1))
(let ((gp-0 (get-process *default-dead-pool* pov-camera #x4000)))
(ppointer->handle (when gp-0
(let ((t9-2 (method-of-type pov-camera activate)))
(t9-2 (the-as pov-camera gp-0) self 'pov-camera (the-as pointer #x70004000))
)
(run-now-in-process
gp-0
pov-camera-init-by-other
(-> self root-override trans)
*ogreboss-cam-sg*
"ogreboss-cam-intro"
0
#f
'((0 setting-reset music ogreboss) (2 ambient camera "gamcam23"))
)
(-> gp-0 ppointer)
)
)
)
(send-event (handle->process (-> self column)) 'anim-mode 'play1)
(send-event (handle->process (-> self column)) 'art-joint-anim "ogreboss-column-intro" 0)
(let ((a0-15 (-> self skel root-channel 0)))
(set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 24)))
(set! (-> a0-15 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 24)) data 0 length) -1))
)
(set! (-> a0-15 param 1) 1.0)
(set! (-> a0-15 frame-num) 0.0)
(joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 24)) 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) 1.0)
(joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!)
)
)
(close-specific-task! (game-task ogre-boss) (task-status need-hint))
(suspend)
(send-event *target* 'continue (get-continue-by-name *game-info* "ogre-start"))
(ogreboss-inc-try-count)
)
(set-setting! *setting-control* self 'music 'ogreboss (the-as float 0.0) 0)
(go ogreboss-wait-for-player)
(none)
)
:post
(the-as (function none :behavior ogreboss) ja-post)
)
(defstate ogreboss-wait-for-player (ogreboss)
:trans
(behavior ()
(when *target*
(if (ogreboss-player-inside-range? (the-as float 614400.0))
(go ogreboss-stage1)
)
(if (not (ogreboss-player-inside-range? (the-as float 737280.0)))
(go ogreboss-idle)
)
)
(none)
)
:code
(behavior ()
(ogreboss-idle-loop)
(none)
)
:post
(the-as (function none :behavior ogreboss) ja-post)
)
(defun ogreboss-debug-adjust-difficulty ()
0
(none)
)
(defbehavior ogreboss-pick-target ogreboss ()
(local-vars (gp-0 int))
(cond
((rand-vu-percent? (the-as float 0.4))
(set! gp-0 (rand-vu-int-range 0 (+ (-> self target-count) -1)))
)
(else
(set! gp-0 0)
(let ((f30-0 4096000.0)
(s5-0 (target-pos 0))
)
(dotimes (s4-0 (-> self target-count))
(let* ((v1-6 (-> self target-actor-array s4-0))
(s3-0 (if v1-6
(-> v1-6 extra process)
)
)
)
(when s3-0
(let ((f0-0 (vector-vector-distance s5-0 (-> (the-as process-drawable s3-0) root trans))))
(when (< f0-0 f30-0)
(set! f30-0 f0-0)
(set! gp-0 s4-0)
)
)
)
)
)
)
)
)
gp-0
)
(defbehavior ogreboss-shoot-boulder ogreboss ((arg0 int))
(let ((gp-0 (new 'stack-no-clear 'ogreboss-missile-init-data)))
(let ((s5-0 (new 'stack-no-clear 'vector)))
(set! (-> gp-0 src) (-> self node-list data 52 bone transform vector 3))
(set! (-> gp-0 duration)
(the-as time-frame (the int (* 300.0 (+ 1.25 (* -0.25 (-> self level)) (/ 0.5 (-> self difficulty))))))
)
(set! (-> gp-0 pickup-type) (the-as pickup-type arg0))
(set! (-> gp-0 blast-radius) 32768.0)
(cond
(*target*
(let ((v1-10 (ogreboss-pick-target)))
(let* ((a0-3 (-> self target-actor-array v1-10))
(a1-0 (if a0-3
(-> a0-3 extra process)
)
)
)
(if a1-0
(set! (-> s5-0 quad) (-> (the-as process-drawable a1-0) root trans quad))
(set! (-> s5-0 quad) (-> self root-override trans quad))
)
)
(vector+! s5-0 s5-0 (-> self target-offset-array v1-10))
(set! (-> gp-0 blast-radius) (-> self target-blast-radius-array v1-10))
)
)
(else
(vector+*! s5-0 (-> self root-override trans) *z-vector* (the-as float 409600.0))
)
)
(set! (-> gp-0 dest) s5-0)
)
(sound-play-by-name
(static-sound-name "ogre-fires")
(new-sound-id)
1024
0
0
1
(the-as symbol (-> self root-override trans))
)
(let ((s5-2 (get-process *default-dead-pool* part-tracker #x4000)))
(when s5-2
(let ((t9-5 (method-of-type part-tracker activate)))
(t9-5 (the-as part-tracker s5-2) *entity-pool* 'part-tracker (the-as pointer #x70004000))
)
(run-now-in-process s5-2 part-tracker-init (-> *part-group-id-table* 470) -1 #f #f #f (-> gp-0 src))
(-> s5-2 ppointer)
)
)
(let ((s5-3 (get-process *default-dead-pool* ogreboss-missile #x4000)))
(when s5-3
(let ((t9-8 (method-of-type ogreboss-missile activate)))
(t9-8 (the-as ogreboss-missile s5-3) self 'ogreboss-missile (the-as pointer #x70004000))
)
(run-now-in-process s5-3 ogreboss-missile-init-by-other gp-0 (-> self entity))
(-> s5-3 ppointer)
)
)
)
0
(none)
)
(defbehavior ogreboss-submerge ogreboss ((arg0 time-frame) (arg1 float))
(when (not (-> self submerged))
(cond
((= (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(-> self draw art-group data 13)
)
(until (ja-done? 0)
(suspend)
(let ((a0-5 (-> self skel root-channel 0)))
(set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group data 0 length) -1)))
(set! (-> a0-5 param 1) arg1)
(joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
(else
(ja-channel-push! 1 30)
(let ((s4-0 (-> self skel root-channel 0)))
(set! (-> s4-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 13)))
(set! (-> s4-0 param 0) (ja-aframe (the-as float 22.0) 0))
(set! (-> s4-0 param 1) arg1)
(set! (-> s4-0 frame-num) 0.0)
(joint-control-channel-group! s4-0 (the-as art-joint-anim (-> self draw art-group data 13)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((s4-1 (-> self skel root-channel 0)))
(set! (-> s4-1 param 0) (ja-aframe (the-as float 22.0) 0))
(set! (-> s4-1 param 1) arg1)
(joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!)
)
)
(cond
((-> self at-near-spot)
(let ((a1-7 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-7 from) self)
(set! (-> a1-7 num-params) 0)
(set! (-> a1-7 message) 'submerge2)
(let ((t9-8 send-event-function)
(v1-31 (-> self lava))
)
(t9-8
(if v1-31
(-> v1-31 extra process)
)
a1-7
)
)
)
)
(else
(let ((a1-8 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-8 from) self)
(set! (-> a1-8 num-params) 0)
(set! (-> a1-8 message) 'submerge1)
(let ((t9-9 send-event-function)
(v1-35 (-> self lava))
)
(t9-9
(if v1-35
(-> v1-35 extra process)
)
a1-8
)
)
)
)
)
(let ((s4-2 (-> self skel root-channel 0)))
(set! (-> s4-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 13)))
(set! (-> s4-2 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 13)) data 0 length) -1))
)
(set! (-> s4-2 param 1) arg1)
(set! (-> s4-2 frame-num) (ja-aframe (the-as float 22.0) 0))
(joint-control-channel-group! s4-2 (the-as art-joint-anim (-> self draw art-group data 13)) 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) arg1)
(joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
(logior! (-> self draw status) (draw-status hidden))
(set! (-> self submerged) #t)
(let ((s5-1 (-> *display* base-frame-counter)))
(until (>= (- (-> *display* base-frame-counter) s5-1) arg0)
(suspend)
)
)
)
0
(none)
)
(defbehavior ogreboss-emerge ogreboss ((arg0 float))
(when (-> self submerged)
(set! (-> self submerged) #f)
(logclear! (-> self draw status) (draw-status hidden))
(cond
((-> self at-near-spot)
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) self)
(set! (-> a1-0 num-params) 0)
(set! (-> a1-0 message) 'emerge2)
(let ((t9-0 send-event-function)
(v1-6 (-> self lava))
)
(t9-0
(if v1-6
(-> v1-6 extra process)
)
a1-0
)
)
)
)
(else
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 0)
(set! (-> a1-1 message) 'emerge1)
(let ((t9-1 send-event-function)
(v1-10 (-> self lava))
)
(t9-1
(if v1-10
(-> v1-10 extra process)
)
a1-1
)
)
)
)
)
(let ((a0-6 (-> self skel root-channel 0)))
(set! (-> a0-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 14)))
(set! (-> a0-6 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 14)) data 0 length) -1))
)
(set! (-> a0-6 param 1) arg0)
(set! (-> a0-6 frame-num) 0.0)
(joint-control-channel-group! a0-6 (the-as art-joint-anim (-> self draw art-group data 14)) num-func-seek!)
)
(until (ja-done? 0)
(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) arg0)
(joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
0
(none)
)
(defbehavior ogreboss-move-near ogreboss ((arg0 time-frame) (arg1 float))
(when (not (-> self at-near-spot))
(ogreboss-submerge arg0 arg1)
(set! (-> self at-near-spot) #t)
(set! (-> self root-override trans quad) (-> self near-pos quad))
(ogreboss-emerge arg1)
)
0
(none)
)
(defbehavior ogreboss-move-far ogreboss ((arg0 time-frame) (arg1 float))
(when (-> self at-near-spot)
(ogreboss-submerge arg0 arg1)
(set! (-> self at-near-spot) #f)
(set! (-> self root-override trans quad) (-> self far-pos quad))
(ogreboss-emerge arg1)
)
0
(none)
)
(defbehavior ogreboss-post ogreboss ()
(transform-post)
(send-event *camera* 'point-of-interest (-> self node-list data 5 bone transform vector 3))
0
(none)
)
(defstate ogreboss-stage1 (ogreboss)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('next-stage)
(set! (-> self bridge-assembled) #t)
(go ogreboss-stage2)
)
)
)
:enter
(behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:trans
(behavior ()
(if (and (-> self bridge-assembled)
(ogreboss-player-inside-range? (the-as float 524288.0))
(>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1))
)
(go ogreboss-stage2)
)
(none)
)
:code
(behavior ()
(set! (-> self mask) (logior (process-mask enemy) (-> self mask)))
(ogreboss-set-stage1-camera)
(ogreboss-move-near (seconds 3) (the-as float 1.0))
(cond
((= (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(-> self draw art-group data 16)
)
(ja-channel-push! 1 30)
(let ((a0-7 (-> self skel root-channel 0)))
(set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 2)))
(set! (-> a0-7 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 2)) data 0 length) -1))
)
(set! (-> a0-7 param 1) 1.0)
(set! (-> a0-7 frame-num) 0.0)
(joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 2)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-8 (-> self skel root-channel 0)))
(set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1)))
(set! (-> a0-8 param 1) 1.0)
(joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
(else
(ja-channel-push! 1 30)
(let ((a0-11 (-> self skel root-channel 0)))
(set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 5)))
(set! (-> a0-11 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1))
)
(set! (-> a0-11 param 1) 1.0)
(set! (-> a0-11 frame-num) 0.0)
(joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 5)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-12 (-> self skel root-channel 0)))
(set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1)))
(set! (-> a0-12 param 1) 1.0)
(joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
(let* ((gp-0 (the int (* (-> self difficulty) (+ 8.0 (* 4.0 (-> self level))))))
(f0-17 1.0)
(f1-2 0.15)
(f2-2 (-> self difficulty))
(f30-0 (+ f0-17 (* f1-2 (* f2-2 f2-2) (-> self level))))
)
(ja-channel-push! 1 30)
(let ((a0-15 (-> self skel root-channel 0)))
(set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 6)))
(set! (-> a0-15 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1))
)
(set! (-> a0-15 param 1) f30-0)
(set! (-> a0-15 frame-num) 0.0)
(joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 6)) 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) f30-0)
(joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!)
)
)
(countdown (gp-1 (+ gp-0 -1))
(let ((s5-0 0))
(let ((f28-0 0.0))
(cond
((>= 1.0 (-> *target* fact-info-target health))
(set! f28-0 0.1)
)
((>= 2.0 (-> *target* fact-info-target health))
(set! f28-0 0.05)
)
)
(set! f28-0 (cond
((< (-> self try-count) (the-as uint 5))
(* 0.0 f28-0)
)
((< (-> self try-count) (the-as uint 10))
(* 0.5 f28-0)
)
(else
(empty)
f28-0
)
)
)
(if (and *target* (< (rand-vu) f28-0))
(set! s5-0 4)
)
)
(ogreboss-shoot-boulder s5-0)
)
(let ((a0-19 (-> self skel root-channel 0)))
(set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 7)))
(set! (-> a0-19 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) data 0 length) -1))
)
(set! (-> a0-19 param 1) f30-0)
(set! (-> a0-19 frame-num) 0.0)
(joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-20 (-> self skel root-channel 0)))
(set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1)))
(set! (-> a0-20 param 1) f30-0)
(joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!)
)
)
(ogreboss-inc-try-count)
)
(ogreboss-shoot-boulder 3)
(let ((a0-23 (-> self skel root-channel 0)))
(set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 8)))
(set! (-> a0-23 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1))
)
(set! (-> a0-23 param 1) f30-0)
(set! (-> a0-23 frame-num) 0.0)
(joint-control-channel-group! a0-23 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-24 (-> self skel root-channel 0)))
(set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1)))
(set! (-> a0-24 param 1) f30-0)
(joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
(ogreboss-move-far (seconds 2) (the-as float 1.0))
(ja-channel-push! 1 30)
(let ((a0-28 (-> self skel root-channel 0)))
(set! (-> a0-28 frame-group) (the-as art-joint-anim (-> self draw art-group data 16)))
(set! (-> a0-28 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1))
)
(set! (-> a0-28 param 1) 1.0)
(set! (-> a0-28 frame-num) 0.0)
(joint-control-channel-group! a0-28 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!)
)
(until (ja-done? 0)
(suspend)
(let ((a0-29 (-> self skel root-channel 0)))
(set! (-> a0-29 param 0) (the float (+ (-> a0-29 frame-group data 0 length) -1)))
(set! (-> a0-29 param 1) 1.0)
(joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-seek!)
)
)
(go ogreboss-stage1)
(none)
)
:post
ogreboss-post
)
(defbehavior ogreboss-roll-boulder ogreboss ()
(sound-play-by-name
(static-sound-name "ogre-fires")
(new-sound-id)
1024
0
0
1
(the-as symbol (-> self root-override trans))
)
(+! (-> self roll-boulder) (rand-vu-int-range 1 2))
(if (>= (-> self roll-boulder) 3)
(+! (-> self roll-boulder) -3)
)
(let ((v1-7 (-> self roll-boulder)))
(cond
((zero? v1-7)
(let ((gp-2 (get-process *default-dead-pool* ogreboss-bounce-boulder #x4000)))
(when gp-2
(let ((t9-4 (method-of-type ogreboss-bounce-boulder activate)))
(t9-4 (the-as ogreboss-bounce-boulder gp-2) self 'ogreboss-bounce-boulder (the-as pointer #x70004000))
)
(run-now-in-process gp-2 ogreboss-bounce-boulder-init-by-other 2 (-> self entity))
(-> gp-2 ppointer)
)
)
)
((= v1-7 1)
(let ((gp-3 (get-process *default-dead-pool* ogreboss-bounce-boulder #x4000)))
(when gp-3
(let ((t9-7 (method-of-type ogreboss-bounce-boulder activate)))
(t9-7 (the-as ogreboss-bounce-boulder gp-3) self 'ogreboss-bounce-boulder (the-as pointer #x70004000))
)
(run-now-in-process gp-3 ogreboss-bounce-boulder-init-by-other 1 (-> self entity))
(-> gp-3 ppointer)
)
)
)
(else
(let ((gp-4 (get-process *default-dead-pool* ogreboss-bounce-boulder #x4000)))
(when gp-4
(let ((t9-10 (method-of-type ogreboss-bounce-boulder activate)))
(t9-10 (the-as ogreboss-bounce-boulder gp-4) self 'ogreboss-bounce-boulder (the-as pointer #x70004000))
)
(run-now-in-process gp-4 ogreboss-bounce-boulder-init-by-other 0 (-> self entity))
(-> gp-4 ppointer)
)
)
)
)
)
0
(none)
)
(defbehavior ogreboss-blend-hit-anim ogreboss ()
(let ((f1-0 0.0)
(f0-0 0.0)
)
(let ((f30-0 (the float (- (-> *display* base-frame-counter) (-> self hit-time)))))
(when (and (> (-> self hit-count) 0) (>= 45.0 f30-0))
(set! f0-0 (+ (ja-aframe (the-as float 0.0) 1)
(* 0.022222223 f30-0 (- (ja-aframe (the-as float 8.0) 1) (ja-aframe (the-as float 0.0) 1)))
)
)
(set! f1-0 (cond
((< f30-0 7.5)
(* 0.120000005 f30-0)
)
((< f30-0 22.5)
0.9
)
(else
(* 0.04 (- 45.0 f30-0))
)
)
)
)
)
(let ((v1-22 (-> self skel root-channel 1)))
(set! (-> v1-22 frame-interp) f1-0)
(set! (-> v1-22 num-func) num-func-identity)
(set! (-> v1-22 frame-num) f0-0)
)
)
0
(none)
)
(defbehavior ogreboss-update-super-boulder ogreboss ()
(let ((a1-0 (handle->process (-> self boulder))))
(if a1-0
(set! (-> (the-as ogreboss-super-boulder a1-0) root-override trans quad) (-> self root-override trans quad))
)
)
0
(none)
)
(defbehavior ogreboss-update-shuffling ogreboss ()
(ogreboss-update-super-boulder)
(ogreboss-blend-hit-anim)
0
(none)
)
(defbehavior ogreboss-attack-event-handler ogreboss ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'attack)
(when (-> self vulnerable)
(cond
(((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 128)
)
(let ((gp-0 (-> self skel root-channel 1)))
(set! (-> gp-0 frame-interp) 0.0)
(joint-control-channel-group-eval!
gp-0
(the-as art-joint-anim (-> self draw art-group data 11))
num-func-identity
)
(set! (-> gp-0 frame-num) 0.0)
)
)
(else
(let ((gp-1 (-> self skel root-channel 1)))
(set! (-> gp-1 frame-interp) 0.0)
(joint-control-channel-group-eval!
gp-1
(the-as art-joint-anim (-> self draw art-group data 10))
num-func-identity
)
(set! (-> gp-1 frame-num) 0.0)
)
)
)
(set! (-> self hit-time) (-> *display* base-frame-counter))
(let ((v1-17 (rand-vu-int-range 0 2)))
(cond
((zero? v1-17)
(sound-play-by-name
(static-sound-name "ogre-grunt1")
(new-sound-id)
1024
0
0
1
(the-as symbol (-> self root-override trans))
)
)
((= v1-17 1)
(sound-play-by-name
(static-sound-name "ogre-grunt2")
(new-sound-id)
1024
0
0
1
(the-as symbol (-> self root-override trans))
)
)
(else
(sound-play-by-name
(static-sound-name "ogre-grunt3")
(new-sound-id)
1024
0
0
1
(the-as symbol (-> self root-override trans))
)
)
)
)
(+! (-> self hit-count) 1)
(if (>= (-> self hit-count) (-> self max-hit-count))
(go ogreboss-stage3-hit)
)
(send-event (handle->process (-> self boulder)) 'speedup)
)
#t
)
)
)
)
(defstate ogreboss-stage2 (ogreboss)
:event
ogreboss-attack-event-handler
:enter
(behavior ()
(set! (-> self boulder) (the-as handle #f))
(none)
)
:trans
(behavior ()
0
(none)
)
:code
(behavior ()
(ogreboss-set-stage2-camera)
(ogreboss-move-far (seconds 0.1) (the-as float 2.0))
(let ((f30-0 (* 0.75 (-> self difficulty))))
(let ((gp-0 #f))
(ja-channel-push! 1 60)
(let ((a0-2 (-> self skel root-channel 0)))
(set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 6)))
(set! (-> a0-2 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1))
)
(set! (-> a0-2 param 1) 1.5)
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 6)) 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) 1.5)
(joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!)
)
)
(set! (-> self state-time) (-> *display* base-frame-counter))
(while (not gp-0)
(ogreboss-roll-boulder)
(set! gp-0 (or (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2))
(not (ogreboss-player-inside-range? (the-as float 524288.0)))
)
(ogreboss-player-inside-range? (the-as float 409600.0))
)
)
(let ((a0-9 (-> self skel root-channel 0)))
(set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 7)))
(set! (-> a0-9 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) 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 7)) num-func-seek!)
)
(until (ja-done? 0)
(if gp-0
0
)
(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!)
)
)
)
)
(ogreboss-roll-boulder)
(let ((a0-12 (-> self skel root-channel 0)))
(set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 8)))
(set! (-> a0-12 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1))
)
(set! (-> a0-12 param 1) f30-0)
(set! (-> a0-12 frame-num) 0.0)
(joint-control-channel-group! a0-12 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!)
)
(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) f30-0)
(joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
(go ogreboss-stage3-shuffle)
(none)
)
:post
ogreboss-post
)
(defbehavior ogreboss-spawn-super-boulder ogreboss ()
(let ((gp-0 (get-process *default-dead-pool* ogreboss-super-boulder #x4000)))
(set! (-> self boulder)
(ppointer->handle
(when gp-0
(let ((t9-1 (method-of-type ogreboss-super-boulder activate)))
(t9-1 (the-as ogreboss-super-boulder gp-0) self 'ogreboss-super-boulder (the-as pointer #x70004000))
)
(run-now-in-process
gp-0
ogreboss-super-boulder-init-by-other
(-> self far-pos)
(-> self grow-time)
(-> self entity)
)
(-> gp-0 ppointer)
)
)
)
)
0
(none)
)
(defstate ogreboss-stage3-shuffle (ogreboss)
:event
ogreboss-attack-event-handler
:enter
(behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(set! (-> self hit-count) 0)
(set! (-> self max-hit-count) (the int (* 6.0 (-> self difficulty))))
(set! (-> self grow-time) (* 300.0 (+ (/ 10.0 (-> self difficulty)) (* -1.0 (-> self level)))))
(set! (-> self boulder) (the-as handle #f))
(none)
)
:exit
(behavior ()
(send-event *camera* 'point-of-interest #f)
(set! (-> self vulnerable) #f)
(none)
)
:trans
(behavior ()
(let ((v1-1 (handle->process (-> self boulder))))
(if (and v1-1 (>= (-> (the-as ogreboss-super-boulder v1-1) size) 1.0))
(go ogreboss-stage3-throw)
)
)
(when (and (not (ogreboss-player-inside-range? (the-as float 409600.0)))
(>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5))
)
(set! (-> self state-time) (-> *display* base-frame-counter))
(send-event (handle->process (-> self boulder)) 'grow-faster)
)
0
(none)
)
:code
(behavior ()
(set! (-> self shuffle-pos) 0.0)
(let ((f30-0 (+ 1.0 (* 0.25 (-> self difficulty) (-> self level))))
(gp-0 (if (rand-vu-percent? (the-as float 0.5))
0
1
)
)
)
(ja-channel-push! 1 60)
(let ((a0-2 (-> self skel root-channel 0)))
(set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 17)))
(set! (-> a0-2 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1))
)
(set! (-> a0-2 param 1) f30-0)
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 17)) 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) f30-0)
(joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!)
)
)
(ogreboss-spawn-super-boulder)
(set! (-> self state-time) (-> *display* base-frame-counter))
(ja-channel-push! 2 15)
(let ((s5-0 (-> self skel root-channel 1)))
(set! (-> s5-0 frame-interp) 0.0)
(joint-control-channel-group-eval!
s5-0
(the-as art-joint-anim (-> self draw art-group data 10))
num-func-identity
)
(set! (-> s5-0 frame-num) 0.0)
)
(set! (-> self vulnerable) #t)
(while #t
(if (>= -61440.0 (-> self shuffle-pos))
(set! gp-0 1)
)
(if (>= (-> self shuffle-pos) 61440.0)
(set! gp-0 0)
)
(cond
((zero? gp-0)
(set! gp-0 1)
(let ((a0-7 (-> self skel root-channel 0)))
(set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 18)))
(set! (-> a0-7 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 18)) data 0 length) -1))
)
(set! (-> a0-7 param 1) f30-0)
(set! (-> a0-7 frame-num) 0.0)
(joint-control-channel-group! a0-7 (the-as art-joint-anim (-> self draw art-group data 18)) num-func-seek!)
)
(until (ja-done? 0)
(ogreboss-update-shuffling)
(suspend)
(let ((a0-8 (-> self skel root-channel 0)))
(set! (-> a0-8 param 0) (the float (+ (-> a0-8 frame-group data 0 length) -1)))
(set! (-> a0-8 param 1) f30-0)
(joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-seek!)
)
)
(let ((s5-1 (rand-vu-int-range 1 5)))
(while (and (> s5-1 0) (< -61440.0 (-> self shuffle-pos)))
(let ((a0-11 (-> self skel root-channel 0)))
(set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 19)))
(set! (-> a0-11 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 19)) data 0 length) -1))
)
(set! (-> a0-11 param 1) f30-0)
(set! (-> a0-11 frame-num) 0.0)
(joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 19)) num-func-seek!)
)
(until (ja-done? 0)
(ogreboss-update-shuffling)
(set! (-> self shuffle-pos) (- (-> self shuffle-pos) (* 16384.0 (-> *display* seconds-per-frame) f30-0)))
(suspend)
(let ((a0-12 (-> self skel root-channel 0)))
(set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1)))
(set! (-> a0-12 param 1) f30-0)
(joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!)
)
)
(+! s5-1 -1)
)
)
(let ((a0-15 (-> self skel root-channel 0)))
(set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 20)))
(set! (-> a0-15 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 20)) data 0 length) -1))
)
(set! (-> a0-15 param 1) f30-0)
(set! (-> a0-15 frame-num) 0.0)
(joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 20)) num-func-seek!)
)
(until (ja-done? 0)
(ogreboss-update-shuffling)
(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) f30-0)
(joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
(else
(set! gp-0 0)
(let ((a0-18 (-> self skel root-channel 0)))
(set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 21)))
(set! (-> a0-18 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 21)) data 0 length) -1))
)
(set! (-> a0-18 param 1) f30-0)
(set! (-> a0-18 frame-num) 0.0)
(joint-control-channel-group! a0-18 (the-as art-joint-anim (-> self draw art-group data 21)) num-func-seek!)
)
(until (ja-done? 0)
(ogreboss-update-shuffling)
(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) f30-0)
(joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!)
)
)
(let ((s5-2 (rand-vu-int-range 1 5)))
(while (and (> s5-2 0) (< (-> self shuffle-pos) 61440.0))
(let ((a0-22 (-> self skel root-channel 0)))
(set! (-> a0-22 frame-group) (the-as art-joint-anim (-> self draw art-group data 22)))
(set! (-> a0-22 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 22)) data 0 length) -1))
)
(set! (-> a0-22 param 1) f30-0)
(set! (-> a0-22 frame-num) 0.0)
(joint-control-channel-group! a0-22 (the-as art-joint-anim (-> self draw art-group data 22)) num-func-seek!)
)
(until (ja-done? 0)
(ogreboss-update-shuffling)
(+! (-> self shuffle-pos) (* 16384.0 (-> *display* seconds-per-frame) f30-0))
(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) f30-0)
(joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!)
)
)
(+! s5-2 -1)
)
)
(let ((a0-26 (-> self skel root-channel 0)))
(set! (-> a0-26 frame-group) (the-as art-joint-anim (-> self draw art-group data 23)))
(set! (-> a0-26 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 23)) data 0 length) -1))
)
(set! (-> a0-26 param 1) f30-0)
(set! (-> a0-26 frame-num) 0.0)
(joint-control-channel-group! a0-26 (the-as art-joint-anim (-> self draw art-group data 23)) num-func-seek!)
)
(until (ja-done? 0)
(ogreboss-update-shuffling)
(suspend)
(let ((a0-27 (-> self skel root-channel 0)))
(set! (-> a0-27 param 0) (the float (+ (-> a0-27 frame-group data 0 length) -1)))
(set! (-> a0-27 param 1) f30-0)
(joint-control-channel-group-eval! a0-27 (the-as art-joint-anim #f) num-func-seek!)
)
)
)
)
)
)
(none)
)
:post
(behavior ()
(vector+*! (-> self root-override trans) (-> self far-pos) (-> self side-dir) (-> self shuffle-pos))
(ogreboss-post)
(none)
)
)
(defstate ogreboss-stage3-throw (ogreboss)
:code
(behavior ()
(ja-channel-push! 1 30)
(send-event (handle->process (-> self boulder)) 'go-throw)
(let ((a0-5 (-> self skel root-channel 0)))
(set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 9)))
(set! (-> a0-5 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) data 0 length) -1))
)
(set! (-> a0-5 param 1) 1.0)
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 9)) 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) 1.0)
(joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!)
)
)
(ja-channel-push! 1 30)
(let ((a0-9 (-> self skel root-channel 0)))
(set! (-> a0-9 frame-group) (the-as art-joint-anim (-> self draw art-group data 16)))
(set! (-> a0-9 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) data 0 length) -1))
)
(set! (-> a0-9 param 1) 1.0)
(set! (-> a0-9 frame-num) 0.0)
(joint-control-channel-group! a0-9 (the-as art-joint-anim (-> self draw art-group data 16)) num-func-seek!)
)
(until (ja-done? 0)
(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) 1.0)
(joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!)
)
)
(ogreboss-submerge (seconds 1) (the-as float 1.0))
(while (handle->process (-> self boulder))
(suspend)
)
(set! (-> self bridge-assembled) #f)
(go ogreboss-stage1)
(none)
)
:post
(the-as (function none :behavior ogreboss) transform-post)
)
(defstate ogreboss-stage3-hit (ogreboss)
:code
(behavior ()
(set! (-> self level) (+ 1.0 (-> self level)))
(if (< 2.0 (-> self level))
(go ogreboss-die)
)
(send-event (handle->process (-> self boulder)) 'go-hit)
(ja-channel-push! 1 60)
(let ((a0-5 (-> self skel root-channel 0)))
(set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 12)))
(set! (-> a0-5 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1))
)
(set! (-> a0-5 param 1) 1.0)
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 12)) 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) 1.0)
(joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!)
)
)
(set! (-> self bridge-assembled) #f)
(set! (-> self submerged) #t)
(while (handle->process (-> self boulder))
(suspend)
)
(go ogreboss-stage1)
(none)
)
:post
(the-as (function none :behavior ogreboss) transform-post)
)
(defbehavior ogreboss-trigger-steps ogreboss ()
(let ((gp-0 (entity-actor-count (-> self entity) 'trigger-actor)))
(dotimes (s5-0 gp-0)
(let ((v1-1 (* 600 (+ s5-0 1)))
(s4-0 (new 'stack-no-clear 'event-message-block))
)
(set! (-> s4-0 from) self)
(set! (-> s4-0 num-params) 1)
(set! (-> s4-0 message) 'trigger)
(set! (-> s4-0 param 0) (the-as uint v1-1))
(let ((s3-0 send-event-function)
(v1-2 (entity-actor-lookup (-> self entity) 'trigger-actor s5-0))
)
(s3-0
(if v1-2
(-> v1-2 extra process)
)
s4-0
)
)
)
)
)
#f
)
(defstate ogreboss-die (ogreboss)
:code
(behavior ()
(ogreboss-reset-camera)
(send-event (handle->process (-> self boulder)) 'go-die)
(ja-channel-push! 1 60)
(let ((a0-5 (-> self skel root-channel 0)))
(set! (-> a0-5 frame-group) (the-as art-joint-anim (-> self draw art-group data 12)))
(set! (-> a0-5 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) data 0 length) -1))
)
(set! (-> a0-5 param 1) 1.0)
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group! a0-5 (the-as art-joint-anim (-> self draw art-group data 12)) num-func-seek!)
)
(until (ja-done? 0)
(transform-post)
(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) 1.0)
(joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!)
)
)
(ogreboss-trigger-steps)
(go ogreboss-dead)
(none)
)
)
(defstate ogreboss-dead (ogreboss)
:event
(the-as
(function process int symbol event-message-block object :behavior ogreboss)
process-drawable-fuel-cell-handler
)
:code
(behavior ()
(clear-pending-settings-from-process *setting-control* self 'music)
(ogreboss-reset-camera)
(let ((gp-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> gp-0 from) self)
(set! (-> gp-0 num-params) 0)
(set! (-> gp-0 message) 'complete)
(let ((s5-0 send-event-function)
(v1-3 (entity-actor-lookup (-> self entity) 'alt-actor 0))
)
(s5-0
(if v1-3
(-> v1-3 extra process)
)
gp-0
)
)
)
(process-entity-status! self (entity-perm-status complete) #t)
(close-specific-task! (game-task ogre-boss) (task-status need-reminder))
(clear-collide-with-as (-> self root-override))
(ja-channel-set! 0)
(ja-post)
(when (not (task-complete? *game-info* (-> self entity extra perm task)))
(let ((gp-1 (new 'stack-no-clear 'vector)))
(let ((a0-9 (the-as entity (entity-actor-lookup (-> self entity) 'trigger-actor 2))))
(if (not (the-as entity-actor a0-9))
(set! a0-9 (-> self entity))
)
(set! (-> gp-1 quad) (-> a0-9 extra trans quad))
)
(label cfg-6)
(birth-pickup-at-point
gp-1
(pickup-type fuel-cell)
(the float (-> self entity extra perm task))
#f
self
(the-as fact-info #f)
)
)
(when (not (-> self child))
(suspend)
(goto cfg-6)
)
(while (-> self child)
(suspend)
)
)
(cleanup-for-death self)
(none)
)
)
(defbehavior ogreboss-get-targets ogreboss ()
(let ((gp-1 (min 3 (entity-actor-count (-> self entity) 'target-actor))))
(dotimes (s5-0 gp-1)
(set! (-> self target-actor-array s5-0) (entity-actor-lookup (-> self entity) 'target-actor s5-0))
)
(set! (-> self target-count) gp-1)
)
(set-vector! (-> self target-offset-array 0) 0.0 16384.0 0.0 1.0)
(set-vector! (-> self target-offset-array-2) 0.0 16384.0 0.0 1.0)
(set-vector! (-> self target-offset-array-3) 0.0 16384.0 0.0 1.0)
(set! (-> self target-blast-radius-array 0) 24576.0)
(set! (-> self target-blast-radius-array 1) 24576.0)
(set! (-> self target-blast-radius-array 2) 24576.0)
0
(none)
)
(defmethod init-from-entity! ogreboss ((obj ogreboss) (arg0 entity-actor))
(set! (-> obj mask) (logior (process-mask attackable) (-> obj mask)))
(let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player))))
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 6) 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-vector! (-> s3-0 local-sphere) 0.0 40960.0 0.0 53248.0)
(set-root-prim! s4-0 s3-0)
(let ((s2-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 131))))
(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 touch))
(set! (-> s2-0 transform-index) 3)
(set-vector! (-> s2-0 local-sphere) 0.0 8192.0 0.0 14336.0)
(append-prim s3-0 s2-0)
)
(let ((s2-1 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 3))))
(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 touch))
(set! (-> s2-1 transform-index) 5)
(set-vector! (-> s2-1 local-sphere) 0.0 0.0 0.0 28672.0)
(append-prim s3-0 s2-1)
)
(let ((s2-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 3))))
(set! (-> s2-2 prim-core collide-as) (collide-kind enemy))
(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 touch))
(set! (-> s2-2 transform-index) 7)
(set-vector! (-> s2-2 local-sphere) 0.0 0.0 0.0 14336.0)
(append-prim s3-0 s2-2)
)
(let ((s2-3 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 3))))
(set! (-> s2-3 prim-core collide-as) (collide-kind enemy))
(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 touch))
(set! (-> s2-3 transform-index) 43)
(set-vector! (-> s2-3 local-sphere) 0.0 0.0 0.0 12288.0)
(append-prim s3-0 s2-3)
)
(let ((s2-4 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 3))))
(set! (-> s2-4 prim-core collide-as) (collide-kind enemy))
(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 touch))
(set! (-> s2-4 transform-index) 42)
(set-vector! (-> s2-4 local-sphere) 0.0 0.0 0.0 12288.0)
(append-prim s3-0 s2-4)
)
(let ((s2-5 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 3))))
(set! (-> s2-5 prim-core collide-as) (collide-kind enemy))
(set! (-> s2-5 collide-with) (collide-kind target))
(set! (-> s2-5 prim-core action) (collide-action solid))
(set! (-> s2-5 prim-core offense) (collide-offense touch))
(set! (-> s2-5 transform-index) 27)
(set-vector! (-> s2-5 local-sphere) 0.0 0.0 0.0 8192.0)
(append-prim s3-0 s2-5)
)
)
(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)
(logclear! (-> obj mask) (process-mask actor-pause))
(initialize-skeleton obj *ogreboss-sg* '())
(set! (-> obj draw origin-joint-index) (the-as uint 5))
(ogreboss-get-targets)
(set! (-> obj try-count) (-> obj entity extra perm user-uint8 0))
(cond
((< (-> obj try-count) (the-as uint 5))
(set! (-> obj difficulty) 1.0)
)
((< (-> obj try-count) (the-as uint 10))
(set! (-> obj difficulty) 0.83334)
)
((< (-> obj try-count) (the-as uint 15))
(set! (-> obj difficulty) 0.66667)
)
(else
(set! (-> obj difficulty) 0.5)
)
)
(set! (-> obj lava) (entity-actor-lookup (-> obj entity) 'water-actor 0))
(set! *ogreboss* (the-as ogreboss (process->ppointer obj)))
(set! (-> obj level) 0.0)
(set! (-> obj vulnerable) #f)
(set! (-> obj bridge-assembled) #f)
(set! (-> obj submerged) #f)
(vector-z-quaternion! (-> obj z-plane) (-> obj root-override quat))
(set! (-> obj z-plane w) (- (vector-dot (-> obj z-plane) (-> obj root-override trans))))
(vector-x-quaternion! (-> obj side-dir) (-> obj root-override quat))
(set! (-> obj far-pos quad) (-> obj root-override trans quad))
(let ((f0-38 1.0))
(set-vector! (-> obj root-override scale) f0-38 f0-38 f0-38 1.0)
)
(vector+*! (-> obj near-pos) (-> obj far-pos) (-> obj z-plane) (the-as float 348160.0))
(set! (-> obj at-near-spot) #t)
(set! (-> obj try-counted) #f)
(set! (-> obj root-override trans quad) (-> obj near-pos quad))
(if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
(go ogreboss-dead)
(go ogreboss-idle)
)
(none)
)