mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
149 lines
5.2 KiB
Common Lisp
149 lines
5.2 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: stadium-race-obs.gc
|
|
;; name in dgo: stadium-race-obs
|
|
;; dgos: STD, STC, STB
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(deftype stdmb-race-hatch (process-drawable)
|
|
((tt float :offset-assert 200)
|
|
(tt-target float :offset-assert 204)
|
|
)
|
|
:heap-base #x50
|
|
:method-count-assert 23
|
|
:size-assert #xd0
|
|
:flag-assert #x17005000d0
|
|
(:methods
|
|
(idle () _type_ :state 20)
|
|
(stdmb-race-hatch-method-21 (_type_) none 21)
|
|
(stdmb-race-hatch-method-22 (_type_) none 22)
|
|
)
|
|
)
|
|
|
|
|
|
(defskelgroup skel-stdmb-race-hatch stdmb-race-hatch stdmb-race-hatch-lod0-jg -1
|
|
((stdmb-race-hatch-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 12.5)
|
|
)
|
|
|
|
(defstate idle (stdmb-race-hatch)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
|
|
(the-as object (case event-type
|
|
(('open)
|
|
(set! (-> self tt-target) 1.0)
|
|
)
|
|
(('close)
|
|
(set! (-> self tt-target) 0.0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:code (the-as (function none :behavior stdmb-race-hatch) sleep-code)
|
|
:post (behavior ()
|
|
(cond
|
|
((!= (-> self tt) (-> self tt-target))
|
|
(seek! (-> self tt) (-> self tt-target) (-> self clock seconds-per-frame))
|
|
(ja :num-func num-func-identity :frame-num (ja-aframe (-> self tt) 0))
|
|
(transform-post)
|
|
)
|
|
(else
|
|
(ja-post)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(defmethod stdmb-race-hatch-method-21 stdmb-race-hatch ((obj stdmb-race-hatch))
|
|
(let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player))))
|
|
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
|
|
(set! (-> s5-0 reaction) cshape-reaction-default)
|
|
(set! (-> s5-0 no-reaction)
|
|
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
|
|
)
|
|
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
|
|
(set! (-> s5-0 total-prims) (the-as uint 3))
|
|
(set! (-> s4-0 prim-core collide-as) (collide-spec camera-blocker pusher))
|
|
(set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list))
|
|
(set! (-> s4-0 prim-core action) (collide-action solid rideable))
|
|
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 51200.0)
|
|
(set! (-> s5-0 root-prim) s4-0)
|
|
)
|
|
(pusher-init s5-0)
|
|
(let ((v1-14 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
|
|
(set! (-> v1-14 prim-core collide-as) (collide-spec camera-blocker pusher))
|
|
(set! (-> v1-14 prim-core collide-with) (collide-spec jak bot player-list))
|
|
(set! (-> v1-14 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-14 transform-index) 4)
|
|
(set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 51200.0)
|
|
)
|
|
(let ((v1-16 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0))))
|
|
(set! (-> v1-16 prim-core collide-as) (collide-spec camera-blocker pusher))
|
|
(set! (-> v1-16 prim-core collide-with) (collide-spec jak bot player-list))
|
|
(set! (-> v1-16 prim-core action) (collide-action solid rideable))
|
|
(set! (-> v1-16 transform-index) 5)
|
|
(set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 51200.0)
|
|
)
|
|
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
|
|
(let ((v1-19 (-> s5-0 root-prim)))
|
|
(set! (-> s5-0 backup-collide-as) (-> v1-19 prim-core collide-as))
|
|
(set! (-> s5-0 backup-collide-with) (-> v1-19 prim-core collide-with))
|
|
)
|
|
(set! (-> obj root) s5-0)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defmethod stdmb-race-hatch-method-22 stdmb-race-hatch ((obj stdmb-race-hatch))
|
|
(initialize-skeleton
|
|
obj
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-stdmb-race-hatch" (the-as (pointer uint32) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(set! (-> obj draw shadow-mask) (the-as uint 30))
|
|
(set! (-> obj draw shadow-values) (the-as uint #x22220))
|
|
(set! (-> obj tt) 0.0)
|
|
(set! (-> obj tt-target) 0.0)
|
|
(ja-channel-push! 1 0)
|
|
(let ((v1-7 (-> obj skel root-channel 0)))
|
|
(set! (-> v1-7 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3)))
|
|
)
|
|
(transform-post)
|
|
(go (method-of-object obj idle))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defmethod init-from-entity! stdmb-race-hatch ((obj stdmb-race-hatch) (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"
|
|
(stdmb-race-hatch-method-21 obj)
|
|
(process-drawable-from-entity! obj arg0)
|
|
(stdmb-race-hatch-method-22 obj)
|
|
(none)
|
|
)
|
|
|
|
(defbehavior stdmb-race-hatch-init-by-other stdmb-race-hatch ((arg0 vector) (arg1 quaternion))
|
|
(stdmb-race-hatch-method-21 self)
|
|
(set! (-> self root trans quad) (-> arg0 quad))
|
|
(quaternion-copy! (-> self root quat) arg1)
|
|
(stdmb-race-hatch-method-22 self)
|
|
(none)
|
|
)
|
|
|
|
(deftype stdmb-platform (stdmb-race-hatch)
|
|
()
|
|
:heap-base #x50
|
|
:method-count-assert 23
|
|
:size-assert #xd0
|
|
:flag-assert #x17005000d0
|
|
)
|