jak-project/goal_src/jak2/levels/hideout/hideout-obs.gc
Tyler Wilding dd0a8a17b2
docs - first chunk of work documenting the files I glossed over (#2130)
- started documenting the files I glossed over, some are totally done,
others are just partially done
- I changed the decompiler to automatically initialize the
art-group-info from the json file. This makes updating gsrc, even a
single file at a time, have consistent naming
- Though I disabled this functionality for jak 1, as I have no idea if
using the ntsc art groups will cause a regression for different versions
- fix indentation for docstrings -- it still doesn't look great, but
this is now a formatting concern, rather than the docstring having a
bunch of happen-stance leading whitespace.
2023-01-15 11:33:39 -05:00

188 lines
6.6 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: hideout-obs.gc
;; name in dgo: hideout-obs
;; dgos: HIDEOUT
;; DECOMP BEGINS
(defskelgroup skel-hide-door-b hide-door-b hide-door-b-lod0-jg hide-door-b-idle-ja
((hide-door-b-lod0-mg (meters 999999)))
:bounds (static-spherem 0 2 0 5)
:origin-joint-index 3
)
(deftype hide-door-b (com-airlock)
()
:heap-base #x100
:method-count-assert 28
:size-assert #x174
:flag-assert #x1c01000174
)
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! hide-door-b ((obj hide-door-b) (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) 1024)
(let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player))))
(set! (-> s5-0 penetrated-by) (penetrate))
(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 obstacle))
(set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> s4-0 prim-core action) (collide-action solid))
(set! (-> s4-0 transform-index) 3)
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 32768.0)
(set! (-> s5-0 root-prim) s4-0)
)
(let ((v1-9 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
(set! (-> v1-9 prim-core collide-as) (collide-spec obstacle))
(set! (-> v1-9 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-9 prim-core action) (collide-action solid))
(set! (-> v1-9 transform-index) 4)
(set-vector! (-> v1-9 local-sphere) 0.0 0.0 0.0 16384.0)
)
(let ((v1-11 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0))))
(set! (-> v1-11 prim-core collide-as) (collide-spec obstacle))
(set! (-> v1-11 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-11 prim-core action) (collide-action solid))
(set! (-> v1-11 transform-index) 5)
(set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 16384.0)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(let ((v1-14 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with))
)
(set! (-> obj root-override) s5-0)
)
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-hide-door-b" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(init-airlock! obj)
(set! (-> obj sound-open-loop) (static-sound-spec "hide-door-open"))
(set! (-> obj sound-open-stop) (static-sound-spec "hide-door-hit"))
(set! (-> obj sound-close-loop) (static-sound-spec "hide-door-close"))
(set! (-> obj sound-close-stop) (static-sound-spec "hide-door-hit"))
(set! (-> obj door-radius) 12288.0)
(go (method-of-object obj close) #t)
(none)
)
(deftype hide-light (process-drawable)
()
:heap-base #x50
:method-count-assert 21
:size-assert #xc8
:flag-assert #x15005000c8
(:methods
(idle () _type_ :state 20)
)
)
(defskelgroup skel-hide-light hide-light hide-light-lod0-jg hide-light-idle-ja
((hide-light-lod0-mg (meters 999999)))
:bounds (static-spherem 0 -2.3 0 4.5)
:shadow hide-light-shadow-mg
:origin-joint-index 3
:shadow-joint-index 3
)
(defskelgroup skel-hide-light-fog hide-light hide-light-fog-lod0-jg hide-light-fog-idle-ja
((hide-light-fog-lod0-mg (meters 999999)))
:bounds (static-spherem 0 -2.5 0 3)
:origin-joint-index 3
)
(defun hide-light-spawn ((arg0 hide-light) (arg1 vector) (arg2 cspace))
(let ((v1-1
(process-spawn
manipy
:init manipy-init
(-> arg0 root trans)
(-> arg0 entity)
(art-group-get-by-name *level* "skel-hide-light-fog" (the-as (pointer uint32) #f))
#f
0
:to arg0
)
)
)
(send-event
(ppointer->process v1-1)
'eval
(lambda :behavior hide-light
()
(let ((v0-0 (-> self node-list data)))
(set! (-> v0-0 0 param0) (the-as (function cspace transformq none) cspace<-parent-joint!))
(set! (-> v0-0 0 param1) (the-as basic (-> self parent)))
(set! (-> v0-0 0 param2) (the-as basic 12))
v0-0
)
)
)
)
0
(none)
)
(defstate idle (hide-light)
:virtual #t
:code (behavior ()
(until #f
(ja-no-eval :group! (-> self draw art-group data 3)
:num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1)))
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
#f
(none)
)
:post (the-as (function none :behavior hide-light) ja-post)
)
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! hide-light ((obj hide-light) (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"
(set! (-> obj mask) (logior (process-mask ambient) (-> obj mask)))
(set! (-> obj root) (new 'process 'trsqv))
(process-drawable-from-entity! obj arg0)
(logclear! (-> obj mask) (process-mask actor-pause))
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-hide-light" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(let ((v1-9 (new 'process 'shadow-control -25088.0 0.0 -40960.0 (shadow-flags shdf03 shdf04) 163840.0)))
(set-vector! (-> v1-9 settings shadow-dir) 0.0 -1.0 0.0 13926.4)
(set-vector! (-> v1-9 settings bot-plane) 0.0 -1.0 0.0 58982.4)
(set-vector! (-> v1-9 settings top-plane) 0.0 -1.0 0.0 0.0)
(set! (-> v1-9 settings shadow-type) 1)
(set! (-> obj draw shadow-ctrl) v1-9)
)
(hide-light-spawn obj *zero-vector* (-> obj node-list data 12))
(set-setting! 'spotlight-color #f 0 (the-as uint #x80c0c0c0))
(ja-post)
(go (method-of-object obj idle))
(none)
)