jak-project/goal_src/levels/beach/bird-lady.gc
Tyler Wilding 253d7996e8
decomp: almost all of the NPCs! (#748)
* all-types: add all missing `:heap-base`s

* decomp: error encountered when compiling `mayor`

`IR_StoreConstOffset::do_codegen can't handle this` for method `play-anim!`

* decomp: finalize `mayor`

* decomp: finish `bird-lady`

* decomp: finish `bird-lady-beach`

* decomp: finish `sculptor`

* decomp: finish `geologist`

* decomp: finish `oracle`

* decomp: finish `farmer` | `explorer` | almost `assistant`

blocked on sparticle-launch-group

* decomp: finish `sage`

* decomp: finish `gambler`

* decomp: finish `warrior`

* decomp: mostly finish `miners`, blocked by sp-launch-group

* fix issue in `sage`

* fix all the reference tests to use the new state stuff

* fix all of goal_src

* address feedback

* re-gen with `until` fixes
2021-08-18 21:33:31 -04:00

289 lines
6.1 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: bird-lady.gc
;; name in dgo: bird-lady
;; dgos: BEA, L1
(define-extern *bird-lady-sg* skeleton-group)
;; definition of type bird-lady
(deftype bird-lady (process-taskable)
()
:heap-base #x110
:method-count-assert 53
:size-assert #x17c
:flag-assert #x350110017c
)
;; failed to figure out what this is:
(let
((v1-1
(new 'static 'skeleton-group
:art-group-name "bird-lady"
:bounds
(new 'static 'vector :y 4096.0 :w 10240.0)
:version #x6
:shadow 2
)
)
)
(set! (-> v1-1 jgeo) 0)
(set! (-> v1-1 janim) 3)
(set! (-> v1-1 mgeo 0) (the-as uint 1))
(set! (-> v1-1 lod-dist 0) 4095996000.0)
(set! *bird-lady-sg* v1-1)
)
;; definition for method 52 of type bird-lady
;; INFO: Return type mismatch int vs none.
(defmethod dummy-52 bird-lady ((obj bird-lady))
(let ((v1-1 (-> obj draw shadow-ctrl)))
(when v1-1
(let ((f0-0 (-> obj root 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
(set! (-> v1-1 settings flags) (logand -9 (-> v1-1 settings flags)))
)
)
(none)
)
;; definition for method 48 of type bird-lady
(defmethod draw-shadow bird-lady ((obj bird-lady))
(-> obj draw shadow-ctrl)
(cond
((and
(-> obj draw shadow)
(zero? (-> obj draw cur-lod))
(nonzero? (logand (-> obj draw status) 8))
)
(let ((v1-9 (-> obj draw shadow-ctrl)))
(set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags)))
)
0
((method-of-object (-> obj draw shadow-ctrl) dummy-14))
)
(else
(let ((v1-14 (-> obj draw shadow-ctrl)))
(logior! (-> v1-14 settings flags) 32)
)
0
)
)
(none)
)
;; definition for method 32 of type bird-lady
(defmethod play-anim! bird-lady ((obj bird-lady) (arg0 symbol))
(case (current-status (-> obj tasks))
((2 3)
(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
)
((the binteger 49)
joint
"cameraB"
)
((the binteger 101)
display-level
beach
special
)
((the binteger 101)
kill
"yakow-8"
)
((the binteger 101)
kill
"yakow-9"
)
((the binteger 101)
kill
"yakow-10"
)
((the binteger 101)
kill
"yakow-11"
)
((the binteger 101)
kill
"yakow-12"
)
((the binteger 102)
joint
"camera"
)
((the binteger 125)
joint
"cameraB"
)
((the binteger 251)
joint
"camera"
)
((the binteger 326)
joint
"cameraB"
)
((the binteger 649)
display-level
beach
movie
)
((the binteger 649)
want-force-vis
beach
#t
)
((the binteger 650)
alive
"flutflutegg-1"
)
((the binteger 651)
joint
"camera"
)
((the binteger 1041)
joint
"cameraB"
)
((the binteger 1046)
dead
"flutflutegg-1"
)
((the binteger 1046)
display-level
beach
display
)
((the binteger 1046) want-force-vis beach #f)
)
)
)
((5)
(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 (the-as task-status (current-status (-> obj tasks))))
)
)
(-> obj draw art-group data 3)
)
)
)
;; definition for method 31 of type bird-lady
(defmethod get-art-elem bird-lady ((obj bird-lady))
(-> obj draw art-group data 3)
)
;; definition for method 43 of type bird-lady
(defmethod TODO-RENAME-43 bird-lady ((obj bird-lady))
(when
(TODO-RENAME-10
(-> obj ambient)
(new 'stack-no-clear 'vector)
9000
122880.0
obj
)
(let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-4 (the-as number (logior #x3f800000 v1-3)))
(f0-2 (+ -1.0 (the-as float v1-4)))
)
(cond
((< 0.66 f0-2)
(dummy-11 (-> obj ambient) "BIR-LO02" #f (-> obj root trans))
)
((< 0.33 f0-2)
(dummy-11 (-> obj ambient) "BIR-LO03" #f (-> obj root trans))
)
(else
(dummy-11 (-> obj ambient) "BIR-am08" #f (-> obj root trans))
)
)
)
)
(none)
)
;; definition for method 47 of type bird-lady
;; INFO: Return type mismatch basic vs symbol.
(defmethod target-above-threshold? bird-lady ((obj bird-lady))
(the-as symbol (and *target* (< (-> (target-pos 0) z) -81920.0)))
)
;; definition for method 11 of type bird-lady
(defmethod copy-defaults! bird-lady ((obj bird-lady) (arg0 res-lump))
(dummy-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) (the-as uint 7))
(set! (-> obj draw light-index) (the-as uint 4))
(if
(closed?
(-> obj tasks)
(game-task beach-flutflut)
(task-status need-reminder)
)
(dummy-18 obj)
(go (method-of-object obj idle))
)
(none)
)