mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
328 lines
12 KiB
Common Lisp
328 lines
12 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: target-ice.gc
|
|
;; name in dgo: target-ice
|
|
;; dgos: L1, SNO
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(defstate target-ice-stance (target)
|
|
:event target-standard-event-handler
|
|
:enter (behavior ()
|
|
(set! (-> self control unknown-surface00) *walk-mods*)
|
|
(none)
|
|
)
|
|
:exit target-state-hook-exit
|
|
:trans (behavior ()
|
|
((-> self state-hook))
|
|
(if (!= (-> self control ground-pat material) (pat-material ice))
|
|
(go target-stance)
|
|
)
|
|
(when (move-legs?)
|
|
(remove-exit)
|
|
(go target-ice-walk)
|
|
)
|
|
(when (and (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1) (can-duck?))
|
|
(remove-exit)
|
|
(go target-duck-stance)
|
|
)
|
|
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
|
|
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1)
|
|
)
|
|
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2)
|
|
)
|
|
(pad-buttons x)
|
|
)
|
|
(can-jump? #f)
|
|
)
|
|
(go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f))
|
|
)
|
|
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
|
|
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1)
|
|
)
|
|
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2)
|
|
)
|
|
(pad-buttons circle)
|
|
)
|
|
(can-feet?)
|
|
)
|
|
(go target-attack)
|
|
)
|
|
(if (can-hands? #t)
|
|
(go target-running-attack)
|
|
)
|
|
(slide-down-test)
|
|
(fall-test)
|
|
(none)
|
|
)
|
|
:code (behavior ()
|
|
(let ((gp-0 60))
|
|
(let ((v1-2 (ja-group)))
|
|
(cond
|
|
((or (= v1-2 (-> self draw art-group data 34)) (= v1-2 (-> self draw art-group data 38)))
|
|
(set! gp-0 21)
|
|
)
|
|
((ja-group? (-> self draw art-group data 71))
|
|
(ja-no-eval :group! (-> self draw art-group data 72) :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
((ja-group? (-> self draw art-group data 51))
|
|
(cond
|
|
((rand-vu-percent? 0.3)
|
|
(ja-no-eval :group! (-> self draw art-group data 53) :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
(else
|
|
(ja-no-eval :group! (-> self draw art-group data 52) :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
((ja-group? (-> self draw art-group data 78))
|
|
(ja-no-eval :group! (-> self draw art-group data 79) :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
((ja-group? (-> self draw art-group data 84))
|
|
(ja-no-eval :group! (-> self draw art-group data 85) :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(set! gp-0 0)
|
|
)
|
|
((ja-group? (-> self draw art-group data 59))
|
|
(set! (-> self control unknown-float81) (-> self control unknown-float80))
|
|
(set! (-> self control unknown-surface00) *walk-no-turn-mods*)
|
|
(ja-no-eval :group! (if (rand-vu-percent? 0.3)
|
|
(-> self draw art-group data 61)
|
|
(-> self draw art-group data 60)
|
|
)
|
|
:num! (seek!)
|
|
:frame-num 0.0
|
|
)
|
|
(until (ja-done? 0)
|
|
(seek! (-> self control unknown-float81) 0.0 (-> *display* seconds-per-frame))
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(set! (-> self control unknown-surface00) *walk-mods*)
|
|
(set! (-> self control unknown-float81) 0.0)
|
|
(rot->dir-targ! (-> self control))
|
|
)
|
|
((let ((v1-188 (ja-group)))
|
|
(or (= v1-188 (-> self draw art-group data 31)) (= v1-188 (-> self draw art-group data 32)))
|
|
)
|
|
(ja-channel-push! 1 (seconds 0.04))
|
|
(ja-no-eval :group! (-> self draw art-group data 30) :num! (seek! 0.0 1.2) :frame-num max)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek! 0.0 1.2))
|
|
)
|
|
(set! gp-0 60)
|
|
)
|
|
)
|
|
)
|
|
(while (< 16384.0 (-> self control unknown-float01))
|
|
(cond
|
|
((ja-group? (-> self draw art-group data 103))
|
|
)
|
|
(else
|
|
(ja-channel-push! 1 (the-as time-frame gp-0))
|
|
(set! gp-0 150)
|
|
(ja :group! (-> self draw art-group data 103))
|
|
)
|
|
)
|
|
(suspend)
|
|
(ja :num! (loop!))
|
|
)
|
|
(when (not (ja-group? (-> self draw art-group data 104)))
|
|
(ja-channel-push! 1 (the-as time-frame gp-0))
|
|
(ja :group! (-> self draw art-group data 104))
|
|
)
|
|
)
|
|
(loop
|
|
(suspend)
|
|
(ja :num! (loop!))
|
|
)
|
|
(none)
|
|
)
|
|
:post target-post
|
|
)
|
|
|
|
(defstate target-ice-walk (target)
|
|
:event target-standard-event-handler
|
|
:enter (behavior ()
|
|
(set! (-> self state-time) (-> *display* base-frame-counter))
|
|
(set! (-> self control unknown-surface00) *walk-mods*)
|
|
(none)
|
|
)
|
|
:exit (behavior ()
|
|
(target-effect-exit)
|
|
(target-state-hook-exit)
|
|
(none)
|
|
)
|
|
:trans (behavior ()
|
|
((-> self state-hook))
|
|
(when (!= (-> self control ground-pat material) (pat-material ice))
|
|
(remove-exit)
|
|
(go target-walk)
|
|
)
|
|
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
|
|
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1)
|
|
)
|
|
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2)
|
|
)
|
|
(pad-buttons l1 r1)
|
|
)
|
|
(and (>= (- (-> *display* base-frame-counter) (-> *TARGET-bank* wheel-timeout)) (-> self control unknown-dword30))
|
|
(and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (can-wheel?))
|
|
)
|
|
)
|
|
(go target-wheel)
|
|
)
|
|
(when (and (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1) (can-duck?))
|
|
(target-effect-exit)
|
|
(remove-exit)
|
|
(go target-duck-stance)
|
|
)
|
|
(when (and (not (move-legs?)) (let ((gp-0 (ja-group))
|
|
(f0-1 (ja-aframe-num 0))
|
|
)
|
|
(if (and (= gp-0 (-> self draw art-group data 102)) (>= f0-1 30.0) (>= 35.0 f0-1))
|
|
#t
|
|
)
|
|
)
|
|
)
|
|
(target-effect-exit)
|
|
(remove-exit)
|
|
(go target-ice-stance)
|
|
)
|
|
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
|
|
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1)
|
|
)
|
|
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2)
|
|
)
|
|
(pad-buttons x)
|
|
)
|
|
(can-jump? #f)
|
|
)
|
|
(go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f))
|
|
)
|
|
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
|
|
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1)
|
|
)
|
|
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2)
|
|
)
|
|
(pad-buttons circle)
|
|
)
|
|
(can-feet?)
|
|
)
|
|
(go target-attack)
|
|
)
|
|
(if (can-hands? #t)
|
|
(go target-running-attack)
|
|
)
|
|
(slide-down-test)
|
|
(fall-test)
|
|
(none)
|
|
)
|
|
:code (behavior ()
|
|
(cond
|
|
((ja-group? (-> self draw art-group data 23))
|
|
(let ((f30-0 (ja-aframe-num 0)))
|
|
(ja-channel-push! 1 (seconds 0.1))
|
|
(ja :group! (-> self draw art-group data 102) :num! (identity f30-0))
|
|
)
|
|
)
|
|
((ja-group? (-> self draw art-group data 102))
|
|
)
|
|
(else
|
|
(let ((v1-18 (ja-group)))
|
|
(cond
|
|
((or (= v1-18 (-> self draw art-group data 60)) (= v1-18 (-> self draw art-group data 61)))
|
|
(set! (-> self control unknown-float81) (-> self control unknown-float80))
|
|
(set! (-> self control unknown-surface00) *walk-no-turn-mods*)
|
|
(while (< (ja-aframe-num 0) 42.0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(set! (-> self control unknown-surface00) *walk-mods*)
|
|
(set! (-> self control unknown-float81) 0.0)
|
|
(ja-channel-push! 1 (seconds 0.1))
|
|
(ja :group! (-> self draw art-group data 102) :num! (identity (ja-aframe 34.0 0)))
|
|
(while (!= (-> self skel root-channel 0) (-> self skel channel))
|
|
(suspend)
|
|
)
|
|
)
|
|
((ja-group? (-> self draw art-group data 59))
|
|
(set! (-> self control unknown-float81) (-> self control unknown-float80))
|
|
(set! (-> self control unknown-surface00) *walk-no-turn-mods*)
|
|
(ja-no-eval :group! (-> self draw art-group data 60) :num! (seek! (ja-aframe 42.0 0)) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek! (ja-aframe 42.0 0)))
|
|
)
|
|
(set! (-> self control unknown-surface00) *walk-mods*)
|
|
(set! (-> self control unknown-float81) 0.0)
|
|
(ja-channel-push! 1 (seconds 0.1))
|
|
(ja :group! (-> self draw art-group data 102) :num! (identity (ja-aframe 34.0 0)))
|
|
(while (!= (-> self skel root-channel 0) (-> self skel channel))
|
|
(suspend)
|
|
)
|
|
)
|
|
(else
|
|
(ja-channel-push! 1 (seconds 0.05))
|
|
(ja :group! (-> self draw art-group data 102))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(loop
|
|
(suspend)
|
|
(let* ((s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control unknown-vector01) 1.0))
|
|
(gp-6 (vector-float*!
|
|
(new 'stack-no-clear 'vector)
|
|
(-> self control unknown-vector00)
|
|
(/ 1.0 (vector-length (-> self control unknown-vector01)))
|
|
)
|
|
)
|
|
(f0-18 (fmax -1.0 (fmin 1.0 (vector-dot s5-0 gp-6))))
|
|
)
|
|
(ja :num! (loop! (cond
|
|
((< f0-18 0.0)
|
|
(lerp-scale 2.0 1.0 f0-18 -1.0 0.5)
|
|
)
|
|
((< 0.5 f0-18)
|
|
(lerp-scale 1.0 0.75 f0-18 0.5 1.0)
|
|
)
|
|
(else
|
|
(lerp-scale 1.33 1.0 f0-18 0.0 0.5)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
:post target-post
|
|
)
|
|
|
|
|
|
|
|
|