Files
jak-project/test/decompiler/reference/levels/snow/target-ice_REF.gc
T
ManDude 7ce58f709f process-spawn + pretty printer improvements (#1428)
* some jp support to fix some errors in the original game

* music fade toggle

* recognize `process-new` macros!!

* strip casts in this macro

* rename macro

* fix cast typecheck

* update source 1

* detect kernel stack case

* less boilerplate

* `manipy-spawn` special case

* pretty printer improvements

* revert dumb thing from earlier

* use shell detection on `send-event`

* fix some events

* remove unused argument

* detect `static-attack-info` and add `CondNoElse` to shell detect

* better `attack-info` detect

* support `process-spawn` in multi-lets

* detect `rand-float-gen` pt 1

* detect as return value

* detect in `countdown` and  `dotimes`

* oops this wasnt working

* fancier `send-event`s

* clang

* update source!!

* fix tests

* fine jeez

* uh okay

* fix some accidental regressions

* fix more regressions

* regression fixes

* fix big bug...

* extra safety!
2022-06-10 02:18:08 +01:00

320 lines
12 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; failed to figure out what this is:
(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
)
;; failed to figure out what this is:
(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
)