jak-project/goal_src/jak1/levels/beach/bird-lady.gc

170 lines
4.9 KiB
Common Lisp
Raw Normal View History

;;-*-Lisp-*-
2020-09-04 14:44:23 -04:00
(in-package goal)
;; name: bird-lady.gc
;; name in dgo: bird-lady
;; dgos: BEA, L1
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
2022-06-29 22:20:09 -04:00
(import "goal_src/jak1/import/bird-lady-ag.gc")
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
(deftype bird-lady (process-taskable)
()
:heap-base #x110
:method-count-assert 53
:size-assert #x17c
:flag-assert #x350110017c
)
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
(defskelgroup *bird-lady-sg* bird-lady bird-lady-lod0-jg bird-lady-idle-ja
((bird-lady-lod0-mg (meters 999999)))
:bounds (static-spherem 0 1 0 2.5)
:shadow bird-lady-shadow-mg
)
(defmethod process-taskable-method-52 bird-lady ((obj bird-lady))
(let ((v1-1 (-> obj draw shadow-ctrl)))
(when v1-1
(let ((f0-0 (-> obj root-override trans y)))
(let ((a0-2 v1-1))
(set! (-> a0-2 settings bot-plane w) (- (+ -1024.0 f0-0)))
)
0
(let ((a0-4 v1-1))
(set! (-> a0-4 settings top-plane w) (- (+ 4096.0 f0-0)))
)
)
0
(logclear! (-> v1-1 settings flags) (shadow-flags shdf03))
)
)
(none)
)
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
(defmethod draw-npc-shadow bird-lady ((obj bird-lady))
(-> 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 play-anim! bird-lady ((obj bird-lady) (arg0 symbol))
(case (current-status (-> obj tasks))
(((task-status need-hint) (task-status need-introduction))
(if arg0
(close-status! (-> obj tasks) (task-status need-introduction))
)
(new 'static 'spool-anim
:name "bird-lady-introduction"
:index 4
:parts 11
:command-list '((0 want-levels village1 beach)
(49 joint "cameraB")
(101 display-level beach special)
(101 kill "yakow-8")
(101 kill "yakow-9")
(101 kill "yakow-10")
(101 kill "yakow-11")
(101 kill "yakow-12")
(102 joint "camera")
(125 joint "cameraB")
(251 joint "camera")
(326 joint "cameraB")
(649 display-level beach movie)
(649 want-force-vis beach #t)
(650 alive "flutflutegg-1")
(651 joint "camera")
(1041 joint "cameraB")
(1046 dead "flutflutegg-1")
(1046 display-level beach display)
(1046 want-force-vis beach #f)
)
)
)
(((task-status need-reminder))
(set! (-> obj skippable) #t)
(cond
((zero? (get-reminder (-> obj tasks) 0))
(if arg0
(save-reminder (-> obj tasks) 1 0)
)
(new 'static 'spool-anim :name "bird-lady-reminder-1" :index 5 :parts 4 :command-list '())
)
(else
(if arg0
(save-reminder (-> obj tasks) 0 0)
)
(new 'static 'spool-anim :name "bird-lady-reminder-2" :index 6 :parts 5 :command-list '())
)
)
)
(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 3)
)
)
)
(defmethod get-art-elem bird-lady ((obj bird-lady))
(-> obj draw art-group data 3)
)
(defmethod process-taskable-method-43 bird-lady ((obj bird-lady))
(when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj)
(let ((f0-2 (rand-float-gen)))
(cond
((< 0.66 f0-2)
(play-ambient (-> obj ambient) "BIR-LO02" #f (-> obj root-override trans))
)
((< 0.33 f0-2)
(play-ambient (-> obj ambient) "BIR-LO03" #f (-> obj root-override trans))
)
(else
(play-ambient (-> obj ambient) "BIR-am08" #f (-> obj root-override trans))
)
)
)
)
)
(defmethod target-above-threshold? bird-lady ((obj bird-lady))
(the-as symbol (and *target* (< (-> (target-pos 0) z) -81920.0)))
)
(defmethod init-from-entity! bird-lady ((obj bird-lady) (arg0 entity-actor))
(process-taskable-method-40 obj arg0 *bird-lady-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5)
(set! (-> obj tasks) (get-task-control (game-task beach-flutflut)))
(set! (-> obj sound-flava) (music-flava birdlady))
(set! (-> obj draw light-index) (the-as uint 4))
(if (closed? (-> obj tasks) (game-task beach-flutflut) (task-status need-reminder))
(cleanup-for-death obj)
(go (method-of-object obj idle))
)
(none)
)