Files
jak-project/test/decompiler/reference/levels/common/launcherdoor_REF.gc
T
2022-01-08 20:57:57 -05:00

255 lines
8.5 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type launcherdoor
(deftype launcherdoor (process-drawable)
((root-override collide-shape :offset 112)
(notify-player-passed-thru? symbol :offset-assert 176)
(thresh-y float :offset-assert 180)
(open-speed float :offset-assert 184)
(close-speed float :offset-assert 188)
(load-mode symbol :offset-assert 192)
)
:heap-base #x60
:method-count-assert 20
:size-assert #xc4
:flag-assert #x14006000c4
(:states
(launcherdoor-closed symbol)
(launcherdoor-open symbol)
)
)
;; definition for method 3 of type launcherdoor
(defmethod inspect launcherdoor ((obj launcherdoor))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~T~Tnotify-player-passed-thru?: ~A~%" (-> obj notify-player-passed-thru?))
(format #t "~T~Tthresh-y: ~f~%" (-> obj thresh-y))
(format #t "~T~Topen-speed: ~f~%" (-> obj open-speed))
(format #t "~T~Tclose-speed: ~f~%" (-> obj close-speed))
(format #t "~T~Tload-mode: ~A~%" (-> obj load-mode))
obj
)
;; failed to figure out what this is:
(defskelgroup *launcherdoor-sg* launcherdoor
0
-1
((1 (meters 20)) (2 (meters 999999)))
:bounds (static-spherem 0 0 0 4)
:longest-edge (meters 0)
)
;; failed to figure out what this is:
(defskelgroup *launcherdoor-maincave-sg* launcherdoor-maincave
0
-1
((1 (meters 20)) (2 (meters 999999)))
:bounds (static-spherem 0 0 0 4)
:longest-edge (meters 0)
)
;; failed to figure out what this is:
(defstate launcherdoor-closed (launcherdoor)
:code
(behavior ((arg0 symbol))
(if (not arg0)
(sound-play-by-name (static-sound-name "ldoor-close") (new-sound-id) 1024 0 0 1 #t)
)
(when *target*
(case (-> *target* current-level name)
(('jungle 'jungleb)
(send-event *target* 'no-load-wait 6000)
)
)
)
(restore-collide-with-as (-> self root-override))
(let ((a0-7 (-> self skel root-channel 0)))
(set! (-> a0-7 param 0) 0.0)
(set! (-> a0-7 param 1) 1.0)
(joint-control-channel-group! a0-7 (the-as art-joint-anim #f) num-func-seek!)
)
(when arg0
(let ((v1-22 (-> self skel root-channel 0)))
(set! (-> v1-22 num-func) num-func-identity)
(set! (-> v1-22 frame-num) 0.0)
)
(set! (-> self draw force-lod) 1)
)
(suspend)
(while #t
(if (and *target*
(= (-> *target* control unknown-surface00 name) 'launch-jump)
(< (-> *target* control trans y) (-> self thresh-y))
)
(go launcherdoor-open #f)
)
(let ((a0-13 (-> self skel root-channel 0)))
(set! (-> a0-13 param 0) 0.0)
(set! (-> a0-13 param 1) (-> self close-speed))
(joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!)
)
(suspend)
(when (ja-done? 0)
(set! (-> self draw force-lod) 1)
(when (-> self notify-player-passed-thru?)
(set! (-> self notify-player-passed-thru?) #f)
(let* ((gp-1 (-> self entity))
(s5-1 (entity-actor-count gp-1 'alt-actor))
)
(dotimes (s4-1 s5-1)
(let ((v1-43 (entity-actor-lookup gp-1 'alt-actor s4-1)))
(if v1-43
(send-event
(if v1-43
(-> v1-43 extra process)
)
'notify
)
)
)
)
)
(case (-> self load-mode)
(('jungle)
(load-state-want-levels 'village1 'jungle)
(load-state-want-display-level 'village1 'display)
)
)
)
)
)
(none)
)
:post
(the-as (function none :behavior launcherdoor) ja-post)
)
;; failed to figure out what this is:
(defstate launcherdoor-open (launcherdoor)
:code
(behavior ((arg0 symbol))
(if (not arg0)
(sound-play-by-name (static-sound-name "ldoor-open") (new-sound-id) 1024 0 0 1 #t)
)
(set! (-> self draw force-lod) 0)
(clear-collide-with-as (-> self root-override))
(let ((a0-4 (-> self skel root-channel 0)))
(set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1)))
(set! (-> a0-4 param 1) 1.0)
(joint-control-channel-group! a0-4 (the-as art-joint-anim #f) num-func-seek!)
)
(when arg0
(let ((v1-16 (-> self skel root-channel 0)))
(set! (-> v1-16 num-func) num-func-identity)
(set! (-> v1-16 frame-num) (the float (+ (-> v1-16 frame-group data 0 length) -1)))
)
)
(while #t
(when (or (not *target*)
(!= (-> *target* control unknown-surface00 name) 'launch-jump)
(< (+ 4096.0 (-> self root-override trans y)) (-> *target* control trans y))
)
(when (and *target* (< (-> self thresh-y) (-> *target* control trans y)))
(let ((a1-3 (res-lump-struct (-> self entity) 'continue-name structure)))
(when a1-3
(let ((v1-36 (set-continue! *game-info* (the-as basic a1-3))))
(load-commands-set! *level* (-> v1-36 load-commands))
)
)
)
(set! (-> self notify-player-passed-thru?) #t)
)
(go launcherdoor-closed #f)
)
(let ((a0-16 (-> self skel root-channel 0)))
(set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1)))
(set! (-> a0-16 param 1) (-> self open-speed))
(joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!)
)
(suspend)
)
(none)
)
:post
(the-as (function none :behavior launcherdoor) ja-post)
)
;; definition for method 11 of type launcherdoor
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! launcherdoor ((obj launcherdoor) (arg0 entity-actor))
(set! (-> obj notify-player-passed-thru?) #f)
(set! (-> obj open-speed) 4.0)
(set! (-> obj close-speed) 2.0)
(let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player))))
(let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s3-0 prim-core collide-as) (collide-kind enemy))
(set! (-> s3-0 collide-with) (collide-kind target))
(set! (-> s3-0 prim-core action) (collide-action solid))
(set! (-> s3-0 prim-core offense) (collide-offense indestructible))
(set! (-> s3-0 transform-index) 0)
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 14336.0)
(set-root-prim! s4-0 s3-0)
)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(backup-collide-with-as s4-0)
(set! (-> obj root-override) s4-0)
)
(process-drawable-from-entity! obj arg0)
(cond
((= (-> (if (-> obj entity)
(-> obj entity extra level)
(-> *level* level-default)
)
name
)
'maincave
)
(set! (-> obj close-speed) 4.0)
(initialize-skeleton obj *launcherdoor-maincave-sg* '())
(ja-channel-set! 1)
(let ((s5-1 (-> obj skel root-channel 0)))
(joint-control-channel-group-eval!
s5-1
(the-as art-joint-anim (-> obj draw art-group data 3))
num-func-identity
)
(set! (-> s5-1 frame-num) 0.0)
)
)
(else
(initialize-skeleton obj *launcherdoor-sg* '())
(ja-channel-set! 1)
(let ((s5-2 (-> obj skel root-channel 0)))
(joint-control-channel-group-eval!
s5-2
(the-as art-joint-anim (-> obj draw art-group data 3))
num-func-identity
)
(set! (-> s5-2 frame-num) 0.0)
)
)
)
(transform-post)
(case (-> obj entity extra level name)
(('jungle)
(set! (-> obj draw shadow-mask) (the-as uint 28))
)
)
(set! (-> obj load-mode) (-> (if (-> obj entity)
(-> obj entity extra level)
(-> *level* level-default)
)
name
)
)
(set! (-> obj thresh-y) (+ -81920.0 (-> obj root-override trans y)))
(if (and *target* (= (-> *target* control unknown-surface00 name) 'launch-jump))
(go launcherdoor-open #t)
(go launcherdoor-closed #t)
)
(none)
)