mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
f4085a4362
Cleans up every `dummy-*` and `TODO-RENAME-*` method up with either proper names or by renaming them to `[type-name]-method-[method-id]` similar to Jak 2's `all-types`. Also fixes the bad format string in `collide-cache` and adds the event handler hack to Jak 1. The game boots and runs fine, but I might have missed a PAL patch or other manual patches here and there, please double-check if possible.
170 lines
4.9 KiB
Common Lisp
170 lines
4.9 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: bird-lady.gc
|
|
;; name in dgo: bird-lady
|
|
;; dgos: BEA, L1
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(import "goal_src/jak1/import/bird-lady-ag.gc")
|
|
|
|
(deftype bird-lady (process-taskable)
|
|
()
|
|
:heap-base #x110
|
|
:method-count-assert 53
|
|
:size-assert #x17c
|
|
:flag-assert #x350110017c
|
|
)
|
|
|
|
|
|
(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)
|
|
)
|
|
|
|
(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)
|
|
)
|