mirror of
https://github.com/open-goal/jak-project
synced 2026-07-01 04:10:32 -04:00
fc43870d85
This renames the method object in `defmethod`s to `this` and adds detection for the `set-time!` and `time-elapsed?` macros. Definitely my biggest PR yet...
76 lines
2.1 KiB
Common Lisp
Vendored
Generated
76 lines
2.1 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type simple-focus
|
|
(deftype simple-focus (process-focusable)
|
|
((first-time? symbol :offset-assert 204)
|
|
)
|
|
:heap-base #x50
|
|
:method-count-assert 28
|
|
:size-assert #xd0
|
|
:flag-assert #x1c005000d0
|
|
(:methods
|
|
(idle () _type_ :state 27)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type simple-focus
|
|
(defmethod inspect simple-focus ((this simple-focus))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type process-focusable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~2Tfirst-time?: ~A~%" (-> this first-time?))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition for method 20 of type simple-focus
|
|
(defmethod get-trans simple-focus ((this simple-focus) (arg0 int))
|
|
"@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])"
|
|
(-> this root trans)
|
|
)
|
|
|
|
;; definition for method 12 of type simple-focus
|
|
(defmethod run-logic? simple-focus ((this simple-focus))
|
|
(when (-> this first-time?)
|
|
(set! (-> this first-time?) #f)
|
|
#t
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (simple-focus)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('move-trans)
|
|
(let ((v0-0 (-> self root trans)))
|
|
(set! (-> v0-0 quad) (-> (the-as vector (-> block param 0)) quad))
|
|
v0-0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:code sleep-code
|
|
)
|
|
|
|
;; definition for function simple-focus-init-by-other
|
|
;; WARN: Return type mismatch object vs none.
|
|
(defbehavior simple-focus-init-by-other simple-focus ()
|
|
"Initializes the new [[simple-focus]]. `first-time?` will be set to [[#t]]"
|
|
(let ((root (new 'process 'trsqv)))
|
|
(set! (-> self root) (the-as collide-shape root))
|
|
(vector-identity! (-> root scale))
|
|
(quaternion-identity! (-> root quat))
|
|
)
|
|
(logclear! (-> self mask) (process-mask enemy))
|
|
(set! (-> self first-time?) #t)
|
|
(set! (-> self event-hook) (-> (method-of-object self idle) event))
|
|
(go-virtual idle)
|
|
(none)
|
|
)
|