mirror of
https://github.com/open-goal/jak-project
synced 2026-06-24 09:51:29 -04:00
dacb704ef6
- `aligner` - `effect-control` - `pov-camera` - `powerups` - `los-control-h` - `airlock` - `water-anim` - `blocking-plane` - `proc-focusable-spawner` - `idle-control` - `enemy-h` - `nav-enemy-h` - `enemy` - `enemy-states` - `particle-curves` - `base-plat` - `plat` - `bouncer` - `elevator` - `rigid-body` - `rigid-body-queue` - `process-taskable` - `scene-actor` - `warp-gate` - `guard-projectile` - `metalhead-projectile` - `los-control` - `joint-exploder` - `ragdoll-test` - `debris` - `shield-sphere` - `text` - `target-launch`
169 lines
5.2 KiB
Common Lisp
Vendored
Generated
169 lines
5.2 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type idle-control-frame
|
|
(deftype idle-control-frame (structure)
|
|
((command idle-control-cmd)
|
|
(anim uint32)
|
|
(param0 int32)
|
|
(param1 int32)
|
|
(param2 pair)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type idle-control-frame
|
|
(defmethod inspect ((this idle-control-frame))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-11)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'idle-control-frame)
|
|
(let ((t9-1 format)
|
|
(a0-2 #t)
|
|
(a1-1 "~1Tcommand: #x~X : ~S~%")
|
|
(a2-1 (-> this command))
|
|
(v1-2 (-> this command))
|
|
)
|
|
(t9-1 a0-2 a1-1 a2-1 (cond
|
|
((= v1-2 (idle-control-cmd play))
|
|
"play"
|
|
)
|
|
((= v1-2 (idle-control-cmd push))
|
|
"push"
|
|
)
|
|
((= v1-2 (idle-control-cmd reset))
|
|
"restart"
|
|
)
|
|
(else
|
|
"*unknown*"
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(format #t "~1Tanim: ~D~%" (-> this anim))
|
|
(format #t "~1Tparam0: ~D~%" (-> this param0))
|
|
(format #t "~1Tparam1: ~D~%" (-> this param1))
|
|
(format #t "~1Tparam2: ~A~%" (-> this param2))
|
|
(label cfg-11)
|
|
this
|
|
)
|
|
|
|
;; definition of type idle-control
|
|
(deftype idle-control (structure)
|
|
((anim (inline-array idle-control-frame))
|
|
(anim-speed float)
|
|
(current-index int32)
|
|
(counter int32)
|
|
(target int32)
|
|
)
|
|
(:methods
|
|
(init! (_type_ (inline-array idle-control-frame)) none)
|
|
(play-idle-frames! (_type_ process-drawable) none :behavior process-drawable)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type idle-control
|
|
(defmethod inspect ((this idle-control))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'idle-control)
|
|
(format #t "~1Tanim: #x~X~%" (-> this anim))
|
|
(format #t "~1Tanim-speed: ~f~%" (-> this anim-speed))
|
|
(format #t "~1Tcurrent-index: ~D~%" (-> this current-index))
|
|
(format #t "~1Tcounter: ~D~%" (-> this counter))
|
|
(format #t "~1Ttarget: ~D~%" (-> this target))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition for method 9 of type idle-control
|
|
;; WARN: Return type mismatch idle-control vs none.
|
|
(defmethod init! ((this idle-control) (arg0 (inline-array idle-control-frame)))
|
|
"Initialize this [[idle-control]]."
|
|
(set! (-> this anim) arg0)
|
|
(set! (-> this anim-speed) 0.0)
|
|
(set! (-> this current-index) 0)
|
|
(set! (-> this counter) 0)
|
|
(set! (-> this target) 0)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 10 of type idle-control
|
|
;; WARN: Return type mismatch int vs none.
|
|
;; WARN: Function (method 10 idle-control) has a return type of none, but the expression builder found a return statement.
|
|
(defmethod play-idle-frames! ((this idle-control) (arg0 process-drawable))
|
|
"Set the process pointer to the given [[process-drawable]] and run the idle frames for it."
|
|
(when (nonzero? (-> this anim))
|
|
(let ((s5-0 self))
|
|
(set! self arg0)
|
|
(loop
|
|
(let ((s4-0 (-> this anim (-> this current-index))))
|
|
(case (-> s4-0 command)
|
|
(((idle-control-cmd play))
|
|
(if (< (-> s4-0 anim) 0)
|
|
(return #f)
|
|
)
|
|
(when (zero? (-> this target))
|
|
(set! (-> this target) (rand-vu-int-range (-> s4-0 param0) (-> s4-0 param1)))
|
|
(set! (-> this anim-speed)
|
|
(rand-vu-float-range
|
|
(command-get-float (-> s4-0 param2 car) 0.0)
|
|
(command-get-float (-> (the-as pair (-> s4-0 param2 cdr)) car) 0.0)
|
|
)
|
|
)
|
|
(ja :group! (-> (the-as process-drawable self) draw art-group data (-> s4-0 anim)) :num! min)
|
|
(return #f)
|
|
)
|
|
(ja :group! (-> (the-as process-drawable self) draw art-group data (-> s4-0 anim))
|
|
:num! (seek! max (-> this anim-speed))
|
|
)
|
|
(cond
|
|
((ja-done? 0)
|
|
(+! (-> this counter) 1)
|
|
(cond
|
|
((>= (-> this counter) (-> this target))
|
|
(+! (-> this current-index) 1)
|
|
(set! (-> this counter) 0)
|
|
(set! (-> this target) 0)
|
|
0
|
|
)
|
|
(else
|
|
(ja :num-func num-func-identity :frame-num 0.0)
|
|
(return #f)
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(return #f)
|
|
)
|
|
)
|
|
)
|
|
(((idle-control-cmd push))
|
|
(ja-channel-push! 1 (the-as time-frame (-> s4-0 param0)))
|
|
(+! (-> this current-index) 1)
|
|
(set! (-> this counter) 0)
|
|
(set! (-> this target) 0)
|
|
0
|
|
)
|
|
(((idle-control-cmd reset))
|
|
(set! (-> this current-index) 0)
|
|
(set! (-> this counter) 0)
|
|
(set! (-> this target) 0)
|
|
0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(set! self s5-0)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
|
|
|
|
|