mirror of
https://github.com/open-goal/jak-project
synced 2026-08-08 18:44:15 -04:00
cd68cb671e
Major change to how `deftype` shows up in our code: - the decompiler will no longer emit the `offset-assert`, `method-count-assert`, `size-assert` and `flag-assert` parameters. There are extremely few cases where having this in the decompiled code is helpful, as the types there come from `all-types` which already has those parameters. This also doesn't break type consistency because: - the asserts aren't compared. - the first step of the test uses `all-types`, which has the asserts, which will throw an error if they're bad. - the decompiler won't emit the `heap-base` parameter unless necessary now. - the decompiler will try its hardest to turn a fixed-offset field into an `overlay-at` field. It falls back to the old offset if all else fails. - `overlay-at` now supports field "dereferencing" to specify the offset that's within a field that's a structure, e.g.: ```lisp (deftype foobar (structure) ((vec vector :inline) (flags int32 :overlay-at (-> vec w)) ) ) ``` in this structure, the offset of `flags` will be 12 because that is the final offset of `vec`'s `w` field within this structure. - **removed ID from all method declarations.** IDs are only ever automatically assigned now. Fixes #3068. - added an `:overlay` parameter to method declarations, in order to declare a new method that goes on top of a previously-defined method. Syntax is `:overlay <method-name>`. Please do not ever use this. - added `state-methods` list parameter. This lets you quickly specify a list of states to be put in the method table. Same syntax as the `states` list parameter. The decompiler will try to put as many states in this as it can without messing with the method ID order. Also changes `defmethod` to make the first type definition (before the arguments) optional. The type can now be inferred from the first argument. Fixes #3093. --------- Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
316 lines
9.8 KiB
Common Lisp
316 lines
9.8 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: consite-obs.gc
|
|
;; name in dgo: consite-obs
|
|
;; dgos: COA
|
|
|
|
(declare-type consite-bomb-elevator process-drawable)
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(defskelgroup skel-consite-break-piece-break-d consite-break-scaffold consite-break-scaffold-break-d-lod0-jg consite-break-scaffold-break-d-idle-ja
|
|
((consite-break-scaffold-break-d-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 25 17 -25 45)
|
|
)
|
|
|
|
(deftype consite-break-scaffold (process-drawable)
|
|
()
|
|
(:state-methods
|
|
idle
|
|
)
|
|
)
|
|
|
|
|
|
(defstate idle (consite-break-scaffold)
|
|
:virtual #t
|
|
:code sleep-code
|
|
)
|
|
|
|
;; WARN: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this consite-break-scaffold) (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! (-> this root) (new 'process 'trsqv))
|
|
(process-drawable-from-entity! this arg0)
|
|
(initialize-skeleton
|
|
this
|
|
(the-as
|
|
skeleton-group
|
|
(art-group-get-by-name *level* "skel-consite-break-piece-break-d" (the-as (pointer uint32) #f))
|
|
)
|
|
(the-as pair 0)
|
|
)
|
|
(ja-post)
|
|
(cond
|
|
((task-node-closed? (game-task-node consite-find-baron-resolution))
|
|
(cleanup-for-death this)
|
|
(logclear! (-> this mask) (process-mask actor-pause))
|
|
(go empty-state)
|
|
)
|
|
(else
|
|
(go (method-of-object this idle))
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
(deftype consite-bomb-elevator-hinges (process-drawable)
|
|
()
|
|
(:state-methods
|
|
idle
|
|
)
|
|
)
|
|
|
|
|
|
(defskelgroup skel-consite-bomb-elevator-hinges consite-bomb-elevator consite-bomb-elevator-hinges-lod0-jg consite-bomb-elevator-hinges-idle-ja
|
|
((consite-bomb-elevator-hinges-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 -25 0 45)
|
|
:origin-joint-index 3
|
|
)
|
|
|
|
(defstate idle (consite-bomb-elevator-hinges)
|
|
:virtual #t
|
|
:code (behavior ()
|
|
(until #f
|
|
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
:post ja-post
|
|
)
|
|
|
|
;; WARN: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this consite-bomb-elevator-hinges) (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! (-> this root) (new 'process 'trsqv))
|
|
(process-drawable-from-entity! this arg0)
|
|
(initialize-skeleton
|
|
this
|
|
(the-as
|
|
skeleton-group
|
|
(art-group-get-by-name *level* "skel-consite-bomb-elevator-hinges" (the-as (pointer uint32) #f))
|
|
)
|
|
(the-as pair 0)
|
|
)
|
|
(go (method-of-object this idle))
|
|
(none)
|
|
)
|
|
|
|
;; WARN: Return type mismatch object vs none.
|
|
(defbehavior consite-bomb-elevator-hinges-init-by-other consite-bomb-elevator-hinges ((arg0 consite-bomb-elevator) (arg1 entity-actor))
|
|
(set! (-> self root) (new 'process 'trsqv))
|
|
(process-drawable-from-entity! self arg1)
|
|
(initialize-skeleton
|
|
self
|
|
(the-as
|
|
skeleton-group
|
|
(art-group-get-by-name *level* "skel-consite-bomb-elevator-hinges" (the-as (pointer uint32) #f))
|
|
)
|
|
(the-as pair 0)
|
|
)
|
|
(go-virtual idle)
|
|
(none)
|
|
)
|
|
|
|
(deftype consite-bomb-elevator (process-drawable)
|
|
()
|
|
(:state-methods
|
|
idle
|
|
)
|
|
)
|
|
|
|
|
|
(defskelgroup skel-consite-bomb-elevator consite-bomb-elevator consite-bomb-elevator-lod0-jg consite-bomb-elevator-idle-ja
|
|
((consite-bomb-elevator-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 -25 0 45)
|
|
:origin-joint-index 3
|
|
)
|
|
|
|
(defstate idle (consite-bomb-elevator)
|
|
:virtual #t
|
|
:code (behavior ()
|
|
(until #f
|
|
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
:post ja-post
|
|
)
|
|
|
|
;; WARN: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this consite-bomb-elevator) (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"
|
|
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
|
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0)))
|
|
(set! (-> s4-0 total-prims) (the-as uint 2))
|
|
(set! (-> s3-0 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list))
|
|
(set! (-> s3-0 prim-core action) (collide-action solid))
|
|
(set-vector! (-> s3-0 local-sphere) 0.0 -102400.0 0.0 184320.0)
|
|
(set! (-> s4-0 root-prim) s3-0)
|
|
)
|
|
(let ((v1-8 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
|
(set! (-> v1-8 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list))
|
|
(set! (-> v1-8 prim-core action) (collide-action solid))
|
|
(set! (-> v1-8 transform-index) 3)
|
|
(set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 61440.0)
|
|
)
|
|
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
|
|
(let ((v1-11 (-> s4-0 root-prim)))
|
|
(set! (-> s4-0 backup-collide-as) (-> v1-11 prim-core collide-as))
|
|
(set! (-> s4-0 backup-collide-with) (-> v1-11 prim-core collide-with))
|
|
)
|
|
(set! (-> this root) s4-0)
|
|
)
|
|
(process-drawable-from-entity! this arg0)
|
|
(initialize-skeleton
|
|
this
|
|
(the-as
|
|
skeleton-group
|
|
(art-group-get-by-name *level* "skel-consite-bomb-elevator" (the-as (pointer uint32) #f))
|
|
)
|
|
(the-as pair 0)
|
|
)
|
|
(process-spawn consite-bomb-elevator-hinges this arg0 :to this)
|
|
(go (method-of-object this idle))
|
|
(none)
|
|
)
|
|
|
|
(deftype consite-silo-doors (process-drawable)
|
|
()
|
|
(:state-methods
|
|
idle
|
|
)
|
|
)
|
|
|
|
|
|
(defskelgroup skel-consite-silo-doors consite-silo-doors consite-silo-doors-lod0-jg consite-silo-doors-idle-ja
|
|
((consite-silo-doors-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 10 0 40)
|
|
:origin-joint-index 3
|
|
)
|
|
|
|
(defstate idle (consite-silo-doors)
|
|
:virtual #t
|
|
:code (behavior ()
|
|
(until #f
|
|
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
:post ja-post
|
|
)
|
|
|
|
;; WARN: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this consite-silo-doors) (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"
|
|
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player))))
|
|
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0)))
|
|
(set! (-> s4-0 total-prims) (the-as uint 3))
|
|
(set! (-> s3-0 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list))
|
|
(set! (-> s3-0 prim-core action) (collide-action solid))
|
|
(set-vector! (-> s3-0 local-sphere) 0.0 40960.0 0.0 163840.0)
|
|
(set! (-> s4-0 root-prim) s3-0)
|
|
)
|
|
(let ((v1-8 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
|
(set! (-> v1-8 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list))
|
|
(set! (-> v1-8 prim-core action) (collide-action solid))
|
|
(set! (-> v1-8 transform-index) 4)
|
|
(set-vector! (-> v1-8 local-sphere) -40960.0 0.0 0.0 61440.0)
|
|
)
|
|
(let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0))))
|
|
(set! (-> v1-10 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-10 prim-core collide-with) (collide-spec jak player-list))
|
|
(set! (-> v1-10 prim-core action) (collide-action solid))
|
|
(set! (-> v1-10 transform-index) 5)
|
|
(set-vector! (-> v1-10 local-sphere) 40960.0 0.0 0.0 61440.0)
|
|
)
|
|
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
|
|
(let ((v1-13 (-> s4-0 root-prim)))
|
|
(set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as))
|
|
(set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with))
|
|
)
|
|
(set! (-> this root) s4-0)
|
|
)
|
|
(process-drawable-from-entity! this arg0)
|
|
(initialize-skeleton
|
|
this
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-consite-silo-doors" (the-as (pointer uint32) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(go (method-of-object this idle))
|
|
(none)
|
|
)
|
|
|
|
(defun consite-activate ()
|
|
(update-mood-weather! *mood-control* 1.0 1.0 30.0 30.0)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(deftype baron-npc (process-taskable)
|
|
()
|
|
)
|
|
|
|
|
|
(defmethod get-art-elem ((this baron-npc))
|
|
"Checks various things such the current actor, task status, etc to determine the right art-group data to use
|
|
@returns the appropriate [[art-element]] for the given NPC"
|
|
(case (-> this task actor)
|
|
(((game-task-actor baron-consite))
|
|
(-> this draw art-group data 4)
|
|
)
|
|
(else
|
|
(-> this draw art-group data 3)
|
|
)
|
|
)
|
|
)
|
|
|
|
(defmethod init-art! ((this baron-npc))
|
|
"@see [[initialize-skeleton]]"
|
|
(initialize-skeleton
|
|
this
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-baron-highres" (the-as (pointer uint32) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(set! (-> this draw light-index) (the-as uint 10))
|
|
(set! (-> this draw shadow) #f)
|
|
0
|
|
(none)
|
|
)
|