mirror of
https://github.com/open-goal/jak-project
synced 2026-07-06 14:01:20 -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>
163 lines
4.7 KiB
Common Lisp
Vendored
Generated
163 lines
4.7 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type evilbro
|
|
(deftype evilbro (process-taskable)
|
|
((evilsis entity-actor)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type evilbro
|
|
(defmethod inspect ((this evilbro))
|
|
(let ((t9-0 (method-of-type process-taskable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~T~Tevilsis: ~A~%" (-> this evilsis))
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *evilbro-intro-sg* evilbro evilbro-lod0-jg evilbro-idle-ja
|
|
((evilbro-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 4)
|
|
:shadow evilbro-shadow-mg
|
|
)
|
|
|
|
;; definition for method 32 of type evilbro
|
|
;; INFO: Return type mismatch spool-anim vs basic.
|
|
(defmethod play-anim! ((this evilbro) (arg0 symbol))
|
|
(cond
|
|
(arg0
|
|
(close-specific-task! (game-task leaving-misty) (task-status need-introduction))
|
|
(send-event (-> this evilsis extra process) 'clone (process->handle this))
|
|
)
|
|
(else
|
|
(set! (-> this will-talk) #t)
|
|
)
|
|
)
|
|
(the-as basic (new 'static 'spool-anim :name "evilbro-misty-end" :index 5 :parts 9 :command-list '()))
|
|
)
|
|
|
|
;; definition for method 31 of type evilbro
|
|
(defmethod get-art-elem ((this evilbro))
|
|
(-> this draw art-group data 3)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate play-anim (evilbro)
|
|
:virtual #t
|
|
:exit (behavior ()
|
|
(send-event (-> self evilsis extra process) 'end-mode)
|
|
((-> (method-of-type process-taskable play-anim) exit))
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (evilbro)
|
|
:virtual #t
|
|
:code (behavior ()
|
|
(if (!= (ja-group) (get-art-elem self))
|
|
(ja-channel-push! 1 (seconds 0.05))
|
|
)
|
|
(loop
|
|
(ja-no-eval :group! evilbro-idle-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(let ((gp-0 (current-time)))
|
|
(while (let ((s5-0 (current-time))
|
|
(f30-0 300.0)
|
|
(f28-0 0.16)
|
|
(f26-0 0.17000002)
|
|
)
|
|
(< (- s5-0 (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (rand-float-gen))))))) gp-0)
|
|
)
|
|
(suspend)
|
|
)
|
|
)
|
|
(ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 0.0 0)) :frame-num (ja-aframe 16.0 0))
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek! (ja-aframe 0.0 0)))
|
|
)
|
|
(let ((gp-3 (current-time)))
|
|
(while (let ((s5-1 (current-time))
|
|
(f30-1 300.0)
|
|
(f28-1 0.16)
|
|
(f26-1 0.17000002)
|
|
)
|
|
(< (- s5-1 (the-as time-frame (the int (* f30-1 (+ f28-1 (* f26-1 (rand-float-gen))))))) gp-3)
|
|
)
|
|
(suspend)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 11 of type evilbro
|
|
(defmethod init-from-entity! ((this evilbro) (arg0 entity-actor))
|
|
(process-taskable-method-40 this arg0 *evilbro-intro-sg* 3 40 (new 'static 'vector :w 4096.0) 5)
|
|
(set! (-> this tasks) (get-task-control (game-task leaving-misty)))
|
|
(set! (-> this evilsis) (entity-actor-lookup arg0 'alt-actor 0))
|
|
(process-taskable-method-42 this)
|
|
(none)
|
|
)
|
|
|
|
;; definition of type evilsis
|
|
(deftype evilsis (process-taskable)
|
|
()
|
|
)
|
|
|
|
;; definition for method 3 of type evilsis
|
|
(defmethod inspect ((this evilsis))
|
|
(let ((t9-0 (method-of-type process-taskable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *evilsis-intro-sg* evilsis evilsis-lod0-jg evilsis-idle-ja
|
|
((evilsis-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 4)
|
|
:shadow evilsis-shadow-mg
|
|
)
|
|
|
|
;; definition for method 32 of type evilsis
|
|
;; INFO: Return type mismatch art-element vs basic.
|
|
(defmethod play-anim! ((this evilsis) (arg0 symbol))
|
|
(if arg0
|
|
(format
|
|
0
|
|
"ERROR: <GMJ>: ~S playing anim for task status ~S~%"
|
|
(-> this name)
|
|
(task-status->string (current-status (-> this tasks)))
|
|
)
|
|
)
|
|
(the-as basic (get-art-elem this))
|
|
)
|
|
|
|
;; definition for method 31 of type evilsis
|
|
(defmethod get-art-elem ((this evilsis))
|
|
(-> this draw art-group data 3)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (evilsis)
|
|
:virtual #t
|
|
:trans (behavior ()
|
|
(set! (-> self will-talk) #f)
|
|
((-> (method-of-type process-taskable idle) trans))
|
|
)
|
|
)
|
|
|
|
;; definition for method 11 of type evilsis
|
|
(defmethod init-from-entity! ((this evilsis) (arg0 entity-actor))
|
|
(process-taskable-method-40 this arg0 *evilsis-intro-sg* 3 0 (new 'static 'vector :w 4096.0) 5)
|
|
(set! (-> this tasks) (get-task-control (game-task leaving-misty)))
|
|
(process-taskable-method-42 this)
|
|
(none)
|
|
)
|