Files
jak-project/test/decompiler/reference/levels/village2/warrior_REF.gc
T
Tyler Wilding dd959d0d0d 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

346 lines
8.8 KiB
Common Lisp
Vendored

;;-*-Lisp-*-
(in-package goal)
;; definition of type warrior
(deftype warrior (process-taskable)
()
:heap-base #x110
:method-count-assert 53
:size-assert #x17c
:flag-assert #x350110017c
)
;; definition for method 3 of type warrior
(defmethod inspect warrior ((obj warrior))
(let ((t9-0 (method-of-type process-taskable inspect)))
(t9-0 obj)
)
obj
)
;; failed to figure out what this is:
(let
((v1-1
(new 'static 'skeleton-group
:art-group-name "warrior"
:bounds (new 'static 'vector :w 16384.0)
:max-lod 2
:version #x6
:shadow 4
)
)
)
(set! (-> v1-1 jgeo) 0)
(set! (-> v1-1 janim) 5)
(set! (-> v1-1 mgeo 0) (the-as uint 1))
(set! (-> v1-1 lod-dist 0) 81920.0)
(set! (-> v1-1 mgeo 1) (the-as uint 2))
(set! (-> v1-1 lod-dist 1) 163840.0)
(set! (-> v1-1 mgeo 2) (the-as uint 3))
(set! (-> v1-1 lod-dist 2) 4095996000.0)
(set! *warrior-sg* v1-1)
)
;; definition for method 52 of type warrior
;; INFO: Return type mismatch int vs none.
(defmethod dummy-52 warrior ((obj warrior))
(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) (- (+ -4096.0 f0-0)))
)
0
(set! (-> v1-1 settings top-plane w) (- (+ 3072.0 f0-0)))
)
0
)
)
(none)
)
;; definition for method 48 of type warrior
(defmethod draw-npc-shadow warrior ((obj warrior))
(-> obj draw shadow-ctrl)
(cond
((and
(-> obj draw shadow)
(zero? (-> obj draw cur-lod))
(logtest? (-> obj draw status) 8)
)
(let ((v1-9 (-> obj draw shadow-ctrl)))
(set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags)))
)
0
(dummy-14 (-> obj draw shadow-ctrl))
)
(else
(let ((v1-14 (-> obj draw shadow-ctrl)))
(logior! (-> v1-14 settings flags) 32)
)
0
)
)
(none)
)
;; definition for method 32 of type warrior
(defmethod play-anim! warrior ((obj warrior) (arg0 symbol))
(with-pp
(set! (-> obj talk-message) (the-as uint 260))
(case (current-status (-> obj tasks))
((2 3)
(if arg0
(close-status! (-> obj tasks) (task-status need-introduction))
)
(new 'static 'spool-anim
:name "warrior-introduction"
:index 6
:parts 29
:command-list
'(
((the binteger 125)
joint
"cameraB"
)
((the binteger 260)
joint
"camera"
)
((the binteger 574)
joint
"cameraB"
)
((the binteger 918)
joint
"camera"
)
((the binteger 1174)
joint
"cameraB"
)
((the binteger 1174)
shadow
self
#f
)
((the binteger 1301)
joint
"camera"
)
((the binteger 1301)
shadow
self
#t
)
((the binteger 2025)
joint
"cameraB"
)
((the binteger 2322)
joint
"camera"
)
((the binteger 2560) joint "cameraB")
)
)
)
((5)
(set! (-> obj skippable) #t)
(new 'static 'spool-anim
:name "warrior-reminder-1"
:index 7
:parts 3
:command-list '()
)
)
((6)
(cond
(arg0
(set!
(-> obj cell-for-task)
(the-as game-task (current-task (-> obj tasks)))
)
(close-current! (-> obj tasks))
(let ((a1-4 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-4 from) pp)
(set! (-> a1-4 num-params) 2)
(set! (-> a1-4 message) 'get-pickup)
(set! (-> a1-4 param 0) (the-as uint 5))
(set!
(-> a1-4 param 1)
(the-as uint (- (-> *GAME-bank* money-task-inc)))
)
(send-event-function *target* a1-4)
)
(let ((s5-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> s5-1 from) pp)
(set! (-> s5-1 num-params) 1)
(set! (-> s5-1 message) 'clone)
(set! (-> s5-1 param 0) (the-as uint (process->handle obj)))
(send-event-function
(-> (entity-by-type allpontoons) extra process)
s5-1
)
)
(dotimes (s5-2 (entity-actor-count (-> obj entity) 'alt-actor))
(entity-birth-no-kill
(entity-actor-lookup (-> obj entity) 'alt-actor s5-2)
)
(let ((s4-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> s4-2 from) pp)
(set! (-> s4-2 num-params) 0)
(set! (-> s4-2 message) 'die)
(let ((s3-0 send-event-function)
(v1-25 (entity-actor-lookup (-> obj entity) 'alt-actor s5-2))
)
(s3-0 (if v1-25
(-> v1-25 extra process)
)
s4-2
)
)
)
)
)
(else
(set! (-> obj will-talk) #t)
(set! (-> obj talk-message) (the-as uint 282))
)
)
(new 'static 'spool-anim
:name "warrior-resolution"
:index 8
:parts 6
:command-list
'(
((the binteger 508)
blackout
(the binteger 10)
)
((the binteger 511) blackout 0)
)
)
)
(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 5)
)
)
)
)
;; definition for method 31 of type warrior
(defmethod get-art-elem warrior ((obj warrior))
(-> obj draw art-group data 5)
)
;; failed to figure out what this is:
(defstate play-anim (warrior)
:virtual #t
:exit
(behavior ()
(let ((gp-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> gp-0 from) self)
(set! (-> gp-0 num-params) 0)
(set! (-> gp-0 message) 'end-mode)
(send-event-function (-> (entity-by-type allpontoons) extra process) gp-0)
)
((-> (method-of-type process-taskable play-anim) exit))
(none)
)
)
;; definition for method 43 of type warrior
(defmethod TODO-RENAME-43 warrior ((obj warrior))
(when
(TODO-RENAME-10
(-> obj ambient)
(new 'stack-no-clear 'vector)
600
61440.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) "WAR-LO1A" #f (-> obj root-override trans))
)
((< 0.33 f0-2)
(dummy-11 (-> obj ambient) "WAR-LO1B" #f (-> obj root-override trans))
)
(else
(dummy-11 (-> obj ambient) "WAR-LO1C" #f (-> obj root-override trans))
)
)
)
)
)
;; definition for method 41 of type warrior
;; INFO: Return type mismatch int vs none.
(defmethod initialize-collision warrior ((obj warrior) (arg0 int) (arg1 vector))
(let
((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player))))
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
(set! (-> s4-0 prim-core collide-as) (the-as uint 256))
(set! (-> s4-0 collide-with) (the-as uint 16))
(set! (-> s4-0 prim-core action) (the-as uint 1))
(set! (-> s4-0 prim-core offense) 4)
(set-vector! (-> s4-0 local-sphere) -3072.0 8192.0 0.0 11264.0)
(dummy-46 s5-0)
(let ((s3-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> s3-0 prim-core collide-as) (the-as uint 256))
(set! (-> s3-0 collide-with) (the-as uint 16))
(set! (-> s3-0 prim-core action) (the-as uint 1))
(set! (-> s3-0 prim-core offense) 4)
(set-vector! (-> s3-0 local-sphere) -2048.0 9216.0 0.0 8192.0)
)
(dummy-28 s4-0)
(let ((s3-1 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> s3-1 prim-core collide-as) (the-as uint 256))
(set! (-> s3-1 collide-with) (the-as uint 16))
(set! (-> s3-1 prim-core action) (the-as uint 1))
(set! (-> s3-1 prim-core offense) 4)
(set-vector! (-> s3-1 local-sphere) 0.0 2048.0 0.0 4096.0)
)
(dummy-28 s4-0)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(dummy-50 s5-0)
(set! (-> obj root-override) s5-0)
)
0
(none)
)
;; definition for method 11 of type warrior
(defmethod copy-defaults! warrior ((obj warrior) (arg0 res-lump))
(dummy-40
obj
arg0
*warrior-sg*
3
33
(new 'static 'vector :y -4096.0 :w 10240.0)
5
)
(set! (-> obj tasks) (get-task-control (game-task village2-warrior-money)))
(set! (-> obj sound-flava) (the-as uint 15))
(set! (-> obj draw light-index) (the-as uint 3))
(dummy-42 obj)
(none)
)