Files
jak-project/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc
T
water111 637990314b wip: better stack var support (#4222)
Closes #736

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2026-04-19 00:14:44 +02:00

372 lines
14 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type ruins-pillar-collapse
(deftype ruins-pillar-collapse (process-drawable)
((root collide-shape-moving :override)
(player-attack-id int32)
(fall-anim-index int32)
(hit-points int8)
(mesh-trans uint8 3)
(mesh-joint joint 2)
(deadly? symbol :overlay-at (-> mesh-joint 1))
(art-name string :offset 220)
(anim spool-anim :offset 224)
)
(:state-methods
idle
bump
hit
(fall symbol)
)
)
;; definition for method 3 of type ruins-pillar-collapse
(defmethod inspect ((this ruins-pillar-collapse))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 this)
)
(format #t "~2Tplayer-attack-id: ~D~%" (-> this player-attack-id))
(format #t "~2Tfall-anim-index: ~D~%" (-> this fall-anim-index))
(format #t "~2Thit-points: ~D~%" (-> this hit-points))
(format #t "~2Tmesh-trans[3] @ #x~X~%" (-> this mesh-trans))
(format #t "~2Tmesh-joint[2] @ #x~X~%" (-> this mesh-joint))
(format #t "~2Tdeadly?: ~A~%" (-> this deadly?))
(format #t "~2Tart-name: ~A~%" (-> this art-name))
(format #t "~2Tanim: ~A~%" (-> this anim))
(label cfg-4)
this
)
;; failed to figure out what this is:
(defskelgroup skel-ruins-pillar-collapse-1 ruins-pillar-collapse ruins-pillar-collapse-lod0-jg ruins-pillar-collapse-1-idle-ja
((ruins-pillar-collapse-lod0-mg (meters 999999)))
:bounds (static-spherem 0 12 16 30)
)
;; failed to figure out what this is:
(defskelgroup skel-ruins-pillar-collapse-2 ruins-pillar-collapse ruins-pillar-collapse-lod0-jg ruins-pillar-collapse-2-idle-ja
((ruins-pillar-collapse-lod0-mg (meters 999999)))
:bounds (static-spherem 0 12 0 17)
)
;; failed to figure out what this is:
(defskelgroup skel-ruins-pillar-collapse-3 ruins-pillar-collapse ruins-pillar-collapse-lod0-jg ruins-pillar-collapse-3-idle-ja
((ruins-pillar-collapse-lod0-mg (meters 999999)))
:bounds (static-spherem 0 12 0 17)
)
;; failed to figure out what this is:
(defstate idle (ruins-pillar-collapse)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('attack)
(when (task-node-closed? (game-task-node ruins-mech-introduction))
(let* ((gp-1 (the-as attack-info (-> block param 1)))
(s4-0 (-> gp-1 id))
(s5-0 (vector-x-quaternion! (new-stack-vector0) (-> self root quat)))
(a0-6 (vector-z-quaternion! (new-stack-vector0) (-> self root quat)))
(v1-4 (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root trans)))
)
0.0
0.0
(when (!= s4-0 (-> self player-attack-id))
(set! (-> self player-attack-id) (the-as int s4-0))
(let* ((f0-3 (vector-dot s5-0 v1-4))
(f1-1 (vector-dot a0-6 v1-4))
(a0-8 (-> gp-1 mode))
(v1-6 (cond
((= a0-8 'mech-punch)
(and (< f1-1 0.0) (< (fabs (/ f0-3 2)) (fabs f1-1)))
)
((= a0-8 'crush)
(< (sqrtf (+ (* (-> v1-4 x) (-> v1-4 x)) (* (-> v1-4 z) (-> v1-4 z)))) 40960.0)
)
((= a0-8 'debug)
#t
)
)
)
)
(cond
(v1-6
(go-virtual hit)
)
(else
(go-virtual bump)
#f
)
)
)
)
)
)
)
(('look-at-point)
(send-event (ppointer->process (-> self child)) 'look-at-point)
)
(('combo)
#t
)
)
)
:enter (behavior ()
(let ((s5-0 (matrix<-transformq! (new 'stack-no-clear 'matrix) (the-as transformq (-> self root trans)))))
(if (string= (-> self name) "ruins-pillar-collapse-9")
(mech-target-spawn
(vector-matrix*! (new 'stack-no-clear 'vector) (new 'static 'vector :y 18432.0 :z 8192.0 :w 1.0) s5-0)
self
(-> self root quat)
(-> self entity)
)
(mech-target-spawn
(vector-matrix*! (new 'stack-no-clear 'vector) (new 'static 'vector :y 18432.0 :z -8192.0 :w 1.0) s5-0)
self
(-> self root quat)
(-> self entity)
)
)
)
)
:exit (behavior ()
(while (-> self child)
(deactivate (-> self child 0))
)
)
:code (behavior ()
(if (task-node-closed? (game-task-node ruins-mech-introduction))
(add-process *gui-control* self (gui-channel art-load) (gui-action queue) (-> self anim name) -99.0 0)
)
(ja :num-func num-func-identity :frame-num 0.0)
(logior! (-> self mask) (process-mask sleep))
(suspend)
0
)
:post transform-post
)
;; failed to figure out what this is:
(defstate bump (ruins-pillar-collapse)
:virtual #t
:event (-> (method-of-type ruins-pillar-collapse idle) event)
:trans rider-trans
:code (behavior ()
(go-virtual idle)
)
:post rider-post
)
;; failed to figure out what this is:
(defstate hit (ruins-pillar-collapse)
:virtual #t
:event (-> (method-of-type ruins-pillar-collapse idle) event)
:trans rider-trans
:code (behavior ()
(+! (-> self hit-points) -1)
(if (zero? (-> self hit-points))
(go-virtual fall #f)
)
(go-virtual idle)
)
:post rider-post
)
;; failed to figure out what this is:
(defstate fall (ruins-pillar-collapse)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('touch 'attack)
(let* ((s5-0 (-> block param 0))
(gp-0 (the-as process (as-type proc process-focusable)))
(a1-4 (if s5-0
((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry s5-0)
(-> self root)
(the-as uint 2)
)
)
)
)
(when (and gp-0 a1-4)
(let ((s4-1
(get-intersect-point (new 'stack-no-clear 'vector) a1-4 (-> self root) (the-as touching-shapes-entry s5-0))
)
)
(if (and (< (-> (get-trans (the-as process-focusable gp-0) 3) y) (-> s4-1 y))
(< 40960.0 (vector-vector-distance s4-1 (-> self root trans)))
)
(send-event gp-0 'attack s5-0 (static-attack-info ((id (new-attack-id)) (mode 'crush))))
)
)
)
)
)
)
)
:trans rider-trans
:post rider-post
)
;; definition for method 11 of type ruins-pillar-collapse
;; INFO: Used lq/sq
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! ((this ruins-pillar-collapse) (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! (-> this main-thread) 512)
(logior! (-> this mask) (process-mask collectable))
(dotimes (v1-3 3)
(set! (-> this mesh-trans v1-3) (the-as uint v1-3))
)
(let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))))
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-0 reaction) cshape-reaction-default)
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
)
(set! (-> s4-0 penetrated-by) (penetrate))
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 33) 0)))
(set! (-> s4-0 total-prims) (the-as uint 34))
(set! (-> s3-0 prim-core collide-as) (collide-spec obstacle))
(set! (-> s3-0 prim-core action) (collide-action solid rideable))
(set! (-> s3-0 transform-index) 0)
(set-vector! (-> s3-0 local-sphere) 0.0 49152.0 0.0 69632.0)
(set! (-> s4-0 root-prim) s3-0)
(let* ((s2-0 (the-as object '((5 22 61440)
(3 21 18432)
(4 22 61440)
(6 46 8192)
(7 47 6144)
(8 48 6963)
(9 49 6963)
(10 53 6963)
(11 54 6144)
(12 61 8192)
(13 62 10240)
(14 63 6963)
(15 64 6963)
(17 66 9011)
(18 67 16384)
(19 68 8192)
(20 69 6144)
(21 70 6553)
(22 71 9420)
(23 72 5734)
(24 73 7782)
(25 74 5734)
(26 75 8192)
(27 76 5734)
(28 77 5734)
(29 78 10240)
(30 79 6144)
(31 80 6144)
(32 81 6144)
(33 82 6963)
(34 83 9830)
(35 84 8192)
(16 65 8192)
)
)
)
(s1-0 (-> (the-as pair s2-0) car))
)
(while (not (null? s2-0))
(let ((sv-16
(new
'process
'collide-shape-prim-mesh
s4-0
(the-as uint (command-get-int (-> (the-as pair s1-0) car) 0))
(the-as uint 0)
)
)
)
(let ((s0-1 sv-16))
(set! (-> s0-1 prim-core collide-as) (-> s3-0 prim-core collide-as))
(set! (-> s0-1 prim-core collide-with) (-> s3-0 prim-core collide-with))
(set! (-> s0-1 prim-core action) (-> s3-0 prim-core action))
(set! (-> s0-1 transform-index) (command-get-int (-> (the-as pair (-> (the-as pair s1-0) cdr)) car) 0))
)
(set-vector!
(-> sv-16 local-sphere)
0.0
0.0
0.0
(command-get-float (-> (the-as pair (-> (the-as pair (-> (the-as pair s1-0) cdr)) cdr)) car) 0.0)
)
)
(set! s2-0 (-> (the-as pair s2-0) cdr))
(set! s1-0 (-> (the-as pair s2-0) car))
)
)
)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(let ((v1-30 (-> s4-0 root-prim)))
(set! (-> s4-0 backup-collide-as) (-> v1-30 prim-core collide-as))
(set! (-> s4-0 backup-collide-with) (-> v1-30 prim-core collide-with))
)
(set! (-> this root) s4-0)
)
(process-drawable-from-entity! this arg0)
(set! (-> this mesh-trans 0) (the-as uint 1))
(set! (-> this mesh-trans 1) (the-as uint 2))
(set! (-> this mesh-trans 2) (the-as uint 0))
(let ((s5-1 (res-lump-struct (-> this entity) 'art-name structure)))
(set! (-> this art-name) (the-as string s5-1))
(cond
((string= (the-as string s5-1) "ruins-pillar-collapse-1")
(let ((v1-38 (-> this root root-prim local-sphere)))
(set! (-> v1-38 y) 49152.0)
(set! (-> v1-38 z) 65536.0)
(set! (-> v1-38 w) 122880.0)
)
(set! (-> this anim) (new 'static 'spool-anim
:name "ruins-pillar-collapse-1"
:anim-name "1-break-center"
:parts 2
:command-list '()
)
)
)
((string= (the-as string s5-1) "ruins-pillar-collapse-2")
(set! (-> this anim) (new 'static 'spool-anim
:name "ruins-pillar-collapse-2"
:anim-name "2-break-center"
:parts 2
:command-list '()
)
)
(set-yaw-angle-clear-roll-pitch! (-> this root) (+ 32768.0 (y-angle (-> this root))))
)
((string= (the-as string s5-1) "ruins-pillar-collapse-3")
(set! (-> this anim) (new 'static 'spool-anim
:name "ruins-pillar-collapse-3"
:anim-name "3-break-center"
:parts 2
:command-list '()
)
)
(set-yaw-angle-clear-roll-pitch! (-> this root) (+ 32768.0 (y-angle (-> this root))))
)
)
(initialize-skeleton-by-name this (the-as string s5-1))
)
(set! (-> this hit-points) 1)
(set! (-> this deadly?) #f)
(if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)))
(go (method-of-object this fall) #t)
(go (method-of-object this idle))
)
(none)
)