jak-project/goal_src/levels/village2/warrior.gc
ManDude caac740aff
[decomp] fisher and FIN.DGO (finalboss) level (#899)
* decomp `fisher`, `robotboss`, `light-eco`, `green-eco-lurker`, `sage-finalboss`, `robotboss-weapon`, `robotboss-misc`

* fixes

* add files

* add `:states` list to `deftype` and fix files

* test state forward decl's on a few more types

* also the refs

* add light-eco

* whatever
2021-10-16 14:06:33 -04:00

334 lines
8.3 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: warrior.gc
;; name in dgo: warrior
;; dgos: L1, VI2
(define-extern *warrior-sg* skeleton-group)
;; DECOMP BEGINS
(deftype warrior (process-taskable)
()
:heap-base #x110
:method-count-assert 53
:size-assert #x17c
:flag-assert #x350110017c
)
(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)
)
(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)
)
(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)
)
(defmethod play-anim! warrior ((obj warrior) (arg0 symbol))
(with-pp
(set! (-> obj talk-message) (the-as uint 260))
(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 "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")
)
)
)
(((task-status need-reminder))
(set! (-> obj skippable) #t)
(new 'static 'spool-anim
:name "warrior-reminder-1"
:index 7
:parts 3
:command-list '()
)
)
(((task-status need-reward-speech))
(cond
(arg0
(set! (-> obj cell-for-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 (current-status (-> obj tasks)))
)
)
(-> obj draw art-group data 5)
)
)
)
)
(defmethod get-art-elem warrior ((obj warrior))
(-> obj draw art-group data 5)
)
(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)
)
)
(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)
(play-ambient (-> obj ambient) "WAR-LO1A" #f (-> obj root-override trans))
)
((< 0.33 f0-2)
(play-ambient (-> obj ambient) "WAR-LO1B" #f (-> obj root-override trans))
)
(else
(play-ambient (-> obj ambient) "WAR-LO1C" #f (-> obj root-override trans))
)
)
)
)
)
(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)
)
(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)
)