jak-project/goal_src/levels/citadel/citadel-sages.gc
Brent Hickey f48fda692e
[game] 150fps support (and 100fps support) (#1264)
* docs for ee merc code

* 150fps support but it replaces 60fps

* oops switched wrong mode

* oops 50.0 not 50

* formatting

* fix cutscene speed

* oops

* Replace latest merc.md, not sure what happened

* Automatically switch between video modes (ntsc or 150fps) based on
refresh rate. Cleanup particle timing

* cleanup

* fix idle animation

* linter

* fix village2 crash

* can load all levels again

* update loader output and replace sparticle time with formula

* Add 100fps support, add some comments, fix build

* formatting

Co-authored-by: water <awaterford111445@gmail.com>
2022-06-19 17:01:51 -04:00

1159 lines
40 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: citadel-sages.gc
;; name in dgo: citadel-sages
;; dgos: CIT, L1
;; TODO
(define-extern *robotboss-sg* skeleton-group)
(declare-type citb-sage process-taskable)
;; DECOMP BEGINS
(import "goal_src/import/green-sagecage-ag.gc")
(import "goal_src/import/yellowsage-ag.gc")
(import "goal_src/import/redsage-ag.gc")
(import "goal_src/import/evilbro-citadel-ag.gc")
(import "goal_src/import/evilsis-citadel-ag.gc")
(import "goal_src/import/citb-sagecage-ag.gc")
(import "goal_src/import/bluesage-ag.gc")
(defskelgroup *citb-sagecage-sg* citb-sagecage citb-sagecage-lod0-jg citb-sagecage-redsage-idle-ja
((citb-sagecage-lod0-mg (meters 20)) (citb-sagecage-lod1-mg (meters 999999)))
:bounds (static-spherem 0 -6 0 7)
)
(deftype citb-sagecage (process-drawable)
((parent-override (pointer citb-sage) :offset 12)
(root-override collide-shape-moving :offset 112)
(bar-array vector 12 :inline :offset-assert 176)
(angle-offset float :offset-assert 368)
(bars-on symbol :offset-assert 372)
(cloning symbol :offset-assert 376)
)
:heap-base #x110
:method-count-assert 22
:size-assert #x17c
:flag-assert #x160110017c
(:methods
(dummy-20 (_type_) none 20)
(dummy-21 (_type_) none 21)
)
(:states
citb-sagecage-idle
)
)
(defbehavior citb-sagecage-draw-bars citb-sagecage ()
(when (logtest? (-> self draw status) (draw-status was-drawn))
(let ((gp-0 (-> self node-list data 3 bone transform))
(s5-0 (new 'stack-no-clear 'vector))
)
(let ((s4-0 (new 'stack-no-clear 'quaternion)))
(let ((s3-0 (new 'stack-no-clear 'vector)))
(matrix->quaternion s4-0 gp-0)
(vector-! s3-0 (camera-pos) (-> self root-override trans))
(let ((v1-7 (-> gp-0 vector 2)))
(set! (-> self angle-offset) (- (atan (-> v1-7 x) (-> v1-7 z))))
)
(quaternion-rotate-local-x! s4-0 s4-0 16384.0)
(let ((f0-7 (+ (-> self angle-offset) (atan (-> s3-0 x) (-> s3-0 z)))))
(quaternion-rotate-local-z! s4-0 s4-0 f0-7)
)
)
(quaternion-copy! *particle-quat* s4-0)
)
(let ((s4-1 (-> *part-id-table* 2473))
(s3-1 *sp-particle-system-3d*)
)
(dotimes (s2-2 12)
(vector-matrix*! s5-0 (-> self bar-array s2-2) gp-0)
(launch-particles :system s3-1 s4-1 s5-0)
)
)
)
)
0
(none)
)
(defbehavior citb-sagecage-update-collision citb-sagecage ()
(change-mesh (the-as collide-shape-prim-mesh (-> self root-override root-prim)) (if (-> self bars-on)
0
1
)
)
0
(none)
)
(defstate citb-sagecage-idle (citb-sagecage)
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(local-vars (v0-3 none))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'disable-bars)
(stop! (-> self sound))
(sound-play "sagecage-off")
(set! (-> self bars-on) #f)
(citb-sagecage-update-collision)
)
((= v1-0 'enable-bars)
(set! (-> self bars-on) #t)
(citb-sagecage-update-collision)
)
((= v1-0 'start-cloning)
(set! v0-3 (the-as none #t))
(set! (-> self cloning) (the-as symbol v0-3))
v0-3
)
((= v1-0 'stop-cloning)
(set! (-> self cloning) #f)
(let ((v1-7 (-> self skel root-channel 0)))
(set! v0-3 (the-as none (-> self draw art-group data 3)))
(set! (-> v1-7 frame-group) (the-as art-joint-anim v0-3))
)
v0-3
)
)
)
)
)
:trans (the-as (function none :behavior citb-sagecage) rider-trans)
:code (behavior ()
(loop
(cond
((-> self cloning)
(let ((gp-0 (ppointer->process (-> self parent-override))))
(when gp-0
(joint-control-copy! (-> self skel) (-> (the-as citb-sage gp-0) skel))
(joint-control-remap!
(-> self skel)
(-> self draw art-group)
(-> (the-as citb-sage gp-0) draw art-group)
'()
0
""
)
)
)
)
(else
(ja :num! (loop!))
)
)
(suspend)
)
(none)
)
:post (behavior ()
(rider-post)
(when (-> self bars-on)
(update! (-> self sound))
(citb-sagecage-draw-bars)
)
(none)
)
)
(defmethod dummy-20 citb-sagecage ((obj citb-sagecage))
(let ((s5-0 (new 'process 'collide-shape-moving obj (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)
)
(alloc-riders s5-0 1)
(let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s4-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
(set! (-> s4-0 prim-core action) (collide-action solid ca-1))
(set! (-> s4-0 prim-core offense) (collide-offense indestructible))
(set! (-> s4-0 transform-index) 3)
(set-vector! (-> s4-0 local-sphere) 0.0 20480.0 0.0 28672.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! (-> obj root-override) s5-0)
)
0
(none)
)
(defmethod dummy-21 citb-sagecage ((obj citb-sagecage))
(initialize-skeleton obj *citb-sagecage-sg* '())
(logior! (-> obj skel status) (janim-status inited))
(set! (-> obj root-override pause-adjust-distance) 409600.0)
(let ((f0-1 20766.72)
(f4-0 14745.6)
(f1-0 -14745.6)
(f2-0 7372.8)
)
(let ((f3-0 -7372.8))
(set-vector! (-> obj bar-array 0) f4-0 f0-1 f3-0 1.0)
(set-vector! (-> obj bar-array 1) f4-0 f0-1 0.0 1.0)
(set-vector! (-> obj bar-array 2) f4-0 f0-1 f2-0 1.0)
(set-vector! (-> obj bar-array 3) f1-0 f0-1 f3-0 1.0)
(set-vector! (-> obj bar-array 4) f1-0 f0-1 0.0 1.0)
(set-vector! (-> obj bar-array 5) f1-0 f0-1 f2-0 1.0)
(set-vector! (-> obj bar-array 6) f3-0 f0-1 f4-0 1.0)
(set-vector! (-> obj bar-array 7) 0.0 f0-1 f4-0 1.0)
(set-vector! (-> obj bar-array 8) f2-0 f0-1 f4-0 1.0)
(set-vector! (-> obj bar-array 9) f3-0 f0-1 f1-0 1.0)
)
(set-vector! (-> obj bar-array 10) 0.0 f0-1 f1-0 1.0)
(set-vector! (-> obj bar-array 11) f2-0 f0-1 f1-0 1.0)
)
(set! (-> obj sound)
(new 'process 'ambient-sound (static-sound-spec "sagecage-gen" :fo-max 20) (-> obj root-override trans))
)
(set! (-> obj bars-on) (not (task-complete? *game-info* (-> obj entity extra perm task))))
(citb-sagecage-update-collision)
(set! (-> obj cloning) #t)
(set! (-> obj event-hook) (-> citb-sagecage-idle event))
0
(none)
)
(defbehavior citb-sagecage-init-by-other citb-sagecage ((arg0 citb-sage))
(dummy-20 self)
(mem-copy! (the-as pointer (-> self root-override trans)) (the-as pointer (-> arg0 root-override trans)) 16)
(mem-copy! (the-as pointer (-> self root-override quat)) (the-as pointer (-> arg0 root-override quat)) 16)
(mem-copy! (the-as pointer (-> self root-override scale)) (the-as pointer (-> arg0 root-override scale)) 16)
(dummy-21 self)
(go citb-sagecage-idle)
(none)
)
(defskelgroup *redsage-sg* redsage redsage-lod0-jg redsage-redsage-idle-ja
((redsage-lod0-mg (meters 20)) (redsage-lod1-mg (meters 999999)))
:bounds (static-spherem 0 0 0 3)
:shadow redsage-shadow-mg
)
(defskelgroup *bluesage-sg* bluesage bluesage-lod0-jg bluesage-bluesage-idle-ja
((bluesage-lod0-mg (meters 20)) (bluesage-lod1-mg (meters 999999)))
:bounds (static-spherem 0 0 0 4)
:shadow bluesage-shadow-mg
)
(defskelgroup *yellowsage-sg* yellowsage yellowsage-lod0-jg yellowsage-yellowsage-idle-ja
((yellowsage-lod0-mg (meters 20)) (yellowsage-lod1-mg (meters 999999)))
:bounds (static-spherem 0 0 0 3)
:shadow yellowsage-shadow-mg
)
(defskelgroup *green-sagecage-sg* green-sagecage green-sagecage-lod0-jg green-sagecage-green-sagecage-idle-ja
((green-sagecage-lod0-mg (meters 20)) (green-sagecage-lod1-mg (meters 999999)))
:bounds (static-spherem 0 0 0 2.5)
:shadow green-sagecage-shadow-mg
)
(defskelgroup *evilbro-citadel-sg* evilbro-citadel evilbro-citadel-lod0-jg evilbro-citadel-idle-ja
((evilbro-citadel-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 1)
:shadow evilbro-citadel-shadow-mg
)
(defskelgroup *evilsis-citadel-sg* evilsis-citadel evilsis-citadel-lod0-jg evilsis-citadel-idle-ja
((evilsis-citadel-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 1)
:shadow evilsis-citadel-shadow-mg
)
(deftype citb-sage (process-taskable)
((spawn-pos vector :inline :offset-assert 384)
(target-pos vector :inline :offset-assert 400)
(dir vector :inline :offset-assert 416)
(rot-y float :offset-assert 432)
(rot-x float :offset-assert 436)
(idle-anim int32 :offset-assert 440)
(attack-start-anim int32 :offset-assert 444)
(attack-anim int32 :offset-assert 448)
(beam-joint int32 :offset-assert 452)
(cage handle :offset-assert 456)
(part-impact sparticle-launch-control :offset-assert 464)
(beam-on symbol :offset-assert 468)
(resolution-anim spool-anim :offset-assert 472)
(sound-name string :offset-assert 476)
(sound-id sound-id :offset-assert 480)
(alt-actor entity-actor :offset-assert 484)
)
:heap-base #x180
:method-count-assert 53
:size-assert #x1e8
:flag-assert #x35018001e8
)
(defmethod relocate citb-sage ((obj citb-sage) (arg0 int))
(if (nonzero? (-> obj part-impact))
(&+! (-> obj part-impact) arg0)
)
(the-as citb-sage ((method-of-type process-taskable relocate) obj arg0))
)
(defmethod deactivate citb-sage ((obj citb-sage))
(if (nonzero? (-> obj part-impact))
(kill-and-free-particles (-> obj part-impact))
)
(sound-stop (-> obj sound-id))
((method-of-type process-taskable deactivate) obj)
(none)
)
(defmethod play-reminder citb-sage ((obj citb-sage))
(set! (-> obj root-override pause-adjust-distance) 409600.0)
(set! (-> obj cage) (ppointer->handle (process-spawn citb-sagecage obj :to obj)))
(set! (-> obj beam-on) #f)
(set! (-> obj sound-id) (new-sound-id))
(if (zero? (-> obj sound-name))
(set! (-> obj sound-name) "")
)
(let ((v1-9 (the-as entity (entity-actor-lookup (-> obj entity) 'alt-actor 0)))
(s5-1 (new 'stack-no-clear 'vector))
)
(let ((s4-0 (new 'stack-no-clear 'vector)))
(if (not (the-as entity-actor v1-9))
(set! v1-9 (entity-by-name "citb-robotboss-1"))
)
(set! (-> obj alt-actor) (the-as entity-actor v1-9))
(set! (-> obj spawn-pos quad) (-> obj root-override trans quad))
(set! (-> s5-1 quad) (-> v1-9 extra trans quad))
(set! (-> s5-1 y) (+ 81920.0 (-> s5-1 y)))
(vector-! s4-0 (-> obj spawn-pos) s5-1)
(set! (-> s4-0 y) 0.0)
(vector-normalize! s4-0 1.0)
(vector+*! (-> obj target-pos) s5-1 s4-0 116940.8)
)
(when (nonzero? (-> obj part))
(vector-! s5-1 (-> obj target-pos) (-> obj spawn-pos))
(vector-float*! (the-as vector (-> obj part group bounds)) s5-1 0.5)
(set! (-> obj part group bounds w) (* 0.6 (vector-vector-distance (-> obj spawn-pos) (-> obj target-pos))))
)
)
(the-as symbol 0)
)
(defmethod dummy-45 citb-sage ((obj citb-sage))
(set! (-> obj spawn-pos quad) (-> obj root-override trans quad))
(the-as symbol 0)
)
(defmethod dummy-42 citb-sage ((obj citb-sage))
(if (not (should-display? obj))
(go (method-of-object obj hidden))
(go (method-of-object obj idle))
)
(none)
)
(defmethod play-anim! citb-sage ((obj citb-sage) (arg0 symbol))
(the-as basic (-> obj resolution-anim))
)
(defmethod get-art-elem citb-sage ((obj citb-sage))
(cond
((= (current-status (-> obj tasks)) (task-status invalid))
(set! (-> obj beam-on) #t)
(-> obj draw art-group data (-> obj attack-anim))
)
(else
(-> obj draw art-group data (-> obj idle-anim))
)
)
)
(defmethod should-display? citb-sage ((obj citb-sage))
(!= (get-task-status (game-task citadel-sage-green)) (task-status invalid))
)
(defstate hidden (citb-sage)
:virtual #t
:enter (behavior ()
(send-event (handle->process (-> self cage)) 'disable-bars)
(send-event (handle->process (-> self cage)) 'stop-cloning)
((-> (method-of-type process-taskable hidden) enter))
(none)
)
)
(defbehavior citb-sage-draw-beam citb-sage ()
(if (< (vector-vector-distance (ear-trans) (-> self spawn-pos)) 409600.0)
(sound-play-by-name
(string->sound-name (-> self sound-name))
(-> self sound-id)
1024
0
0
(sound-group sfx)
(the-as symbol (-> self spawn-pos))
)
)
(set! (-> self spawn-pos quad) (-> self node-list data (-> self beam-joint) bone transform vector 3 quad))
(vector-! (-> self dir) (-> self target-pos) (-> self spawn-pos))
(set! (-> self rot-y) (vector-y-angle (-> self dir)))
(set! (-> self rot-x) (- 16384.0 (vector-x-angle (-> self dir))))
(dummy-45 self)
(spawn (-> self part) (-> self spawn-pos))
(spawn (-> self part-impact) (-> self target-pos))
)
(defstate play-anim (citb-sage)
:virtual #t
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('disable-bars)
(send-event (handle->process (-> self cage)) 'disable-bars)
)
(else
((-> (method-of-type process-taskable play-anim) event) arg0 arg1 arg2 arg3)
)
)
)
)
(defstate idle (citb-sage)
:virtual #t
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('open)
(send-event (handle->process (-> self cage)) 'disable-bars)
)
(else
((-> (method-of-type process-taskable idle) event) arg0 arg1 arg2 arg3)
)
)
)
:trans (behavior ()
(#if PC_PORT
;; fix infinite state recursion
(if (and (not (-> self been-kicked)) (not (should-display? self)))
(go-virtual hidden)
)
;; no fix
(if (not (should-display? self))
(go-virtual hidden)
)
)
((-> (method-of-type process-taskable idle) trans))
(none)
)
:post (behavior ()
((the-as (function none :behavior citb-sage) (-> (method-of-type process-taskable idle) post)))
(if (-> self beam-on)
(citb-sage-draw-beam)
)
(none)
)
)
(deftype red-sagecage (citb-sage)
()
:heap-base #x180
:method-count-assert 53
:size-assert #x1e8
:flag-assert #x35018001e8
)
(defmethod dummy-52 red-sagecage ((obj red-sagecage))
(let ((v1-1 (-> obj draw shadow-ctrl)))
(when v1-1
(let ((a0-1 v1-1))
(set! (-> a0-1 settings bot-plane w) (- -8192.0))
)
0
(let ((a0-3 v1-1))
(set! (-> a0-3 settings top-plane w) (- 4096.0))
)
0
(logclear! (-> v1-1 settings flags) (shadow-flags shdf02 shdf03))
)
)
(none)
)
(defmethod draw-npc-shadow red-sagecage ((obj red-sagecage))
(-> obj draw shadow-ctrl)
(cond
((and (-> obj draw shadow)
(zero? (-> obj draw cur-lod))
(logtest? (-> obj draw status) (draw-status was-drawn))
)
(let ((v1-9 (-> obj draw shadow-ctrl)))
(logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
)
0
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
)
(else
(let ((v1-14 (-> obj draw shadow-ctrl)))
(logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
)
0
)
)
(none)
)
(defmethod dummy-45 red-sagecage ((obj red-sagecage))
(set! (-> *part-id-table* 2455 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2455 init-specs 13 initial-valuef) (-> obj rot-x))
(set! (-> *part-id-table* 2457 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2457 init-specs 13 initial-valuef) (-> obj rot-x))
(set! (-> *part-id-table* 2454 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2454 init-specs 13 initial-valuef) (-> obj rot-x))
(the-as symbol 0)
)
(defmethod play-reminder red-sagecage ((obj red-sagecage))
(set! (-> obj idle-anim) 4)
(set! (-> obj attack-start-anim) 5)
(set! (-> obj attack-anim) 6)
(set! (-> obj beam-joint) 20)
(set! (-> obj part) (create-launch-control (-> *part-group-id-table* 604) obj))
(set! (-> obj part-impact) (create-launch-control (-> *part-group-id-table* 608) obj))
(set! (-> obj resolution-anim) (new 'static 'spool-anim
:name "redsage-resolution"
:index 7
:parts 9
:command-list '((15 send-event self disable-bars)
(45 joint "cameraB")
(216 joint "camera")
(435 joint "cameraB")
(685 joint "camera")
)
)
)
(set! (-> obj sound-name) "redsage-fires")
((the-as (function citb-sage none) (find-parent-method red-sagecage 44)) obj)
(the-as symbol 0)
)
(defmethod TODO-RENAME-43 red-sagecage ((obj red-sagecage))
(if (-> obj beam-on)
(return #f)
)
(when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj)
(let ((f0-2 (rand-float-gen)))
(cond
((< 0.6666667 f0-2)
(play-ambient (-> obj ambient) "RED-AM01" #f (-> obj root-override trans))
)
((< 0.33333334 f0-2)
(play-ambient (-> obj ambient) "RED-AM02" #f (-> obj root-override trans))
)
(else
(play-ambient (-> obj ambient) "RED-AM03" #f (-> obj root-override trans))
)
)
)
)
)
(defmethod init-from-entity! red-sagecage ((obj red-sagecage) (arg0 entity-actor))
(dummy-40 obj arg0 *redsage-sg* 3 33 (new 'static 'vector :w 8192.0) 5)
(set! (-> obj tasks) (get-task-control (-> obj entity extra perm task)))
(play-reminder obj)
(set! (-> obj sound-flava) (music-flava sage-red))
(dummy-42 obj)
(none)
)
(deftype blue-sagecage (citb-sage)
()
:heap-base #x180
:method-count-assert 53
:size-assert #x1e8
:flag-assert #x35018001e8
)
(defmethod dummy-52 blue-sagecage ((obj blue-sagecage))
(let ((v1-1 (-> obj draw shadow-ctrl)))
(when v1-1
(let ((a0-1 v1-1))
(set! (-> a0-1 settings bot-plane w) (- -10035.2))
)
0
(let ((a0-3 v1-1))
(set! (-> a0-3 settings top-plane w) (- 4096.0))
)
0
(logclear! (-> v1-1 settings flags) (shadow-flags shdf02 shdf03))
)
)
(none)
)
(defmethod draw-npc-shadow blue-sagecage ((obj blue-sagecage))
(-> obj draw shadow-ctrl)
(cond
((and (-> obj draw shadow)
(zero? (-> obj draw cur-lod))
(logtest? (-> obj draw status) (draw-status was-drawn))
)
(let ((v1-9 (-> obj draw shadow-ctrl)))
(logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
)
0
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
)
(else
(let ((v1-14 (-> obj draw shadow-ctrl)))
(logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
)
0
)
)
(none)
)
(defmethod dummy-45 blue-sagecage ((obj blue-sagecage))
(set! (-> *part-id-table* 2448 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2448 init-specs 13 initial-valuef) (-> obj rot-x))
(set! (-> *part-id-table* 2450 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2450 init-specs 13 initial-valuef) (-> obj rot-x))
(set! (-> *part-id-table* 2447 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2447 init-specs 13 initial-valuef) (-> obj rot-x))
(the-as symbol 0)
)
(defmethod play-reminder blue-sagecage ((obj blue-sagecage))
(set! (-> obj idle-anim) 4)
(set! (-> obj attack-start-anim) 5)
(set! (-> obj attack-anim) 6)
(set! (-> obj beam-joint) 53)
(set! (-> obj part) (create-launch-control (-> *part-group-id-table* 603) obj))
(set! (-> obj part-impact) (create-launch-control (-> *part-group-id-table* 607) obj))
(set! (-> obj resolution-anim) (new 'static 'spool-anim
:name "bluesage-resolution"
:index 7
:parts 9
:command-list '((15 send-event self disable-bars)
(45 joint "cameraB")
(74 shadow self #f)
(185 joint "camera")
(256 joint "cameraB")
(505 joint "camera")
(590 joint "cameraB")
(670 joint "camera")
(875 shadow self #t)
(876 joint "cameraB")
)
)
)
(set! (-> obj sound-name) "bluesage-fires")
((the-as (function citb-sage none) (find-parent-method blue-sagecage 44)) obj)
(the-as symbol 0)
)
(defmethod TODO-RENAME-43 blue-sagecage ((obj blue-sagecage))
(if (-> obj beam-on)
(return #f)
)
(when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj)
(let ((f0-2 (rand-float-gen)))
(cond
((< 0.6666667 f0-2)
(play-ambient (-> obj ambient) "BLU-AM01" #f (-> obj root-override trans))
)
((< 0.33333334 f0-2)
(play-ambient (-> obj ambient) "BLU-AM02" #f (-> obj root-override trans))
)
(else
(play-ambient (-> obj ambient) "BLU-AM03" #f (-> obj root-override trans))
)
)
)
)
)
(defmethod init-from-entity! blue-sagecage ((obj blue-sagecage) (arg0 entity-actor))
(dummy-40 obj arg0 *bluesage-sg* 3 54 (new 'static 'vector :w 8192.0) 5)
(set! (-> obj tasks) (get-task-control (-> obj entity extra perm task)))
(play-reminder obj)
(set! (-> obj sound-flava) (music-flava sage-blue))
(dummy-42 obj)
(none)
)
(deftype yellow-sagecage (citb-sage)
()
:heap-base #x180
:method-count-assert 53
:size-assert #x1e8
:flag-assert #x35018001e8
)
(defmethod dummy-52 yellow-sagecage ((obj yellow-sagecage))
(let ((v1-1 (-> obj draw shadow-ctrl)))
(when v1-1
(let ((a0-1 v1-1))
(set! (-> a0-1 settings bot-plane w) (- -6144.0))
)
0
(let ((a0-3 v1-1))
(set! (-> a0-3 settings top-plane w) (- 4096.0))
)
0
(logclear! (-> v1-1 settings flags) (shadow-flags shdf02 shdf03))
)
)
(none)
)
(defmethod draw-npc-shadow yellow-sagecage ((obj yellow-sagecage))
(-> obj draw shadow-ctrl)
(cond
((and (-> obj draw shadow)
(zero? (-> obj draw cur-lod))
(logtest? (-> obj draw status) (draw-status was-drawn))
)
(let ((v1-9 (-> obj draw shadow-ctrl)))
(logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
)
0
(update-direction-from-time-of-day (-> obj draw shadow-ctrl))
)
(else
(let ((v1-14 (-> obj draw shadow-ctrl)))
(logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
)
0
)
)
(none)
)
(defmethod dummy-45 yellow-sagecage ((obj yellow-sagecage))
(set! (-> *part-id-table* 2462 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2462 init-specs 13 initial-valuef) (-> obj rot-x))
(set! (-> *part-id-table* 2464 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2464 init-specs 13 initial-valuef) (-> obj rot-x))
(set! (-> *part-id-table* 2461 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2461 init-specs 13 initial-valuef) (-> obj rot-x))
(the-as symbol 0)
)
(defmethod play-reminder yellow-sagecage ((obj yellow-sagecage))
(set! (-> obj idle-anim) 4)
(set! (-> obj attack-start-anim) 5)
(set! (-> obj attack-anim) 6)
(set! (-> obj beam-joint) 74)
(set! (-> obj part) (create-launch-control (-> *part-group-id-table* 605) obj))
(set! (-> obj part-impact) (create-launch-control (-> *part-group-id-table* 609) obj))
(set! (-> obj resolution-anim) (new 'static 'spool-anim
:name "yellowsage-resolution"
:index 7
:parts 6
:command-list '((15 send-event self disable-bars)
(45 joint "cameraB")
(256 joint "camera")
(314 joint "cameraB")
(600 joint "camera")
)
)
)
(set! (-> obj sound-name) "yellsage-fire")
((the-as (function citb-sage none) (find-parent-method yellow-sagecage 44)) obj)
(the-as symbol 0)
)
(defmethod TODO-RENAME-43 yellow-sagecage ((obj yellow-sagecage))
(if (-> obj beam-on)
(return #f)
)
(when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj)
(let ((f0-2 (rand-float-gen)))
(cond
((< 0.6666667 f0-2)
(play-ambient (-> obj ambient) "YEL-AM01" #f (-> obj root-override trans))
)
((< 0.33333334 f0-2)
(play-ambient (-> obj ambient) "YEL-AM02" #f (-> obj root-override trans))
)
(else
(play-ambient (-> obj ambient) "YEL-AM03" #f (-> obj root-override trans))
)
)
)
)
)
(defmethod init-from-entity! yellow-sagecage ((obj yellow-sagecage) (arg0 entity-actor))
(dummy-40 obj arg0 *yellowsage-sg* 3 50 (new 'static 'vector :w 8192.0) 5)
(set! (-> obj tasks) (get-task-control (-> obj entity extra perm task)))
(play-reminder obj)
(set! (-> obj sound-flava) (music-flava sage-yellow))
(dummy-42 obj)
(none)
)
(deftype green-sagecage (citb-sage)
((which-movie int32 :offset-assert 488)
(evilbro handle :offset-assert 496)
(evilsis handle :offset-assert 504)
(robotboss handle :offset-assert 512)
(exitplat handle :offset-assert 520)
)
:heap-base #x1a0
:method-count-assert 53
:size-assert #x210
:flag-assert #x3501a00210
)
(defmethod dummy-45 green-sagecage ((obj green-sagecage))
(set! (-> *part-id-table* 2469 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2469 init-specs 13 initial-valuef) (-> obj rot-x))
(set! (-> *part-id-table* 2471 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2471 init-specs 13 initial-valuef) (-> obj rot-x))
(set! (-> *part-id-table* 2468 init-specs 14 initial-valuef) (-> obj rot-y))
(set! (-> *part-id-table* 2468 init-specs 13 initial-valuef) (-> obj rot-x))
(the-as symbol 0)
)
(defmethod play-reminder green-sagecage ((obj green-sagecage))
(set! (-> obj idle-anim) 4)
(set! (-> obj attack-start-anim) 4)
(set! (-> obj attack-anim) 4)
(set! (-> obj beam-joint) 22)
(set! (-> obj part) (create-launch-control (-> *part-group-id-table* 606) obj))
(set! (-> obj part-impact) (create-launch-control (-> *part-group-id-table* 610) obj))
(set! (-> obj resolution-anim) (new 'static 'spool-anim
:name "green-sagecage-resolution"
:index 6
:parts 12
:command-list '((33 joint "cameraB")
(156 joint "camera")
(405 joint "cameraB")
(576 joint "camera")
(823 joint "cameraB")
(1156 joint "camera")
(1199 joint "cameraB")
)
)
)
(set! (-> obj sound-name) "greensage-fires")
((the-as (function citb-sage none) (find-parent-method green-sagecage 44)) obj)
(the-as symbol 0)
)
(defmethod play-anim! green-sagecage ((obj green-sagecage) (arg0 symbol))
(local-vars (v1-7 int))
(let ((v1-1 (current-status (-> obj tasks))))
(cond
((= v1-1 (task-status need-hint))
(when arg0
(close-current! (-> obj tasks))
(close-specific-task! (game-task citadel-sage-blue) (task-status need-hint))
(close-specific-task! (game-task citadel-sage-red) (task-status need-hint))
(close-specific-task! (game-task citadel-sage-yellow) (task-status need-hint))
(set-continue! *game-info* "citadel-elevator")
)
(new 'static 'spool-anim
:name "green-sagecage-introduction"
:index 5
:parts 12
:command-list '((71 joint "cameraB")
(207 joint "camera")
(343 joint "cameraB")
(574 joint "camera")
(1060 joint "cameraB")
(1061 send-event camera teleport)
)
)
)
((begin (set! v1-7 (-> obj which-movie)) (zero? v1-7))
(when arg0
(send-event (handle->process (-> obj cage)) 'disable-bars)
(+! (-> obj which-movie) 1)
(set! (-> obj draw bounds w) 40960.0)
)
(-> obj resolution-anim)
)
((= v1-7 1)
(when arg0
(+! (-> obj which-movie) 1)
(set! (-> obj draw bounds w) 40960.0)
(set! (-> obj evilbro)
(ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilbro-citadel-sg* #f :to obj))
)
(send-event (handle->process (-> obj evilbro)) 'anim-mode 'clone-anim)
(send-event (handle->process (-> obj evilbro)) 'blend-shape #t)
(send-event (handle->process (-> obj evilbro)) 'center-joint 3)
(set! (-> obj evilsis)
(ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilsis-citadel-sg* #f :to obj))
)
(send-event (handle->process (-> obj evilsis)) 'anim-mode 'clone-anim)
(send-event (handle->process (-> obj evilsis)) 'blend-shape #t)
(send-event (handle->process (-> obj evilsis)) 'center-joint 3)
(if (handle->process (-> obj exitplat))
(format 0 "exitplat activated~%")
)
)
(new 'static 'spool-anim
:name "green-sagecage-outro-preboss"
:index 7
:parts 22
:command-list '((0 blackout 0)
(0 want-levels citadel finalboss)
(0 display-level finalboss special)
(0 send-event "citb-robotboss-1" 'die)
(335 joint "cameraB")
(581 joint "camera")
(696 joint "cameraB")
(828 joint "camera")
(1180 joint "cameraB")
(1380 send-event self 'spawn-robot)
(1382 joint "camera")
(1382 kill "citb-disc-d-2")
(1382 kill "citb-disc-c-4")
(1382 kill "citb-disc-c-5")
(1382 kill "citb-disc-c-6")
(1382 kill "citb-disc-b-12")
(1382 kill "citb-disc-b-13")
(1382 kill "citb-disc-b-14")
(1382 kill "citb-disc-a-11")
(1382 kill "citb-disc-a-12")
(1382 kill "citb-disc-a-13")
(1382 kill "citb-disc-a-14")
(1382 kill "citb-disc-a-15")
(1382 kill "citb-disc-a-16")
(1382 kill "citb-disc-b-21")
(1382 kill "citb-button-28")
(1382 kill "citb-button-32")
(1382 kill "citb-generator-1")
(1382 kill "citb-generator-2")
(1382 kill "citb-generator-3")
(1382 kill "citb-generator-4")
(1382 kill "citb-iris-door-15")
(1382 kill "citb-iris-door-16")
(1382 kill "crate-2996")
(1382 kill "crate-2997")
(1382 kill "crate-2998")
(1382 kill "crate-3000")
(1382 kill "citb-plat-eco-1")
(1382 kill "citb-plat-eco-2")
(1382 kill "citb-plat-eco-3")
(1382 kill "citb-stair-plat-1")
(1382 kill "citb-stair-plat-2")
(1382 kill "citb-stair-plat-3")
(1382 kill "citb-stair-plat-4")
(1382 kill "citb-stair-plat-5")
(1382 kill "citb-stair-plat-6")
(1382 kill "red-sagecage-1")
(1382 kill "blue-sagecage-1")
(1382 kill "yellow-sagecage-1")
(1382 kill "babak-391")
(1382 kill "citb-disc-c-10")
(1382 kill "citb-iris-door-32")
(1382 kill "citb-disc-b-18")
(1382 kill "citb-disc-b-19")
(1382 kill "citb-disc-b-20")
(1382 kill "citb-iris-door-14")
(1382 kill "orb-cache-top-32")
(1382 kill "citb-disc-b-17")
(1382 kill "citb-iris-door-13")
(1382 kill "citb-button-39")
(1382 kill "citb-button-40")
(1382 kill "babak-392")
(1382 kill "babak-393")
(1382 kill "citb-button-33")
(1382 kill "citb-button-34")
(1382 kill "citb-drop-plat-365")
(1382 kill "citb-drop-plat-366")
(1382 kill "citb-drop-plat-367")
(1382 kill "citb-iris-door-21")
(1382 kill "assistant-lavatube-end-3")
(1382 kill "babak-394")
(1382 kill "babak-396")
(1382 kill "citb-drop-plat-376")
(1605 joint "cameraB")
(1733 kill "citb-iris-door-2")
(1736 joint "camera")
)
)
)
(else
(if arg0
(format
0
"ERROR: <GMJ>: ~S playing anim for task status ~S~%"
(-> obj name)
(task-status->string (current-status (-> obj tasks)))
)
)
(-> obj draw art-group data 4)
)
)
)
)
(defstate play-anim (green-sagecage)
:virtual #t
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('spawn-robot)
(let ((gp-0 (entity-by-name "robotboss-3")))
(format 0 "robotboss ent ~A~%" gp-0)
(when gp-0
(set! (-> self robotboss)
(ppointer->handle (manipy-spawn (-> self root-override trans) gp-0 *robotboss-sg* #f :to self))
)
(send-event (handle->process (-> self robotboss)) 'anim-mode 'clone-anim)
(send-event (handle->process (-> self robotboss)) 'center-joint 3)
(send-event (handle->process (-> self robotboss)) 'origin-joint-index 3)
(let ((s5-1 (handle->process (-> self robotboss))))
(when s5-1
(format 0 "robotboss activated ent ~A~%" gp-0)
(let ((f0-0 327680.0))
(set! (-> (the-as process-drawable s5-1) draw bounds w) f0-0)
f0-0
)
)
)
)
)
)
(else
((-> (method-of-type citb-sage play-anim) event) arg0 arg1 arg2 arg3)
)
)
)
:exit (behavior ()
(let ((a0-1 (handle->process (-> self evilbro))))
(if a0-1
(deactivate a0-1)
)
)
(let ((a0-5 (handle->process (-> self evilsis))))
(if a0-5
(deactivate a0-5)
)
)
(let ((a0-9 (handle->process (-> self robotboss))))
(if a0-9
(deactivate a0-9)
)
)
(let ((a0-13 (handle->process (-> self exitplat))))
(if a0-13
(deactivate a0-13)
)
)
(when (= (current-status (-> self tasks)) (task-status invalid))
(let ((a1-4 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-4 from) self)
(set! (-> a1-4 num-params) 0)
(set! (-> a1-4 message) 'shield-off)
(let ((t9-5 send-event-function)
(v1-28 (-> self alt-actor))
)
(t9-5
(if v1-28
(-> v1-28 extra process)
)
a1-4
)
)
)
)
(cond
((= (-> self which-movie) 1)
(set-blackout-frames (seconds 100))
)
((= (-> self which-movie) 2)
(start 'play (get-continue-by-name *game-info* "citadel-elevator"))
)
)
(set! (-> self draw bounds w) 10240.0)
((-> (method-of-type process-taskable play-anim) exit))
(none)
)
:trans (behavior ()
(case (-> self which-movie)
((1)
(spool-push *art-control* "green-sagecage-outro-preboss" 0 self -1.0)
(if (< 1200.0 (ja-aframe-num 0))
(citb-sage-draw-beam)
)
(when (< 1310.0 (ja-aframe-num 0))
(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) 'shield-off)
(let ((t9-4 send-event-function)
(v1-8 (-> self alt-actor))
)
(t9-4
(if v1-8
(-> v1-8 extra process)
)
a1-1
)
)
)
)
)
)
((-> (method-of-type process-taskable play-anim) trans))
(none)
)
)
(defmethod should-display? green-sagecage ((obj green-sagecage))
(< (-> obj which-movie) 2)
)
(defstate idle (green-sagecage)
:virtual #t
:trans (behavior ()
(cond
((and *target*
(and (< (-> (target-pos 0) z) -18821530.0) (= (current-status (-> self tasks)) (task-status need-hint)))
)
(send-event self 'play-anim)
)
((= (-> self which-movie) 1)
(send-event self 'play-anim)
)
)
((-> (method-of-type citb-sage idle) trans))
(none)
)
)
(defmethod init-from-entity! green-sagecage ((obj green-sagecage) (arg0 entity-actor))
(dummy-40 obj arg0 *green-sagecage-sg* 3 40 (new 'static 'vector :w 4096.0) 5)
(set! (-> obj tasks) (get-task-control (-> obj entity extra perm task)))
(play-reminder obj)
(set! (-> obj evilbro) (the-as handle #f))
(set! (-> obj evilsis) (the-as handle #f))
(set! (-> obj robotboss) (the-as handle #f))
(set! (-> obj exitplat) (the-as handle #f))
(cond
((= (current-status (-> obj tasks)) (task-status invalid))
(set! (-> obj which-movie) 2)
)
(else
(set! (-> obj which-movie) 0)
0
)
)
(set! (-> obj sound-flava) (music-flava sage))
(dummy-42 obj)
(none)
)