jak-project/goal_src/jak2/levels/mountain/rhino-wall.gc

314 lines
14 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: rhino-wall.gc
;; name in dgo: rhino-wall
;; dgos: MTN
;; DECOMP BEGINS
(deftype rhino-wall (process-focusable)
((anim spool-anim :offset-assert 204)
(art-name string :offset-assert 208)
(id int8 :offset-assert 212)
)
:heap-base #x60
:method-count-assert 31
:size-assert #xd5
:flag-assert #x1f006000d5
(:methods
(unbroken () _type_ :state 27)
(hit () _type_ :state 28)
(broken () _type_ :state 29)
(rhino-wall-method-30 (_type_) none 30)
)
)
(defskelgroup skel-rhino-wall-1 rhino-wall rhino-wall-1-lod0-jg rhino-wall-1-idle-ja
((rhino-wall-1-lod0-mg (meters 999999)))
:bounds (static-spherem 0.3 9 -3 11)
)
(defskelgroup skel-rhino-wall-2 rhino-wall rhino-wall-2-lod0-jg rhino-wall-2-idle-ja
((rhino-wall-2-lod0-mg (meters 999999)))
:bounds (static-spherem 0.3 13.5 0 14.5)
)
;; WARN: Return type mismatch vector vs none.
(defmethod rhino-wall-method-30 rhino-wall ((obj rhino-wall))
(let ((v1-1 (-> obj root root-prim)))
(countdown (a1-0 (-> v1-1 specific 0))
(let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a1-0)))
(cond
((zero? a1-0)
(set! (-> a2-1 prim-core collide-as) (collide-spec))
0
)
(else
(set! (-> a2-1 prim-core collide-as) (collide-spec obstacle))
)
)
)
)
(case (-> obj id)
((1)
(set! (-> obj draw origin-joint-index) (the-as uint 2))
(set-vector! (-> obj draw bounds) 0.0 0.0 81920.0 131072.0)
(set! (-> v1-1 transform-index) 2)
(set-vector! (-> v1-1 local-sphere) 0.0 0.0 81920.0 122880.0)
)
((2)
(set! (-> obj draw origin-joint-index) (the-as uint 2))
(set-vector! (-> obj draw bounds) 0.0 0.0 81920.0 131072.0)
(set! (-> v1-1 transform-index) 2)
(set-vector! (-> v1-1 local-sphere) 0.0 0.0 81920.0 122880.0)
)
)
)
(none)
)
(defstate unbroken (rhino-wall)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
(('trigger)
(go-virtual hit)
)
)
)
:code (behavior ()
(add-process *gui-control* self (gui-channel art-load) (gui-action queue) (-> self anim name) -99.0 0)
(transform-post)
(suspend)
(transform-post)
(sleep-code)
(none)
)
)
(defstate hit (rhino-wall)
:virtual #t
:code (behavior ()
(process-entity-status! self (entity-perm-status subtask-complete) #t)
(rhino-wall-method-30 self)
(set! (-> self draw bounds w) 573440.0)
(let* ((gp-0 (-> self draw art-group))
(s5-0 (method-of-object gp-0 get-art-by-name-method))
)
(format (clear *temp-string*) "~S-end" (-> self art-name))
(let ((a2-3 (s5-0 gp-0 *temp-string* art-joint-anim)))
;; added cast
(ja-play-spooled-anim (-> self anim) (ja-group) (the-as art-joint-anim a2-3) (the-as (function process-drawable symbol) false-func))
)
)
(go-virtual broken)
(none)
)
:post (the-as (function none :behavior rhino-wall) transform-post)
)
(defstate broken (rhino-wall)
:virtual #t
:code (behavior ()
(rhino-wall-method-30 self)
(let* ((gp-0 (-> self draw art-group))
(s5-0 (method-of-object gp-0 get-art-by-name-method))
)
(format (clear *temp-string*) "~S-end" (-> self art-name))
(let ((gp-1 (s5-0 gp-0 *temp-string* art-joint-anim)))
(ja-channel-set! 1)
;; added cast
(set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1))
)
)
(logior! (-> self skel status) (joint-control-status sync-math))
(transform-post)
(logclear! (-> self skel status) (joint-control-status sync-math))
(suspend)
(transform-post)
(sleep-code)
(none)
)
)
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! rhino-wall ((obj rhino-wall) (arg0 entity-actor))
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
This commonly includes things such as:
- stack size
- collision information
- loading the skeleton group / bones
- sounds"
(stack-size-set! (-> obj main-thread) 512)
(logior! (-> obj mask) (process-mask collectable))
(let ((s3-0 (res-lump-struct (-> obj entity) 'art-name structure))
(s4-0 (art-group-get-by-name *level* "skel-rhino-wall-1" (the-as (pointer uint32) #f)))
)
(set! (-> obj art-name) (the-as string s3-0))
(cond
((string= (the-as string s3-0) "rhino-wall-1")
(set! (-> obj id) 1)
(let ((s4-1 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player))))
(set! (-> s4-1 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-1 reaction) cshape-reaction-default)
(set! (-> s4-1 no-reaction)
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
)
(set! (-> s4-1 penetrated-by) (penetrate))
(let ((s3-1 (new 'process 'collide-shape-prim-group s4-1 (the-as uint 9) 0)))
(set! (-> s4-1 total-prims) (the-as uint 10))
(set! (-> s3-1 prim-core collide-as) (collide-spec obstacle))
(set! (-> s3-1 prim-core action) (collide-action solid))
(set! (-> s3-1 transform-index) 3)
(set-vector! (-> s3-1 local-sphere) 14336.0 -8192.0 0.0 40960.0)
(set! (-> s4-1 root-prim) s3-1)
)
(let ((v1-19 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 1) (the-as uint 0))))
(set! (-> v1-19 prim-core collide-as) (collide-spec obstacle))
(set! (-> v1-19 prim-core action) (collide-action solid))
(set! (-> v1-19 transform-index) 3)
(set-vector! (-> v1-19 local-sphere) 14336.0 -8192.0 0.0 40960.0)
)
(let ((v1-21 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 8) (the-as uint 0))))
(set! (-> v1-21 prim-core action) (collide-action solid))
(set! (-> v1-21 transform-index) 43)
(set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 32768.0)
)
(let ((v1-23 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 2) (the-as uint 0))))
(set! (-> v1-23 prim-core action) (collide-action solid))
(set! (-> v1-23 transform-index) 7)
(set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-25 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 5) (the-as uint 0))))
(set! (-> v1-25 prim-core action) (collide-action solid))
(set! (-> v1-25 transform-index) 12)
(set-vector! (-> v1-25 local-sphere) 8192.0 0.0 0.0 12288.0)
)
(let ((v1-27 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 6) (the-as uint 0))))
(set! (-> v1-27 prim-core action) (collide-action solid))
(set! (-> v1-27 transform-index) 16)
(set-vector! (-> v1-27 local-sphere) 0.0 0.0 0.0 10240.0)
)
(let ((v1-29 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 0) (the-as uint 0))))
(set! (-> v1-29 prim-core action) (collide-action solid))
(set! (-> v1-29 transform-index) 3)
(set-vector! (-> v1-29 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-31 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 4) (the-as uint 0))))
(set! (-> v1-31 prim-core action) (collide-action solid))
(set! (-> v1-31 transform-index) 9)
(set-vector! (-> v1-31 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-33 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 7) (the-as uint 0))))
(set! (-> v1-33 prim-core action) (collide-action solid))
(set! (-> v1-33 transform-index) 28)
(set-vector! (-> v1-33 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-35 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 3) (the-as uint 0))))
(set! (-> v1-35 prim-core action) (collide-action solid))
(set! (-> v1-35 transform-index) 8)
(set-vector! (-> v1-35 local-sphere) 0.0 0.0 0.0 16384.0)
)
(set! (-> s4-1 nav-radius) (* 0.75 (-> s4-1 root-prim local-sphere w)))
(let ((v1-38 (-> s4-1 root-prim)))
(set! (-> s4-1 backup-collide-as) (-> v1-38 prim-core collide-as))
(set! (-> s4-1 backup-collide-with) (-> v1-38 prim-core collide-with))
)
(set! (-> obj root) s4-1)
)
(set! s4-0 (art-group-get-by-name *level* "skel-rhino-wall-1" (the-as (pointer uint32) #f)))
(set! (-> obj anim)
(new 'static 'spool-anim :name "rhino-wall-1" :anim-name "1-break" :parts 2 :command-list '())
)
)
((string= (the-as string s3-0) "rhino-wall-2")
(set! (-> obj id) 2)
(let ((s4-2 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player))))
(set! (-> s4-2 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-2 reaction) cshape-reaction-default)
(set! (-> s4-2 no-reaction)
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
)
(set! (-> s4-2 penetrated-by) (penetrate))
(let ((s3-2 (new 'process 'collide-shape-prim-group s4-2 (the-as uint 9) 0)))
(set! (-> s4-2 total-prims) (the-as uint 10))
(set! (-> s3-2 prim-core collide-as) (collide-spec obstacle))
(set! (-> s3-2 prim-core action) (collide-action solid))
(set! (-> s3-2 transform-index) 3)
(set-vector! (-> s3-2 local-sphere) -8192.0 -4096.0 0.0 40960.0)
(set! (-> s4-2 root-prim) s3-2)
)
(let ((v1-55 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 0) (the-as uint 0))))
(set! (-> v1-55 prim-core collide-as) (collide-spec obstacle))
(set! (-> v1-55 prim-core action) (collide-action solid))
(set! (-> v1-55 transform-index) 3)
(set-vector! (-> v1-55 local-sphere) -8192.0 -4096.0 0.0 40960.0)
)
(let ((v1-57 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 1) (the-as uint 0))))
(set! (-> v1-57 prim-core action) (collide-action solid))
(set! (-> v1-57 transform-index) 4)
(set-vector! (-> v1-57 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-59 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 2) (the-as uint 0))))
(set! (-> v1-59 prim-core action) (collide-action solid))
(set! (-> v1-59 transform-index) 7)
(set-vector! (-> v1-59 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-61 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 3) (the-as uint 0))))
(set! (-> v1-61 prim-core action) (collide-action solid))
(set! (-> v1-61 transform-index) 15)
(set-vector! (-> v1-61 local-sphere) 0.0 0.0 0.0 12288.0)
)
(let ((v1-63 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 4) (the-as uint 0))))
(set! (-> v1-63 prim-core action) (collide-action solid))
(set! (-> v1-63 transform-index) 16)
(set-vector! (-> v1-63 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-65 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 5) (the-as uint 0))))
(set! (-> v1-65 prim-core action) (collide-action solid))
(set! (-> v1-65 transform-index) 26)
(set-vector! (-> v1-65 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-67 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 6) (the-as uint 0))))
(set! (-> v1-67 prim-core action) (collide-action solid))
(set! (-> v1-67 transform-index) 27)
(set-vector! (-> v1-67 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-69 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 7) (the-as uint 0))))
(set! (-> v1-69 prim-core action) (collide-action solid))
(set! (-> v1-69 transform-index) 28)
(set-vector! (-> v1-69 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-71 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 9) (the-as uint 0))))
(set! (-> v1-71 prim-core action) (collide-action solid))
(set! (-> v1-71 transform-index) 58)
(set-vector! (-> v1-71 local-sphere) 0.0 12288.0 0.0 32768.0)
)
(set! (-> s4-2 nav-radius) (* 0.75 (-> s4-2 root-prim local-sphere w)))
(let ((v1-74 (-> s4-2 root-prim)))
(set! (-> s4-2 backup-collide-as) (-> v1-74 prim-core collide-as))
(set! (-> s4-2 backup-collide-with) (-> v1-74 prim-core collide-with))
)
(set! (-> obj root) s4-2)
)
(set! s4-0 (art-group-get-by-name *level* "skel-rhino-wall-2" (the-as (pointer uint32) #f)))
(set! (-> obj anim)
(new 'static 'spool-anim :name "rhino-wall-2" :anim-name "2-break" :parts 1 :command-list '())
)
)
(else
(go process-drawable-art-error (the-as string s3-0))
)
)
(process-drawable-from-entity! obj arg0)
(initialize-skeleton obj (the-as skeleton-group s4-0) (the-as pair 0))
)
(if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)))
(go (method-of-object obj broken))
(go (method-of-object obj unbroken))
)
(none)
)