jak-project/goal_src/levels/sunken/wall-plat.gc

358 lines
8.6 KiB
Common Lisp
Raw Normal View History

;;-*-Lisp-*-
2020-09-04 14:44:23 -04:00
(in-package goal)
;; name: wall-plat.gc
;; name in dgo: wall-plat
;; dgos: L1, SUN, SUNKEN
(define-extern *wall-plat-sg* skeleton-group)
(declare-type wall-plat process-drawable)
(define-extern wall-plat-sync-idle (state wall-plat)) ;; unknown type
(define-extern wall-plat-retracted (state wall-plat)) ;; unknown type
(define-extern wall-plat-retracting (state wall-plat)) ;; unknown type
(define-extern wall-plat-extended (state wall-plat)) ;; unknown type
(define-extern wall-plat-extending (state wall-plat)) ;; unknown type
decomp: Continuing full pass of gameplay code (#839) * decomp: finish `babak` - :code is called in `(code nav-enemy-patrol babak)` * decomp: almost finish `process-taskable` * blocked: mistycannon / pelican * decomp: finish `babak-with-cannon` write a script to fix gsrc * decomp: finish `process-taskable` * decomp: finish `flutflut` and `yakow` * decomp: finish `fishermans-boat` * blocked: state decomp `training-obs` * decomp: finish `muse` * decomp: finish `bonelurker` * blocked: state decomp in `quicksandlurker`| `balloonlurker` * decomp: finish `assistant-village2` * scripts: script to help updating goal_src * starting to update goal_src * tests: update ref tests * src: more src updating * src: waiting on `process-taskable` and `muse` * blocked: `citb-plat` state decomp * decomp: finish `square-platform` * blocked: `orbit-plat` due to overlays + static data * decomp: finish `qbert-plat` * blocked: almost finish `misty-conveyor`, sparticle-callback * blocked: jungle-mirrors * blocked: state decomp in `swamp-blimp` * decomp: finish `swamp-bat` * decomp: finish `swamp-rat` * decomp: finish `swamp-rat-nest` * blocked: state decomp `kermit` * decomp: finish `cavecrystal-light` * decomp: finish `spiderwebs` * blocked: state decomp `dark-crystal` * decomp: finish `baby-spider` * decomp: finish `mother-spider-h` * decomp: finish `mother-spider-proj` * blocked: state decomp in `gnawer` * blocked: state decomp in `driller-lurker` * blocked: `sun-exit-chamber` breaks when adding handle cast * decomp: finish `sunken-water` * blocked: `target-tube` ShortCircuitElement::push_to_stack * decomp: finish `sunken-fish` * blocked: `minecart` decomp crash when adding stack cast * decomp: finish `assistant-village3` * decomp: finish `sage-village3` * blocked: `cave-trap` done but ran into `go` issue * blocked: `spider-egg` state decomp * decomp: finish `target-snowball` * blocked/stuck: `target-ice` decomp issue around cpad * pausing: ice-cube has some weird collide-shape-prim handling * blocked: `snow-ball` state decomp * blocked: `snow-bumper` state decomp * decomp: finish `snow-ram-h` * decomp: finish `yeti` * decomp: finish `assistant-lavatube` * re-enable the float cast log * decomp: updating to new sparticle definitions * decomp: address feedback up to `swamp-rat-nest` * address remaining feedback * all-types: move the `pointer` def * add back temporary `hud-hidden?`
2021-09-28 20:42:00 -04:00
;; DECOMP BEGINS
(deftype wall-plat (process-drawable)
((root-override collide-shape-moving :offset 112)
(use-sync? symbol :offset-assert 176)
(extended-amount float :offset-assert 180)
(in-trans vector :inline :offset-assert 192)
(out-trans vector :inline :offset-assert 208)
(sync sync-info-paused :inline :offset-assert 224)
)
:heap-base #x80
:method-count-assert 20
:size-assert #xf0
:flag-assert #x14008000f0
)
decomp: Continuing full pass of gameplay code (#839) * decomp: finish `babak` - :code is called in `(code nav-enemy-patrol babak)` * decomp: almost finish `process-taskable` * blocked: mistycannon / pelican * decomp: finish `babak-with-cannon` write a script to fix gsrc * decomp: finish `process-taskable` * decomp: finish `flutflut` and `yakow` * decomp: finish `fishermans-boat` * blocked: state decomp `training-obs` * decomp: finish `muse` * decomp: finish `bonelurker` * blocked: state decomp in `quicksandlurker`| `balloonlurker` * decomp: finish `assistant-village2` * scripts: script to help updating goal_src * starting to update goal_src * tests: update ref tests * src: more src updating * src: waiting on `process-taskable` and `muse` * blocked: `citb-plat` state decomp * decomp: finish `square-platform` * blocked: `orbit-plat` due to overlays + static data * decomp: finish `qbert-plat` * blocked: almost finish `misty-conveyor`, sparticle-callback * blocked: jungle-mirrors * blocked: state decomp in `swamp-blimp` * decomp: finish `swamp-bat` * decomp: finish `swamp-rat` * decomp: finish `swamp-rat-nest` * blocked: state decomp `kermit` * decomp: finish `cavecrystal-light` * decomp: finish `spiderwebs` * blocked: state decomp `dark-crystal` * decomp: finish `baby-spider` * decomp: finish `mother-spider-h` * decomp: finish `mother-spider-proj` * blocked: state decomp in `gnawer` * blocked: state decomp in `driller-lurker` * blocked: `sun-exit-chamber` breaks when adding handle cast * decomp: finish `sunken-water` * blocked: `target-tube` ShortCircuitElement::push_to_stack * decomp: finish `sunken-fish` * blocked: `minecart` decomp crash when adding stack cast * decomp: finish `assistant-village3` * decomp: finish `sage-village3` * blocked: `cave-trap` done but ran into `go` issue * blocked: `spider-egg` state decomp * decomp: finish `target-snowball` * blocked/stuck: `target-ice` decomp issue around cpad * pausing: ice-cube has some weird collide-shape-prim handling * blocked: `snow-ball` state decomp * blocked: `snow-bumper` state decomp * decomp: finish `snow-ram-h` * decomp: finish `yeti` * decomp: finish `assistant-lavatube` * re-enable the float cast log * decomp: updating to new sparticle definitions * decomp: address feedback up to `swamp-rat-nest` * address remaining feedback * all-types: move the `pointer` def * add back temporary `hud-hidden?`
2021-09-28 20:42:00 -04:00
(let
((v1-1
(new 'static 'skeleton-group
:art-group-name "wall-plat"
:bounds
(new 'static 'vector :x 4096.0 :y -8192.0 :w 26624.0)
:version #x6
)
)
)
(set! (-> v1-1 jgeo) 0)
(set! (-> v1-1 janim) -1)
(set! (-> v1-1 mgeo 0) (the-as uint 1))
(set! (-> v1-1 lod-dist 0) 4095996000.0)
(set! *wall-plat-sg* v1-1)
)
(defstate wall-plat-retracted (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('trigger)
(go wall-plat-extending)
)
)
)
:code
(behavior ()
(set! (-> self extended-amount) 0.0)
(TODO-RENAME-30 (-> self root-override) (-> self in-trans))
(transform-post)
(dummy-48 (-> self root-override))
(while #t
(logior! (-> self mask) (process-mask sleep-code))
(suspend)
)
(none)
)
)
(defstate wall-plat-extending (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'touch)
(send-event arg0 'no-look-around 450)
#f
)
)
)
)
:enter
(behavior ()
(sound-play-by-name
(static-sound-name "wall-plat")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(none)
)
:trans
(the-as (function none :behavior wall-plat) rider-trans)
:code
(behavior ()
decomp: Continuing full pass of gameplay code (#839) * decomp: finish `babak` - :code is called in `(code nav-enemy-patrol babak)` * decomp: almost finish `process-taskable` * blocked: mistycannon / pelican * decomp: finish `babak-with-cannon` write a script to fix gsrc * decomp: finish `process-taskable` * decomp: finish `flutflut` and `yakow` * decomp: finish `fishermans-boat` * blocked: state decomp `training-obs` * decomp: finish `muse` * decomp: finish `bonelurker` * blocked: state decomp in `quicksandlurker`| `balloonlurker` * decomp: finish `assistant-village2` * scripts: script to help updating goal_src * starting to update goal_src * tests: update ref tests * src: more src updating * src: waiting on `process-taskable` and `muse` * blocked: `citb-plat` state decomp * decomp: finish `square-platform` * blocked: `orbit-plat` due to overlays + static data * decomp: finish `qbert-plat` * blocked: almost finish `misty-conveyor`, sparticle-callback * blocked: jungle-mirrors * blocked: state decomp in `swamp-blimp` * decomp: finish `swamp-bat` * decomp: finish `swamp-rat` * decomp: finish `swamp-rat-nest` * blocked: state decomp `kermit` * decomp: finish `cavecrystal-light` * decomp: finish `spiderwebs` * blocked: state decomp `dark-crystal` * decomp: finish `baby-spider` * decomp: finish `mother-spider-h` * decomp: finish `mother-spider-proj` * blocked: state decomp in `gnawer` * blocked: state decomp in `driller-lurker` * blocked: `sun-exit-chamber` breaks when adding handle cast * decomp: finish `sunken-water` * blocked: `target-tube` ShortCircuitElement::push_to_stack * decomp: finish `sunken-fish` * blocked: `minecart` decomp crash when adding stack cast * decomp: finish `assistant-village3` * decomp: finish `sage-village3` * blocked: `cave-trap` done but ran into `go` issue * blocked: `spider-egg` state decomp * decomp: finish `target-snowball` * blocked/stuck: `target-ice` decomp issue around cpad * pausing: ice-cube has some weird collide-shape-prim handling * blocked: `snow-ball` state decomp * blocked: `snow-bumper` state decomp * decomp: finish `snow-ram-h` * decomp: finish `yeti` * decomp: finish `assistant-lavatube` * re-enable the float cast log * decomp: updating to new sparticle definitions * decomp: address feedback up to `swamp-rat-nest` * address remaining feedback * all-types: move the `pointer` def * add back temporary `hud-hidden?`
2021-09-28 20:42:00 -04:00
(dummy-49 (-> self root-override))
(set! (-> self state-time) (-> *display* base-frame-counter))
(while #t
(set!
(-> self extended-amount)
(seek
(-> self extended-amount)
1.0
(* 2.5 (-> *display* seconds-per-frame))
)
)
(let ((gp-0 (new 'stack-no-clear 'vector)))
(vector-lerp!
gp-0
(-> self in-trans)
(-> self out-trans)
(-> self extended-amount)
)
(TODO-RENAME-30 (-> self root-override) gp-0)
)
(suspend)
(if (= (-> self extended-amount) 1.0)
(go wall-plat-extended)
)
)
(none)
)
:post
(the-as (function none :behavior wall-plat) rider-post)
)
(defstate wall-plat-extended (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('untrigger)
(go wall-plat-retracting)
)
)
)
:code
(behavior ()
(set! (-> self extended-amount) 1.0)
(TODO-RENAME-30 (-> self root-override) (-> self out-trans))
(transform-post)
(while #t
(logior! (-> self mask) (process-mask sleep-code))
(suspend)
)
(none)
)
)
(defstate wall-plat-retracting (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'touch)
(send-event arg0 'no-look-around 450)
#f
)
)
)
)
:enter
(behavior ()
(sound-play-by-name
(static-sound-name "wall-plat")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(none)
)
:trans
(the-as (function none :behavior wall-plat) rider-trans)
:code
(behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(while #t
(set!
(-> self extended-amount)
(seek
(-> self extended-amount)
0.0
(* 2.5 (-> *display* seconds-per-frame))
)
)
(let ((gp-0 (new 'stack-no-clear 'vector)))
(vector-lerp!
gp-0
(-> self in-trans)
(-> self out-trans)
(-> self extended-amount)
)
(TODO-RENAME-30 (-> self root-override) gp-0)
)
(suspend)
(if (= (-> self extended-amount) 0.0)
(go wall-plat-retracted)
)
)
(none)
)
:post
(the-as (function none :behavior wall-plat) rider-post)
)
(defstate wall-plat-sync-idle (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'touch)
(send-event arg0 'no-look-around 450)
#f
)
)
)
)
:enter
(behavior ()
(logclear! (-> self mask) (process-mask actor-pause))
(none)
)
:exit
(behavior ()
(logior! (-> self mask) (process-mask actor-pause))
(none)
)
:trans
(the-as (function none :behavior wall-plat) rider-trans)
:code
(behavior ()
(let ((gp-0 #f))
(while #t
(let ((f30-0 (get-current-phase-with-mirror (-> self sync))))
(let ((s5-0 (new 'stack-no-clear 'vector)))
(vector-lerp! s5-0 (-> self in-trans) (-> self out-trans) f30-0)
(TODO-RENAME-30 (-> self root-override) s5-0)
)
(cond
((= f30-0 0.0)
(set! gp-0 #f)
(dummy-48 (-> self root-override))
)
((= f30-0 1.0)
(set! gp-0 #f)
decomp: Continuing full pass of gameplay code (#839) * decomp: finish `babak` - :code is called in `(code nav-enemy-patrol babak)` * decomp: almost finish `process-taskable` * blocked: mistycannon / pelican * decomp: finish `babak-with-cannon` write a script to fix gsrc * decomp: finish `process-taskable` * decomp: finish `flutflut` and `yakow` * decomp: finish `fishermans-boat` * blocked: state decomp `training-obs` * decomp: finish `muse` * decomp: finish `bonelurker` * blocked: state decomp in `quicksandlurker`| `balloonlurker` * decomp: finish `assistant-village2` * scripts: script to help updating goal_src * starting to update goal_src * tests: update ref tests * src: more src updating * src: waiting on `process-taskable` and `muse` * blocked: `citb-plat` state decomp * decomp: finish `square-platform` * blocked: `orbit-plat` due to overlays + static data * decomp: finish `qbert-plat` * blocked: almost finish `misty-conveyor`, sparticle-callback * blocked: jungle-mirrors * blocked: state decomp in `swamp-blimp` * decomp: finish `swamp-bat` * decomp: finish `swamp-rat` * decomp: finish `swamp-rat-nest` * blocked: state decomp `kermit` * decomp: finish `cavecrystal-light` * decomp: finish `spiderwebs` * blocked: state decomp `dark-crystal` * decomp: finish `baby-spider` * decomp: finish `mother-spider-h` * decomp: finish `mother-spider-proj` * blocked: state decomp in `gnawer` * blocked: state decomp in `driller-lurker` * blocked: `sun-exit-chamber` breaks when adding handle cast * decomp: finish `sunken-water` * blocked: `target-tube` ShortCircuitElement::push_to_stack * decomp: finish `sunken-fish` * blocked: `minecart` decomp crash when adding stack cast * decomp: finish `assistant-village3` * decomp: finish `sage-village3` * blocked: `cave-trap` done but ran into `go` issue * blocked: `spider-egg` state decomp * decomp: finish `target-snowball` * blocked/stuck: `target-ice` decomp issue around cpad * pausing: ice-cube has some weird collide-shape-prim handling * blocked: `snow-ball` state decomp * blocked: `snow-bumper` state decomp * decomp: finish `snow-ram-h` * decomp: finish `yeti` * decomp: finish `assistant-lavatube` * re-enable the float cast log * decomp: updating to new sparticle definitions * decomp: address feedback up to `swamp-rat-nest` * address remaining feedback * all-types: move the `pointer` def * add back temporary `hud-hidden?`
2021-09-28 20:42:00 -04:00
(dummy-49 (-> self root-override))
)
(else
(when (not gp-0)
(sound-play-by-name
(static-sound-name "wall-plat")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(set! gp-0 #t)
)
decomp: Continuing full pass of gameplay code (#839) * decomp: finish `babak` - :code is called in `(code nav-enemy-patrol babak)` * decomp: almost finish `process-taskable` * blocked: mistycannon / pelican * decomp: finish `babak-with-cannon` write a script to fix gsrc * decomp: finish `process-taskable` * decomp: finish `flutflut` and `yakow` * decomp: finish `fishermans-boat` * blocked: state decomp `training-obs` * decomp: finish `muse` * decomp: finish `bonelurker` * blocked: state decomp in `quicksandlurker`| `balloonlurker` * decomp: finish `assistant-village2` * scripts: script to help updating goal_src * starting to update goal_src * tests: update ref tests * src: more src updating * src: waiting on `process-taskable` and `muse` * blocked: `citb-plat` state decomp * decomp: finish `square-platform` * blocked: `orbit-plat` due to overlays + static data * decomp: finish `qbert-plat` * blocked: almost finish `misty-conveyor`, sparticle-callback * blocked: jungle-mirrors * blocked: state decomp in `swamp-blimp` * decomp: finish `swamp-bat` * decomp: finish `swamp-rat` * decomp: finish `swamp-rat-nest` * blocked: state decomp `kermit` * decomp: finish `cavecrystal-light` * decomp: finish `spiderwebs` * blocked: state decomp `dark-crystal` * decomp: finish `baby-spider` * decomp: finish `mother-spider-h` * decomp: finish `mother-spider-proj` * blocked: state decomp in `gnawer` * blocked: state decomp in `driller-lurker` * blocked: `sun-exit-chamber` breaks when adding handle cast * decomp: finish `sunken-water` * blocked: `target-tube` ShortCircuitElement::push_to_stack * decomp: finish `sunken-fish` * blocked: `minecart` decomp crash when adding stack cast * decomp: finish `assistant-village3` * decomp: finish `sage-village3` * blocked: `cave-trap` done but ran into `go` issue * blocked: `spider-egg` state decomp * decomp: finish `target-snowball` * blocked/stuck: `target-ice` decomp issue around cpad * pausing: ice-cube has some weird collide-shape-prim handling * blocked: `snow-ball` state decomp * blocked: `snow-bumper` state decomp * decomp: finish `snow-ram-h` * decomp: finish `yeti` * decomp: finish `assistant-lavatube` * re-enable the float cast log * decomp: updating to new sparticle definitions * decomp: address feedback up to `swamp-rat-nest` * address remaining feedback * all-types: move the `pointer` def * add back temporary `hud-hidden?`
2021-09-28 20:42:00 -04:00
(dummy-49 (-> self root-override))
)
)
)
(suspend)
)
)
(none)
)
:post
(the-as (function none :behavior wall-plat) rider-post)
)
(defmethod copy-defaults! wall-plat ((obj wall-plat) (arg0 res-lump))
(set! (-> obj extended-amount) 0.0)
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(let
((s4-0
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))
)
)
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-0 reaction) default-collision-reaction)
(set! (-> s4-0 no-reaction) nothing)
(dummy-29 s4-0 1)
(let
((s3-0
(new
'process
'collide-shape-prim-mesh
s4-0
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s3-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s3-0 collide-with) (the-as uint 16))
(set! (-> s3-0 prim-core action) (the-as uint 19))
(set! (-> s3-0 prim-core offense) 4)
(set! (-> s3-0 transform-index) 2)
(set-vector! (-> s3-0 local-sphere) 0.0 -6144.0 -12288.0 19456.0)
)
(dummy-46 s4-0)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(dummy-50 s4-0)
(set! (-> obj root-override) s4-0)
)
(process-drawable-from-entity! obj arg0)
(dummy-14 obj *wall-plat-sg* '())
(logior! (-> obj skel status) 1)
(set!
(-> obj use-sync?)
(load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.2 0.2)
)
(let ((f30-0 (quaternion-y-angle (-> obj root-override quat)))
(s4-1 (new 'stack-no-clear 'vector))
)
(set-vector! s4-1 0.0 0.0 (+ 1638.4 (res-lump-float arg0 'tunemeters)) 1.0)
(vector-rotate-around-y! s4-1 s4-1 f30-0)
(vector+! (-> obj out-trans) (-> obj root-override trans) s4-1)
(set-vector! s4-1 0.0 0.0 20480.0 1.0)
(vector-rotate-around-y! s4-1 s4-1 f30-0)
(vector+! (-> obj in-trans) (-> obj out-trans) s4-1)
)
(ja-channel-push! 1 0)
(let ((s5-1 (-> obj skel root-channel 0)))
(joint-control-channel-group-eval!
s5-1
(the-as art-joint-anim (-> obj draw art-group data 2))
num-func-identity
)
(set! (-> s5-1 frame-num) 0.0)
)
(ja-post)
(dummy-47 (-> obj root-override))
(cond
((-> obj use-sync?)
(logclear! (-> obj mask) (process-mask actor-pause))
(go wall-plat-sync-idle)
)
(else
(go wall-plat-retracted)
)
)
(none)
)